Home | History | Annotate | Download | only in include
      1 /******************************************************************************
      2  *
      3  *  Copyright (C) 2009-2012 Broadcom Corporation
      4  *
      5  *  Licensed under the Apache License, Version 2.0 (the "License");
      6  *  you may not use this file except in compliance with the License.
      7  *  You may obtain a copy of the License at:
      8  *
      9  *  http://www.apache.org/licenses/LICENSE-2.0
     10  *
     11  *  Unless required by applicable law or agreed to in writing, software
     12  *  distributed under the License is distributed on an "AS IS" BASIS,
     13  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     14  *  See the License for the specific language governing permissions and
     15  *  limitations under the License.
     16  *
     17  ******************************************************************************/
     18 
     19 #ifndef BTIF_AV_CO_H
     20 #define BTIF_AV_CO_H
     21 
     22 #include "btif_media.h"
     23 
     24 /*******************************************************************************
     25 **  Constants & Macros
     26 ********************************************************************************/
     27 
     28 enum
     29 {
     30     BTIF_SV_AV_AA_SBC_INDEX = 0,
     31     BTIF_SV_AV_AA_SBC_SINK_INDEX,
     32     BTIF_SV_AV_AA_SEP_INDEX  /* Last index */
     33 };
     34 
     35 
     36 /*******************************************************************************
     37 **  Functions
     38 ********************************************************************************/
     39 
     40 /*******************************************************************************
     41  **
     42  ** Function         bta_av_co_cp_is_active
     43  **
     44  ** Description      Get the current configuration of content protection
     45  **
     46  ** Returns          TRUE if the current streaming has CP, FALSE otherwise
     47  **
     48  *******************************************************************************/
     49 BOOLEAN bta_av_co_cp_is_active(void);
     50 
     51 /*******************************************************************************
     52  **
     53  ** Function         bta_av_co_cp_get_flag
     54  **
     55  ** Description      Get content protection flag
     56  **                  BTA_AV_CP_SCMS_COPY_NEVER
     57  **                  BTA_AV_CP_SCMS_COPY_ONCE
     58  **                  BTA_AV_CP_SCMS_COPY_FREE
     59  **
     60  ** Returns          The current flag value
     61  **
     62  *******************************************************************************/
     63 UINT8 bta_av_co_cp_get_flag(void);
     64 
     65 /*******************************************************************************
     66  **
     67  ** Function         bta_av_co_cp_set_flag
     68  **
     69  ** Description      Set content protection flag
     70  **                  BTA_AV_CP_SCMS_COPY_NEVER
     71  **                  BTA_AV_CP_SCMS_COPY_ONCE
     72  **                  BTA_AV_CP_SCMS_COPY_FREE
     73  **
     74  ** Returns          TRUE if setting the SCMS flag is supported else FALSE
     75  **
     76  *******************************************************************************/
     77 BOOLEAN bta_av_co_cp_set_flag(UINT8 cp_flag);
     78 
     79 /*******************************************************************************
     80  **
     81  ** Function         bta_av_co_audio_codec_reset
     82  **
     83  ** Description      Reset the current codec configuration
     84  **
     85  ** Returns          void
     86  **
     87  *******************************************************************************/
     88 void bta_av_co_audio_codec_reset(void);
     89 
     90 /*******************************************************************************
     91  **
     92  ** Function         bta_av_co_audio_codec_supported
     93  **
     94  ** Description      Check if all opened connections are compatible with a codec
     95  **                  configuration
     96  **
     97  ** Returns          TRUE if all opened devices support this codec, FALSE otherwise
     98  **
     99  *******************************************************************************/
    100 BOOLEAN bta_av_co_audio_codec_supported(tBTIF_STATUS *p_status);
    101 
    102 /*******************************************************************************
    103  **
    104  ** Function         bta_av_co_audio_set_codec
    105  **
    106  ** Description      Set the current codec configuration from the feeding type.
    107  **                  This function is starting to modify the configuration, it
    108  **                  should be protected.
    109  **
    110  ** Returns          TRUE if successful, FALSE otherwise
    111  **
    112  *******************************************************************************/
    113 BOOLEAN bta_av_co_audio_set_codec(const tBTIF_AV_MEDIA_FEEDINGS *p_feeding, tBTIF_STATUS *p_status);
    114 
    115 /*******************************************************************************
    116  **
    117  ** Function         bta_av_co_audio_get_sbc_config
    118  **
    119  ** Description      Retrieves the SBC codec configuration.  If the codec in use
    120  **                  is not SBC, return the default SBC codec configuration.
    121  **
    122  ** Returns          TRUE if codec is SBC, FALSE otherwise
    123  **
    124  *******************************************************************************/
    125 BOOLEAN bta_av_co_audio_get_sbc_config(tA2D_SBC_CIE *p_sbc_config, UINT16 *p_minmtu);
    126 
    127 /*******************************************************************************
    128  **
    129  ** Function         bta_av_co_audio_discard_config
    130  **
    131  ** Description      Discard the codec configuration of a connection
    132  **
    133  ** Returns          Nothing
    134  **
    135  *******************************************************************************/
    136 void bta_av_co_audio_discard_config(tBTA_AV_HNDL hndl);
    137 
    138 /*******************************************************************************
    139  **
    140  ** Function         bta_av_co_init
    141  **
    142  ** Description      Initialization
    143  **
    144  ** Returns          Nothing
    145  **
    146  *******************************************************************************/
    147 void bta_av_co_init(void);
    148 
    149 
    150 /*******************************************************************************
    151  **
    152  ** Function         bta_av_co_peer_cp_supported
    153  **
    154  ** Description      Checks if the peer supports CP
    155  **
    156  ** Returns          TRUE if the peer supports CP
    157  **
    158  *******************************************************************************/
    159 BOOLEAN bta_av_co_peer_cp_supported(tBTA_AV_HNDL hndl);
    160 
    161 /*******************************************************************************
    162  **
    163  ** Function         bta_av_co_get_remote_bitpool_pref
    164  **
    165  ** Description      Check if remote side did a setconfig within the limits
    166  **                  of our exported bitpool range. If set we will set the
    167  **                  remote preference.
    168  **
    169  ** Returns          TRUE if config set, FALSE otherwize
    170  **
    171  *******************************************************************************/
    172 BOOLEAN bta_av_co_get_remote_bitpool_pref(UINT8 *min, UINT8 *max);
    173 
    174 #endif
    175