To make clear change media_id to index 92/175892/1 accepted/tizen/unified/20180416.213845 submit/tizen/20180416.031123
authorhj kim <backto.kim@samsung.com>
Fri, 13 Apr 2018 06:56:14 +0000 (15:56 +0900)
committerhj kim <backto.kim@samsung.com>
Fri, 13 Apr 2018 06:56:14 +0000 (15:56 +0900)
Change-Id: I1163833b6a9400281a279af0229ea63c58910e9c

include/media_controller_client.h
include/media_controller_server.h
src/media_controller_client.c
test/server_test/media_controller_server_test.c

index 8146a15844271fe4926229f74a1d4e7c35363756..7f5c71842359941f9200b8069228227df6241d43 100755 (executable)
@@ -171,12 +171,12 @@ typedef bool (*mc_subscribed_server_cb)(const char *server_name, void *user_data
  * @brief Called when updating the playlist of the media controller server.
  * @since_tizen 5.0
  *
- * @remarks The callback is called in the dbus event loop. @a data is a bundle. A bundle is a set of key-value pairs. "item id" is the key and "item metadata" is the value.
+ * @remarks The callback is called in the dbus event loop. @a data is a bundle. A bundle is a set of key-value pairs. "index" is the key and "media metadata" is the value.
  *
  * @param[in] server_name The app_id of the media controller server which sent the notification. It can be used only in the callback. To use outside, make a copy.
  * @param[in] mode The playlist update mode of the updated media controller server
  * @param[in] playlist_name Updated playlist name. It can be used only in the callback. To use outside, make a copy.
- * @param[in] data The playlist of the media controller server. When the playlist has been removed or it has no items after the change, @a data is NULL. It can be used only in the callback. To use outside, make a copy using @c bundle_dup().
+ * @param[in] data The playlist of the media controller server. When the playlist has been removed or it has no media after the change, @a data is NULL. It can be used only in the callback. To use outside, make a copy using @c bundle_dup().
  * @param[in] user_data The user data passed from the mc_client_set_playlist_update_cb() function
  *
  * @pre mc_client_set_playlist_update_cb()
@@ -740,7 +740,7 @@ int mc_client_get_server_repeat_mode(mc_client_h client, const char *server_name
  * @privilege %http://tizen.org/privilege/mediacontroller.client
  *
  * @remarks The @a playlist_name should be released using free(). \n
- *               @a playlist is a bundle. A bundle is a set of key-value pairs. "item id" is the key and "item metadata" is the value. \n
+ *               @a playlist is a bundle. A bundle is a set of key-value pairs. "index" is the key and "media metadata" is the value. \n
  *               And also the @a playlist should be released using @c bundle_free(). \n
  *               If there is no playlist, return value of @a playlist_name and @a playlist is NULL.
  *
@@ -911,7 +911,7 @@ int mc_client_send_custom_command(mc_client_h client, const char *server_name, c
 
 /**
  * @brief Sends the playlist command to server.
- * @details The media controller client can send "item id" of the playlist to the media controller server with playback action and position.
+ * @details The media controller client can send "index" of the playlist to the media controller server with playback action and position.
  * @since_tizen 5.0
  *
  * @privlevel public
@@ -920,7 +920,7 @@ int mc_client_send_custom_command(mc_client_h client, const char *server_name, c
  * @param[in] client    The handle to the media controller client
  * @param[in] server_name    The app_id of the media controller server
  * @param[in] playlist_name    The playlist name of the server
- * @param[in] media_id    The ID of the media in playlist to send to the media controller server
+ * @param[in] index    The index of the media in playlist to send to the media controller server
  * @param[in] action    The playback action command to send to the media controller server
  * @param[in] position    The position of the playback in milliseconds to send to media controller server
  * @return @c 0 on success,
@@ -931,7 +931,7 @@ int mc_client_send_custom_command(mc_client_h client, const char *server_name, c
  * @pre Create a media controller client handle by calling mc_client_create().
  * @see mc_client_create()
  */
-int mc_client_send_playlist_command(mc_client_h client, const char *server_name, const char *playlist_name, const char *media_id, mc_playback_action_e action, unsigned long long position);
+int mc_client_send_playlist_command(mc_client_h client, const char *server_name, const char *playlist_name, const char *index, mc_playback_action_e action, unsigned long long position);
 
 /**
  * @brief Destroys client.
index f6ae46af969a596534e0a0a96a71a3d093ffe646..db7c40c019c03ad2cf51bb1be5601f5f70f318df 100755 (executable)
@@ -142,7 +142,7 @@ typedef void (*mc_server_custom_command_received_cb)(const char* client_name, co
  *
  * @param[in] client_name    The app_id of the media controller client. It can be used only in the callback. To use outside, make a copy.
  * @param[in] playlist_name    The name of the server playlist. It can be used only in the callback. To use outside, make a copy.
- * @param[in] media_id    The ID of the media in playlist. It can be used only in the callback. To use outside, make a copy.
+ * @param[in] index    The index of the media in playlist. It can be used only in the callback. To use outside, make a copy.
  * @param[in] action    The received playback action
  * @param[in] position    The received playback position (milliseconds)
  * @param[in] user_data    The user data passed from the mc_server_set_playlist_command_received_cb() function
@@ -151,7 +151,7 @@ typedef void (*mc_server_custom_command_received_cb)(const char* client_name, co
  *
  * @see mc_server_set_playlist_command_received_cb()
  */
-typedef void (*mc_server_playlist_command_received_cb)(const char* client_name, const char *playlist_name, const char *media_id, mc_playback_action_e action, unsigned long long position, void *user_data);
+typedef void (*mc_server_playlist_command_received_cb)(const char* client_name, const char *playlist_name, const char *index, mc_playback_action_e action, unsigned long long position, void *user_data);
 
 /**
  * @brief Creates a media controller server.
@@ -323,7 +323,7 @@ int mc_server_update_repeat_mode(mc_server_h server, mc_repeat_mode_e mode);
  * @brief Updates the modified playlist info.
  * @details If this function is called, the updated playlist will be sent to all clients. \n
  *            The server can register only one playlist. If a new one is registered, the old one is removed. \n
- *            @a data is a bundle. A bundle is a set of key-value pairs. "item id" is the key and "item metadata" is the value. \n
+ *            @a data is a bundle. A bundle is a set of key-value pairs. "index" is the key and "media metadata" is the value. \n
  *            Therefore you should fill the metadata order using #mc_meta_e. \n
  *            If there are no playlist items or the server wants to remove the playlist, set @data to NULL.
  * @since_tizen 5.0
index 10442347446b3cc8cc8a7a2a21993947f1ad12c7..79e55ee92d84efbab7c446044d4ce0970f7faa4f 100755 (executable)
@@ -1270,7 +1270,7 @@ int mc_client_send_custom_command(mc_client_h client, const char *server_name, c
        return ret;
 }
 
-int mc_client_send_playlist_command(mc_client_h client, const char *server_name, const char *playlist_name, const char *media_id, mc_playback_action_e action, unsigned long long position)
+int mc_client_send_playlist_command(mc_client_h client, const char *server_name, const char *playlist_name, const char *index, mc_playback_action_e action, unsigned long long position)
 {
        int ret = MEDIA_CONTROLLER_ERROR_NONE;
        char *message = NULL;
@@ -1280,7 +1280,7 @@ int mc_client_send_playlist_command(mc_client_h client, const char *server_name,
        mc_retvm_if(mc_client == NULL, MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "Handle is NULL");
        mc_retvm_if(!MC_STRING_VALID(server_name), MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "Invalid server_name");
        mc_retvm_if(!MC_STRING_VALID(playlist_name), MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "Invalid playlist_name");
-       mc_retvm_if(!MC_STRING_VALID(media_id), MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "Invalid media_id");
+       mc_retvm_if(!MC_STRING_VALID(index), MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "Invalid index");
        mc_retvm_if(((action < MC_PLAYBACK_ACTION_PLAY) || (action > MC_PLAYBACK_ACTION_TOGGLE_PLAY_PAUSE)), MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "Invalid action");
 
        ret = mc_db_check_server_table_exist(mc_client->db_handle, server_name, &exist_server);
@@ -1290,7 +1290,7 @@ int mc_client_send_playlist_command(mc_client_h client, const char *server_name,
        ret = mc_util_set_command_available(mc_client->client_name, MC_COMMAND_PLAY_PLAYLIST, NULL);
        mc_retvm_if(ret != MEDIA_CONTROLLER_ERROR_NONE, ret, "Error mc_util_set_command_available [%d]", ret);
 
-       message = g_strdup_printf("%s%s%s%s%s%s%d%s%llu", mc_client->client_name, MC_STRING_DELIMITER, playlist_name, MC_STRING_DELIMITER, media_id, MC_STRING_DELIMITER, action, MC_STRING_DELIMITER, position);
+       message = g_strdup_printf("%s%s%s%s%s%s%d%s%llu", mc_client->client_name, MC_STRING_DELIMITER, playlist_name, MC_STRING_DELIMITER, index, MC_STRING_DELIMITER, action, MC_STRING_DELIMITER, position);
        mc_retvm_if(message == NULL, MEDIA_CONTROLLER_ERROR_INVALID_OPERATION, "fail making message [%d]", ret);
 
        char *interface_name = mc_util_get_interface_name(MC_SERVER, server_name);
index 0c76628feb909eb8be1bdcfc3f47d0b3dd097f90..a1437e69030a535977b3465d8c58fdb170f810a0 100755 (executable)
@@ -99,9 +99,9 @@ void __repeat_mode_command_received_cb(const char *client_name, mc_repeat_mode_e
        mc_debug("[%s] recieved repeat mode:[%d] from [%s]", client_name, repeat_mode, client_name);
 }
 
-void __playlist_play_received_cb(const char* client_name, const char *playlist_name, const char *media_id, mc_playback_action_e action, unsigned long long position, void *user_data)
+void __playlist_play_received_cb(const char* client_name, const char *playlist_name, const char *index, mc_playback_action_e action, unsigned long long position, void *user_data)
 {
-       mc_debug("recieved playlist play : playlist_name[%s] media_id[%s] action[%d] position[%llu] from [%s]", playlist_name, media_id, action, position, client_name);
+       mc_debug("recieved playlist play : playlist_name[%s] index[%s] action[%d] position[%llu] from [%s]", playlist_name, index, action, position, client_name);
 }
 
 void __custom_command_received_cb(const char *client_name, const char *command, bundle *data, void *user_data)