WARNING: The online documentation has moved to https://docs.pjsip.org.

Visit the new documentation at https://docs.pjsip.org:

BLOG | DOCUMENTATION | GITHUB

Home --> Documentations --> PJMEDIA Reference

Audio and video converter utilities. More...

Data Structures

struct  pjmedia_conversion_param
 
struct  pjmedia_converter_factory
 
struct  pjmedia_converter
 
struct  pjmedia_converter_factory_op
 
struct  pjmedia_converter_op
 

Typedefs

typedef void pjmedia_converter_convert_setting
 
typedef struct pjmedia_converter_mgr pjmedia_converter_mgr
 

Enumerations

enum  pjmedia_converter_priority_guide {
  PJMEDIA_CONVERTER_PRIORITY_LOWEST = 0 ,
  PJMEDIA_CONVERTER_PRIORITY_NORMAL = 15000 ,
  PJMEDIA_CONVERTER_PRIORITY_HIGHEST = 32000
}
 

Functions

pj_status_t pjmedia_converter_mgr_create (pj_pool_t *pool, pjmedia_converter_mgr **mgr)
 
pjmedia_converter_mgrpjmedia_converter_mgr_instance (void)
 
void pjmedia_converter_mgr_set_instance (pjmedia_converter_mgr *mgr)
 
void pjmedia_converter_mgr_destroy (pjmedia_converter_mgr *mgr)
 
pj_status_t pjmedia_converter_mgr_register_factory (pjmedia_converter_mgr *mgr, pjmedia_converter_factory *f)
 
pj_status_t pjmedia_converter_mgr_unregister_factory (pjmedia_converter_mgr *mgr, pjmedia_converter_factory *f, pj_bool_t call_destroy)
 
pj_status_t pjmedia_converter_create (pjmedia_converter_mgr *mgr, pj_pool_t *pool, pjmedia_conversion_param *param, pjmedia_converter **p_cv)
 
pj_status_t pjmedia_converter_convert (pjmedia_converter *cv, pjmedia_frame *src_frame, pjmedia_frame *dst_frame)
 
pj_status_t pjmedia_converter_convert2 (pjmedia_converter *cv, pjmedia_frame *src_frame, const pjmedia_rect_size *src_frame_size, const pjmedia_coord *src_pos, pjmedia_frame *dst_frame, const pjmedia_rect_size *dst_frame_size, const pjmedia_coord *dst_pos, pjmedia_converter_convert_setting *param)
 
void pjmedia_converter_destroy (pjmedia_converter *cv)
 

Detailed Description

Typedef Documentation

◆ pjmedia_converter_convert_setting

◆ pjmedia_converter_mgr

Opaque data type for conversion manager. Typically, the conversion manager is a singleton instance, although application may instantiate more than one instances of this if required.

Enumeration Type Documentation

◆ pjmedia_converter_priority_guide

Converter priority guides. Converter priority determines which converter instance to be used if more than one converters are able to perform the requested conversion. Converter implementor can use this value to order the preference based on attributes such as quality or performance. Higher number indicates higher priority.

Enumerator
PJMEDIA_CONVERTER_PRIORITY_LOWEST 

Lowest priority.

PJMEDIA_CONVERTER_PRIORITY_NORMAL 

Normal priority.

PJMEDIA_CONVERTER_PRIORITY_HIGHEST 

Highest priority.

Function Documentation

◆ pjmedia_converter_mgr_create()

pj_status_t pjmedia_converter_mgr_create ( pj_pool_t pool,
pjmedia_converter_mgr **  mgr 
)

Create a new conversion manager instance. This will also set the pointer to the singleton instance if the value is still NULL.

Parameters
poolPool to allocate memory from.
mgrPointer to hold the created instance of the conversion manager.
Returns
PJ_SUCCESS on success or the appropriate error code.

◆ pjmedia_converter_mgr_instance()

pjmedia_converter_mgr * pjmedia_converter_mgr_instance ( void  )

Get the singleton instance of the conversion manager.

