vidcodec.h

Go to the documentation of this file.
00001 /*
00002  * vidcodec.h
00003  *
00004  * Uncompressed video handler
00005  *
00006  * Open Phone Abstraction Library
00007  *
00008  * Copyright (c) 2003 Equivalence Pty. Ltd.
00009  *
00010  * The contents of this file are subject to the Mozilla Public License
00011  * Version 1.0 (the "License"); you may not use this file except in
00012  * compliance with the License. You may obtain a copy of the License at
00013  * http://www.mozilla.org/MPL/
00014  *
00015  * Software distributed under the License is distributed on an "AS IS"
00016  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
00017  * the License for the specific language governing rights and limitations
00018  * under the License.
00019  *
00020  * The Original Code is Open Phone Abstraction Library.
00021  *
00022  * The Initial Developer of the Original Code is Equivalence Pty. Ltd.
00023  *
00024  * Contributor(s): 
00025  *
00026  * $Revision: 19647 $
00027  * $Author: rjongbloed $
00028  * $Date: 2008-03-03 01:54:25 +0000 (Mon, 03 Mar 2008) $
00029  */
00030 
00031 #ifndef __OPAL_VIDCODEC_H
00032 #define __OPAL_VIDCODEC_H
00033 
00034 #ifdef P_USE_PRAGMA
00035 #pragma interface
00036 #endif
00037 
00038 
00039 #include <opal/transcoders.h>
00040 
00041 #if OPAL_H323
00042 #include <h323/h323caps.h>
00043 #endif
00044 
00045 #include <codec/opalplugin.h>
00046 
00047 
00048 #define OPAL_RGB24   "RGB24"
00049 #define OPAL_RGB32   "RGB32"
00050 #define OPAL_YUV420P "YUV420P"
00051 
00052 extern const OpalVideoFormat & GetOpalRGB24();
00053 extern const OpalVideoFormat & GetOpalRGB32();
00054 extern const OpalVideoFormat & GetOpalYUV420P();
00055 
00056 #define OpalRGB24   GetOpalRGB24()
00057 #define OpalRGB32   GetOpalRGB32()
00058 #define OpalYUV420P GetOpalYUV420P()
00059 
00060 
00062 
00069 class OpalVideoTranscoder : public OpalTranscoder
00070 {
00071     PCLASSINFO(OpalVideoTranscoder, OpalTranscoder);
00072   public:
00073     typedef PluginCodec_Video_FrameHeader FrameHeader;
00074 
00079     OpalVideoTranscoder(
00080       const OpalMediaFormat & inputMediaFormat,  
00081       const OpalMediaFormat & outputMediaFormat  
00082     );
00084 
00099     virtual bool UpdateMediaFormats(
00100       const OpalMediaFormat & inputMediaFormat,  
00101       const OpalMediaFormat & outputMediaFormat  
00102     );
00103 
00110     virtual PINDEX GetOptimalDataFrameSize(
00111       PBoolean input      
00112     ) const;
00113 
00121     virtual PBoolean ExecuteCommand(
00122       const OpalMediaCommand & command    
00123     );
00124 
00135     virtual PBoolean Convert(
00136       const RTP_DataFrame & input,  
00137       RTP_DataFrame & output        
00138     );
00139 
00140 #ifdef OPAL_STATISTICS
00141     virtual void GetStatistics(OpalMediaStatistics & statistics) const;
00142 #endif
00143 
00144 
00145   protected:
00146     PINDEX inDataSize;
00147     PINDEX outDataSize;
00148     bool   forceIFrame;
00149 
00150 #ifdef OPAL_STATISTICS
00151     DWORD m_totalFrames;
00152     DWORD m_keyFrames;
00153 #endif
00154 };
00155 
00156 
00158 
00159 OPAL_DEFINE_MEDIA_COMMAND(OpalVideoFreezePicture, "Freeze Picture");
00160 
00161 class OpalVideoUpdatePicture : public OpalMediaCommand
00162 {
00163   PCLASSINFO(OpalVideoUpdatePicture, OpalMediaCommand);
00164   public:
00165     OpalVideoUpdatePicture(int firstGOB = -1, int firstMB = -1, int numBlocks = 0)
00166       : m_firstGOB(firstGOB), m_firstMB(firstMB), m_numBlocks(numBlocks) { }
00167 
00168     virtual PString GetName() const;
00169 
00170     int GetFirstGOB() const { return m_firstGOB; }
00171     int GetFirstMB() const { return m_firstMB; }
00172     int GetNumBlocks() const { return m_numBlocks; }
00173 
00174   protected:
00175     int m_firstGOB;
00176     int m_firstMB;
00177     int m_numBlocks;
00178 };
00179 
00180 
00181 class OpalTemporalSpatialTradeOff : public OpalMediaCommand
00182 {
00183   PCLASSINFO(OpalTemporalSpatialTradeOff, OpalMediaCommand);
00184   public:
00185     OpalTemporalSpatialTradeOff(int quality) : m_quality(quality) { }
00186 
00187     virtual PString GetName() const;
00188 
00189     int GetQuality() const { return m_quality; }
00190 
00191   protected:
00192     int m_quality;
00193 };
00194 
00195 
00196 class OpalLostPartialPicture : public OpalMediaCommand
00197 {
00198   PCLASSINFO(OpalLostPartialPicture, OpalMediaCommand);
00199   public:
00200     OpalLostPartialPicture() { }
00201     virtual PString GetName() const;
00202 };
00203 
00204 
00205 class OpalLostPicture : public OpalMediaCommand
00206 {
00207   PCLASSINFO(OpalLostPicture, OpalMediaCommand);
00208   public:
00209     OpalLostPicture() { }
00210     virtual PString GetName() const;
00211 };
00212 
00213 #endif // __OPAL_VIDCODEC_H
00214 
00215 

Generated on Fri Mar 7 07:36:40 2008 for OPAL by  doxygen 1.5.1