# opalplugin.hpp File Reference

`#include "opalplugin.h"`
`#include <string.h>`
`#include <stdlib.h>`
`#include <limits.h>`
`#include <map>`
`#include <string>`
`#include <sstream>`

Include dependency graph for opalplugin.hpp:

Go to the source code of this file.

## Data Structures

class | PluginCodec_RTP
class | PluginCodec_Utilities
class | PluginCodec_OptionMap
class | PluginCodec_MediaFormat< NAME >
class | PluginCodec_AudioFormat< NAME >
class | PluginCodec_VideoFormat< NAME >
class | PluginCodec< NAME >
class | PluginVideoCodec< NAME >
class | PluginVideoEncoder< NAME >
class | PluginVideoDecoder< NAME >
struct | PluginVideoDecoder< NAME >::OutputImagePlaneInfo

## Defines

#define | PLUGINCODEC_TRACING 1
#define | PLUGINCODEC_CONTROL_LOG_FUNCTION_DEF
#define | PLUGINCODEC_CONTROL_LOG_FUNCTION_INC { PLUGINCODEC_CONTROL_SET_LOG_FUNCTION, PluginCodec_SetLogFunction },
#define | PTRACE_CHECK(level) (PluginCodec_LogFunctionInstance != NULL && PluginCodec_LogFunctionInstance(level, NULL, 0, NULL, NULL))
#define | PTRACE(level, section, args)
#define | OPAL_PLUGIN_CLAMPED_RESOLUTION(width, height) { width, height, ((width+15)/16) * ((height+15)/16) }
#define | PLUGINCODEC_AUDIO_CODEC_CXX(MediaFormat,EncoderClass,DecoderClass)
| Declare an audio codec using C++ support classes.
#define | PLUGINCODEC_VIDEO_CODEC_CXX(MediaFormat,EncoderClass,DecoderClass)
| Declare a video codec using C++ support classes.
#define | PLUGIN_CODEC_IMPLEMENT_CXX(NAME, table)

## Typedefs

typedef std::map< std::string, std::string > | PluginCodec_OptionMapBase

## Functions

int | PluginCodec_SetLogFunction (const PluginCodec_Definition *, void *, const char *, void *parm, unsigned *len)

## Variables

PluginCodec_LogFunction | PluginCodec_LogFunctionInstance

## Define Documentation

#define OPAL_PLUGIN_CLAMPED_RESOLUTION | ( | width,
|  | height |  | ) | { width, height, ((width+15)/16) * ((height+15)/16) }

#define PLUGIN_CODEC_IMPLEMENT_CXX | ( | NAME,
|  | table |  | ) |

Value:

    extern "C" { \
        PLUGIN_CODEC_IMPLEMENT(NAME) \
        PLUGIN_CODEC_DLL_API struct PluginCodec_Definition * PLUGIN_CODEC_GET_CODEC_FN(unsigned * count, unsigned version) { \
          if (version < PLUGIN_CODEC_VERSION_OPTIONS) return NULL; \
          *count = sizeof(table)/sizeof(struct PluginCodec_Definition); \
          PluginCodec_MediaFormat<NAME>::AdjustAllForVersion(version, table, *count); \
          return table; \
        } \
      }

#define PLUGINCODEC_AUDIO_CODEC_CXX | ( | MediaFormat,
|  | EncoderClass,
|  | DecoderClass |  | ) |

Value:

    PLUGINCODEC_CODEC_PAIR(MediaFormat.GetFormatName(), \
                                        MediaFormat.GetPayloadName(), \
                                        MediaFormat.GetDescription(), \
                                        MediaFormat.GetSampleRate(), \
                                        MediaFormat.GetMaxBandwidth(), \
                                        MediaFormat.GetFrameTime(), \
                                        MediaFormat.GetSamplesPerFrame(), \
                                        MediaFormat.GetBytesPerFrame(), \
                                        MediaFormat.GetRecommendedFramesPerPacket(), \
                                        MediaFormat.GetMaxFramesPerPacket(), \
                                        MediaFormat.GetPayloadType(), \
                                        MediaFormat.GetH323CapabilityType(), \
                                        MediaFormat.GetH323CapabilityData(), \
                                        EncoderClass::Create_s<EncoderClass>, \
                                        EncoderClass::Destroy_s, \
                                        EncoderClass::Transcode_s, \
                                        DecoderClass::Create_s<DecoderClass>, \
                                        DecoderClass::Destroy_s, \
                                        DecoderClass::Transcode_s, \
                                        DecoderClass::GetControls(), /* Note doesn't matter if encoder or decoder */ \
                                        MediaFormat.GetFlags(), \
                                        PLUGINCODEC_RAW_AUDIO, \
                                        &MediaFormat)