Returns
The instance.

◆ pjmedia_converter_mgr_set_instance()

void pjmedia_converter_mgr_set_instance ( pjmedia_converter_mgr mgr)

Manually assign a specific video manager instance as the singleton instance. Normally this is not needed if only one instance is ever going to be created, as the library automatically assign the singleton instance.

Parameters
mgrThe instance to be used as the singleton instance. Application may specify NULL to clear the singleton singleton instance.

◆ pjmedia_converter_mgr_destroy()

void pjmedia_converter_mgr_destroy ( pjmedia_converter_mgr mgr)

Destroy a converter manager. If the manager happens to be the singleton instance, the singleton instance will be set to NULL.

Parameters
mgrThe converter manager. Specify NULL to use the singleton instance.

◆ pjmedia_converter_mgr_register_factory()

pj_status_t pjmedia_converter_mgr_register_factory ( pjmedia_converter_mgr mgr,
pjmedia_converter_factory f 
)

Register a converter factory to the converter manager.

Parameters
mgrThe converter manager. Specify NULL to use the singleton instance.
fThe converter factory to be registered.
Returns
PJ_SUCCESS on success or the appropriate error code.

◆ pjmedia_converter_mgr_unregister_factory()

pj_status_t pjmedia_converter_mgr_unregister_factory ( pjmedia_converter_mgr mgr,
pjmedia_converter_factory f,
pj_bool_t  call_destroy 
)

Unregister a previously registered converter factory from the converter manager.

Parameters
mgrThe converter manager. Specify NULL to use the singleton instance.
fThe converter factory to be unregistered.
call_destroyIf this is set to non-zero, the destroy_factory() callback of the factory will be called while unregistering the factory from the manager.
Returns
PJ_SUCCESS on success or the appropriate error code.

◆ pjmedia_converter_create()

pj_status_t pjmedia_converter_create ( pjmedia_converter_mgr mgr,
pj_pool_t pool,
pjmedia_conversion_param param,
pjmedia_converter **  p_cv 
)

Create a converter instance to perform the specified format conversion as specified in param.

Parameters
mgrThe converter manager. Specify NULL to use the singleton instance.
poolPool to allocate the memory from.
paramConversion parameter.
p_cvPointer to hold the created converter.
Returns
PJ_SUCCESS if a converter has been created successfully or the appropriate error code.

◆ pjmedia_converter_convert()

pj_status_t pjmedia_converter_convert ( pjmedia_converter cv,
pjmedia_frame src_frame,
pjmedia_frame dst_frame 
)

Convert the buffer in the source frame and save the result in the buffer of the destination frame, according to conversion format that was specified when the converter was created.

Parameters
cvThe converter instance.
src_frameThe source frame.
dst_frameThe destination frame.
Returns
PJ_SUCCESS if conversion has been performed successfully.

◆ pjmedia_converter_convert2()

pj_status_t pjmedia_converter_convert2 ( pjmedia_converter cv,
pjmedia_frame src_frame,
const pjmedia_rect_size src_frame_size,
const pjmedia_coord src_pos,
pjmedia_frame dst_frame,
const pjmedia_rect_size dst_frame_size,
const pjmedia_coord dst_pos,
pjmedia_converter_convert_setting param 
)

Convert a region in the buffer of the source frame and put the result into a region in the buffer of the destination frame, according to conversion format that was specified when the converter was created.

Parameters
cvThe converter instance.
src_frameThe source frame.
src_frame_sizeThe source frame size.
src_posThe source region position.
dst_frameThe destination frame.
dst_frame_sizeThe destination frame size.
dst_posThe destination region position.
paramThis is unused for now and must be NULL.
Returns
PJ_SUCCESS if conversion has been performed successfully.

◆ pjmedia_converter_destroy()

void pjmedia_converter_destroy ( pjmedia_converter cv)

Destroy the converter.

Parameters
cvThe converter instance.

 


PJMEDIA small footprint Open Source media stack
Copyright (C) 2006-2008 Teluu Inc.