OPAL Version 3.10.2
|
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: 26320 $ 00027 * $Author: rjongbloed $ 00028 * $Date: 2011-08-17 06:58:09 -0500 (Wed, 17 Aug 2011) $ 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 DWORD m_totalFrames; 00159 DWORD m_keyFrames; 00160 }; 00161 00162 00164 00165 OPAL_DEFINE_MEDIA_COMMAND(OpalVideoFreezePicture, "Freeze Picture"); 00166 00172 class OpalVideoUpdatePicture : public OpalMediaCommand 00173 { 00174 PCLASSINFO(OpalVideoUpdatePicture, OpalMediaCommand); 00175 public: 00176 virtual PString GetName() const; 00177 }; 00178 00184 class OpalVideoPictureLoss : public OpalVideoUpdatePicture 00185 { 00186 PCLASSINFO(OpalVideoPictureLoss, OpalVideoUpdatePicture); 00187 public: 00188 OpalVideoPictureLoss(unsigned sequenceNumber = 0, unsigned timestamp = 0); 00189 00190 virtual PString GetName() const; 00191 00192 unsigned GetSequenceNumber() const { return m_sequenceNumber; } 00193 unsigned GetTimestamp() const { return m_timestamp; } 00194 00195 protected: 00196 unsigned m_sequenceNumber; 00197 unsigned m_timestamp; 00198 }; 00199 00200 00208 class OpalTemporalSpatialTradeOff : public OpalMediaCommand 00209 { 00210 PCLASSINFO(OpalTemporalSpatialTradeOff, OpalMediaCommand); 00211 public: 00212 OpalTemporalSpatialTradeOff(int tradeoff) : m_tradeOff(tradeoff) { } 00213 00214 virtual PString GetName() const; 00215 00216 int GetTradeOff() const { return m_tradeOff; } 00217 00218 protected: 00219 int m_tradeOff; 00220 }; 00221 00222 00223 #endif // OPAL_VIDEO 00224 00225 #endif // OPAL_CODEC_VIDCODEC_H 00226