📄 wmadec.h
字号:
* Initializes the WMAudio decoder.
*
* Must be called before starting to decode a WMA file.
*
* Syntax
* ------
* tWMAFileStatus WMAFileDecodeInit (tHWMAFileState phstate);
*
* where:
*
* phstate pointer to the handle that holds the internal
* state of the WMAudio decoder
* This memory should be cleared before the first call
* to WMAFileDecodeInit
*
* Return Value
* ------------
* cWMA_NoErr decoder initialized
* cWMA_BadArgument bad argument passed in
* cWMA_BadAsfHeader bad ASF header
* cWMA_BadDRMType unknown encryption type
* cWMA_DRMFailed DRM failed
* cWMA_Failed decoder Initialization failed
*/
tWMAFileStatus RK_WMAFileDecodeInit(tWMAFileState *phstate);
/*
* WMAFileDecodeInfo
* =================
*
* Description
* -----------
* Retrieves the header information for the WMA file.
*
* Syntax
* ------
* tWMAFileStatus WMAFileDecodeInfo(tHWMAFileState hstate,
* tWMAFileHeader *hdr);
*
* where:
*
* state pointer to the structure that holds the internal
* state of the WMAudio decoder
* hdr pointer to the structure that holds the WMA file
* header info
*
* Return Value
* ------------
* cWMA_NoErr header retrieved ok
* cWMA_BadArgument bad argument(s)
*
*/
tWMAFileStatus RK_WMAFileDecodeInfo(tWMAFileState *hstate, tWMAFileHeader *hdr);
/*
* WMAFileContentDesc
* ==================
*
* Description
* -----------
* Retrieves the content description for the WMA file. Content
* descriptions are such as the song title, the author, the
* copyright info, the song description, and the rating info.
* All these are part of the standard ASF description.
*
* Not all songs have content descriptions.
*
* Syntax
* ------
* tWMAFileStatus WMAFileContentDesc (const tWMAFileContDesc **ppDesc);
*
* where:
*
* ppDesc pointer of pointer to the Content Desc
* structure that holds in the ASF file.
*
* Return Value
* ------------
* cWMA_NoErr description retrieved ok
* cWMA_BadArgument bad argument(s)
* ppDesc is the pointer of pointer to the ASF content desc object.
*
*/
tWMAFileStatus RK_WMAFileContentDesc(tWMAFileContDesc *ppDesc);
/* Description
Reads the DRM license file and check the license for the
\file.
Uses WMAFileCBGetLicenseData to retrieve the license file.
Returns
<table>
\Return Value Mean
-------------------- ------------------------------
cWMA_NoErr license checked ok
cWMA_BadArgument bad argument
cWMA_DRMFailed no license
cWMA_DRMUnsupported DRM is not supported for this
\version
</table>
Parameters
state : pointer to the structure that holds the internal state
of the WMA decoder
lic_params : pointer to the structure that passes in the parameters
for the license initialization.
CheckLicTypes : This parameter is for licence types to be checked.<p/>
CHECK_ALL_LICENSE is defined.
bBurnCD : 0 \- don't want to burn a CD. (Maybe just play back)<p/>1
\- Want to burn a CD.
currentDate : currentDate = NULL if no date available<p/>currentDate[0]
= Year / 100<p/>currentDate[1] = Year % 100<p/>currentDate[2]
= Month<p/>currentDate[3] = Day<p/> */
tWMAFileStatus RK_WMAFileLicenseInit(tWMAFileState *state,
tWMAFileLicParams *lic_params, tWMA_U16 CheckLicTypes, unsigned char bBurnCD, unsigned char *currentDate);
/*
* WMAFileDecodeData
* =================
*
* Description
* -----------
* Decodes WMAudio bitstream.
*
* Syntax
* ------
* tWMAFileStatus WMAFileDecodeData (tHWMAFileState hstate, tWMA_U32 *pnDecodedSamples);
*
* where:
*
* state pointer to the structure that holds the internal
* state of the WMAudio decoder
* pnDecodedSamples pointer to the number of samples decoded by this call.
*
* Return Value
* ------------
* cWMA_NoErr frame decoded ok
* cWMA_BadArgument bad argument
* cWMA_NoMoreFrames no more data to decode
* cWMA_BadPacketHeader Bad Packet header
*
*/
tWMAFileStatus RK_WMAFileDecodeData(tWMAFileState *hstate);
/*
* WMAFileGetPCM
* =============
*
* Description
* -----------
* Write PCM samples from the WMAudio bitstream previously decoded by
* WMAFileDecodeData().
*
* WMAFileGetPCM() may have to be called more than once to obtain all
* of the samples for the frame. The frame is complete when the number
* of samples written is less than the number of samples requested.
*
* Syntax
* ------
* tWMA_U32 WMAFileGetPCM(tHWMAFileState hstate,
* tWMA_I16 *pi16Channel0, tWMA_I16 *pi16Channel1,
* tWMA_U32 iSizeOfChannel0);
*
* where:
*
* state pointer to the structure that holds the internal
* state of the WMAudio decoder
* pi16Channel0 pointer to output buffer for left-channel PCM, or the entire PCM output if it is inter-leaved form
* pi16Channel1 pointer to output buffer for right-channel PCM, NULL if the output PCM is in parallel form
* iSizeOfChannel0 size of the pi16Channel0 buffer in bytes. It is assumed that Channel1 is the same size.
* *** NOTE*** If Channel downmixing, frequency resampling or bit-depth conversion is being requested,
* the memory provided should be for maximum of source & destination sizes.
*
* Return Value
* ------------
* tWMA_U32 number of samples written
* < max_nsamples when frame complete
*
*/
tWMA_U32 RK_WMAFileGetPCM(
tWMAFileState *hstate,
tWMA_I16 *pi16Channel0, tWMA_I16 *pi16Channel1,
tWMA_U32 iSizeOfChannel0);
/*
* WMAFileSeek
* ===========
*
* Description
* -----------
* Seek to a time into the WMA file. It seeks to the nearest seek
* point.
*
* Syntax
* ------
* tWMA_U32 WMAFileSeek (tHWMAFileState hstate, tWMA_U32 msSeek, tWMA_U32 seek_type);
*
* where:
*
* state pointer to the structure that holds the internal
* state of the WMAudio decoder
* msSeek time position to seek from the beginning of the
* clip, in milliseconds
* seek_type FF/REW/OTHER/exFF/exREW/exOTHER
*
* Return Value
* ------------
* actual time position from the beginning of the clip, in milliseconds.
*
*/
tWMA_U32 RK_WMAFileSeek(tWMAFileState *state,
tWMA_U32 msSeek, tWMA_U32 SeekType);
// [hstate] -- pointer to the structure that holds the internal state of the WMAudio decoder
// [cbOffset] -- Seek位置所对应的文件偏移,必须是Packet的开始处
// 返回: 0:正确;其它:错误
int WMAFileSeekFast(void *hstate, unsigned long cbOffset);
/************************************************************************
* EXTERN FUCTION DEFINE
************************************************************************/
/*
* WMAFileCBGetData
* ================
*
* Description
* -----------
* Supplies more data to the WMAudio decoder. Not implemented by
* the WMAudio decoder library.
*
* It is a callback function implemented by the application. When
* the WMAudio library needs more data to process (both to parse
* informatio and to decode the actual data bitstream), the library
* will call this function.
*
* Called by WMAFileDecodeInit(), WMAFileContentDesc() and
* WMAFileDecodeData().
*
* Syntax
* ------
* tWMA_U32 WMAFileCBGetData(tHWMAFileState hstate,
* tWMA_U32 offset,
* tWMA_U32 num_bytes,
* tWMA_U8 **ppData);
*
* where:
*
* state pointer to the structure that holds the internal
* state of the WMAudio decoder
* offset offset into the WMA file to get the data from
* num_bytes how many bytes to get
* ppData pointer to contain the returned buffer with more
* data
* The WMA library may over-write this buffer
*
* Return Value
* ------------
* tWMA_U32 how many actually returned
* should be same as num_bytes except for at the
* very end of the file
*
*/
extern tWMA_U32 RK_WMAFileCBGetData(tWMAFileState *state,
tWMA_U64 offset,
tWMA_U32 num_bytes,
unsigned char **ppData);
extern int RK_WMABufferCBGetData(tWMA_U8 **ppBuffer, tWMA_U32* pBufLen);
/* Description
Supplies more data to the WMAudio DRM decryption function.
Not implemented by the WMA decoder library.
It is a callback function implemented by the application.
When the WMA's DRM decryption library needs more data to
process the library will call this function.
Called by WMAFileLicenseInit().
Returns
How many actually returned should be same as num_bytes except
for at the very end of the file
Parameters
state : pointer to the structure that holds the internal
state of the WMA decoder
offset : offset into the license file to get the data from
num_bytes : how many bytes to get
ppData : pointer to contain the returned buffer with more
data */
extern tWMA_U32 RK_WMAFileCBGetLicenseData(tWMAFileState *state,
tWMA_U32 offset,
tWMA_U32 num_bytes,
unsigned char **ppData);
#ifdef __cplusplus
}
#endif // __cplusplus
#ifdef USE_PACK_HEADERS
#include <poppack.h>
#endif
#endif // _WMAUDIO_API_H_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -