=== General Data Structure changes in 2.0 === ==== Media Format ==== Containing all information needed to completely describe a media. - '''Changed''': [http://www.pjsip.org/docs/latest-2/pjmedia/docs/html/structpjmedia__format.htm pjmedia_format] — it is now virtually able to describe any media types (in 1.x it was containing extended info for audio format). Here are the core contents: - Format ID — Specifies the audio sample or video pixel format. Enumeration of some well known formats IDs is defined in [http://www.pjsip.org/docs/latest-2/pjmedia/docs/html/group__PJMEDIA__FORMAT.htm#ga7a0830cb291693cabb364a3403777bda pjmedia_format_id]. - Media type — The top-most type of the media, as an information. - Format detail — Detail section to describe the media. As the details are different among media types, this field is declared as union and [http://www.pjsip.org/docs/latest-2/pjmedia/docs/html/group__PJMEDIA__FORMAT.htm#ga3272e8f9dc6d369dc9fe5dcb67408fc5 pjmedia_format_detail_type] is introduced to recognize the content. Currently there are two predefined structures: - [http://www.pjsip.org/docs/latest-2/pjmedia/docs/html/structpjmedia__audio__format__detail.htm pjmedia_audio_format_detail] for audio format detail - [http://www.pjsip.org/docs/latest-2/pjmedia/docs/html/structpjmedia__video__format__detail.htm pjmedia_video_format_detail] for video format detail. - '''New''': Video format helper: - [http://www.pjsip.org/docs/latest-2/pjmedia/docs/html/structpjmedia__video__format__info.htm pjmedia_video_format_info] — Information to describe a raw video format, such as RGB/YUV color model, number of bits per pixel, planar/packed data representation, and pointer to function to get ''real-time'' information of a raw video format (such as buffer size needed for a picture, byte size of a picture line, pointer and buffer size of each plane). - [http://www.pjsip.org/docs/latest-2/pjmedia/docs/html/structpjmedia__video__apply__fmt__param.htm pjmedia_video_apply_fmt_param] — Information to apply a raw video format against size and buffer information, and get additional information from it. To do that, application fills up the input fields of this structure, and give this structure to {{{apply_fmt()}}} function of {{{pjmedia_video_format_info}}} structure. Check the media format documentation [http://www.pjsip.org/docs/latest-2/pjmedia/docs/html/group__PJMEDIA__FORMAT.htm here] for details. ==== Missing samples_per_frame ==== - '''Removed''': {{{samples_per_frame}}}, which was used in many PJMEDIA components and functions. Generally, application can now use {{{PJMEDIA_AFD_SAMPLES_PER_FRAME(audio-format-detail)}}} to get the same result. ==== Port info ==== - '''Changed''': All fields in the port info that desribe the media format have been removed and replaced by {{{pjmedia_format}}}. Check the port info documentation [http://www.pjsip.org/docs/latest-2/pjmedia/docs/html/structpjmedia__port__info.htm here] for details. ==== put_frame() callback of pjmedia_port ==== - '''Changed''': Removed const qualifier from the frame argument, this is to accomodate ''in-place'' media processing by PJMEDIA port. - Sample warnings in building application after upgrading from 1.x to 2.0: {{{ ../src/pjmedia/bidirectional.c: In function ‘put_frame’: ../src/pjmedia/bidirectional.c:39: warning: passing argument 2 of ‘pjmedia_port_put_frame’ discards qualifiers from pointer target type ../include/pjmedia/port.h:334: note: expected ‘struct pjmedia_frame *’ but argument is of type ‘const struct pjmedia_frame *’ ../src/pjmedia/bidirectional.c:70: warning: assignment from incompatible pointer type }}} ==== pjsua_call_info ==== - '''Changed''': As now call can have multiple media streams, e.g: M audio streams and N video streams, {{{pjsua_call_info}}} also has array of media info. Check the call info documentation [http://www.pjsip.org/docs/latest-2/pjsip/docs/html/structpjsua__call__info.htm here] for details.