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: 20745 $
00027  * $Author: rjongbloed $
00028  * $Date: 2008-08-28 00:20:52 +0000 (Thu, 28 Aug 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_VIDEO
00042 
00043 #if OPAL_H323
00044 #include <h323/h323caps.h>
00045 #endif
00046 
00047 #include <codec/opalplugin.h>
00048 
00049 
00050 #define OPAL_RGB24   "RGB24"
00051 #define OPAL_RGB32   "RGB32"
00052 #define OPAL_YUV420P "YUV420P"
00053 
00054 extern const OpalVideoFormat & GetOpalRGB24();
00055 extern const OpalVideoFormat & GetOpalRGB32();
00056 extern const OpalVideoFormat & GetOpalYUV420P();
00057 
00058 #define OpalRGB24   GetOpalRGB24()
00059 #define OpalRGB32   GetOpalRGB32()
00060 #define OpalYUV420P GetOpalYUV420P()
00061 
00062 
00064 
00071 class OpalVideoTranscoder : public OpalTranscoder
00072 {
00073     PCLASSINFO(OpalVideoTranscoder, OpalTranscoder);
00074   public:
00075     typedef PluginCodec_Video_FrameHeader FrameHeader;
00076 
00081     OpalVideoTranscoder(
00082       const OpalMediaFormat & inputMediaFormat,  
00083       const OpalMediaFormat & outputMediaFormat  
00084     );
00086 
00102     virtual bool UpdateMediaFormats(
00103       const OpalMediaFormat & inputMediaFormat,  
00104       const OpalMediaFormat & outputMediaFormat  
00105     );
00106 
00113     virtual PINDEX GetOptimalDataFrameSize(
00114       PBoolean input      
00115     ) const;
00116 
00124     virtual PBoolean ExecuteCommand(
00125       const OpalMediaCommand & command    
00126     );
00127 
00138     virtual PBoolean Convert(
00139       const RTP_DataFrame & input,  
00140       RTP_DataFrame & output        
00141     );
00142 
00143 #ifdef OPAL_STATISTICS
00144     virtual void GetStatistics(OpalMediaStatistics & statistics) const;
00145 #endif
00146 
00147 
00148   protected:
00149     PINDEX inDataSize;
00150     PINDEX outDataSize;
00151     bool   forceIFrame;
00152 
00153 #ifdef OPAL_STATISTICS
00154     DWORD m_totalFrames;
00155     DWORD m_keyFrames;
00156 #endif
00157 };
00158 
00159 
00161 
00162 OPAL_DEFINE_MEDIA_COMMAND(OpalVideoFreezePicture, "Freeze Picture");
00163 
00164 class OpalVideoUpdatePicture : public OpalMediaCommand
00165 {
00166   PCLASSINFO(OpalVideoUpdatePicture, OpalMediaCommand);
00167   public:
00168     OpalVideoUpdatePicture(int firstGOB = -1, int firstMB = -1, int numBlocks = 0)
00169       : m_firstGOB(firstGOB), m_firstMB(firstMB), m_numBlocks(numBlocks) { }
00170 
00171     virtual PString GetName() const;
00172 
00173     int GetFirstGOB() const { return m_firstGOB; }
00174     int GetFirstMB() const { return m_firstMB; }
00175     int GetNumBlocks() const { return m_numBlocks; }
00176 
00177   protected:
00178     int m_firstGOB;
00179     int m_firstMB;
00180     int m_numBlocks;
00181 };
00182 
00183 
00184 class OpalTemporalSpatialTradeOff : public OpalMediaCommand
00185 {
00186   PCLASSINFO(OpalTemporalSpatialTradeOff, OpalMediaCommand);
00187   public:
00188     OpalTemporalSpatialTradeOff(int quality) : m_quality(quality) { }
00189 
00190     virtual PString GetName() const;
00191 
00192     int GetQuality() const { return m_quality; }
00193 
00194   protected:
00195     int m_quality;
00196 };
00197 
00198 
00199 class OpalLostPartialPicture : public OpalMediaCommand
00200 {
00201   PCLASSINFO(OpalLostPartialPicture, OpalMediaCommand);
00202   public:
00203     OpalLostPartialPicture() { }
00204     virtual PString GetName() const;
00205 };
00206 
00207 
00208 class OpalLostPicture : public OpalMediaCommand
00209 {
00210   PCLASSINFO(OpalLostPicture, OpalMediaCommand);
00211   public:
00212     OpalLostPicture() { }
00213     virtual PString GetName() const;
00214 };
00215 
00216 
00217 #endif // OPAL_VIDEO
00218 
00219 #endif // __OPAL_VIDCODEC_H
00220 

Generated on Mon Sep 15 11:49:16 2008 for OPAL by  doxygen 1.5.1