Declare an audio codec using C++ support classes.

< Decoder class name

#define PLUGINCODEC_CONTROL_LOG_FUNCTION_DEF

Value:

    PluginCodec_LogFunction PluginCodec_LogFunctionInstance; \
      int PluginCodec_SetLogFunction(const PluginCodec_Definition *, void *, const char *, void * parm, unsigned * len) \
      { \
        if (len == NULL || *len != sizeof(PluginCodec_LogFunction)) \
          return false; \
     \
        PluginCodec_LogFunctionInstance = (PluginCodec_LogFunction)parm; \
        if (PluginCodec_LogFunctionInstance != NULL) \
          PluginCodec_LogFunctionInstance(4, __FILE__, __LINE__, "Plugin", "Started logging."); \
     \
        return true; \
      } \

#define PLUGINCODEC_CONTROL_LOG_FUNCTION_INC { PLUGINCODEC_CONTROL_SET_LOG_FUNCTION, PluginCodec_SetLogFunction },

#define PLUGINCODEC_TRACING 1

#define PLUGINCODEC_VIDEO_CODEC_CXX | ( | MediaFormat,
|  | EncoderClass,
|  | DecoderClass |  | ) |

Value:

    PLUGINCODEC_CODEC_PAIR(MediaFormat.GetFormatName(), \
                                        MediaFormat.GetPayloadName(), \
                                        MediaFormat.GetDescription(), \
                                        PLUGINCODEC_VIDEO_CLOCK, \
                                        MediaFormat.GetMaxBandwidth(), \
                                        1000000/PLUGINCODEC_MAX_FRAME_RATE, \
                                        MediaFormat.GetMaxWidth(), \
                                        MediaFormat.GetMaxHeight(), \
                                        0,PLUGINCODEC_MAX_FRAME_RATE, \
                                        MediaFormat.GetPayloadType(), \
                                        MediaFormat.GetH323CapabilityType(), \
                                        MediaFormat.GetH323CapabilityData(), \
                                        EncoderClass::Create_s<EncoderClass>, \
                                        EncoderClass::Destroy_s, \
                                        EncoderClass::Transcode_s, \
                                        DecoderClass::Create_s<DecoderClass>, \
                                        DecoderClass::Destroy_s, \
                                        DecoderClass::Transcode_s, \
                                        DecoderClass::GetControls(), /* Note doesn't matter if encoder or decoder */ \
                                        MediaFormat.GetFlags(), \
                                        PLUGINCODEC_RAW_VIDEO, \
                                        &MediaFormat)

Declare a video codec using C++ support classes.

< Decoder class name

#define PTRACE | ( | level,
|  | section,
|  | args |  | ) |

Value:

    if (PTRACE_CHECK(level)) { \
            std::ostringstream strm; strm << args; \
            PluginCodec_LogFunctionInstance(level, __FILE__, __LINE__, section, strm.str().c_str()); \
          } else (void)0

#define PTRACE_CHECK | ( | level |  | ) | (PluginCodec_LogFunctionInstance != NULL && PluginCodec_LogFunctionInstance(level, NULL, 0, NULL, NULL))

## Typedef Documentation

typedef std::map<std::string, std::string> PluginCodec_OptionMapBase

## Function Documentation

int PluginCodec_SetLogFunction | ( | const PluginCodec_Definition * | ,
|  | void * | ,
|  | const char * | ,
|  | void * | parm,
|  | unsigned * | len |
| ) |  |  |

## Variable Documentation

PluginCodec_LogFunction PluginCodec_LogFunctionInstance