OPAL Version 3.10.4

- Main Page
- Related Pages
- Namespaces
- Data Structures
- Files

- File List
- Globals

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: 26728 $
27 * $Author: rjongbloed $
28 * $Date: 2011-12-01 22:59:14 -0600 (Thu, 01 Dec 2011) $
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
72 class OpalVideoTranscoder : public OpalTranscoder
73 {
74 PCLASSINFO(OpalVideoTranscoder, OpalTranscoder);
75 public:
76 typedef PluginCodec_Video_FrameHeader FrameHeader;
77
82 OpalVideoTranscoder(
83 const OpalMediaFormat & inputMediaFormat,
84 const OpalMediaFormat & outputMediaFormat
85 );
87
103 virtual bool UpdateMediaFormats(
104 const OpalMediaFormat & inputMediaFormat,
105 const OpalMediaFormat & outputMediaFormat
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;
157 bool forceIFrame;
158 bool lastFrameWasIFrame;
159
160 DWORD m_totalFrames;
161 DWORD m_keyFrames;
162 };
163
164
166
167 OPAL_DEFINE_MEDIA_COMMAND(OpalVideoFreezePicture, "Freeze Picture");
168
174 class OpalVideoUpdatePicture : public OpalMediaCommand
175 {
176 PCLASSINFO(OpalVideoUpdatePicture, OpalMediaCommand);
177 public:
178 virtual PString GetName() const;
179 };
180
186 class OpalVideoPictureLoss : public OpalVideoUpdatePicture
187 {
188 PCLASSINFO(OpalVideoPictureLoss, OpalVideoUpdatePicture);
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:
198 unsigned m_sequenceNumber;
199 unsigned m_timestamp;
200 };
201
202
210 class OpalTemporalSpatialTradeOff : public OpalMediaCommand
211 {
212 PCLASSINFO(OpalTemporalSpatialTradeOff, OpalMediaCommand);
213 public:
214 OpalTemporalSpatialTradeOff(int tradeoff) : m_tradeOff(tradeoff) { }
215
216 virtual PString GetName() const;
217
218 int GetTradeOff() const { return m_tradeOff; }
219
220 protected:
221 int m_tradeOff;
222 };
223
224
225 #endif // OPAL_VIDEO
226
227 #endif // OPAL_CODEC_VIDCODEC_H
228