Fix the build error in capi-network-bluetooth 02/11502/1 accepted/tizen/20131029.090052 accepted/tizen/20131029.175620 submit/tizen/20131029.071534
authorDoHyun Pyun <dh79.pyun@samsung.com>
Tue, 29 Oct 2013 05:26:40 +0000 (14:26 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Tue, 29 Oct 2013 05:30:09 +0000 (14:30 +0900)
After upgrading bluez 5.x version, some enum value and structure
variables were removed. Because of this there was a build break
in capi-network-bluetooth. So in now rollback removed values.
In later, capi-network-bluetooth will apply bluez 5.x values.
And then we can remove previous values.

Change-Id: Ia13e86310fffdf058d5db0ed1668e3dba49237b8
Signed-off-by: Dohyun Pyun <dh79.pyun@samsung.com>
bt-api/bt-avrcp.c
bt-service/bt-request-handler.c
bt-service/bt-service-avrcp.c
include/bluetooth-media-control.h

index fe6a22b..1d705aa 100644 (file)
@@ -121,11 +121,11 @@ BT_EXPORT_API int bluetooth_media_player_change_track(
 
        if (_bt_copy_utf8_string(meta_data.title, metadata->title, BT_NAME_MAX))
                BT_DBG("Error in copying Title\n");
-       if (_bt_copy_utf8_string(meta_data.artist, metadata->artist[0], BT_NAME_MAX))
+       if (_bt_copy_utf8_string(meta_data.artist, metadata->artists[0], BT_NAME_MAX))
                BT_DBG("Error in copying Artist\n");
        if (_bt_copy_utf8_string(meta_data.album, metadata->album, BT_NAME_MAX))
                BT_DBG("Error in copying Album\n");
-       if (_bt_copy_utf8_string(meta_data.genre, metadata->genre[0], BT_NAME_MAX))
+       if (_bt_copy_utf8_string(meta_data.genre, metadata->genres[0], BT_NAME_MAX))
                BT_DBG("Error in copying Genre\n");
 
        meta_data.number = metadata->tracknumber;
index 94992c1..6dac47e 100644 (file)
@@ -465,20 +465,20 @@ static int __bt_bluez_request(int function_name,
                                        media_metadata_t, 0);
 
                properties.metadata.title = g_strdup(data.title);
-               properties.metadata.artist = g_malloc0(sizeof(char *));
-               properties.metadata.artist[0] = g_strdup(data.artist);
+               properties.metadata.artists = g_malloc0(sizeof(char *));
+               properties.metadata.artists[0] = g_strdup(data.artist);
                properties.metadata.album = g_strdup(data.album);
-               properties.metadata.genre = g_malloc0(sizeof(char *));
-               properties.metadata.genre[0] = g_strdup(data.genre);
+               properties.metadata.genres = g_malloc0(sizeof(char *));
+               properties.metadata.genres[0] = g_strdup(data.genre);
                properties.metadata.tracknumber = data.number;
                properties.metadata.duration = data.duration;
 
                result = _bt_avrcp_set_properties(&properties);
 
                g_free((gpointer)properties.metadata.title);
-               g_free((gpointer)properties.metadata.artist);
+               g_free((gpointer)properties.metadata.artists);
                g_free((gpointer)properties.metadata.album);
-               g_free((gpointer)properties.metadata.genre);
+               g_free((gpointer)properties.metadata.genres);
 
                break;
        }
index 538b401..e65e7df 100644 (file)
@@ -664,8 +664,8 @@ int _bt_register_media_player(void)
                "xesam:title",
                DBUS_TYPE_STRING, &metadata.title, 0);
 
-       metadata.artist = g_malloc0(sizeof(char *));
-       metadata.artist[0] = "";
+       metadata.artists = g_malloc0(sizeof(char *));
+       metadata.artists[0] = "";
 
        __bt_media_append_metadata_dict_entry(&property_dict,
                "xesam:artist",
@@ -675,8 +675,8 @@ int _bt_register_media_player(void)
                "xesam:album",
                DBUS_TYPE_STRING, &metadata.album, 0);
 
-       metadata.genre = g_malloc0(sizeof(char *));
-       metadata.genre[0] = "";
+       metadata.genres = g_malloc0(sizeof(char *));
+       metadata.genres[0] = "";
 
        __bt_media_append_metadata_dict_entry(&property_dict,
                "xesam:genre",
index 5e12053..906be7c 100644 (file)
@@ -37,20 +37,35 @@ typedef enum {
        SHUFFLE,
        LOOPSTATUS,
        POSITION,
-       METADATA
+       METADATA,
+       EQUALIZER = 0x02,       /* bluez 4.101 */
+       REPEAT,                 /* bluez 4.101 */
+       SCAN,                   /* bluez 4.101 */
+       STATUS,                 /* bluez 4.101 */
 } media_player_property_type;
 
+/* bluez 4.101 */
 typedef enum {
-        REPEAT_MODE_OFF = 0x01,
-        REPEAT_SINGLE_TRACK,
-        REPEAT_ALL_TRACK,
-        REPEAT_INVALID,
+       EQUALIZER_OFF = 0x01,
+       EQUALIZER_ON,
+       EQUALIZER_INVALID,
+} media_player_equalizer_status;
+
+typedef enum {
+       REPEAT_MODE_OFF = 0x01,
+       REPEAT_SINGLE_TRACK,
+       REPEAT_ALL_TRACK,
+       REPEAT_GROUP,           /* bluez 4.101 */
+       REPEAT_INVALID,
 } media_player_repeat_status;
 
 typedef enum {
         STATUS_STOPPED = 0x00,
         STATUS_PLAYING,
         STATUS_PAUSED,
+       STATUS_FORWARD_SEEK,    /* bluez 4.101 */
+       STATUS_REVERSE_SEEK,    /* bluez 4.101 */
+       STATUS_ERROR,           /* bluez 4.101 */
         STATUS_INVALID
 } media_player_status;
 
@@ -61,21 +76,38 @@ typedef enum {
        SHUFFLE_INVALID,
 } media_player_shuffle_status;
 
+/* bluez 4.101 */
+typedef enum {
+       SCAN_MODE_OFF = 0x01,
+       SCAN_ALL_TRACK,
+       SCAN_GROUP,
+       SCAN_INVALID,
+} media_player_scan_status;
+
 typedef struct {
        const char *title;
-       const char **artist;
+       const char **artists;
        const char *album;
-       const char **genre;
+       const char **genres;
        unsigned int tracknumber;
+       const char *artist;             /* bluez 4.101 */
+       const char *genre;              /* bluez 4.101 */
+       unsigned int total_tracks;      /* bluez 4.101 */
+       unsigned int number;            /* bluez 4.101 */
        unsigned int duration;
 } media_metadata_attributes_t;
 
 typedef struct {
        media_player_repeat_status      loopstatus;
        media_player_status     playbackstatus;
-       gboolean        shuffle;
+       gboolean        shuffle_mode;
        gint64  position;
        media_metadata_attributes_t     metadata;
+       media_player_equalizer_status equalizer;        /* bluez 4.101 */
+       media_player_repeat_status  repeat;             /* bluez 4.101 */
+       media_player_shuffle_status  shuffle;           /* bluez 4.101 */
+       media_player_scan_status scan;                  /* bluez 4.101 */
+       media_player_status status;                     /* bluez 4.101 */
 } media_player_settings_t;
 
 typedef struct {