Home | History | Annotate | Download | only in include
      1 /*
      2  * Copyright (C) 2016 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 //
     18 // A2DP constants for LDAC codec
     19 //
     20 
     21 #ifndef A2DP_VENDOR_LDAC_CONSTANTS_H
     22 #define A2DP_VENDOR_LDAC_CONSTANTS_H
     23 
     24 // LDAC Quality Mode Index
     25 #define A2DP_LDAC_QUALITY_HIGH 0  // Equal to LDACBT_EQMID_HQ 990kbps
     26 #define A2DP_LDAC_QUALITY_MID 1   // Equal to LDACBT_EQMID_SQ 660kbps
     27 #define A2DP_LDAC_QUALITY_LOW 2   // Equal to LDACBT_EQMID_MQ 330kbps
     28 #define A2DP_LDAC_QUALITY_ABR 3   // ABR mode, range: 990,660,492,396,330(kbps)
     29 
     30 // Length of the LDAC Media Payload header
     31 #define A2DP_LDAC_MPL_HDR_LEN 1
     32 
     33 // LDAC Media Payload Header
     34 #define A2DP_LDAC_HDR_F_MSK 0x80
     35 #define A2DP_LDAC_HDR_S_MSK 0x40
     36 #define A2DP_LDAC_HDR_L_MSK 0x20
     37 #define A2DP_LDAC_HDR_NUM_MSK 0x0F
     38 
     39 // LDAC codec specific settings
     40 #define A2DP_LDAC_CODEC_LEN 10
     41 // [Octet 0-3] Vendor ID
     42 #define A2DP_LDAC_VENDOR_ID 0x0000012D
     43 // [Octet 4-5] Vendor Specific Codec ID
     44 #define A2DP_LDAC_CODEC_ID 0x00AA
     45 // [Octet 6], [Bits 0-5] Sampling Frequency
     46 #define A2DP_LDAC_SAMPLING_FREQ_MASK 0x3F
     47 #define A2DP_LDAC_SAMPLING_FREQ_44100 0x20
     48 #define A2DP_LDAC_SAMPLING_FREQ_48000 0x10
     49 #define A2DP_LDAC_SAMPLING_FREQ_88200 0x08
     50 #define A2DP_LDAC_SAMPLING_FREQ_96000 0x04
     51 #define A2DP_LDAC_SAMPLING_FREQ_176400 0x02
     52 #define A2DP_LDAC_SAMPLING_FREQ_192000 0x01
     53 // [Octet 7], [Bits 0-2] Channel Mode
     54 #define A2DP_LDAC_CHANNEL_MODE_MASK 0x07
     55 #define A2DP_LDAC_CHANNEL_MODE_MONO 0x04
     56 #define A2DP_LDAC_CHANNEL_MODE_DUAL 0x02
     57 #define A2DP_LDAC_CHANNEL_MODE_STEREO 0x01
     58 
     59 #endif  // A2DP_VENDOR_LDAC_CONSTANTS_H
     60