OSDN Git Service

Bluetooth: Rename BTA_AVK_INCLUDED flag to BTA_AV_SINK_INCLUDED (bt_target.h)
authorlungtsai_lin <lungtsai_lin@htc.com>
Wed, 2 Jul 2014 12:39:02 +0000 (20:39 +0800)
committerDmitry Shmidt <dimitrysh@google.com>
Mon, 7 Jul 2014 16:56:56 +0000 (09:56 -0700)
Now OEM could enable/disable A2DP SINK role

Change-Id: I62cf17b0397a86c5f886a2c1ca724ca77a7f9bd4
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Android.mk
bta/av/bta_av_act.c
bta/av/bta_av_api.c
bta/av/bta_av_int.h
bta/av/bta_av_main.c
btif/co/bta_av_co.c
btif/src/btif_media_task.c
include/bt_target.h

index 91b00ea..1ddfb47 100644 (file)
@@ -12,7 +12,6 @@ else
 endif
 
 bdroid_CFLAGS += -Wall -Werror
-bdroid_CFLAGS += -DBTA_AVK_INCLUDED
 
 ifneq ($(BOARD_BLUETOOTH_BDROID_HCILP_INCLUDED),)
   bdroid_CFLAGS += -DHCILP_INCLUDED=$(BOARD_BLUETOOTH_BDROID_HCILP_INCLUDED)
index 624e160..dfd3662 100644 (file)
@@ -1997,7 +1997,7 @@ void bta_av_dereg_comp(tBTA_AV_DATA *p_data)
                 bta_av_del_sdp_rec(&p_cb->sdp_a2d_handle);
                 bta_sys_remove_uuid(UUID_SERVCLASS_AUDIO_SOURCE);
 
-#ifdef BTA_AVK_INCLUDED
+#if (BTA_AV_SINK_INCLUDED == TRUE)
                 bta_av_del_sdp_rec(&p_cb->sdp_a2d_snk_handle);
                 bta_sys_remove_uuid(UUID_SERVCLASS_AUDIO_SINK);
 #endif
