Group PJMEDIA_SIG

group PJMEDIA_SIG

Standard PJMEDIA object signatures.

Object signature is a 32-bit integral value similar to FOURCC to help identify PJMEDIA objects such as media ports, transports, codecs, etc. There are several uses of this signature, for example a media port can use the port object signature to verify that the given port instance is the one that it created, and a receiver of Event Framework can use the signature of the publisher to know which object emitted the event.

The 32-bit value of an object signature is generated by the following macro:

  #define PJMEDIA_SIGNATURE(a,b,c,d)   (a<<24 | b<<16 | c<<8 | d)
*

The following convention is used to maintain order to the signature values so that application can make use of it more effectively, and to avoid conflict between the values themselves. For each object type or class, a specific prefix will be assigned as signature, and a macro is created to build a signature for such object:

   Class               Signature  Signature creation and test macros
   ---------------------------------------------------------------
   Codec               Cxxx       PJMEDIA_SIG_CLASS_CODEC(b,c,d)
                                  PJMEDIA_SIG_IS_CLASS_CODEC(sig)

   Audio codec         CAxx       PJMEDIA_SIG_CLASS_AUD_CODEC(c,d)
                                  PJMEDIA_SIG_IS_CLASS_AUD_CODEC(sig)

   Video codec         CVxx       PJMEDIA_SIG_CLASS_VID_CODEC(c,d)
                                  PJMEDIA_SIG_IS_CLASS_VID_CODEC(sig)

   Media port          Pxxx       PJMEDIA_SIG_CLASS_PORT(b,c,d)
                                  PJMEDIA_SIG_IS_CLASS_PORT(sig)

   Audio media port    PAxx       PJMEDIA_SIG_CLASS_PORT_AUD(c,d)
                                  PJMEDIA_SIG_IS_CLASS_PORT_AUD(sig)

   Video media port    PVxx       PJMEDIA_SIG_CLASS_PORT_VID(c,d)
                                  PJMEDIA_SIG_IS_CLASS_PORT_VID(sig)

   Video device        VDxx       PJMEDIA_SIG_CLASS_VID_DEV(c,d)
                                  PJMEDIA_SIG_IS_CLASS_VID_DEV(sig)

   Video other         VOxx       PJMEDIA_SIG_CLASS_VID_OTHER(c,d)
                                  PJMEDIA_SIG_IS_CLASS_VID_OTHER(sig)

   Application object  Axxx       PJMEDIA_SIG_CLASS_APP(b,c,d)
                                  PJMEDIA_SIG_IS_CLASS_APP(sig)

*

In addition, signatures created in application code should have lowercase letters to avoid conflict with built-in objects.

Defines

PJMEDIA_SIGNATURE(a, b, c, d)

Macro to generate signature from four ASCII letters.

PJMEDIA_SIG_CLASS_CODEC(b, c, d)
PJMEDIA_SIG_IS_CLASS_CODEC(sig)
PJMEDIA_SIG_CLASS_AUD_CODEC(c, d)
PJMEDIA_SIG_IS_CLASS_AUD_CODEC(s)
PJMEDIA_SIG_CLASS_VID_CODEC(c, d)
PJMEDIA_SIG_IS_CLASS_VID_CODEC(sig)
PJMEDIA_SIG_VID_CODEC_FFMPEG
PJMEDIA_SIG_CLASS_PORT(b, c, d)
PJMEDIA_SIG_IS_CLASS_PORT(sig)
PJMEDIA_SIG_CLASS_PORT_AUD(c, d)
PJMEDIA_SIG_IS_CLASS_PORT_AUD(s)
PJMEDIA_SIG_PORT_BIDIR
PJMEDIA_SIG_PORT_CONF
PJMEDIA_SIG_PORT_CONF_PASV
PJMEDIA_SIG_PORT_CONF_SWITCH
PJMEDIA_SIG_PORT_ECHO
PJMEDIA_SIG_PORT_MEM_CAPTURE
PJMEDIA_SIG_PORT_MEM_PLAYER
PJMEDIA_SIG_PORT_NULL
PJMEDIA_SIG_PORT_RESAMPLE
PJMEDIA_SIG_PORT_SPLIT_COMB
PJMEDIA_SIG_PORT_SPLIT_COMB_P
PJMEDIA_SIG_PORT_STEREO
PJMEDIA_SIG_PORT_STREAM
PJMEDIA_SIG_PORT_TONEGEN
PJMEDIA_SIG_PORT_WAV_PLAYER
PJMEDIA_SIG_PORT_WAV_PLAYLIST
PJMEDIA_SIG_PORT_WAV_WRITER
PJMEDIA_SIG_CLASS_PORT_VID(c, d)
PJMEDIA_SIG_IS_CLASS_PORT_VID(s)
PJMEDIA_SIG_PORT_VID_AVI_PLAYER

AVI player signature.

PJMEDIA_SIG_PORT_VID_STREAM
PJMEDIA_SIG_PORT_VID_TEE
PJMEDIA_SIG_CLASS_VID_DEV(c, d)
PJMEDIA_SIG_IS_CLASS_VID_DEV(s)
PJMEDIA_SIG_VID_DEV_COLORBAR
PJMEDIA_SIG_VID_DEV_SDL
PJMEDIA_SIG_VID_DEV_V4L2
PJMEDIA_SIG_VID_DEV_DSHOW
PJMEDIA_SIG_VID_DEV_QT
PJMEDIA_SIG_VID_DEV_IOS
PJMEDIA_SIG_CLASS_VID_OTHER(c, d)
PJMEDIA_SIG_IS_CLASS_VID_OTHER(s)
PJMEDIA_SIG_VID_CONF
PJMEDIA_SIG_VID_PORT
PJMEDIA_SIG_CLASS_APP(b, c, d)
PJMEDIA_SIG_IS_CLASS_APP(s)

Typedefs

typedef pj_uint32_t pjmedia_obj_sig

Type to store object signature.

Functions

const char *pjmedia_sig_name(pjmedia_obj_sig sig, char buf[])

A utility function to convert signature to four letters string.

Parameters:
  • sig – The signature value.

  • buf – Buffer to store the string, which MUST be at least five bytes long.

Returns:

The string.