vidcodec.h
Go to the documentation of this file.
/*
* vidcodec.h
*
* Uncompressed video handler
*
* Open Phone Abstraction Library
*
* Copyright (c) 2003 Equivalence Pty. Ltd.
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
* the License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Open Phone Abstraction Library.
*
* The Initial Developer of the Original Code is Equivalence Pty. Ltd.
*
* Contributor(s):
*
* $Revision: 27792 $
* $Author: rjongbloed $
* $Date: 2012-06-07 21:14:33 -0500 (Thu, 07 Jun 2012) $
*/
#ifndef OPAL_CODEC_VIDCODEC_H
#define OPAL_CODEC_VIDCODEC_H
#ifdef P_USE_PRAGMA
#pragma interface
#endif
#include <opal/buildopts.h>
#include <opal/transcoders.h>
#if OPAL_VIDEO
#if OPAL_H323
#include <h323/h323caps.h>
#endif
#include <codec/opalplugin.h>
#define OPAL_RGB24 "RGB24"
#define OPAL_RGB32 "RGB32"
#define OPAL_YUV420P "YUV420P"
extern const OpalVideoFormat & GetOpalRGB24();
extern const OpalVideoFormat & GetOpalRGB32();
extern const OpalVideoFormat & GetOpalYUV420P();
#define OpalRGB24 GetOpalRGB24()
#define OpalRGB32 GetOpalRGB32()
#define OpalYUV420P GetOpalYUV420P()
class OpalVideoTranscoder : public OpalTranscoder
{
PCLASSINFO(OpalVideoTranscoder, OpalTranscoder);
public:
typedef PluginCodec_Video_FrameHeader FrameHeader;
OpalVideoTranscoder(
const OpalMediaFormat & inputMediaFormat,
const OpalMediaFormat & outputMediaFormat
);
virtual bool UpdateMediaFormats(
const OpalMediaFormat & inputMediaFormat,
const OpalMediaFormat & outputMediaFormat
);
virtual PINDEX GetOptimalDataFrameSize(
PBoolean input
) const;
virtual PBoolean ExecuteCommand(
const OpalMediaCommand & command
);
virtual PBoolean Convert(
const RTP_DataFrame & input,
RTP_DataFrame & output
);
#if OPAL_STATISTICS
virtual void GetStatistics(OpalMediaStatistics & statistics) const;
#endif
bool WasLastFrameIFrame() const { return lastFrameWasIFrame; }
void ForceIFrame() { forceIFrame = true; }
protected:
PINDEX inDataSize;
PINDEX outDataSize;
bool forceIFrame;
bool lastFrameWasIFrame;
DWORD m_totalFrames;
DWORD m_keyFrames;
};
OPAL_DEFINE_MEDIA_COMMAND(OpalVideoFreezePicture, "Freeze Picture");
class OpalVideoUpdatePicture : public OpalMediaCommand
{
PCLASSINFO(OpalVideoUpdatePicture, OpalMediaCommand);
public:
virtual PString GetName() const;
};
class OpalVideoPictureLoss : public OpalVideoUpdatePicture
{
PCLASSINFO(OpalVideoPictureLoss, OpalVideoUpdatePicture);
public:
OpalVideoPictureLoss(unsigned sequenceNumber = 0, unsigned timestamp = 0);
virtual PString GetName() const;
unsigned GetSequenceNumber() const { return m_sequenceNumber; }
unsigned GetTimestamp() const { return m_timestamp; }
protected:
unsigned m_sequenceNumber;
unsigned m_timestamp;
};
class OpalTemporalSpatialTradeOff : public OpalMediaCommand
{
PCLASSINFO(OpalTemporalSpatialTradeOff, OpalMediaCommand);
public:
OpalTemporalSpatialTradeOff(int tradeoff) : m_tradeOff(tradeoff) { }
virtual PString GetName() const;
enum {
MaximiseSpatial = 0,
MaximiseTemporal = 31
};
unsigned GetTradeOff() const { return m_tradeOff; }
protected:
unsigned m_tradeOff;
};
#endif // OPAL_VIDEO
#endif // OPAL_CODEC_VIDCODEC_H
GetOpalYUV420P
const OpalVideoFormat & GetOpalYUV420P()
OpalVideoTranscoder::ExecuteCommand
virtual PBoolean ExecuteCommand(const OpalMediaCommand &command)
OpalVideoTranscoder::outDataSize
PINDEX outDataSize
Definition: vidcodec.h:156
OpalVideoTranscoder::GetStatistics
virtual void GetStatistics(OpalMediaStatistics &statistics) const
OpalVideoPictureLoss::m_timestamp
unsigned m_timestamp
Definition: vidcodec.h:199
OpalMediaCommand
Definition: mediacmd.h:43
OpalVideoTranscoder::Convert
virtual PBoolean Convert(const RTP_DataFrame &input, RTP_DataFrame &output)
opalplugin.h
buildopts.h
OpalVideoTranscoder::m_keyFrames
DWORD m_keyFrames
Definition: vidcodec.h:161
h323caps.h
OpalVideoTranscoder::OpalVideoTranscoder
OpalVideoTranscoder(const OpalMediaFormat &inputMediaFormat, const OpalMediaFormat &outputMediaFormat)
GetOpalRGB24
const OpalVideoFormat & GetOpalRGB24()
OpalTemporalSpatialTradeOff::MaximiseTemporal
Definition: vidcodec.h:221
OpalVideoTranscoder::forceIFrame
bool forceIFrame
Definition: vidcodec.h:157
OpalVideoUpdatePicture::GetName
virtual PString GetName() const
OpalVideoPictureLoss::GetSequenceNumber
unsigned GetSequenceNumber() const
Definition: vidcodec.h:194
OpalVideoTranscoder::WasLastFrameIFrame
bool WasLastFrameIFrame() const
Definition: vidcodec.h:150
PluginCodec_Video_FrameHeader
Definition: opalplugin.h:892
OpalVideoPictureLoss::GetName
virtual PString GetName() const
OpalVideoTranscoder::inDataSize
PINDEX inDataSize
Definition: vidcodec.h:155
RTP_DataFrame
Definition: rtp.h:71
OpalVideoTranscoder::m_totalFrames
DWORD m_totalFrames
Definition: vidcodec.h:160
OpalMediaFormat
Definition: mediafmt.h:724
OpalTemporalSpatialTradeOff::MaximiseSpatial
Definition: vidcodec.h:220
OpalVideoTranscoder::FrameHeader
PluginCodec_Video_FrameHeader FrameHeader
Definition: vidcodec.h:76
OpalTranscoder
Definition: transcoders.h:137
transcoders.h
GetOpalRGB32
const OpalVideoFormat & GetOpalRGB32()
OpalMediaFormatPair::inputMediaFormat
OpalMediaFormat inputMediaFormat
Definition: transcoders.h:107
OpalTemporalSpatialTradeOff::GetName
virtual PString GetName() const
OpalTemporalSpatialTradeOff::OpalTemporalSpatialTradeOff
OpalTemporalSpatialTradeOff(int tradeoff)
Definition: vidcodec.h:215
OpalTemporalSpatialTradeOff
Definition: vidcodec.h:211
OpalVideoTranscoder::ForceIFrame
void ForceIFrame()
Definition: vidcodec.h:151
OpalVideoUpdatePicture
Definition: vidcodec.h:174
OpalVideoTranscoder::GetOptimalDataFrameSize
virtual PINDEX GetOptimalDataFrameSize(PBoolean input) const
OpalVideoTranscoder::lastFrameWasIFrame
bool lastFrameWasIFrame
Definition: vidcodec.h:158
OPAL_DEFINE_MEDIA_COMMAND
OPAL_DEFINE_MEDIA_COMMAND(OpalVideoFreezePicture,"Freeze Picture")
OpalMediaStatistics
Definition: rtp.h:370
OpalVideoTranscoder::UpdateMediaFormats
virtual bool UpdateMediaFormats(const OpalMediaFormat &inputMediaFormat, const OpalMediaFormat &outputMediaFormat)
OpalVideoFormat
Definition: mediafmt.h:1306
OpalVideoPictureLoss::OpalVideoPictureLoss
OpalVideoPictureLoss(unsigned sequenceNumber=0, unsigned timestamp=0)
OpalMediaFormatPair::outputMediaFormat
OpalMediaFormat outputMediaFormat
Definition: transcoders.h:108
OpalTemporalSpatialTradeOff::m_tradeOff
unsigned m_tradeOff
Definition: vidcodec.h:227
OpalVideoPictureLoss::GetTimestamp
unsigned GetTimestamp() const
Definition: vidcodec.h:195
OpalVideoPictureLoss
Definition: vidcodec.h:186
OpalTemporalSpatialTradeOff::GetTradeOff
unsigned GetTradeOff() const
Definition: vidcodec.h:224
OpalVideoPictureLoss::m_sequenceNumber
unsigned m_sequenceNumber
Definition: vidcodec.h:198
OpalVideoTranscoder
Definition: vidcodec.h:72