00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
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