]> granicus.if.org Git - esp-idf/commitdiff
component/bt: modify headers btif_av_api.h, btif_av_co.h
authorwangmengyang <wangmengyang@espressif.com>
Thu, 2 Mar 2017 08:08:24 +0000 (16:08 +0800)
committerwangmengyang <wangmengyang@espressif.com>
Thu, 2 Mar 2017 08:08:24 +0000 (16:08 +0800)
components/bt/bluedroid/btc/profile/std/a2dp/btc_media_task.c
components/bt/bluedroid/btc/profile/std/include/btc_av_api.h [new file with mode: 0644]
components/bt/bluedroid/btc/profile/std/include/btc_media.h
components/bt/bluedroid/btif/bta_av_co.c
components/bt/bluedroid/btif/include/btif_av_api.h [deleted file]
components/bt/bluedroid/btif/include/btif_av_co.h

index a13438c7414c2a7f8f4db031f956c4b6c2816d4c..ec12b32f3c9f71d299094bd152a7da3ceebc3233 100644 (file)
@@ -465,7 +465,7 @@ void btc_a2dp_on_init(void)
 
 void btc_a2dp_setup_codec(void)
 {
-    tBTIF_AV_MEDIA_FEEDINGS media_feeding;
+    tBTC_AV_MEDIA_FEEDINGS media_feeding;
     tBTC_STATUS status;
 
     APPL_TRACE_EVENT("## A2DP SETUP CODEC ##\n");
@@ -476,7 +476,7 @@ void btc_a2dp_setup_codec(void)
     media_feeding.cfg.pcm.sampling_freq = 44100;
     media_feeding.cfg.pcm.bit_per_sample = 16;
     media_feeding.cfg.pcm.num_channel = 2;
-    media_feeding.format = BTIF_AV_CODEC_PCM;
+    media_feeding.format = BTC_AV_CODEC_PCM;
 
     bta_av_co_audio_set_codec(&media_feeding, &status);
 
diff --git a/components/bt/bluedroid/btc/profile/std/include/btc_av_api.h b/components/bt/bluedroid/btc/profile/std/include/btc_av_api.h
new file mode 100644 (file)
index 0000000..fcac94c
--- /dev/null
@@ -0,0 +1,201 @@
+// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+
+/*****************************************************************************
+ **
+ **  Name:           btc_av_api.h
+ **
+ **  Description:    This is the public interface file for the advanced
+ **                  audio/video streaming (AV) subsystem of BTC.
+ **
+ *****************************************************************************/
+
+#ifndef __BTC_AV_API_H__
+#define __BTC_AV_API_H__
+
+#include "bt_target.h"
+#include "bta_av_api.h"
+
+#include "btc_media.h"
+#include "a2d_api.h"
+#include "a2d_sbc.h"
+
+
+/*****************************************************************************
+ **  Constants and data types
+ *****************************************************************************/
+
+/* Codec type */
+#define BTC_AV_CODEC_NONE       0xFF
+#define BTC_AV_CODEC_SBC        A2D_MEDIA_CT_SBC        /* SBC media codec type */
+
+#define BTC_AV_CODEC_PCM        0x5                     /* Raw PCM */
+
+typedef UINT8 tBTC_AV_CODEC_ID;
+
+/* AV features masks */
+#define BTC_AV_FEAT_RCTG        BTA_AV_FEAT_RCTG      /* remote control target */
+#define BTC_AV_FEAT_RCCT        BTA_AV_FEAT_RCCT      /* remote control controller */
+#define BTC_AV_FEAT_METADATA    BTA_AV_FEAT_METADATA  /* remote control Metadata Transfer command/response */
+
+typedef UINT16 tBTC_AV_FEAT;
+
+/* AV channel values */
+#define BTC_AV_CHNL_MSK         BTA_AV_CHNL_MSK
+#define BTC_AV_CHNL_AUDIO       BTA_AV_CHNL_AUDIO       /* audio channel */
+#define BTC_AV_CHNL_VIDEO       BTA_AV_CHNL_VIDEO       /* video channel */
+typedef UINT8 tBTC_AV_CHNL;
+
+typedef UINT8 tBTC_AV_HNDL;
+
+/* Operation id list for BTIF_AvRemoteCmd */
+#define BTC_AV_ID_SELECT      0x00    /* select */
+#define BTC_AV_ID_UP          0x01    /* up */
+#define BTC_AV_ID_DOWN        0x02    /* down */
+#define BTC_AV_ID_LEFT        0x03    /* left */
+#define BTC_AV_ID_RIGHT       0x04    /* right */
+#define BTC_AV_ID_RIGHT_UP    0x05    /* right-up */
+#define BTC_AV_ID_RIGHT_DOWN  0x06    /* right-down */
+#define BTC_AV_ID_LEFT_UP     0x07    /* left-up */
+#define BTC_AV_ID_LEFT_DOWN   0x08    /* left-down */
+#define BTC_AV_ID_ROOT_MENU   0x09    /* root menu */
+#define BTC_AV_ID_SETUP_MENU  0x0A    /* setup menu */
+#define BTC_AV_ID_CONT_MENU   0x0B    /* contents menu */
+#define BTC_AV_ID_FAV_MENU    0x0C    /* favorite menu */
+#define BTC_AV_ID_EXIT        0x0D    /* exit */
+#define BTC_AV_ID_0           0x20    /* 0 */
+#define BTC_AV_ID_1           0x21    /* 1 */
+#define BTC_AV_ID_2           0x22    /* 2 */
+#define BTC_AV_ID_3           0x23    /* 3 */
+#define BTC_AV_ID_4           0x24    /* 4 */
+#define BTC_AV_ID_5           0x25    /* 5 */
+#define BTC_AV_ID_6           0x26    /* 6 */
+#define BTC_AV_ID_7           0x27    /* 7 */
+#define BTC_AV_ID_8           0x28    /* 8 */
+#define BTC_AV_ID_9           0x29    /* 9 */
+#define BTC_AV_ID_DOT         0x2A    /* dot */
+#define BTC_AV_ID_ENTER       0x2B    /* enter */
+#define BTC_AV_ID_CLEAR       0x2C    /* clear */
+#define BTC_AV_ID_CHAN_UP     0x30    /* channel up */
+#define BTC_AV_ID_CHAN_DOWN   0x31    /* channel down */
+#define BTC_AV_ID_PREV_CHAN   0x32    /* previous channel */
+#define BTC_AV_ID_SOUND_SEL   0x33    /* sound select */
+#define BTC_AV_ID_INPUT_SEL   0x34    /* input select */
+#define BTC_AV_ID_DISP_INFO   0x35    /* display information */
+#define BTC_AV_ID_HELP        0x36    /* help */
+#define BTC_AV_ID_PAGE_UP     0x37    /* page up */
+#define BTC_AV_ID_PAGE_DOWN   0x38    /* page down */
+#define BTC_AV_ID_POWER       0x40    /* power */
+#define BTC_AV_ID_VOL_UP      0x41    /* volume up */
+#define BTC_AV_ID_VOL_DOWN    0x42    /* volume down */
+#define BTC_AV_ID_MUTE        0x43    /* mute */
+#define BTC_AV_ID_PLAY        0x44    /* play */
+#define BTC_AV_ID_STOP        0x45    /* stop */
+#define BTC_AV_ID_PAUSE       0x46    /* pause */
+#define BTC_AV_ID_RECORD      0x47    /* record */
+#define BTC_AV_ID_REWIND      0x48    /* rewind */
+#define BTC_AV_ID_FAST_FOR    0x49    /* fast forward */
+#define BTC_AV_ID_EJECT       0x4A    /* eject */
+#define BTC_AV_ID_FORWARD     0x4B    /* forward */
+#define BTC_AV_ID_BACKWARD    0x4C    /* backward */
+#define BTC_AV_ID_ANGLE       0x50    /* angle */
+#define BTC_AV_ID_SUBPICT     0x51    /* subpicture */
+#define BTC_AV_ID_F1          0x71    /* F1 */
+#define BTC_AV_ID_F2          0x72    /* F2 */
+#define BTC_AV_ID_F3          0x73    /* F3 */
+#define BTC_AV_ID_F4          0x74    /* F4 */
+#define BTC_AV_ID_F5          0x75    /* F5 */
+#define BTC_AV_ID_VENDOR      0x7E    /* vendor unique */
+#define BTC_AV_KEYPRESSED_RELEASE 0x80
+
+typedef UINT8 tBTC_AV_RC;
+
+/* State flag for pass through command */
+#define BTC_AV_STATE_PRESS      0    /* key pressed */
+#define BTC_AV_STATE_RELEASE    1  /* key released */
+
+typedef UINT8 tBTC_AV_STATE;
+
+typedef UINT8 tBTC_AV_RC_HNDL;
+
+/* Command codes for BTIF_AvVendorCmd */
+#define BTC_AV_CMD_CTRL         0
+#define BTC_AV_CMD_STATUS       1
+#define BTC_AV_CMD_SPEC_INQ     2
+#define BTC_AV_CMD_NOTIF        3
+#define BTC_AV_CMD_GEN_INQ      4
+
+typedef UINT8 tBTC_AV_CMD;
+
+/* AV callback events */
+#define BTC_AV_OPEN_EVT         0       /* connection opened */
+#define BTC_AV_CLOSE_EVT        1       /* connection closed */
+#define BTC_AV_START_EVT        2       /* stream data transfer started */
+#define BTC_AV_STOP_EVT         3       /* stream data transfer stopped */
+#define BTC_AV_RC_OPEN_EVT      4       /* remote control channel open */
+#define BTC_AV_RC_CLOSE_EVT     5       /* remote control channel closed */
+#define BTC_AV_REMOTE_CMD_EVT   6      /* remote control command */
+#define BTC_AV_REMOTE_RSP_EVT   7      /* remote control response */
+#define BTC_AV_META_MSG_EVT     8      /* metadata messages */
+
+typedef UINT8 tBTC_AV_EVT;
+
+#define BTC_AV_FEEDING_ASYNCHRONOUS 0   /* asynchronous feeding, use tx av timer */
+#define BTC_AV_FEEDING_SYNCHRONOUS  1   /* synchronous feeding, no av tx timer */
+
+#define BTC_AV_MAX_SYNCHRONOUS_LATENCY 80 /* max latency in ms for BTC_AV_FEEDING_SYNCHRONOUS */
+#define BTC_AV_MIN_SYNCHRONOUS_LATENCY 4 /* min latency in ms for BTC_AV_FEEDING_SYNCHRONOUS */
+
+typedef UINT8 tBTC_AV_FEEDING_MODE;
+
+#define BTC_AV_CHANNEL_MODE_MONO    A2D_SBC_IE_CH_MD_MONO
+#define BTC_AV_CHANNEL_MODE_STEREO  A2D_SBC_IE_CH_MD_STEREO
+#define BTC_AV_CHANNEL_MODE_JOINT   A2D_SBC_IE_CH_MD_JOINT
+#define BTC_AV_CHANNEL_MODE_DUAL    A2D_SBC_IE_CH_MD_DUAL
+
+typedef UINT8 tBTC_AV_CHANNEL_MODE;
+
+/**
+ * Structure used to configure the AV codec capabilities/config
+ */
+typedef struct {
+    tBTC_AV_CODEC_ID id;            /* Codec ID (in terms of BTIF) */
+    UINT8 info[AVDT_CODEC_SIZE];     /* Codec info (can be config or capabilities) */
+} tBTC_AV_CODEC_INFO;
+
+/**
+ * Structure used to configure the AV media feeding
+ */
+typedef struct {
+    UINT16 sampling_freq;   /* 44100, 48000 etc */
+    UINT16 num_channel;     /* 1 for mono or 2 stereo */
+    UINT8  bit_per_sample;  /* Number of bits per sample (8, 16) */
+} tBTC_AV_MEDIA_FEED_CFG_PCM;
+
+typedef union {
+    tBTC_AV_MEDIA_FEED_CFG_PCM pcm;     /* Raw PCM feeding format */
+} tBTC_AV_MEDIA_FEED_CFG;
+
+typedef struct {
+    tBTC_AV_CODEC_ID format;        /* Media codec identifier */
+    tBTC_AV_MEDIA_FEED_CFG cfg;     /* Media codec configuration */
+} tBTC_AV_MEDIA_FEEDINGS;
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __BTC_AV_API_H__ */
index 0975a6ac84e877ddcfc7c73d5408ce962c80f43b..bc852caf413dd504da46389697bbf475fd91e32d 100644 (file)
@@ -26,7 +26,7 @@
 #include <stdbool.h>
 #include "bta_api.h"
 #include "gki.h"
-#include "btif_av_api.h"
+#include "btc_av_api.h"
 
 
 /*******************************************************************************
@@ -77,8 +77,8 @@ typedef struct {
 /* tBTC_MEDIA_INIT_AUDIO_FEEDING msg structure */
 typedef struct {
     BT_HDR hdr;
-    tBTIF_AV_FEEDING_MODE feeding_mode;
-    tBTIF_AV_MEDIA_FEEDINGS feeding;
+    tBTC_AV_FEEDING_MODE feeding_mode;
+    tBTC_AV_MEDIA_FEEDINGS feeding;
 } tBTC_MEDIA_INIT_AUDIO_FEEDING;
 
 typedef struct {
index 373ba8d1341c7147f82794a42b297ac367c97baa..3cbf422bdbc0006f4deab50a2c3b8df56f6b7209 100644 (file)
@@ -145,8 +145,8 @@ typedef struct {
     /* Connected peer information */
     tBTA_AV_CO_PEER peers[BTA_AV_NUM_STRS];
     /* Current codec configuration - access to this variable must be protected */
-    tBTIF_AV_CODEC_INFO codec_cfg;
-    tBTIF_AV_CODEC_INFO codec_cfg_setconfig; /* remote peer setconfig preference */
+    tBTC_AV_CODEC_INFO codec_cfg;
+    tBTC_AV_CODEC_INFO codec_cfg_setconfig; /* remote peer setconfig preference */
 
     tBTA_AV_CO_CP cp;
 } tBTA_AV_CO_CB;
@@ -274,7 +274,7 @@ BOOLEAN bta_av_co_audio_init(UINT8 *p_codec_type, UINT8 *p_codec_info, UINT8 *p_
     *p_protect_info = 0;
 
     /* reset remote preference through setconfig */
-    bta_av_co_cb.codec_cfg_setconfig.id = BTIF_AV_CODEC_NONE;
+    bta_av_co_cb.codec_cfg_setconfig.id = BTC_AV_CODEC_NONE;
 
     switch (index) {
     case BTIF_SV_AV_AA_SBC_INDEX:
@@ -772,7 +772,7 @@ void bta_av_co_audio_setconfig(tBTA_AV_HNDL hndl, tBTA_AV_CODEC codec_type,
 
             /* Check if the configuration matches the current codec config */
             switch (bta_av_co_cb.codec_cfg.id) {
-            case BTIF_AV_CODEC_SBC:
+            case BTC_AV_CODEC_SBC:
                 if ((codec_type != BTA_AV_CODEC_SBC) || memcmp(p_codec_info, bta_av_co_cb.codec_cfg.info, 5)) {
                     recfg_needed = TRUE;
                 } else if ((num_protect == 1) && (!bta_av_co_cb.cp.active)) {
@@ -785,7 +785,7 @@ void bta_av_co_audio_setconfig(tBTA_AV_HNDL hndl, tBTA_AV_CODEC codec_type,
                                  p_codec_info[BTA_AV_CO_SBC_MIN_BITPOOL_OFF],
                                  p_codec_info[BTA_AV_CO_SBC_MAX_BITPOOL_OFF] );
 
-                bta_av_co_cb.codec_cfg_setconfig.id = BTIF_AV_CODEC_SBC;
+                bta_av_co_cb.codec_cfg_setconfig.id = BTC_AV_CODEC_SBC;
                 memcpy(bta_av_co_cb.codec_cfg_setconfig.info, p_codec_info, AVDT_CODEC_SIZE);
                 if (AVDT_TSEP_SNK == t_local_sep) {
                     /* If Peer is SRC, and our cfg subset matches with what is requested by peer, then
@@ -889,7 +889,7 @@ void bta_av_co_audio_close(tBTA_AV_HNDL hndl, tBTA_AV_CODEC codec_type, UINT16 m
     }
 
     /* reset remote preference through setconfig */
-    bta_av_co_cb.codec_cfg_setconfig.id = BTIF_AV_CODEC_NONE;
+    bta_av_co_cb.codec_cfg_setconfig.id = BTC_AV_CODEC_NONE;
 }
 
 /*******************************************************************************
@@ -1046,7 +1046,7 @@ static BOOLEAN bta_av_co_audio_codec_build_config(const UINT8 *p_codec_caps, UIN
     memset(p_codec_cfg, 0, AVDT_CODEC_SIZE);
 
     switch (bta_av_co_cb.codec_cfg.id) {
-    case BTIF_AV_CODEC_SBC:
+    case BTC_AV_CODEC_SBC:
         /*  only copy the relevant portions for this codec to avoid issues when
             comparing codec configs covering larger codec sets than SBC (7 bytes) */
         memcpy(p_codec_cfg, bta_av_co_cb.codec_cfg.info, BTA_AV_CO_SBC_MAX_BITPOOL_OFF + 1);
@@ -1081,7 +1081,7 @@ static BOOLEAN bta_av_co_audio_codec_cfg_matches_caps(UINT8 codec_id, const UINT
     FUNC_TRACE();
 
     switch (codec_id) {
-    case BTIF_AV_CODEC_SBC:
+    case BTC_AV_CODEC_SBC:
 
         APPL_TRACE_EVENT("bta_av_co_audio_codec_cfg_matches_caps : min %d/%d max %d/%d",
                          p_codec_caps[BTA_AV_CO_SBC_MIN_BITPOOL_OFF],
@@ -1247,7 +1247,7 @@ static BOOLEAN bta_av_co_audio_peer_supports_codec(tBTA_AV_CO_PEER *p_peer, UINT
     for (index = 0; index < p_peer->num_sup_snks; index++) {
         if (p_peer->snks[index].codec_type == codec_type) {
             switch (bta_av_co_cb.codec_cfg.id) {
-            case BTIF_AV_CODEC_SBC:
+            case BTC_AV_CODEC_SBC:
                 if (p_snk_index) {
                     *p_snk_index = index;
                 }
@@ -1287,7 +1287,7 @@ static BOOLEAN bta_av_co_audio_peer_src_supports_codec(tBTA_AV_CO_PEER *p_peer,
     for (index = 0; index < p_peer->num_sup_srcs; index++) {
         if (p_peer->srcs[index].codec_type == codec_type) {
             switch (bta_av_co_cb.codec_cfg.id) {
-            case BTIF_AV_CODEC_SBC:
+            case BTC_AV_CODEC_SBC:
                 if (p_src_index) {
                     *p_src_index = index;
                 }
@@ -1465,7 +1465,7 @@ void bta_av_co_audio_codec_reset(void)
     FUNC_TRACE();
 
     /* Reset the current configuration to SBC */
-    bta_av_co_cb.codec_cfg.id = BTIF_AV_CODEC_SBC;
+    bta_av_co_cb.codec_cfg.id = BTC_AV_CODEC_SBC;
 
     if (A2D_BldSbcInfo(A2D_MEDIA_TYPE_AUDIO, (tA2D_SBC_CIE *)&btif_av_sbc_default_config, bta_av_co_cb.codec_cfg.info) != A2D_SUCCESS) {
         APPL_TRACE_ERROR("bta_av_co_audio_codec_reset A2D_BldSbcInfo failed");
@@ -1485,10 +1485,10 @@ void bta_av_co_audio_codec_reset(void)
  ** Returns          TRUE if successful, FALSE otherwise
  **
  *******************************************************************************/
-BOOLEAN bta_av_co_audio_set_codec(const tBTIF_AV_MEDIA_FEEDINGS *p_feeding, tBTC_STATUS *p_status)
+BOOLEAN bta_av_co_audio_set_codec(const tBTC_AV_MEDIA_FEEDINGS *p_feeding, tBTC_STATUS *p_status)
 {
     tA2D_SBC_CIE sbc_config;
-    tBTIF_AV_CODEC_INFO new_cfg;
+    tBTC_AV_CODEC_INFO new_cfg;
 
     FUNC_TRACE();
 
@@ -1499,8 +1499,8 @@ BOOLEAN bta_av_co_audio_set_codec(const tBTIF_AV_MEDIA_FEEDINGS *p_feeding, tBTC
 
     /* Supported codecs */
     switch (p_feeding->format) {
-    case BTIF_AV_CODEC_PCM:
-        new_cfg.id = BTIF_AV_CODEC_SBC;
+    case BTC_AV_CODEC_PCM:
+        new_cfg.id = BTC_AV_CODEC_SBC;
 
         sbc_config = btif_av_sbc_default_config;
         if ((p_feeding->cfg.pcm.num_channel != 1) &&
@@ -1579,7 +1579,7 @@ BOOLEAN bta_av_co_audio_get_sbc_config(tA2D_SBC_CIE *p_sbc_config, UINT16 *p_min
     *p_minmtu = 0xFFFF;
 
     GKI_disable();
-    if (bta_av_co_cb.codec_cfg.id == BTIF_AV_CODEC_SBC) {
+    if (bta_av_co_cb.codec_cfg.id == BTC_AV_CODEC_SBC) {
         if (A2D_ParsSbcInfo(p_sbc_config, bta_av_co_cb.codec_cfg.info, FALSE) == A2D_SUCCESS) {
             for (index = 0; index < BTA_AV_CO_NUM_ELEMENTS(bta_av_co_cb.peers); index++) {
                 p_peer = &bta_av_co_cb.peers[index];
@@ -1659,7 +1659,7 @@ void bta_av_co_init(void)
     /* Reset the control block */
     memset(&bta_av_co_cb, 0, sizeof(bta_av_co_cb));
 
-    bta_av_co_cb.codec_cfg_setconfig.id = BTIF_AV_CODEC_NONE;
+    bta_av_co_cb.codec_cfg_setconfig.id = BTC_AV_CODEC_NONE;
 
 #if defined(BTA_AV_CO_CP_SCMS_T) && (BTA_AV_CO_CP_SCMS_T == TRUE)
     bta_av_co_cp_set_flag(BTA_AV_CP_SCMS_COPY_NEVER);
@@ -1722,7 +1722,7 @@ BOOLEAN bta_av_co_peer_cp_supported(tBTA_AV_HNDL hndl)
 BOOLEAN bta_av_co_get_remote_bitpool_pref(UINT8 *min, UINT8 *max)
 {
     /* check if remote peer did a set config */
-    if (bta_av_co_cb.codec_cfg_setconfig.id == BTIF_AV_CODEC_NONE) {
+    if (bta_av_co_cb.codec_cfg_setconfig.id == BTC_AV_CODEC_NONE) {
         return FALSE;
     }
 
diff --git a/components/bt/bluedroid/btif/include/btif_av_api.h b/components/bt/bluedroid/btif/include/btif_av_api.h
deleted file mode 100644 (file)
index bc23bcb..0000000
+++ /dev/null
@@ -1,206 +0,0 @@
-/******************************************************************************
- *
- *  Copyright (C) 2009-2012 Broadcom Corporation
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at:
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- *
- ******************************************************************************/
-
-/*****************************************************************************
- **
- **  Name:           btif_av_api.h
- **
- **  Description:    This is the public interface file for the advanced
- **                  audio/video streaming (AV) subsystem of BTIF, Broadcom's
- **                  Bluetooth application layer for mobile phones.
- **
- *****************************************************************************/
-
-#ifndef BTIF_AV_API_H
-#define BTIF_AV_API_H
-
-#include "bt_target.h"
-#include "bta_av_api.h"
-// #include "uipc.h"
-
-#include "btc_media.h"
-#include "a2d_api.h"
-#include "a2d_sbc.h"
-
-
-/*****************************************************************************
- **  Constants and data types
- *****************************************************************************/
-
-/* Codec type */
-#define BTIF_AV_CODEC_NONE       0xFF
-#define BTIF_AV_CODEC_SBC        A2D_MEDIA_CT_SBC        /* SBC media codec type */
-
-#define BTIF_AV_CODEC_PCM        0x5                     /* Raw PCM */
-
-typedef UINT8 tBTIF_AV_CODEC_ID;
-
-/* AV features masks */
-#define BTIF_AV_FEAT_RCTG        BTA_AV_FEAT_RCTG      /* remote control target */
-#define BTIF_AV_FEAT_RCCT        BTA_AV_FEAT_RCCT      /* remote control controller */
-#define BTIF_AV_FEAT_METADATA    BTA_AV_FEAT_METADATA  /* remote control Metadata Transfer command/response */
-
-typedef UINT16 tBTIF_AV_FEAT;
-
-/* AV channel values */
-#define BTIF_AV_CHNL_MSK         BTA_AV_CHNL_MSK
-#define BTIF_AV_CHNL_AUDIO       BTA_AV_CHNL_AUDIO       /* audio channel */
-#define BTIF_AV_CHNL_VIDEO       BTA_AV_CHNL_VIDEO       /* video channel */
-typedef UINT8 tBTIF_AV_CHNL;
-
-typedef UINT8 tBTIF_AV_HNDL;
-
-/* Operation id list for BTIF_AvRemoteCmd */
-#define BTIF_AV_ID_SELECT      0x00    /* select */
-#define BTIF_AV_ID_UP          0x01    /* up */
-#define BTIF_AV_ID_DOWN        0x02    /* down */
-#define BTIF_AV_ID_LEFT        0x03    /* left */
-#define BTIF_AV_ID_RIGHT       0x04    /* right */
-#define BTIF_AV_ID_RIGHT_UP    0x05    /* right-up */
-#define BTIF_AV_ID_RIGHT_DOWN  0x06    /* right-down */
-#define BTIF_AV_ID_LEFT_UP     0x07    /* left-up */
-#define BTIF_AV_ID_LEFT_DOWN   0x08    /* left-down */
-#define BTIF_AV_ID_ROOT_MENU   0x09    /* root menu */
-#define BTIF_AV_ID_SETUP_MENU  0x0A    /* setup menu */
-#define BTIF_AV_ID_CONT_MENU   0x0B    /* contents menu */
-#define BTIF_AV_ID_FAV_MENU    0x0C    /* favorite menu */
-#define BTIF_AV_ID_EXIT        0x0D    /* exit */
-#define BTIF_AV_ID_0           0x20    /* 0 */
-#define BTIF_AV_ID_1           0x21    /* 1 */
-#define BTIF_AV_ID_2           0x22    /* 2 */
-#define BTIF_AV_ID_3           0x23    /* 3 */
-#define BTIF_AV_ID_4           0x24    /* 4 */
-#define BTIF_AV_ID_5           0x25    /* 5 */
-#define BTIF_AV_ID_6           0x26    /* 6 */
-#define BTIF_AV_ID_7           0x27    /* 7 */
-#define BTIF_AV_ID_8           0x28    /* 8 */
-#define BTIF_AV_ID_9           0x29    /* 9 */
-#define BTIF_AV_ID_DOT         0x2A    /* dot */
-#define BTIF_AV_ID_ENTER       0x2B    /* enter */
-#define BTIF_AV_ID_CLEAR       0x2C    /* clear */
-#define BTIF_AV_ID_CHAN_UP     0x30    /* channel up */
-#define BTIF_AV_ID_CHAN_DOWN   0x31    /* channel down */
-#define BTIF_AV_ID_PREV_CHAN   0x32    /* previous channel */
-#define BTIF_AV_ID_SOUND_SEL   0x33    /* sound select */
-#define BTIF_AV_ID_INPUT_SEL   0x34    /* input select */
-#define BTIF_AV_ID_DISP_INFO   0x35    /* display information */
-#define BTIF_AV_ID_HELP        0x36    /* help */
-#define BTIF_AV_ID_PAGE_UP     0x37    /* page up */
-#define BTIF_AV_ID_PAGE_DOWN   0x38    /* page down */
-#define BTIF_AV_ID_POWER       0x40    /* power */
-#define BTIF_AV_ID_VOL_UP      0x41    /* volume up */
-#define BTIF_AV_ID_VOL_DOWN    0x42    /* volume down */
-#define BTIF_AV_ID_MUTE        0x43    /* mute */
-#define BTIF_AV_ID_PLAY        0x44    /* play */
-#define BTIF_AV_ID_STOP        0x45    /* stop */
-#define BTIF_AV_ID_PAUSE       0x46    /* pause */
-#define BTIF_AV_ID_RECORD      0x47    /* record */
-#define BTIF_AV_ID_REWIND      0x48    /* rewind */
-#define BTIF_AV_ID_FAST_FOR    0x49    /* fast forward */
-#define BTIF_AV_ID_EJECT       0x4A    /* eject */
-#define BTIF_AV_ID_FORWARD     0x4B    /* forward */
-#define BTIF_AV_ID_BACKWARD    0x4C    /* backward */
-#define BTIF_AV_ID_ANGLE       0x50    /* angle */
-#define BTIF_AV_ID_SUBPICT     0x51    /* subpicture */
-#define BTIF_AV_ID_F1          0x71    /* F1 */
-#define BTIF_AV_ID_F2          0x72    /* F2 */
-#define BTIF_AV_ID_F3          0x73    /* F3 */
-#define BTIF_AV_ID_F4          0x74    /* F4 */
-#define BTIF_AV_ID_F5          0x75    /* F5 */
-#define BTIF_AV_ID_VENDOR      0x7E    /* vendor unique */
-#define BTIF_AV_KEYPRESSED_RELEASE 0x80
-
-typedef UINT8 tBTIF_AV_RC;
-
-/* State flag for pass through command */
-#define BTIF_AV_STATE_PRESS      0    /* key pressed */
-#define BTIF_AV_STATE_RELEASE    1  /* key released */
-
-typedef UINT8 tBTIF_AV_STATE;
-
-typedef UINT8 tBTIF_AV_RC_HNDL;
-
-/* Command codes for BTIF_AvVendorCmd */
-#define BTIF_AV_CMD_CTRL         0
-#define BTIF_AV_CMD_STATUS       1
-#define BTIF_AV_CMD_SPEC_INQ     2
-#define BTIF_AV_CMD_NOTIF        3
-#define BTIF_AV_CMD_GEN_INQ      4
-
-typedef UINT8 tBTIF_AV_CMD;
-
-/* AV callback events */
-#define BTIF_AV_OPEN_EVT         0       /* connection opened */
-#define BTIF_AV_CLOSE_EVT        1       /* connection closed */
-#define BTIF_AV_START_EVT        2       /* stream data transfer started */
-#define BTIF_AV_STOP_EVT         3       /* stream data transfer stopped */
-#define BTIF_AV_RC_OPEN_EVT      4       /* remote control channel open */
-#define BTIF_AV_RC_CLOSE_EVT     5       /* remote control channel closed */
-#define BTIF_AV_REMOTE_CMD_EVT   6      /* remote control command */
-#define BTIF_AV_REMOTE_RSP_EVT   7      /* remote control response */
-#define BTIF_AV_META_MSG_EVT     8      /* metadata messages */
-
-typedef UINT8 tBTIF_AV_EVT;
-
-#define BTIF_AV_FEEDING_ASYNCHRONOUS 0   /* asynchronous feeding, use tx av timer */
-#define BTIF_AV_FEEDING_SYNCHRONOUS  1   /* synchronous feeding, no av tx timer */
-
-#define BTIF_AV_MAX_SYNCHRONOUS_LATENCY 80 /* max latency in ms for BTIF_AV_FEEDING_SYNCHRONOUS */
-#define BTIF_AV_MIN_SYNCHRONOUS_LATENCY 4 /* min latency in ms for BTIF_AV_FEEDING_SYNCHRONOUS */
-
-typedef UINT8 tBTIF_AV_FEEDING_MODE;
-
-#define BTIF_AV_CHANNEL_MODE_MONO    A2D_SBC_IE_CH_MD_MONO
-#define BTIF_AV_CHANNEL_MODE_STEREO  A2D_SBC_IE_CH_MD_STEREO
-#define BTIF_AV_CHANNEL_MODE_JOINT   A2D_SBC_IE_CH_MD_JOINT
-#define BTIF_AV_CHANNEL_MODE_DUAL    A2D_SBC_IE_CH_MD_DUAL
-
-typedef UINT8 tBTIF_AV_CHANNEL_MODE;
-
-/**
- * Structure used to configure the AV codec capabilities/config
- */
-typedef struct {
-    tBTIF_AV_CODEC_ID id;            /* Codec ID (in terms of BTIF) */
-    UINT8 info[AVDT_CODEC_SIZE];     /* Codec info (can be config or capabilities) */
-} tBTIF_AV_CODEC_INFO;
-
-/**
- * Structure used to configure the AV media feeding
- */
-typedef struct {
-    UINT16 sampling_freq;   /* 44100, 48000 etc */
-    UINT16 num_channel;     /* 1 for mono or 2 stereo */
-    UINT8  bit_per_sample;  /* Number of bits per sample (8, 16) */
-} tBTIF_AV_MEDIA_FEED_CFG_PCM;
-
-typedef union {
-    tBTIF_AV_MEDIA_FEED_CFG_PCM pcm;     /* Raw PCM feeding format */
-} tBTIF_AV_MEDIA_FEED_CFG;
-
-typedef struct {
-    tBTIF_AV_CODEC_ID format;        /* Media codec identifier */
-    tBTIF_AV_MEDIA_FEED_CFG cfg;     /* Media codec configuration */
-} tBTIF_AV_MEDIA_FEEDINGS;
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BTIF_AV_API_H */
index f7e6cac23679a214b81b109ec1208064c9956458..bc72387a141a5d44781348a10ddfa004d8a6c03f 100644 (file)
@@ -109,7 +109,7 @@ BOOLEAN bta_av_co_audio_codec_supported(tBTC_STATUS *p_status);
  ** Returns          TRUE if successful, FALSE otherwise
  **
  *******************************************************************************/
-BOOLEAN bta_av_co_audio_set_codec(const tBTIF_AV_MEDIA_FEEDINGS *p_feeding, tBTC_STATUS *p_status);
+BOOLEAN bta_av_co_audio_set_codec(const tBTC_AV_MEDIA_FEEDINGS *p_feeding, tBTC_STATUS *p_status);
 
 /*******************************************************************************
  **