OPAL  Version 3.10.10
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: 27792 $
27  * $Author: rjongbloed $
28  * $Date: 2012-06-07 21:14:33 -0500 (Thu, 07 Jun 2012) $
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  bool WasLastFrameIFrame() const { return lastFrameWasIFrame; }
151  void ForceIFrame() { forceIFrame = true; }
153 
154  protected:
155  PINDEX inDataSize;
156  PINDEX outDataSize;
159 
161  DWORD m_keyFrames;
162 };
163 
164 
166 
167 OPAL_DEFINE_MEDIA_COMMAND(OpalVideoFreezePicture, "Freeze Picture");
168 
175 {
177  public:
178  virtual PString GetName() const;
179 };
180 
187 {
189  public:
190  OpalVideoPictureLoss(unsigned sequenceNumber = 0, unsigned timestamp = 0);
191 
192  virtual PString GetName() const;
193 
194  unsigned GetSequenceNumber() const { return m_sequenceNumber; }
195  unsigned GetTimestamp() const { return m_timestamp; }
196 
197  protected:
199  unsigned m_timestamp;
200 };
201 
202 
212 {
214  public:
215  OpalTemporalSpatialTradeOff(int tradeoff) : m_tradeOff(tradeoff) { }
216 
217  virtual PString GetName() const;
218 
219  enum {
220  MaximiseSpatial = 0,
221  MaximiseTemporal = 31
222  };
223 
224  unsigned GetTradeOff() const { return m_tradeOff; }
225 
226  protected:
227  unsigned m_tradeOff;
228 };
229 
230 
231 #endif // OPAL_VIDEO
232 
233 #endif // OPAL_CODEC_VIDCODEC_H
234 
const OpalVideoFormat & GetOpalYUV420P()
virtual PBoolean ExecuteCommand(const OpalMediaCommand &command)
PINDEX outDataSize
Definition: vidcodec.h:156
virtual void GetStatistics(OpalMediaStatistics &statistics) const
unsigned m_timestamp
Definition: vidcodec.h:199
Definition: mediacmd.h:43
virtual PBoolean Convert(const RTP_DataFrame &input, RTP_DataFrame &output)
DWORD m_keyFrames
Definition: vidcodec.h:161
OpalVideoTranscoder(const OpalMediaFormat &inputMediaFormat, const OpalMediaFormat &outputMediaFormat)
const OpalVideoFormat & GetOpalRGB24()
bool forceIFrame
Definition: vidcodec.h:157
unsigned GetSequenceNumber() const
Definition: vidcodec.h:194
bool WasLastFrameIFrame() const
Definition: vidcodec.h:150
Definition: opalplugin.h:892
PINDEX inDataSize
Definition: vidcodec.h:155
Definition: rtp.h:71
DWORD m_totalFrames
Definition: vidcodec.h:160
Definition: mediafmt.h:724
PluginCodec_Video_FrameHeader FrameHeader
Definition: vidcodec.h:76
Definition: transcoders.h:137
const OpalVideoFormat & GetOpalRGB32()
OpalMediaFormat inputMediaFormat
Definition: transcoders.h:107
OpalTemporalSpatialTradeOff(int tradeoff)
Definition: vidcodec.h:215
Definition: vidcodec.h:211
void ForceIFrame()
Definition: vidcodec.h:151
Definition: vidcodec.h:174
virtual PINDEX GetOptimalDataFrameSize(PBoolean input) const
bool lastFrameWasIFrame
Definition: vidcodec.h:158
OPAL_DEFINE_MEDIA_COMMAND(OpalVideoFreezePicture,"Freeze Picture")
Definition: rtp.h:370
virtual bool UpdateMediaFormats(const OpalMediaFormat &inputMediaFormat, const OpalMediaFormat &outputMediaFormat)
Definition: mediafmt.h:1306
OpalMediaFormat outputMediaFormat
Definition: transcoders.h:108
unsigned m_tradeOff
Definition: vidcodec.h:227
unsigned GetTimestamp() const
Definition: vidcodec.h:195
Definition: vidcodec.h:186
unsigned GetTradeOff() const
Definition: vidcodec.h:224
unsigned m_sequenceNumber
Definition: vidcodec.h:198
Definition: vidcodec.h:72