index 47cc2aa..5aa401b 100644 (file)
@@ -258,7 +258,7 @@ void BTA_AvEnable_Sink(int enable)
 {
     BT_HDR  *p_buf;
 
-#ifdef BTA_AVK_INCLUDED
+#if (BTA_AV_SINK_INCLUDED == TRUE)
     if ((p_buf = (BT_HDR *) GKI_getbuf(sizeof(BT_HDR))) != NULL)
     {
         p_buf->event = BTA_AV_API_SINK_ENABLE_EVT;
index bbef8c5..5deed76 100644 (file)
@@ -96,7 +96,7 @@ enum
     BTA_AV_AVRC_CLOSE_EVT,
     BTA_AV_CONN_CHG_EVT,
     BTA_AV_DEREG_COMP_EVT,
-#ifdef BTA_AVK_INCLUDED
+#if (BTA_AV_SINK_INCLUDED == TRUE)
     BTA_AV_API_SINK_ENABLE_EVT,
 #endif
 #if (AVDT_REPORTING == TRUE)
@@ -563,7 +563,7 @@ typedef struct
     TIMER_LIST_ENT      sig_tmr;        /* link timer */
     TIMER_LIST_ENT      acp_sig_tmr;    /* timer to monitor signalling when accepting */
     UINT32              sdp_a2d_handle; /* SDP record handle for audio src */
-#ifdef BTA_AVK_INCLUDED
+#if (BTA_AV_SINK_INCLUDED == TRUE)
     UINT32              sdp_a2d_snk_handle; /* SDP record handle for audio snk */
 #endif
     UINT32              sdp_vdp_handle; /* SDP record handle for video src */
index e332cac..a8544c4 100644 (file)
@@ -152,7 +152,7 @@ static const tBTA_AV_ST_TBL bta_av_st_tbl[] =
 typedef void (*tBTA_AV_NSM_ACT)(tBTA_AV_DATA *p_data);
 static void bta_av_api_enable(tBTA_AV_DATA *p_data);
 static void bta_av_api_register(tBTA_AV_DATA *p_data);
-#ifdef BTA_AVK_INCLUDED
+#if (BTA_AV_SINK_INCLUDED == TRUE)
 static void bta_av_api_sink_enable(tBTA_AV_DATA *p_data);
 #endif
 static void bta_av_ci_data(tBTA_AV_DATA *p_data);
@@ -180,7 +180,7 @@ const tBTA_AV_NSM_ACT bta_av_nsm_act[] =
     bta_av_rc_closed,       /* BTA_AV_AVRC_CLOSE_EVT */
     bta_av_conn_chg,        /* BTA_AV_CONN_CHG_EVT */
     bta_av_dereg_comp,      /* BTA_AV_DEREG_COMP_EVT */
-#ifdef BTA_AVK_INCLUDED
+#if (BTA_AV_SINK_INCLUDED == TRUE)
     bta_av_api_sink_enable, /* BTA_AV_API_SINK_ENABLE_EVT */
 #endif
 #if (AVDT_REPORTING == TRUE)
@@ -467,7 +467,7 @@ static void bta_av_a2dp_report_cback(UINT8 handle, AVDT_REPORT_TYPE type,
 }
 #endif
 
-#ifdef BTA_AVK_INCLUDED
+#if (BTA_AV_SINK_INCLUDED == TRUE)
 /*******************************************************************************
 **
 ** Function         bta_av_api_sink_enable
@@ -587,7 +587,7 @@ static void bta_av_api_register(tBTA_AV_DATA *p_data)
             }
 
             /* Set the Capturing service class bit */
-#ifdef BTA_AVK_INCLUDED
+#if (BTA_AV_SINK_INCLUDED == TRUE)
             cod.service = BTM_COD_SERVICE_CAPTURING | BTM_COD_SERVICE_RENDERING;
 #else
             cod.service = BTM_COD_SERVICE_CAPTURING;
@@ -652,7 +652,7 @@ static void bta_av_api_register(tBTA_AV_DATA *p_data)
                 &cs.cfg.num_protect, cs.cfg.protect_info, index) == TRUE)
             {
 
-#ifdef BTA_AVK_INCLUDED
+#if (BTA_AV_SINK_INCLUDED == TRUE)
             if(index == 1)
             {
                 cs.tsep = AVDT_TSEP_SNK;
@@ -664,7 +664,7 @@ static void bta_av_api_register(tBTA_AV_DATA *p_data)
                 {
                     p_scb->seps[index].codec_type = codec_type;
 
-#ifdef BTA_AVK_INCLUDED
+#if (BTA_AV_SINK_INCLUDED == TRUE)
                     p_scb->seps[index].tsep = cs.tsep;
                     if(cs.tsep == AVDT_TSEP_SNK)
                         p_scb->seps[index].p_app_data_cback = p_data->api_reg.p_app_data_cback;
@@ -688,7 +688,7 @@ static void bta_av_api_register(tBTA_AV_DATA *p_data)
                                   A2D_SUPF_PLAYER, bta_av_cb.sdp_a2d_handle);
                 bta_sys_add_uuid(UUID_SERVCLASS_AUDIO_SOURCE);
 
-#ifdef BTA_AVK_INCLUDED
+#if (BTA_AV_SINK_INCLUDED == TRUE)
                 bta_av_cb.sdp_a2d_snk_handle = SDP_CreateRecord();
                 A2D_AddRecord(UUID_SERVCLASS_AUDIO_SINK, p_avk_service_name, NULL,
                                   A2D_SUPF_PLAYER, bta_av_cb.sdp_a2d_snk_handle);
@@ -1399,7 +1399,7 @@ char *bta_av_evt_code(UINT16 evt_code)
     case BTA_AV_AVRC_CLOSE_EVT: return "AVRC_CLOSE";
     case BTA_AV_CONN_CHG_EVT: return "CONN_CHG";
     case BTA_AV_DEREG_COMP_EVT: return "DEREG_COMP";
-#ifdef BTA_AVK_INCLUDED
+#if (BTA_AV_SINK_INCLUDED == TRUE)
     case BTA_AV_API_SINK_ENABLE_EVT: return "SINK_ENABLE";
 #endif
 #if (AVDT_REPORTING == TRUE)
index 78a1128..985d39f 100644 (file)
@@ -311,7 +311,7 @@ BOOLEAN bta_av_co_audio_init(UINT8 *p_codec_type, UINT8 *p_codec_info, UINT8 *p_
 
         /* Codec is valid */
         return TRUE;
-#ifdef BTA_AVK_INCLUDED
+#if (BTA_AV_SINK_INCLUDED == TRUE)
     case BTIF_SV_AV_AA_SBC_SINK_INDEX:
         *p_codec_type = BTA_AV_CODEC_SBC;
 
index 4de63bc..24c8533 100644 (file)
@@ -66,7 +66,7 @@
 #include "btif_av.h"
 #include "btif_sm.h"
 #include "btif_util.h"
-#ifdef BTA_AVK_INCLUDED
+#if (BTA_AV_SINK_INCLUDED == TRUE)
 #include "oi_codec_sbc.h"
 #include "oi_status.h"
 #endif
@@ -75,7 +75,7 @@
 
 //#define DEBUG_MEDIA_AV_FLOW TRUE
 
-#ifdef BTA_AVK_INCLUDED
+#if (BTA_AV_SINK_INCLUDED == TRUE)
 OI_CODEC_SBC_DECODER_CONTEXT context;
 OI_UINT32 contextData[CODEC_DATA_WORDS(2, SBC_CODEC_FAST_FILTER_BUFFERS)];
 OI_INT16 pcmData[15*SBC_MAX_SAMPLES_PER_FRAME*SBC_MAX_CHANNELS];
@@ -312,7 +312,7 @@ static void btif_a2dp_data_cb(tUIPC_CH_ID ch_id, tUIPC_EVENT event);
 static void btif_a2dp_ctrl_cb(tUIPC_CH_ID ch_id, tUIPC_EVENT event);
 static void btif_a2dp_encoder_update(void);
 const char* dump_media_event(UINT16 event);
-#ifdef BTA_AVK_INCLUDED
+#if (BTA_AV_SINK_INCLUDED == TRUE)
 extern OI_STATUS OI_CODEC_SBC_DecodeFrame(OI_CODEC_SBC_DECODER_CONTEXT *context,
                                           const OI_BYTE **frameData,
                                           unsigned long *frameBytes,
@@ -337,7 +337,7 @@ static BOOLEAN btif_media_task_stop_decoding_req(void);
 static void btif_media_task_handle_cmd(BT_HDR *p_msg);
 static void btif_media_task_handle_media(BT_HDR*p_msg);
 /* Handle incoming media packets A2DP SINK streaming*/
-#ifdef BTA_AVK_INCLUDED
+#if (BTA_AV_SINK_INCLUDED == TRUE)
 static void btif_media_task_handle_inc_media(tBT_SBC_HDR*p_msg);
 #endif
 
@@ -351,7 +351,7 @@ static void btif_media_task_enc_update(BT_HDR *p_msg);
 static void btif_media_task_audio_feeding_init(BT_HDR *p_msg);
 static void btif_media_task_aa_tx_flush(BT_HDR *p_msg);
 static void btif_media_aa_prep_2_send(UINT8 nb_frame);
-#ifdef BTA_AVK_INCLUDED
+#if (BTA_AV_SINK_INCLUDED == TRUE)
 static void btif_media_task_aa_handle_decoder_reset(BT_HDR *p_msg);
 static void btif_media_task_aa_handle_clear_track(void);
 #endif
@@ -886,7 +886,7 @@ void btif_a2dp_on_idle(void)
     }
 
     bta_av_co_init();
-#ifdef BTA_AVK_INCLUDED
+#if (BTA_AV_SINK_INCLUDED == TRUE)
     if (btif_media_cb.peer_sep == AVDT_TSEP_SRC)
     {
         btif_media_cb.rx_flush = TRUE;
@@ -1192,7 +1192,7 @@ void btif_a2dp_set_tx_flush(BOOLEAN enable)
     btif_media_cb.tx_flush = enable;
 }
 
-#ifdef BTA_AVK_INCLUDED
+#if (BTA_AV_SINK_INCLUDED == TRUE)
 /*******************************************************************************
  **
  ** Function         btif_media_task_avk_handle_timer
@@ -1400,7 +1400,7 @@ int btif_media_task(void *p)
 
         if (event & BTIF_MEDIA_AVK_TASK_TIMER)
         {
-#ifdef BTA_AVK_INCLUDED
+#if (BTA_AV_SINK_INCLUDED == TRUE)
             /* advance audio timer expiration for a2dp sink */
             btif_media_task_avk_handle_timer();
 #endif
@@ -1511,7 +1511,7 @@ static void btif_media_task_handle_cmd(BT_HDR *p_msg)
         btif_media_task_aa_handle_uipc_rx_rdy();
         break;
     case BTIF_MEDIA_AUDIO_SINK_CFG_UPDATE:
-#ifdef BTA_AVK_INCLUDED
+#if (BTA_AV_SINK_INCLUDED == TRUE)
         btif_media_task_aa_handle_decoder_reset(p_msg);
 #endif
         break;
@@ -1519,7 +1519,7 @@ static void btif_media_task_handle_cmd(BT_HDR *p_msg)
         btif_media_task_aa_handle_start_decoding();
         break;
     case BTIF_MEDIA_AUDIO_SINK_CLEAR_TRACK:
-#ifdef BTA_AVK_INCLUDED
+#if (BTA_AV_SINK_INCLUDED == TRUE)
         btif_media_task_aa_handle_clear_track();
 #endif
         break;
@@ -1537,7 +1537,7 @@ static void btif_media_task_handle_cmd(BT_HDR *p_msg)
     VERBOSE("btif_media_task_handle_cmd : %s DONE", dump_media_event(p_msg->event));
 }
 
-#ifdef BTA_AVK_INCLUDED
+#if (BTA_AV_SINK_INCLUDED == TRUE)
 /*******************************************************************************
  **
  ** Function         btif_media_task_handle_inc_media
@@ -2179,7 +2179,7 @@ static void btif_media_task_aa_handle_start_decoding(void )
     GKI_start_timer(BTIF_MEDIA_AVK_TASK_TIMER_ID, GKI_MS_TO_TICKS(BTIF_SINK_MEDIA_TIME_TICK), TRUE);
 }
 
-#ifdef BTA_AVK_INCLUDED
+#if (BTA_AV_SINK_INCLUDED == TRUE)
 
 static void btif_media_task_aa_handle_clear_track (void)
 {
index 34ccd50..ace4eed 100644 (file)
 #define BTA_GATT_INCLUDED TRUE
 #endif
 
-/* defined BTA_AVK_INCLUDED in Android.mk file based on target selected*/
+#ifndef BTA_AV_SINK_INCLUDED
+#define BTA_AV_SINK_INCLUDED FALSE
+#endif
 
 #ifndef BTA_DISABLE_DELAY
 #define BTA_DISABLE_DELAY 200 /* in milliseconds */