MPEG-1,2 Support

group wicedbt_a2dp_mpeg_1_2

This section describes A2DP MPEG-1,2 Audio codec API.

MPEG-1,2 Layer

for Codec Specific Information Element

A2D_M12_IE_LAYER_MSK

b7-b5 layer

A2D_M12_IE_LAYER1

b7: layer1 (mp1)

A2D_M12_IE_LAYER2

b6: layer2 (mp2)

A2D_M12_IE_LAYER3

b5: layer3 (mp3)

MPEG-1,2 Channel Mode

A2D_M12_IE_CH_MD_MSK

b3-b0 channel mode

A2D_M12_IE_CH_MD_MONO

b3: mono

A2D_M12_IE_CH_MD_DUAL

b2: dual

A2D_M12_IE_CH_MD_STEREO

b1: stereo

A2D_M12_IE_CH_MD_JOINT

b0: joint stereo

MPEG-1,2 Sampling Frequency

A2D_M12_IE_SAMP_FREQ_MSK

b5-b0 sampling frequency

A2D_M12_IE_SAMP_FREQ_16

b5:16 kHz

A2D_M12_IE_SAMP_FREQ_22

b4:22.05kHz

A2D_M12_IE_SAMP_FREQ_24

b3:24 kHz

A2D_M12_IE_SAMP_FREQ_32

b2:32 kHz

A2D_M12_IE_SAMP_FREQ_44

b1:44.1kHz

A2D_M12_IE_SAMP_FREQ_48

b0:48 kHz

MPEG-1,2 Bitrate

A2D_M12_IE_BITRATE_MSK

b6-b0 of octect 2, all of octect3

A2D_M12_IE_BITRATE_0

0000

A2D_M12_IE_BITRATE_1

0001

A2D_M12_IE_BITRATE_2

0010

A2D_M12_IE_BITRATE_3

0011

A2D_M12_IE_BITRATE_4

0100

A2D_M12_IE_BITRATE_5

0101

A2D_M12_IE_BITRATE_6

0110

A2D_M12_IE_BITRATE_7

0111

A2D_M12_IE_BITRATE_8

1000

A2D_M12_IE_BITRATE_9

1001

A2D_M12_IE_BITRATE_10

1010

A2D_M12_IE_BITRATE_11

1011

A2D_M12_IE_BITRATE_12

1100

A2D_M12_IE_BITRATE_13

1101

A2D_M12_IE_BITRATE_14

1110

Defines

A2D_M12_MPL_HDR_LEN

the length of the MPEG_1, 2 Audio Media Payload header.

A2D_M12_INFO_LEN

the LOSC of MPEG_1, 2 Audio media codec capabilitiy

A2D_M12_IE_CRC_MSK

b4: CRC

A2D_M12_IE_MPF_MSK

b6: MPF

A2D_M12_IE_VBR_MSK

b7: VBR

A2D_BLD_M12_PML_HDR(p_dst, frag_offset)

Build MPEG-1,2 Header.

A2D_PARS_M12_PML_HDR(p_src, frag_offset)

Parse MPEG-1,2 Header.

Functions

wiced_bt_a2d_status_t wiced_bt_a2d_bld_m12info(uint8_t media_type, wiced_bt_a2d_m12_cie_t *p_ie, uint8_t *p_result)

This function is called by an application to build the MPEG-1, 2 Audio Media Codec Capabilities byte sequence beginning from the LOSC octet.

Parameters
  • media_type[in] : Indicates Audio, or Multimedia.

  • p_ie[in] : The MPEG-1, 2 Audio Codec Information Element information.

  • p_result[out] : the resulting codec info byte sequence.

Returns

A2D_SUCCESS if function execution succeeded. Error status code otherwise.

wiced_bt_a2d_status_t wiced_bt_a2d_pars_m12info(wiced_bt_a2d_m12_cie_t *p_ie, uint8_t *p_info, wiced_bool_t for_caps)

This function is called by an application to parse the MPEG-1, 2 Audio Media Codec Capabilities byte sequence beginning from the LOSC octet.

Parameters
  • p_info[in] : the byte sequence to parse.

  • for_caps[in] : TRUE, if the byte sequence is for get capabilities response.

  • p_ie[out] : The MPEG-1, 2 Audio Codec Information Element information.

Returns

A2D_SUCCESS if function execution succeeded. Error status code otherwise.

struct wiced_bt_a2d_m12_cie_t
#include <>

data type for the MPEG-1, 2 Audio Codec Information Element

Public Members

uint8_t layer

layers A2D_M12_LAYER

uint8_t crc

Support of CRC protection or not.

uint8_t ch_mode

Channel mode A2D_M12_CH_MD.

uint8_t mpf

1, if MPF-2 is supported.

0, otherwise

uint8_t samp_freq

Sampling frequency A2D_M12_SF.

uint8_t vbr

Variable Bit Rate.

uint16_t bitrate

Bit rate index A2D_M12_BITRATE.