DriveWorks SDK Reference
5.16.65 Release
For Test and Development only

CodecHeader

Detailed Description

Defines the codecheader types.

Typedefs

typedef struct dwCodecHeaderObject const * dwCodecHeaderConstHandle_t
 CodecHeader handle. More...
 
typedef struct dwCodecHeaderObject * dwCodecHeaderHandle_t
 CodecHeader handle. More...
 

Functions

dwStatus dwCodecHeader_create (dwCodecHeaderHandle_t *handle, dwCodecType type, void *codecConfig)
 Create a new codec header with the specified dwCodecType. More...
 
dwStatus dwCodecHeader_createNew (dwCodecHeaderHandle_t *handle, char8_t const *codecMimeType, void *codecConfig, void *params, dwContextHandle_t context)
 Create a new codec header with the specified codec MIME type. More...
 
dwStatus dwCodecHeader_destroy (dwCodecHeaderHandle_t handle)
 Destroy a previously allocated codec header. More...
 
dwStatus dwCodecHeader_getCodecType (dwCodecType *const type, dwCodecHeaderConstHandle_t const handle)
 Get the specified dwCodecType in a codec header. More...
 
dwStatus dwCodecHeader_getCodecTypeNew (char8_t *type, const size_t size, dwCodecHeaderConstHandle_t const handle)
 Get the specified codec MIME type in a codec header. More...
 
dwStatus dwCodecHeader_getConfig (void *config, size_t configSize, dwMediaType mediaType, dwCodecHeaderConstHandle_t handle)
 Get the specified dwCodecConfig* in a codec header. More...
 
dwStatus dwCodecHeader_getMediaType (dwMediaType *const type, dwCodecHeaderConstHandle_t const handle)
 Get the specified dwMediaType in a codec header. More...
 
dwStatus dwCodecHeader_load (dwCodecHeaderHandle_t *const handle, void *const data, size_t const dataSize, dwContextHandle_t context)
 Load a serialized codec header from JSON string. More...
 
dwStatus dwCodecHeader_register (char const *codecMimeType, dwCodecHeaderPluginFunctions const *const funcTable, dwContextHandle_t ctx)
 Register CodecHeader plugin with associated codec MIME type. More...
 
dwStatus dwCodecHeader_release (dwCodecHeaderHandle_t const handle)
 Release resources associated with codec header. More...
 
dwStatus dwCodecHeader_save (size_t *const dataSize, void *data, size_t const maxDataSize, dwCodecHeaderConstHandle_t const handle)
 Serializes the codec header into JSON string. More...
 

Typedef Documentation

◆ dwCodecHeaderConstHandle_t

typedef struct dwCodecHeaderObject const* dwCodecHeaderConstHandle_t

CodecHeader handle.

Definition at line 64 of file CodecHeader.h.

◆ dwCodecHeaderHandle_t

typedef struct dwCodecHeaderObject* dwCodecHeaderHandle_t

CodecHeader handle.

Definition at line 61 of file CodecHeader.h.

Function Documentation

◆ dwCodecHeader_create()

dwStatus dwCodecHeader_create ( dwCodecHeaderHandle_t handle,
dwCodecType  type,
void *  codecConfig 
)

Create a new codec header with the specified dwCodecType.

Parameters
[out]handlethe pointer in which the created codec header is stored
[in]typethe type of codec header to create
[in]codecConfigthe config associated with the type. Such as dwCodecConfigVideo for video codec types
Returns
DW_NOT_SUPPORT if type is not a supported type.
DW_INVALID_ARGUMENT if handle is nullptr. DW_SUCCESS return successfully.

◆ dwCodecHeader_createNew()

dwStatus dwCodecHeader_createNew ( dwCodecHeaderHandle_t handle,
char8_t const *  codecMimeType,
void *  codecConfig,
void *  params,
dwContextHandle_t  context 
)

Create a new codec header with the specified codec MIME type.

Parameters
[out]handlethe pointer in which the created codec header is stored
[in]codecMimeTypethe type of codec header to create
[in]codecConfigthe config associated with the type. Such as dwCodecConfigVideo for video codec types
[in]paramspointer to additional parameters of associated codec header
[in]contextDW context
Returns
DW_NOT_SUPPORT if type is not a supported type.
DW_INVALID_ARGUMENT if handle is nullptr DW_SUCCESS return successfully.

◆ dwCodecHeader_destroy()

dwStatus dwCodecHeader_destroy ( dwCodecHeaderHandle_t  handle)

Destroy a previously allocated codec header.

Parameters
[in]handlethe handle to release
Returns
DW_SUCCESS return successfully.

◆ dwCodecHeader_getCodecType()

dwStatus dwCodecHeader_getCodecType ( dwCodecType *const  type,
dwCodecHeaderConstHandle_t const  handle 
)

Get the specified dwCodecType in a codec header.

Parameters
[out]typestored in codec header
[in]handlethe handle of codec header
Returns
DW_INVALID_ARGUMENT if type or codecHeader is nullptr.
DW_SUCCESS return successfully.

◆ dwCodecHeader_getCodecTypeNew()

dwStatus dwCodecHeader_getCodecTypeNew ( char8_t type,
const size_t  size,
dwCodecHeaderConstHandle_t const  handle 
)

Get the specified codec MIME type in a codec header.

Parameters
[out]typestored in codec header
[in]sizethe size of the output buffer provided
[in]handlethe handle of codec header
Returns
DW_INVALID_ARGUMENT if type or codecHeader is nullptr.
DW_SUCCESS return successfully.

◆ dwCodecHeader_getConfig()

dwStatus dwCodecHeader_getConfig ( void *  config,
size_t  configSize,
dwMediaType  mediaType,
dwCodecHeaderConstHandle_t  handle 
)

Get the specified dwCodecConfig* in a codec header.

Parameters
[out]configstored in codec header
[in]configSizesize of the memory pointed by the passed in config pointer
[in]mediaTypemedia type corresonding to the codecHeader
[in]handlethe handle of codec header
Returns
DW_INVALID_ARGUMENT if config or codecHeader is nullptr, or if configSize mismatches the expected size of specified mediaType.
DW_SUCCESS return successfully.

◆ dwCodecHeader_getMediaType()

dwStatus dwCodecHeader_getMediaType ( dwMediaType *const  type,
dwCodecHeaderConstHandle_t const  handle 
)

Get the specified dwMediaType in a codec header.

Parameters
[out]typestored in codec header
[in]handlethe handle of codec header
Returns
DW_INVALID_ARGUMENT if type or codecHeader is nullptr.
DW_SUCCESS return successfully.

◆ dwCodecHeader_load()

dwStatus dwCodecHeader_load ( dwCodecHeaderHandle_t *const  handle,
void *const  data,
size_t const  dataSize,
dwContextHandle_t  context 
)

Load a serialized codec header from JSON string.

Parameters
[out]handlethe handle of codec to populate
[in]datapointer to memory block to containing the serialized codec header
[in]dataSizesize of the serialized data
[in]contextDW context
Returns
DW_INVALID_ARGUMENT if data or codecHeader is nullptr.
DW_SUCCESS return successfully.

◆ dwCodecHeader_register()

dwStatus dwCodecHeader_register ( char const *  codecMimeType,
dwCodecHeaderPluginFunctions const *const  funcTable,
dwContextHandle_t  ctx 
)

Register CodecHeader plugin with associated codec MIME type.

Parameters
[in]codecMimeTypethe codec type of registered CodecHeader plugin
[in]funcTablepointer to CodecHeader plugin function pointer table
[in]ctxDW context
Returns
DW_INVALID_ARGUMENT if codecMimeType, funcTable or ctx is nullptr.
DW_BUFFER_FULL if no available entry in registration factory DW_SUCCESS return successfully.

◆ dwCodecHeader_release()

dwStatus dwCodecHeader_release ( dwCodecHeaderHandle_t const  handle)

Release resources associated with codec header.

Parameters
[in]handlethe handle of codec to populate
Returns
DW_SUCCESS return successfully.

◆ dwCodecHeader_save()

dwStatus dwCodecHeader_save ( size_t *const  dataSize,
void *  data,
size_t const  maxDataSize,
dwCodecHeaderConstHandle_t const  handle 
)

Serializes the codec header into JSON string.

Parameters
[out]dataSizesize of the serialized data
[out]datapointer to memory block to store the serialized string
[in]maxDataSizesize of the memory block pointed to by data
[in]handlethe handle of codec header
Returns
DW_INVALID_ARGUMENT if dataSize, data or codecHeader is nullptr, or if maxDataSize is smaller than the serialized size.
DW_SUCCESS return successfully.