| 1 | /*************************************************************************** |
|---|
| 2 | * Copyright (c) 2003-2012, Broadcom Corporation |
|---|
| 3 | * All Rights Reserved |
|---|
| 4 | * Confidential Property of Broadcom Corporation |
|---|
| 5 | * |
|---|
| 6 | * THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED SOFTWARE LICENSE |
|---|
| 7 | * AGREEMENT BETWEEN THE USER AND BROADCOM. YOU HAVE NO RIGHT TO USE OR |
|---|
| 8 | * EXPLOIT THIS MATERIAL EXCEPT SUBJECT TO THE TERMS OF SUCH AN AGREEMENT. |
|---|
| 9 | * |
|---|
| 10 | * $brcm_Workfile: bavc_rap.h $ |
|---|
| 11 | * $brcm_Revision: Hydra_Software_Devel/13 $ |
|---|
| 12 | * $brcm_Date: 2/10/12 1:41p $ |
|---|
| 13 | * |
|---|
| 14 | * [File Description:] |
|---|
| 15 | * |
|---|
| 16 | * Revision History: |
|---|
| 17 | * |
|---|
| 18 | * $brcm_Log: /magnum/commonutils/avc/7038/bavc_rap.h $ |
|---|
| 19 | * |
|---|
| 20 | * Hydra_Software_Devel/13 2/10/12 1:41p jgarrett |
|---|
| 21 | * SW7425-1221: Adding STC Snapshot |
|---|
| 22 | * |
|---|
| 23 | * Hydra_Software_Devel/12 12/16/11 11:34a jgarrett |
|---|
| 24 | * SW7425-1478: Adding BlockAlign and NumChannels to WMA metadata |
|---|
| 25 | * |
|---|
| 26 | * Hydra_Software_Devel/11 12/7/11 5:44p jgarrett |
|---|
| 27 | * SW7425-1478: Adding WMA encoder interface |
|---|
| 28 | * |
|---|
| 29 | * Hydra_Software_Devel/10 4/18/11 8:54p jgarrett |
|---|
| 30 | * SW7425-288: Adding ADTS parsing and metadata |
|---|
| 31 | * |
|---|
| 32 | * Hydra_Software_Devel/9 4/17/11 1:55p jgarrett |
|---|
| 33 | * SW7425-288: Adding audio codec to metadata |
|---|
| 34 | * |
|---|
| 35 | * Hydra_Software_Devel/8 4/16/11 2:01p jgarrett |
|---|
| 36 | * SW7425-288: Adding metadata interface |
|---|
| 37 | * |
|---|
| 38 | * Hydra_Software_Devel/7 2/3/11 4:39p nilesh |
|---|
| 39 | * SW7425-38,SW7425-56: Removed bavc_enc.h |
|---|
| 40 | * |
|---|
| 41 | * Hydra_Software_Devel/6 2/1/11 4:57p nilesh |
|---|
| 42 | * SW7425-38,SW7425-56: Added protocol to encoder buffer status |
|---|
| 43 | * |
|---|
| 44 | * Hydra_Software_Devel/5 2/1/11 4:15p nilesh |
|---|
| 45 | * SW7425-56,SW7425-38: Combined common portions of audio/video compressed |
|---|
| 46 | * buffer descriptors |
|---|
| 47 | * |
|---|
| 48 | * Hydra_Software_Devel/4 11/18/10 4:03p nilesh |
|---|
| 49 | * SW7425-38: Added protocol to buffer descriptor. Updated description of |
|---|
| 50 | * transmission parameters. |
|---|
| 51 | * |
|---|
| 52 | * Hydra_Software_Devel/3 11/16/10 1:49p nilesh |
|---|
| 53 | * SW7425-38: Updated "flag" defines |
|---|
| 54 | * |
|---|
| 55 | * Hydra_Software_Devel/2 10/19/10 1:18p nilesh |
|---|
| 56 | * SW7425-38: Added TicksPerBit and SHR fields. Changed uiOffset to |
|---|
| 57 | * unsigned. |
|---|
| 58 | * |
|---|
| 59 | * Hydra_Software_Devel/1 10/11/10 3:00p hongtaoz |
|---|
| 60 | * SW7425-38: merged to mainline; |
|---|
| 61 | * |
|---|
| 62 | * Hydra_Software_Devel/SW7425-38/1 9/21/10 2:06p nilesh |
|---|
| 63 | * SW7425-38: Added A/V encoder common files |
|---|
| 64 | * |
|---|
| 65 | ***************************************************************************/ |
|---|
| 66 | |
|---|
| 67 | #ifndef BAVC_RAP_H__ |
|---|
| 68 | #define BAVC_RAP_H__ |
|---|
| 69 | |
|---|
| 70 | #include "bavc_vce.h" |
|---|
| 71 | |
|---|
| 72 | #ifdef __cplusplus |
|---|
| 73 | extern "C" { |
|---|
| 74 | #endif |
|---|
| 75 | |
|---|
| 76 | /*************************/ |
|---|
| 77 | /* AUDIO SPECIFIC FIELDS */ |
|---|
| 78 | /*************************/ |
|---|
| 79 | #define BAVC_AUDIOMETADATADESCRIPTOR_FLAGS_BITRATE_VALID 0x00000001 |
|---|
| 80 | #define BAVC_AUDIOMETADATADESCRIPTOR_FLAGS_SAMPLING_FREQUENCY_VALID 0x00000002 |
|---|
| 81 | #define BAVC_AUDIOMETADATADESCRIPTOR_FLAGS_PROTOCOL_DATA_VALID 0x00000004 |
|---|
| 82 | #define BAVC_AUDIOMETADATADESCRIPTOR_FLAGS_TIMING_VALID 0x00000008 |
|---|
| 83 | |
|---|
| 84 | #define BAVC_AUDIO_SPECIFIC_CONFIG_MAX_LENGTH (8) |
|---|
| 85 | |
|---|
| 86 | typedef enum BAVC_AudioMetadataType |
|---|
| 87 | { |
|---|
| 88 | BAVC_AudioMetadataType_eCommon, /* BAVC_AudioMetadataDescriptor */ |
|---|
| 89 | |
|---|
| 90 | /* This enum cannot contain more than 256 entries because uiDataUnitType is defined as a uint8_t */ |
|---|
| 91 | BAVC_AudioMetadataType_eMax |
|---|
| 92 | } BAVC_AudioMetadataType; |
|---|
| 93 | |
|---|
| 94 | typedef struct BAVC_AudioMetadataDescriptor |
|---|
| 95 | { |
|---|
| 96 | uint32_t uiMetadataFlags; |
|---|
| 97 | |
|---|
| 98 | struct |
|---|
| 99 | { |
|---|
| 100 | unsigned uiMax; /* in bits/sec */ |
|---|
| 101 | } stBitrate; |
|---|
| 102 | |
|---|
| 103 | struct |
|---|
| 104 | { |
|---|
| 105 | unsigned uiSamplingFrequency; /* In Hz */ |
|---|
| 106 | } stSamplingFrequency; |
|---|
| 107 | |
|---|
| 108 | struct |
|---|
| 109 | { |
|---|
| 110 | uint64_t uiSTCSnapshot; /* Initial 42-bit STC Snapshot from audio encode */ |
|---|
| 111 | } stTiming; |
|---|
| 112 | |
|---|
| 113 | BAVC_AudioCompressionStd eProtocol; /* Audio Compression Protocol */ |
|---|
| 114 | union |
|---|
| 115 | { |
|---|
| 116 | struct |
|---|
| 117 | { |
|---|
| 118 | uint8_t auiASC[BAVC_AUDIO_SPECIFIC_CONFIG_MAX_LENGTH]; /* Audio Specific Config from ISO 11496-3 */ |
|---|
| 119 | unsigned uiASCLengthBits; /* Length In Bits */ |
|---|
| 120 | unsigned uiASCLengthBytes;/* Length In Bytes - Since this is a bitfield extra bytes will be 0 filled */ |
|---|
| 121 | } stAac; /* Applies for BAVC_AudioCompressionStd_eAacAdts, BAVC_AudioCompressionStd_eAacLoas, |
|---|
| 122 | BAVC_AudioCompressionStd_eAacPlusAdts, BAVC_AudioCompressionStd_eAacPlusLoas */ |
|---|
| 123 | struct |
|---|
| 124 | { |
|---|
| 125 | unsigned uiSamplesPerBlock; |
|---|
| 126 | unsigned uiEncodeOptions; |
|---|
| 127 | unsigned uiSuperBlockAlign; |
|---|
| 128 | unsigned uiBlockAlign; |
|---|
| 129 | unsigned uiNumChannels; |
|---|
| 130 | } stWmaStd; /* Applies for BAVC_AudioCompressionStd_eWmaStd */ |
|---|
| 131 | } uProtocolData; |
|---|
| 132 | } BAVC_AudioMetadataDescriptor; |
|---|
| 133 | |
|---|
| 134 | typedef struct BAVC_AudioBufferDescriptor |
|---|
| 135 | { |
|---|
| 136 | BAVC_CompressedBufferDescriptor stCommon; |
|---|
| 137 | |
|---|
| 138 | /* Audio Specifics */ |
|---|
| 139 | |
|---|
| 140 | /* Offset to RAW Frame Data and length. */ |
|---|
| 141 | unsigned uiRawDataOffset; /* For most codecs, this will be equivalent to stCommon.uiOffset but if the data is encapsulated in another |
|---|
| 142 | container (e.g. AAC ADTS) this will reflect the offset to the raw data block within the encapsulated |
|---|
| 143 | frame. */ |
|---|
| 144 | size_t uiRawDataLength; /* For most codecs, this will be equivalent to stCommon.uiLength but if the data is encapsulated in another |
|---|
| 145 | container (e.g. AAC ADTS) this will reflect the length of the raw data block within the encapsulated |
|---|
| 146 | frame. */ |
|---|
| 147 | /* Metadata */ |
|---|
| 148 | uint8_t uiDataUnitType; /* If stCommon.uiFlags == BAVC_COMPRESSEDBUFFERDESCRIPTOR_FLAGS_METADATA |
|---|
| 149 | * this indicates the type of metadata that is contained in the buffer. |
|---|
| 150 | * See BAVC_AudioMetadataType enum for possible types and values |
|---|
| 151 | */ |
|---|
| 152 | } BAVC_AudioBufferDescriptor; |
|---|
| 153 | |
|---|
| 154 | typedef struct BAVC_AudioBufferInfo |
|---|
| 155 | { |
|---|
| 156 | BAVC_AudioCompressionStd eProtocol; |
|---|
| 157 | } BAVC_AudioBufferInfo; |
|---|
| 158 | |
|---|
| 159 | typedef struct BAVC_AudioBufferStatus |
|---|
| 160 | { |
|---|
| 161 | BAVC_CompressedBufferStatus stCommon; |
|---|
| 162 | } BAVC_AudioBufferStatus; |
|---|
| 163 | |
|---|
| 164 | #define BAVC_AudioContextMap BAVC_XptContextMap |
|---|
| 165 | |
|---|
| 166 | |
|---|
| 167 | #ifdef __cplusplus |
|---|
| 168 | } |
|---|
| 169 | #endif |
|---|
| 170 | |
|---|
| 171 | #endif /* BAVC_RAP_H__ */ |
|---|