BLOG | DOCUMENTATION | TRAC

Home --> Documentations --> PJMEDIA Reference

pjmedia_codec_factory_op Struct Reference

Data Fields

pj_status_t(* test_alloc )(pjmedia_codec_factory *factory, const pjmedia_codec_info *info)
 
pj_status_t(* default_attr )(pjmedia_codec_factory *factory, const pjmedia_codec_info *info, pjmedia_codec_param *attr)
 
pj_status_t(* enum_info )(pjmedia_codec_factory *factory, unsigned *count, pjmedia_codec_info codecs[])
 
pj_status_t(* alloc_codec )(pjmedia_codec_factory *factory, const pjmedia_codec_info *info, pjmedia_codec **p_codec)
 
pj_status_t(* dealloc_codec )(pjmedia_codec_factory *factory, pjmedia_codec *codec)
 
pj_status_t(* destroy )(void)
 

Detailed Description

This structure describes operations that must be supported by codec factories.

Field Documentation

pj_status_t(* pjmedia_codec_factory_op::test_alloc) (pjmedia_codec_factory *factory, const pjmedia_codec_info *info)

Check whether the factory can create codec with the specified codec info.

Parameters
factoryThe codec factory.
infoThe codec info.
Returns
PJ_SUCCESS if this factory is able to create an instance of codec with the specified info.
pj_status_t(* pjmedia_codec_factory_op::default_attr) (pjmedia_codec_factory *factory, const pjmedia_codec_info *info, pjmedia_codec_param *attr)

Create default attributes for the specified codec ID. This function can be called by application to get the capability of the codec.

Parameters
factoryThe codec factory.
infoThe codec info.
attrThe attribute to be initialized.
Returns
PJ_SUCCESS if success.
pj_status_t(* pjmedia_codec_factory_op::enum_info) (pjmedia_codec_factory *factory, unsigned *count, pjmedia_codec_info codecs[])

Enumerate supported codecs that can be created using this factory.

Parameters
factoryThe codec factory.
countOn input, specifies the number of elements in the array. On output, the value will be set to the number of elements that have been initialized by this function.
infoThe codec info array, which contents will be initialized upon return.
Returns
PJ_SUCCESS on success.
pj_status_t(* pjmedia_codec_factory_op::alloc_codec) (pjmedia_codec_factory *factory, const pjmedia_codec_info *info, pjmedia_codec **p_codec)

Create one instance of the codec with the specified codec info.

Parameters
factoryThe codec factory.
infoThe codec info.
p_codecPointer to receive the codec instance.
Returns
PJ_SUCCESS on success.
pj_status_t(* pjmedia_codec_factory_op::dealloc_codec) (pjmedia_codec_factory *factory, pjmedia_codec *codec)

This function is called by codec manager to return a particular instance of codec back to the codec factory.

Parameters
factoryThe codec factory.
codecThe codec instance to be returned.
Returns
PJ_SUCCESS on success.
pj_status_t(* pjmedia_codec_factory_op::destroy) (void)

This callback will be called to deinitialize and destroy this factory.


The documentation for this struct was generated from the following file:

 


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