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
28enum
29{
30    BTIF_SV_AV_AA_SBC_INDEX = 0,
31    BTIF_SV_AV_AA_SEP_INDEX  /* Last index */
32};
33
34
35/*******************************************************************************
36**  Functions
37********************************************************************************/
38
39/*******************************************************************************
40 **
41 ** Function         bta_av_co_cp_is_active
42 **
43 ** Description      Get the current configuration of content protection
44 **
45 ** Returns          TRUE if the current streaming has CP, FALSE otherwise
46 **
47 *******************************************************************************/
48BOOLEAN bta_av_co_cp_is_active(void);
49
50/*******************************************************************************
51 **
52 ** Function         bta_av_co_cp_get_flag
53 **
54 ** Description      Get content protection flag
55 **                  BTA_AV_CP_SCMS_COPY_NEVER
56 **                  BTA_AV_CP_SCMS_COPY_ONCE
57 **                  BTA_AV_CP_SCMS_COPY_FREE
58 **
59 ** Returns          The current flag value
60 **
61 *******************************************************************************/
62UINT8 bta_av_co_cp_get_flag(void);
63
64/*******************************************************************************
65 **
66 ** Function         bta_av_co_cp_set_flag
67 **
68 ** Description      Set content protection flag
69 **                  BTA_AV_CP_SCMS_COPY_NEVER
70 **                  BTA_AV_CP_SCMS_COPY_ONCE
71 **                  BTA_AV_CP_SCMS_COPY_FREE
72 **
73 ** Returns          TRUE if setting the SCMS flag is supported else FALSE
74 **
75 *******************************************************************************/
76BOOLEAN bta_av_co_cp_set_flag(UINT8 cp_flag);
77
78/*******************************************************************************
79 **
80 ** Function         bta_av_co_audio_codec_reset
81 **
82 ** Description      Reset the current codec configuration
83 **
84 ** Returns          void
85 **
86 *******************************************************************************/
87void bta_av_co_audio_codec_reset(void);
88
89/*******************************************************************************
90 **
91 ** Function         bta_av_co_audio_codec_supported
92 **
93 ** Description      Check if all opened connections are compatible with a codec
94 **                  configuration
95 **
96 ** Returns          TRUE if all opened devices support this codec, FALSE otherwise
97 **
98 *******************************************************************************/
99BOOLEAN bta_av_co_audio_codec_supported(tBTIF_STATUS *p_status);
100
101/*******************************************************************************
102 **
103 ** Function         bta_av_co_audio_set_codec
104 **
105 ** Description      Set the current codec configuration from the feeding type.
106 **                  This function is starting to modify the configuration, it
107 **                  should be protected.
108 **
109 ** Returns          TRUE if successful, FALSE otherwise
110 **
111 *******************************************************************************/
112BOOLEAN bta_av_co_audio_set_codec(const tBTIF_AV_MEDIA_FEEDINGS *p_feeding, tBTIF_STATUS *p_status);
113
114/*******************************************************************************
115 **
116 ** Function         bta_av_co_audio_get_sbc_config
117 **
118 ** Description      Retrieves the SBC codec configuration.  If the codec in use
119 **                  is not SBC, return the default SBC codec configuration.
120 **
121 ** Returns          TRUE if codec is SBC, FALSE otherwise
122 **
123 *******************************************************************************/
124BOOLEAN bta_av_co_audio_get_sbc_config(tA2D_SBC_CIE *p_sbc_config, UINT16 *p_minmtu);
125
126/*******************************************************************************
127 **
128 ** Function         bta_av_co_audio_discard_config
129 **
130 ** Description      Discard the codec configuration of a connection
131 **
132 ** Returns          Nothing
133 **
134 *******************************************************************************/
135void bta_av_co_audio_discard_config(tBTA_AV_HNDL hndl);
136
137/*******************************************************************************
138 **
139 ** Function         bta_av_co_init
140 **
141 ** Description      Initialization
142 **
143 ** Returns          Nothing
144 **
145 *******************************************************************************/
146void bta_av_co_init(void);
147
148
149/*******************************************************************************
150 **
151 ** Function         bta_av_co_peer_cp_supported
152 **
153 ** Description      Checks if the peer supports CP
154 **
155 ** Returns          TRUE if the peer supports CP
156 **
157 *******************************************************************************/
158BOOLEAN bta_av_co_peer_cp_supported(tBTA_AV_HNDL hndl);
159
160/*******************************************************************************
161 **
162 ** Function         bta_av_co_get_remote_bitpool_pref
163 **
164 ** Description      Check if remote side did a setconfig within the limits
165 **                  of our exported bitpool range. If set we will set the
166 **                  remote preference.
167 **
168 ** Returns          TRUE if config set, FALSE otherwize
169 **
170 *******************************************************************************/
171BOOLEAN bta_av_co_get_remote_bitpool_pref(UINT8 *min, UINT8 *max);
172
173#endif
174