OPAL  Version 3.12.9
vidcodec.h
Go to the documentation of this file.
1 /*
2  * vidcodec.h
3  *
4  * Uncompressed video handler
5  *
6  * Open Phone Abstraction Library
7  *
8  * Copyright (c) 2003 Equivalence Pty. Ltd.
9  *
10  * The contents of this file are subject to the Mozilla Public License
11  * Version 1.0 (the "License"); you may not use this file except in
12  * compliance with the License. You may obtain a copy of the License at
13  * http://www.mozilla.org/MPL/
14  *
15  * Software distributed under the License is distributed on an "AS IS"
16  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
17  * the License for the specific language governing rights and limitations
18  * under the License.
19  *
20  * The Original Code is Open Phone Abstraction Library.
21  *
22  * The Initial Developer of the Original Code is Equivalence Pty. Ltd.
23  *
24  * Contributor(s):
25  *
26  * $Revision: 29334 $
27  * $Author: rjongbloed $
28  * $Date: 2013-03-27 14:08:07 +1100 (Wed, 27 Mar 2013) $
29  */
30 
31 #ifndef OPAL_CODEC_VIDCODEC_H
32 #define OPAL_CODEC_VIDCODEC_H
33 
34 #ifdef P_USE_PRAGMA
35 #pragma interface
36 #endif
37 
38 #include <opal/buildopts.h>
39 
40 #include <opal/transcoders.h>
41 
42 #if OPAL_VIDEO
43 
44 #if OPAL_H323
45 #include <h323/h323caps.h>
46 #endif
47 
48 #include <codec/opalplugin.h>
49 
50 
51 #define OPAL_RGB24 "RGB24"
52 #define OPAL_RGB32 "RGB32"
53 #define OPAL_YUV420P "YUV420P"
54 
55 extern const OpalVideoFormat & GetOpalRGB24();
56 extern const OpalVideoFormat & GetOpalRGB32();
57 extern const OpalVideoFormat & GetOpalYUV420P();
58 
59 #define OpalRGB24 GetOpalRGB24()
60 #define OpalRGB32 GetOpalRGB32()
61 #define OpalYUV420P GetOpalYUV420P()
62 
63 
65 
73 {
75  public:
77 
85  );
87 
103  virtual bool UpdateMediaFormats(
106  );
107 
114  virtual PINDEX GetOptimalDataFrameSize(
115  PBoolean input
116  ) const;
117 
127  virtual PBoolean ExecuteCommand(
128  const OpalMediaCommand & command
129  );
130 
141  virtual PBoolean Convert(
142  const RTP_DataFrame & input,
143  RTP_DataFrame & output
144  );
145 
146 #if OPAL_STATISTICS
147  virtual void GetStatistics(OpalMediaStatistics & statistics) const;
148 #endif
149 
150  virtual bool HasErrorConcealment() const { return m_errorConcealment; }
151  bool WasLastFrameIFrame() const { return lastFrameWasIFrame; }
152  void ForceIFrame() { forceIFrame = true; }
154 
155  protected:
157  PINDEX inDataSize;
158  PINDEX outDataSize;
161 
163  DWORD m_keyFrames;
164 };
165 
166 
168 
169 OPAL_DEFINE_MEDIA_COMMAND(OpalVideoFreezePicture, "Freeze Picture");
170 
177 {
178  PCLASSINFO_WITH_CLONE(OpalVideoUpdatePicture, OpalMediaCommand);
179  public:
180  virtual PString GetName() const;
181 };
182 
189 {
190  PCLASSINFO_WITH_CLONE(OpalVideoPictureLoss, OpalVideoUpdatePicture);
191  public:
192  OpalVideoPictureLoss(unsigned sequenceNumber = 0, unsigned timestamp = 0);
193 
194  virtual PString GetName() const;
195 
196  unsigned GetSequenceNumber() const { return m_sequenceNumber; }
197  unsigned GetTimestamp() const { return m_timestamp; }
198 
199  protected:
201  unsigned m_timestamp;
202 };
203 
204 
214 {
215  PCLASSINFO_WITH_CLONE(OpalTemporalSpatialTradeOff, OpalMediaCommand);
216  public:
217  OpalTemporalSpatialTradeOff(int tradeoff) : m_tradeOff(tradeoff) { }
218 
219  virtual PString GetName() const;
220 
221  enum {
224  };
225 
226  unsigned GetTradeOff() const { return m_tradeOff; }
227 
228  protected:
229  unsigned m_tradeOff;
230 };
231 
232 
233 #endif // OPAL_VIDEO
234 
235 #endif // OPAL_CODEC_VIDCODEC_H
236