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_CODEC_VIDCODEC_H
00032 #define OPAL_CODEC_VIDCODEC_H
00033
00034 #ifdef P_USE_PRAGMA
00035 #pragma interface
00036 #endif
00037
00038 #include <opal/buildopts.h>
00039
00040 #include <opal/transcoders.h>
00041
00042 #if OPAL_VIDEO
00043
00044 #if OPAL_H323
00045 #include <h323/h323caps.h>
00046 #endif
00047
00048 #include <codec/opalplugin.h>
00049
00050
00051 #define OPAL_RGB24 "RGB24"
00052 #define OPAL_RGB32 "RGB32"
00053 #define OPAL_YUV420P "YUV420P"
00054
00055 extern const OpalVideoFormat & GetOpalRGB24();
00056 extern const OpalVideoFormat & GetOpalRGB32();
00057 extern const OpalVideoFormat & GetOpalYUV420P();
00058
00059 #define OpalRGB24 GetOpalRGB24()
00060 #define OpalRGB32 GetOpalRGB32()
00061 #define OpalYUV420P GetOpalYUV420P()
00062
00063
00065
00072 class OpalVideoTranscoder : public OpalTranscoder
00073 {
00074 PCLASSINFO(OpalVideoTranscoder, OpalTranscoder);
00075 public:
00076 typedef PluginCodec_Video_FrameHeader FrameHeader;
00077
00082 OpalVideoTranscoder(
00083 const OpalMediaFormat & inputMediaFormat,
00084 const OpalMediaFormat & outputMediaFormat
00085 );
00087
00103 virtual bool UpdateMediaFormats(
00104 const OpalMediaFormat & inputMediaFormat,
00105 const OpalMediaFormat & outputMediaFormat
00106 );
00107
00114 virtual PINDEX GetOptimalDataFrameSize(
00115 PBoolean input
00116 ) const;
00117
00125 virtual PBoolean ExecuteCommand(
00126 const OpalMediaCommand & command
00127 );
00128
00139 virtual PBoolean Convert(
00140 const RTP_DataFrame & input,
00141 RTP_DataFrame & output
00142 );
00143
00144 #if OPAL_STATISTICS
00145 virtual void GetStatistics(OpalMediaStatistics & statistics) const;
00146 #endif
00147
00148 bool WasLastFrameIFrame() const { return lastFrameWasIFrame; }
00149 void ForceIFrame() { forceIFrame = true; }
00151
00152 protected:
00153 PINDEX inDataSize;
00154 PINDEX outDataSize;
00155 bool forceIFrame;
00156 bool lastFrameWasIFrame;
00157
00158 #if OPAL_STATISTICS
00159 DWORD m_totalFrames;
00160 DWORD m_keyFrames;
00161 #endif
00162 };
00163
00164
00166
00167 OPAL_DEFINE_MEDIA_COMMAND(OpalVideoFreezePicture, "Freeze Picture");
00168
00169 class OpalVideoUpdatePicture : public OpalMediaCommand
00170 {
00171 PCLASSINFO(OpalVideoUpdatePicture, OpalMediaCommand);
00172 public:
00173 OpalVideoUpdatePicture(int firstGOB = -1, int firstMB = -1, int numBlocks = 0)
00174 : m_firstGOB(firstGOB), m_firstMB(firstMB), m_numBlocks(numBlocks) { }
00175
00176 virtual PString GetName() const;
00177
00178 int GetFirstGOB() const { return m_firstGOB; }
00179 int GetFirstMB() const { return m_firstMB; }
00180 int GetNumBlocks() const { return m_numBlocks; }
00181
00182 protected:
00183 int m_firstGOB;
00184 int m_firstMB;
00185 int m_numBlocks;
00186 };
00187
00188
00189 class OpalTemporalSpatialTradeOff : public OpalMediaCommand
00190 {
00191 PCLASSINFO(OpalTemporalSpatialTradeOff, OpalMediaCommand);
00192 public:
00193 OpalTemporalSpatialTradeOff(int quality) : m_quality(quality) { }
00194
00195 virtual PString GetName() const;
00196
00197 int GetQuality() const { return m_quality; }
00198
00199 protected:
00200 int m_quality;
00201 };
00202
00203
00204 class OpalLostPartialPicture : public OpalMediaCommand
00205 {
00206 PCLASSINFO(OpalLostPartialPicture, OpalMediaCommand);
00207 public:
00208 OpalLostPartialPicture() { }
00209 virtual PString GetName() const;
00210 };
00211
00212
00213 class OpalLostPicture : public OpalMediaCommand
00214 {
00215 PCLASSINFO(OpalLostPicture, OpalMediaCommand);
00216 public:
00217 OpalLostPicture() { }
00218 virtual PString GetName() const;
00219 };
00220
00221
00222 #endif // OPAL_VIDEO
00223
00224 #endif // OPAL_CODEC_VIDCODEC_H
00225