28 #ifndef OPAL_OPAL_TRANSCODERS_H
29 #define OPAL_OPAL_TRANSCODERS_H
124 #define OPAL_REGISTER_TRANSCODER(cls, input, output) \
125 PFACTORY_CREATE(OpalTranscoderFactory, cls, MakeOpalTranscoderKey(input, output), false)
202 RTP_DataFrameList & output
223 const BYTE * instance = NULL,
224 unsigned instanceLen = 0
304 const PNotifier & notifier
345 const BYTE * instance,
543 #define OPAL_REGISTER_L16_MONO() \
544 OPAL_REGISTER_TRANSCODER(Opal_Linear16Mono_PCM, OpalL16_MONO_8KHZ, OpalPCM16); \
545 OPAL_REGISTER_TRANSCODER(Opal_PCM_Linear16Mono, OpalPCM16, OpalL16_MONO_8KHZ)
560 #define OPAL_DECLARE_EMPTY_TRANSCODER(fmt) \
561 class Opal_Empty_##fmt##_Encoder : public OpalEmptyFramedAudioTranscoder \
564 Opal_Empty_##fmt##_Encoder() \
565 : OpalEmptyFramedAudioTranscoder(OpalPCM16, fmt) \
568 class Opal_Empty_##fmt##_Decoder : public OpalEmptyFramedAudioTranscoder \
571 Opal_Empty_##fmt##_Decoder() \
572 : OpalEmptyFramedAudioTranscoder(fmt, OpalPCM16) \
576 #define OPAL_DEFINE_EMPTY_TRANSCODER(fmt) \
577 OPAL_REGISTER_TRANSCODER(Opal_Empty_##fmt##_Encoder, OpalPCM16, fmt); \
578 OPAL_REGISTER_TRANSCODER(Opal_Empty_##fmt##_Decoder, fmt, OpalPCM16); \
580 #endif // OPAL_OPAL_TRANSCODERS_H
PFactory< OpalTranscoder, OpalTranscoderKey >::KeyList_T OpalTranscoderList
Definition: transcoders.h:111
bool inputIsRTP
Definition: transcoders.h:354
virtual PBoolean ConvertSilentFrame(BYTE *output, PINDEX &created)
PINDEX outputBytesPerFrame
Definition: transcoders.h:450
RTP_DataFrame::PayloadTypes GetPayloadType(PBoolean input) const
bool acceptOtherPayloads
Definition: transcoders.h:356
Definition: transcoders.h:534
unsigned m_outClockRate
Definition: transcoders.h:358
virtual PINDEX GetOptimalDataFrameSize(PBoolean input) const =0
virtual int ConvertOne(int sample) const
virtual PBoolean Convert(const RTP_DataFrame &input, RTP_DataFrame &output)
Definition: transcoders.h:525
void CopyTimestamp(RTP_DataFrame &dst, const RTP_DataFrame &src, bool inToOut) const
virtual PBoolean ExecuteCommand(const OpalMediaCommand &command)
bool outputIsRTP
Definition: transcoders.h:354
PINDEX maxOutputDataSize
Definition: transcoders.h:451
RTP_Timestamp m_lastEmptyPayloadTimestamp
Definition: transcoders.h:458
Definition: transcoders.h:469
bool acceptEmptyPayload
Definition: transcoders.h:355
OpalStreamedTranscoder(const OpalMediaFormat &inputMediaFormat, const OpalMediaFormat &outputMediaFormat, unsigned inputBits, unsigned outputBits)
static OpalMediaFormatList GetSourceFormats(const OpalMediaFormat &dstFormat)
virtual PINDEX GetOptimalDataFrameSize(PBoolean input) const
OpalTranscoder(const OpalMediaFormat &inputMediaFormat, const OpalMediaFormat &outputMediaFormat)
PayloadTypes
Definition: rtp.h:556
virtual bool AcceptComfortNoise() const
Definition: transcoders.h:328
unsigned m_sessionID
Definition: transcoders.h:353
virtual bool AcceptOtherPayloads() const
Definition: transcoders.h:330
std::pair< PString, PString > OpalTranscoderKey
Definition: transcoders.h:109
unsigned m_consecutivePayloadTypeMismatches
Definition: transcoders.h:361
OpalFramedTranscoder(const OpalMediaFormat &inputMediaFormat, const OpalMediaFormat &outputMediaFormat)
void NotifyCommand(const OpalMediaCommand &command) const
Notify command notifier of command.
enum OpalFramedTranscoder::@36 m_emptyPayloadState
unsigned GetSessionID() const
Get session ID for the transcoder (from OpalMediaStream)
Definition: transcoders.h:319
Definition: transcoders.h:548
__inline OpalTranscoderKey MakeOpalTranscoderKey(const OpalMediaFormat &from, const OpalMediaFormat &to)
Definition: transcoders.h:114
static OpalMediaFormatList GetPossibleFormats(const OpalMediaFormatList &formats)
static bool SelectFormats(const OpalMediaType &mediaType, const OpalMediaFormatList &srcFormats, const OpalMediaFormatList &dstFormats, const OpalMediaFormatList &masterFormats, OpalMediaFormat &srcFormat, OpalMediaFormat &dstFormat)
Definition: transcoders.h:134
virtual bool UpdateMediaFormats(const OpalMediaFormat &inputMediaFormat, const OpalMediaFormat &outputMediaFormat)
virtual PBoolean ConvertFrames(const RTP_DataFrame &input, RTP_DataFrameList &output)
Definition: transcoders.h:456
PINDEX GetMaxOutputSize() const
Definition: transcoders.h:291
PINDEX maxOutputSize
Definition: transcoders.h:349
void SetCommandNotifier(const PNotifier ¬ifier)
Definition: transcoders.h:303
void SetMaxOutputSize(PINDEX size)
virtual bool OnCreated(const OpalMediaFormat &srcFormat, const OpalMediaFormat &destFormat, const BYTE *instance, unsigned instanceLen)
PBoolean ConvertFrame(const BYTE *, PINDEX &, BYTE *, PINDEX &)
Definition: transcoders.h:556
static OpalTranscoder * Create(const OpalMediaFormat &srcFormat, const OpalMediaFormat &dstFormat, const BYTE *instance=NULL, unsigned instanceLen=0)
Definition: transcoders.h:372
unsigned outputBitsPerSample
Definition: transcoders.h:519
Definition: transcoders.h:454
uint32_t RTP_Timestamp
Definition: rtp.h:44
OpalEmptyFramedAudioTranscoder(const char *inFormat, const char *outFormat)
Definition: transcoders.h:552
void SetSessionID(unsigned id)
Set session ID for the transcoder (from OpalMediaStream)
Definition: transcoders.h:322
PNotifier commandNotifier
Definition: transcoders.h:350
PFactory< OpalTranscoder, OpalTranscoderKey > OpalTranscoderFactory
Definition: transcoders.h:110
virtual int ConvertOne(int sample) const
static OpalMediaFormatList GetDestinationFormats(const OpalMediaFormat &srcFormat)
PFactory< OpalTranscoder, OpalTranscoderKey >::KeyList_T::iterator OpalTranscoderIterator
Definition: transcoders.h:112
virtual bool AcceptEmptyPayload() const
Definition: transcoders.h:329
virtual PBoolean ConvertFrame(const BYTE *input, BYTE *output)
virtual PINDEX GetOptimalDataFrameSize(PBoolean input) const
static bool FindIntermediateFormat(const OpalMediaFormat &srcFormat, const OpalMediaFormat &dstFormat, OpalMediaFormat &intermediateFormat)
virtual bool UpdateMediaFormats(const OpalMediaFormat &inputMediaFormat, const OpalMediaFormat &outputMediaFormat)
PINDEX inputBytesPerFrame
Definition: transcoders.h:449
unsigned m_inClockRate
Definition: transcoders.h:357
Definition: transcoders.h:455
PDECLARE_MUTEX(updateMutex)
virtual PBoolean Convert(const RTP_DataFrame &input, RTP_DataFrame &output)
virtual void GetStatistics(OpalMediaStatistics &statistics) const
virtual int ConvertOne(int sample) const =0
virtual PBoolean Convert(const RTP_DataFrame &input, RTP_DataFrame &output)=0
RTP_DataFrame::PayloadTypes m_lastPayloadType
Definition: transcoders.h:360
unsigned inputBitsPerSample
Definition: transcoders.h:518
const PNotifier & GetCommandNotifier() const
Definition: transcoders.h:311