Tizen Native API
4.0
|
The Media Controller Server API provides functions for sending the server information to the client.
#include <media_controller_server.h>
The Media Controller Server API allows you to send the playback info (mc_server_set_playback_state(), mc_server_set_playback_position(), mc_server_set_playlist_item_index()), the metadata (mc_server_set_metadata() and playlist (mc_server_set_playlist_item_index(), mc_server_create_playlist()). and to receive the custom command (mc_server_set_custom_cmd_received_cb()), to update the status information on the latest server (mc_server_update_playback_info(), mc_server_update_metadata().
Before doing those things you should create handle(mc_server_create()). And if you don't use handle anymore, you have to destroy it(mc_server_destroy()).
Functions | |
int | mc_server_create (mc_server_h *server) |
Creates a media controller server. | |
int | mc_server_set_playback_state (mc_server_h server, mc_playback_states_e state) |
Sets the playback state to update the latest state info. | |
int | mc_server_set_playback_position (mc_server_h server, unsigned long long position) |
Sets the playback position to update the latest playback info. | |
int | mc_server_set_playlist_item_index (mc_server_h server, const char *index) |
Sets the index of the current playing media in the playlist to update the latest playback info. . | |
int | mc_server_update_playback_info (mc_server_h server) |
Updates the modified playback info. | |
int | mc_server_set_metadata (mc_server_h server, mc_meta_e attribute, const char *value) |
Sets the metadata to update the latest metadata info. | |
int | mc_server_update_metadata (mc_server_h server) |
Updates the modified metadata info. | |
int | mc_server_update_shuffle_mode (mc_server_h server, mc_shuffle_mode_e mode) |
Updates the modified shuffle mode. | |
int | mc_server_update_repeat_mode (mc_server_h server, mc_repeat_mode_e mode) |
Updates the modified repeat mode. | |
int | mc_server_set_playback_state_command_received_cb (mc_server_h server, mc_server_playback_state_command_received_cb callback, void *user_data) TIZEN_DEPRECATED_API |
Sets the callback for receiving playback state command from client. | |
int | mc_server_unset_playback_state_command_received_cb (mc_server_h server) TIZEN_DEPRECATED_API |
Unsets the callback for receiving playback state command from client. | |
int | mc_server_set_playback_action_cmd_received_cb (mc_server_h server, mc_server_playback_action_cmd_received_cb callback, void *user_data) |
Sets the callback for receiving playback action command from client. | |
int | mc_server_unset_playback_action_cmd_received_cb (mc_server_h server) |
Unsets the callback for receiving playback action command from client. | |
int | mc_server_set_playback_position_cmd_received_cb (mc_server_h server, mc_server_playback_position_cmd_received_cb callback, void *user_data) |
Sets the callback for receiving playback position command from client. | |
int | mc_server_unset_playback_position_cmd_received_cb (mc_server_h server) |
Unsets the callback for receiving playback position command from client. | |
int | mc_server_set_shuffle_mode_cmd_received_cb (mc_server_h server, mc_server_shuffle_mode_cmd_received_cb callback, void *user_data) |
Sets the callback for receiving shuffle mode command from client. | |
int | mc_server_unset_shuffle_mode_cmd_received_cb (mc_server_h server) |
Unsets the callback for receiving shuffle mode command from client. | |
int | mc_server_set_repeat_mode_cmd_received_cb (mc_server_h server, mc_server_repeat_mode_cmd_received_cb callback, void *user_data) |
Sets the callback for receiving repeat mode command from client. | |
int | mc_server_unset_repeat_mode_cmd_received_cb (mc_server_h server) |
Unsets the callback for receiving repeat mode command from client. | |
int | mc_server_set_custom_command_received_cb (mc_server_h server, mc_server_custom_command_received_cb callback, void *user_data) TIZEN_DEPRECATED_API |
Sets the callback for receiving custom command from client. | |
int | mc_server_unset_custom_command_received_cb (mc_server_h server) TIZEN_DEPRECATED_API |
Unsets the callback for receiving custom command from client. | |
int | mc_server_send_command_reply (mc_server_h server, const char *client_name, int result_code, bundle *data) TIZEN_DEPRECATED_API |
Sends a reply for the requested command to the client. | |
int | mc_server_set_playlist_cmd_received_cb (mc_server_h server, mc_server_playlist_cmd_received_cb callback, void *user_data) |
Sets the callback for receiving playlist command from client. | |
int | mc_server_unset_playlist_cmd_received_cb (mc_server_h server) |
Unsets the callback for receiving playlist command from client. | |
int | mc_server_set_custom_cmd_received_cb (mc_server_h server, mc_server_custom_cmd_received_cb callback, void *user_data) |
Sets the callback for receiving custom command from client. | |
int | mc_server_unset_custom_cmd_received_cb (mc_server_h server) |
Unsets the callback for receiving custom command from client. | |
int | mc_server_send_cmd_reply (mc_server_h server, const char *client_name, const char *request_id, int result_code, bundle *data) |
Replies the result of the requested command to the client. | |
int | mc_server_foreach_client (mc_server_h server, mc_activated_client_cb callback, void *user_data) |
Retrieves all created clients. | |
int | mc_server_send_custom_event (mc_server_h server, const char *client_name, const char *event, bundle *data, char **request_id) |
Sends the customized event with the bundle data. | |
int | mc_server_set_event_reply_received_cb (mc_server_h server, mc_server_event_reply_received_cb callback, void *user_data) |
Sets the callback for receiving the result of the event from the media controller client. | |
int | mc_server_unset_event_reply_received_cb (mc_server_h server) |
Unsets the callback for receiving event reply of the media controller client. | |
int | mc_server_destroy (mc_server_h server) |
Destroys media controller server. | |
int | mc_server_create_playlist (mc_server_h server, const char *playlist_name, mc_playlist_h *playlist) |
Creates a new playlist with the given name. | |
int | mc_server_add_item_to_playlist (mc_server_h server, mc_playlist_h playlist, const char *index, mc_meta_e attribute, const char *value) |
Adds a new item to the playlist. | |
int | mc_server_update_playlist_done (mc_server_h server, mc_playlist_h playlist) |
Registers items to the playlist. | |
int | mc_server_delete_playlist (mc_server_h server, mc_playlist_h playlist) |
Deletes the playlist of the media controller server. | |
int | mc_server_foreach_playlist (mc_server_h server, mc_playlist_cb callback, void *user_data) |
Retrieves all playlists of the media controller server. | |
Typedefs | |
typedef void(* | mc_server_playback_state_command_received_cb )(const char *client_name, mc_playback_states_e state, void *user_data) |
Called when the server receives the playback state from the client. | |
typedef void(* | mc_server_playback_action_cmd_received_cb )(const char *client_name, const char *request_id, mc_playback_action_e action, void *user_data) |
Called when the server receives the playback action command from the client. | |
typedef void(* | mc_server_playback_position_cmd_received_cb )(const char *client_name, const char *request_id, unsigned long long position, void *user_data) |
Called when the server receives the playback position from the client. | |
typedef void(* | mc_server_shuffle_mode_cmd_received_cb )(const char *client_name, const char *request_id, mc_shuffle_mode_e shuffle_mode, void *user_data) |
Called when the server receives the shuffle mode from the client. | |
typedef void(* | mc_server_repeat_mode_cmd_received_cb )(const char *client_name, const char *request_id, mc_repeat_mode_e repeat_mode, void *user_data) |
Called when the server receives the repeat mode from the client. | |
typedef void(* | mc_server_custom_command_received_cb )(const char *client_name, const char *command, bundle *data, void *user_data) TIZEN_DEPRECATED_API |
Called when the Server receives custom command from the client. | |
typedef void(* | mc_server_playlist_cmd_received_cb )(const char *client_name, const char *request_id, const char *playlist_name, const char *index, mc_playback_action_e action, unsigned long long position, void *user_data) |
Called when the Server receives playlist command from the client. | |
typedef void(* | mc_server_custom_cmd_received_cb )(const char *client_name, const char *request_id, const char *command, bundle *data, void *user_data) |
Called when the Server receives custom command from the client. | |
typedef bool(* | mc_activated_client_cb )(const char *client_name, void *user_data) |
Called when requesting the list of created clients. | |
typedef void(* | mc_server_event_reply_received_cb )(const char *client_name, const char *request_id, int result_code, bundle *data, void *user_data) |
Called when the result of the event from the client is received. |
typedef bool(* mc_activated_client_cb)(const char *client_name, void *user_data) |
Called when requesting the list of created clients.
[in] | client_name | The app_id of the created media controller client. |
[in] | user_data | The user data passed from the mc_client_foreach_server() function |
true
to continue with the next iteration of the loop, otherwise false
to break out of the looptypedef void(* mc_server_custom_cmd_received_cb)(const char *client_name, const char *request_id, const char *command, bundle *data, void *user_data) |
Called when the Server receives custom command from the client.
This callback is called when server receives custom command from client. If you want to reply to the command, call mc_server_send_cmd_reply() function.
[in] | client_name | The app_id of the media controller client. |
[in] | request_id | The id of the command request |
[in] | command | The received command. |
[in] | data | The extra data |
[in] | user_data | The user data passed from the mc_server_set_custom_cmd_received_cb() function |
typedef void(* mc_server_custom_command_received_cb)(const char *client_name, const char *command, bundle *data, void *user_data) TIZEN_DEPRECATED_API |
Called when the Server receives custom command from the client.
This callback is called when server receives custom command from client. If there is reply for command, call mc_server_send_command_reply() function.
[in] | client_name | The app_id of the media controller client. |
[in] | command | The received command. |
[in] | data | The extra data |
[in] | user_data | The user data passed from the mc_server_set_custom_command_received_cb() function |
typedef void(* mc_server_event_reply_received_cb)(const char *client_name, const char *request_id, int result_code, bundle *data, void *user_data) |
Called when the result of the event from the client is received.
[in] | client_name | The app_id of the media controller client which sent the reply. It can be used only in the callback. To use outside, make a copy. |
[in] | request_id | The id of the event request |
[in] | result_code | The result code of the event |
[in] | data | The extra data |
[in] | user_data | The user data passed from the mc_server_set_event_reply_received_cb() function |
typedef void(* mc_server_playback_action_cmd_received_cb)(const char *client_name, const char *request_id, mc_playback_action_e action, void *user_data) |
Called when the server receives the playback action command from the client.
[in] | client_name | The app_id of the media controller client. |
[in] | request_id | The request_id of the media controller client. |
[in] | action | The received playback action |
[in] | user_data | The user data passed from the mc_server_set_playback_action_cmd_received_cb() function |
typedef void(* mc_server_playback_position_cmd_received_cb)(const char *client_name, const char *request_id, unsigned long long position, void *user_data) |
Called when the server receives the playback position from the client.
[in] | client_name | The app_id of the media controller client. |
[in] | request_id | The request_id of the media controller client. |
[in] | position | The received playback position (milliseconds) |
[in] | user_data | The user data passed from the mc_server_set_playback_position_cmd_received_cb() function |
typedef void(* mc_server_playback_state_command_received_cb)(const char *client_name, mc_playback_states_e state, void *user_data) |
Called when the server receives the playback state from the client.
[in] | client_name | The app_id of the media controller client. |
[in] | state | The received playback state |
[in] | user_data | The user data passed from the mc_server_set_playback_state_command_received_cb() function |
typedef void(* mc_server_playlist_cmd_received_cb)(const char *client_name, const char *request_id, const char *playlist_name, const char *index, mc_playback_action_e action, unsigned long long position, void *user_data) |
Called when the Server receives playlist command from the client.
[in] | client_name | The app_id of the media controller client. |
[in] | request_id | The request_id of the media controller client. |
[in] | playlist_name | The name of the server playlist. |
[in] | index | The index of the media in playlist. |
[in] | action | The received playback action |
[in] | position | The received playback position (milliseconds) |
[in] | user_data | The user data passed from the mc_server_set_playlist_cmd_received_cb() function |
typedef void(* mc_server_repeat_mode_cmd_received_cb)(const char *client_name, const char *request_id, mc_repeat_mode_e repeat_mode, void *user_data) |
Called when the server receives the repeat mode from the client.
[in] | client_name | The app_id of the media controller client. |
[in] | request_id | The request_id of the media controller client. |
[in] | repeat_mode | The received repeat mode |
[in] | user_data | The user data passed from the mc_server_set_repeat_mode_cmd_received_cb() function |
typedef void(* mc_server_shuffle_mode_cmd_received_cb)(const char *client_name, const char *request_id, mc_shuffle_mode_e shuffle_mode, void *user_data) |
Called when the server receives the shuffle mode from the client.
[in] | client_name | The app_id of the media controller client. |
[in] | request_id | The request_id of the media controller client. |
[in] | shuffle_mode | The received shuffle_mode |
[in] | user_data | The user data passed from the mc_server_set_shuffle_mode_cmd_received_cb() function |
int mc_server_add_item_to_playlist | ( | mc_server_h | server, |
mc_playlist_h | playlist, | ||
const char * | index, | ||
mc_meta_e | attribute, | ||
const char * | value | ||
) |
Adds a new item to the playlist.
[in] | server | The handle to media controller server |
[in] | playlist | The handle to the media controller playlist |
[in] | index | The index of the playlist item. It should not be NULL |
[in] | attribute | The key attribute name to set |
[in] | value | The value of the attribute |
0
on success, otherwise a negative error valueMEDIA_CONTROLLER_ERROR_NONE | Successful |
MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTROLLER_ERROR_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTROLLER_ERROR_PERMISSION_DENIED | Permission denied |
mc_server_update_playlist_done()
to register it. int mc_server_create | ( | mc_server_h * | server | ) |
Creates a media controller server.
[out] | server | The handle to media controller server |
0
on success, otherwise a negative error value MEDIA_CONTROLLER_ERROR_NONE | Successful |
MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTROLLER_ERROR_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTROLLER_ERROR_PERMISSION_DENIED | Permission denied |
int mc_server_create_playlist | ( | mc_server_h | server, |
const char * | playlist_name, | ||
mc_playlist_h * | playlist | ||
) |
Creates a new playlist with the given name.
[in] | server | The handle to media controller server |
[in] | playlist_name | The name of the created playlist. It should not be NULL. |
[out] | playlist | The handle to the media controller playlist |
0
on success, otherwise a negative error valueMEDIA_CONTROLLER_ERROR_NONE | Successful |
MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTROLLER_ERROR_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTROLLER_ERROR_PERMISSION_DENIED | Permission denied |
mc_server_update_playlist_done()
to register it. int mc_server_delete_playlist | ( | mc_server_h | server, |
mc_playlist_h | playlist | ||
) |
Deletes the playlist of the media controller server.
[in] | server | The handle to media controller server |
[in] | playlist | The handle to the media controller playlist |
0
on success, otherwise a negative error valueMEDIA_CONTROLLER_ERROR_NONE | Successful |
MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTROLLER_ERROR_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTROLLER_ERROR_PERMISSION_DENIED | Permission denied |
int mc_server_destroy | ( | mc_server_h | server | ) |
Destroys media controller server.
[in] | server | The handle to media controller server |
0
on success, otherwise a negative error value METADATA_EXTRACTOR_ERROR_NONE | Successful |
METADATA_EXTRACTOR_ERROR_INVALID_PARAMETER | Invalid parameter |
int mc_server_foreach_client | ( | mc_server_h | server, |
mc_activated_client_cb | callback, | ||
void * | user_data | ||
) |
Retrieves all created clients.
This function gets all created media controller clients. The callback function will be invoked for every created media controller client. If there are no media controller clients, the callback will not be invoked.
[in] | server | The handle to media controller server |
[in] | callback | The callback function to be invoked, will be called for each client |
[in] | user_data | The user data to be passed to the callback function |
0
on success, otherwise a negative error value MEDIA_CONTROLLER_ERROR_NONE | Successful |
MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTROLLER_ERROR_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTROLLER_ERROR_PERMISSION_DENIED | Permission denied |
int mc_server_foreach_playlist | ( | mc_server_h | server, |
mc_playlist_cb | callback, | ||
void * | user_data | ||
) |
Retrieves all playlists of the media controller server.
This function gets all playlists of the media controller server. The callback function will be invoked for every retrieved playlist. If there are no playlists, callback will not be invoked.
[in] | server | The handle to media controller server |
[in] | callback | The callback function to be invoked, will be called for each playlist |
[in] | user_data | The user data to be passed to the callback function |
0
on success, otherwise a negative error valueMEDIA_CONTROLLER_ERROR_NONE | Successful |
MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTROLLER_ERROR_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTROLLER_ERROR_PERMISSION_DENIED | Permission denied |
int mc_server_send_cmd_reply | ( | mc_server_h | server, |
const char * | client_name, | ||
const char * | request_id, | ||
int | result_code, | ||
bundle * | data | ||
) |
Replies the result of the requested command to the client.
[in] | server | The handle to media controller server |
[in] | client_name | The app_id of the media controller client |
[in] | request_id | The id of the command request, received in the mc_server_custom_cmd_received_cb() function. |
[in] | result_code | The result code of custom command |
[in] | data | The extra data |
0
on success, otherwise a negative error value MEDIA_CONTROLLER_ERROR_NONE | Successful |
MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTROLLER_ERROR_PERMISSION_DENIED | Permission denied |
int mc_server_send_command_reply | ( | mc_server_h | server, |
const char * | client_name, | ||
int | result_code, | ||
bundle * | data | ||
) |
Sends a reply for the requested command to the client.
[in] | server | The handle to media controller server |
[in] | client_name | The app_id of the media controller client |
[in] | result_code | The result code of custom command |
[in] | data | The extra data |
0
on success, otherwise a negative error value MEDIA_CONTROLLER_ERROR_NONE | Successful |
MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTROLLER_ERROR_PERMISSION_DENIED | Permission denied |
int mc_server_send_custom_event | ( | mc_server_h | server, |
const char * | client_name, | ||
const char * | event, | ||
bundle * | data, | ||
char ** | request_id | ||
) |
Sends the customized event with the bundle data.
If the event is needed in the client, this function should be called. data is a bundle.
[in] | server | The handle to media controller server |
[in] | client_name | The name of the client which receive the event |
[in] | event | The name of the event |
[in] | data | The data can include other information associated with the event |
[out] | request_id | The id of the event request, it will be passed to the mc_server_event_reply_received_cb() function |
0
on success, otherwise a negative error value MEDIA_CONTROLLER_ERROR_NONE | Successful |
MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTROLLER_ERROR_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTROLLER_ERROR_PERMISSION_DENIED | Permission denied |
int mc_server_set_custom_cmd_received_cb | ( | mc_server_h | server, |
mc_server_custom_cmd_received_cb | callback, | ||
void * | user_data | ||
) |
Sets the callback for receiving custom command from client.
[in] | server | The handle to media controller server |
[in] | callback | The callback to be invoked when media controller server receives custom command from client. |
[in] | user_data | The user data to be passed to the callback function |
0
on success, otherwise a negative error value MEDIA_CONTROLLER_ERROR_NONE | Successful |
MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTROLLER_ERROR_PERMISSION_DENIED | Permission denied |
int mc_server_set_custom_command_received_cb | ( | mc_server_h | server, |
mc_server_custom_command_received_cb | callback, | ||
void * | user_data | ||
) |
Sets the callback for receiving custom command from client.
[in] | server | The handle to media controller server |
[in] | callback | The callback to be invoked when media controller server receives custom command from client. |
[in] | user_data | The user data to be passed to the callback function |
0
on success, otherwise a negative error value MEDIA_CONTROLLER_ERROR_NONE | Successful |
MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTROLLER_ERROR_PERMISSION_DENIED | Permission denied |
int mc_server_set_event_reply_received_cb | ( | mc_server_h | server, |
mc_server_event_reply_received_cb | callback, | ||
void * | user_data | ||
) |
Sets the callback for receiving the result of the event from the media controller client.
The media controller server which calls this function will receive the result of the event from all media controller clients. The media controller server can send event by using mc_server_send_custom_event().
[in] | server | The handle to the media controller server |
[in] | callback | The callback to be invoked when the reply is received |
[in] | user_data | The user data to be passed to the callback function |
0
on success, otherwise a negative error value MEDIA_CONTROLLER_ERROR_NONE | Successful |
MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTROLLER_ERROR_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTROLLER_ERROR_PERMISSION_DENIED | Permission denied |
int mc_server_set_metadata | ( | mc_server_h | server, |
mc_meta_e | attribute, | ||
const char * | value | ||
) |
Sets the metadata to update the latest metadata info.
[in] | server | The handle to media controller server |
[in] | attribute | The key attribute name to set |
[in] | value | The value of the attribute |
0
on success, otherwise a negative error value MEDIA_CONTROLLER_ERROR_NONE | Successful |
MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTROLLER_ERROR_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTROLLER_ERROR_PERMISSION_DENIED | Permission denied |
int mc_server_set_playback_action_cmd_received_cb | ( | mc_server_h | server, |
mc_server_playback_action_cmd_received_cb | callback, | ||
void * | user_data | ||
) |
Sets the callback for receiving playback action command from client.
[in] | server | The handle to media controller server |
[in] | callback | The callback to be invoked when media controller server receives playback action from client. |
[in] | user_data | The user data to be passed to the callback function |
0
on success, otherwise a negative error value MEDIA_CONTROLLER_ERROR_NONE | Successful |
MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTROLLER_ERROR_PERMISSION_DENIED | Permission denied |
int mc_server_set_playback_position | ( | mc_server_h | server, |
unsigned long long | position | ||
) |
Sets the playback position to update the latest playback info.
[in] | server | The handle to media controller server |
[in] | position | The position to set in milliseconds |
0
on success, otherwise a negative error value MEDIA_CONTROLLER_ERROR_NONE | Successful |
MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTROLLER_ERROR_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTROLLER_ERROR_PERMISSION_DENIED | Permission denied |
int mc_server_set_playback_position_cmd_received_cb | ( | mc_server_h | server, |
mc_server_playback_position_cmd_received_cb | callback, | ||
void * | user_data | ||
) |
Sets the callback for receiving playback position command from client.
[in] | server | The handle to media controller server |
[in] | callback | The callback to be invoked when media controller server receives position command from client. |
[in] | user_data | The user data to be passed to the callback function |
0
on success, otherwise a negative error value MEDIA_CONTROLLER_ERROR_NONE | Successful |
MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTROLLER_ERROR_PERMISSION_DENIED | Permission denied |
int mc_server_set_playback_state | ( | mc_server_h | server, |
mc_playback_states_e | state | ||
) |
Sets the playback state to update the latest state info.
[in] | server | The handle to media controller server |
[in] | state | The state to set |
0
on success, otherwise a negative error value MEDIA_CONTROLLER_ERROR_NONE | Successful |
MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTROLLER_ERROR_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTROLLER_ERROR_PERMISSION_DENIED | Permission denied |
int mc_server_set_playback_state_command_received_cb | ( | mc_server_h | server, |
mc_server_playback_state_command_received_cb | callback, | ||
void * | user_data | ||
) |
Sets the callback for receiving playback state command from client.
[in] | server | The handle to media controller server |
[in] | callback | The callback to be invoked when media controller server receives playback command from client. |
[in] | user_data | The user data to be passed to the callback function |
0
on success, otherwise a negative error value MEDIA_CONTROLLER_ERROR_NONE | Successful |
MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTROLLER_ERROR_PERMISSION_DENIED | Permission denied |
int mc_server_set_playlist_cmd_received_cb | ( | mc_server_h | server, |
mc_server_playlist_cmd_received_cb | callback, | ||
void * | user_data | ||
) |
Sets the callback for receiving playlist command from client.
[in] | server | The handle to media controller server |
[in] | callback | The callback to be invoked when media controller server receives playlist command from client. |
[in] | user_data | The user data to be passed to the callback function |
0
on success, otherwise a negative error value MEDIA_CONTROLLER_ERROR_NONE | Successful |
MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTROLLER_ERROR_PERMISSION_DENIED | Permission denied |
int mc_server_set_playlist_item_index | ( | mc_server_h | server, |
const char * | index | ||
) |
Sets the index of the current playing media in the playlist to update the latest playback info.
.
If a media controller server has a playlist, the server can register and share it with media controller client. A playlist is a set of "index" and "media metadata".
The media controller server can let media controller clients know the index of current playing media by using this function.
[in] | server | The handle to media controller server |
[in] | index | The index of the current playing media in the playlist |
0
on success, otherwise a negative error value MEDIA_CONTROLLER_ERROR_NONE | Successful |
MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTROLLER_ERROR_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTROLLER_ERROR_PERMISSION_DENIED | Permission denied |
int mc_server_set_repeat_mode_cmd_received_cb | ( | mc_server_h | server, |
mc_server_repeat_mode_cmd_received_cb | callback, | ||
void * | user_data | ||
) |
Sets the callback for receiving repeat mode command from client.
[in] | server | The handle to media controller server |
[in] | callback | The callback to be invoked when media controller server receives repeat mode from client. |
[in] | user_data | The user data to be passed to the callback function |
0
on success, otherwise a negative error value MEDIA_CONTROLLER_ERROR_NONE | Successful |
MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTROLLER_ERROR_PERMISSION_DENIED | Permission denied |
int mc_server_set_shuffle_mode_cmd_received_cb | ( | mc_server_h | server, |
mc_server_shuffle_mode_cmd_received_cb | callback, | ||
void * | user_data | ||
) |
Sets the callback for receiving shuffle mode command from client.
[in] | server | The handle to media controller server |
[in] | callback | The callback to be invoked when media controller server receives shuffle mode from client. |
[in] | user_data | The user data to be passed to the callback function |
0
on success, otherwise a negative error value MEDIA_CONTROLLER_ERROR_NONE | Successful |
MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTROLLER_ERROR_PERMISSION_DENIED | Permission denied |
int mc_server_unset_custom_cmd_received_cb | ( | mc_server_h | server | ) |
Unsets the callback for receiving custom command from client.
[in] | server | The handle to media controller server |
0
on success, otherwise a negative error value MEDIA_CONTROLLER_ERROR_NONE | Successful |
MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTROLLER_ERROR_PERMISSION_DENIED | Permission denied |
int mc_server_unset_custom_command_received_cb | ( | mc_server_h | server | ) |
Unsets the callback for receiving custom command from client.
[in] | server | The handle to media controller server |
0
on success, otherwise a negative error value MEDIA_CONTROLLER_ERROR_NONE | Successful |
MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTROLLER_ERROR_PERMISSION_DENIED | Permission denied |
int mc_server_unset_event_reply_received_cb | ( | mc_server_h | server | ) |
Unsets the callback for receiving event reply of the media controller client.
[in] | server | The handle to the media controller server |
0
on success, otherwise a negative error value MEDIA_CONTROLLER_ERROR_NONE | Successful |
MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTROLLER_ERROR_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTROLLER_ERROR_PERMISSION_DENIED | Permission denied |
int mc_server_unset_playback_action_cmd_received_cb | ( | mc_server_h | server | ) |
Unsets the callback for receiving playback action command from client.
[in] | server | The handle to media controller server |
0
on success, otherwise a negative error value MEDIA_CONTROLLER_ERROR_NONE | Successful |
MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTROLLER_ERROR_PERMISSION_DENIED | Permission denied |
int mc_server_unset_playback_position_cmd_received_cb | ( | mc_server_h | server | ) |
Unsets the callback for receiving playback position command from client.
[in] | server | The handle to media controller server |
0
on success, otherwise a negative error value MEDIA_CONTROLLER_ERROR_NONE | Successful |
MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTROLLER_ERROR_PERMISSION_DENIED | Permission denied |
Unsets the callback for receiving playback state command from client.
[in] | server | The handle to media controller server |
0
on success, otherwise a negative error value MEDIA_CONTROLLER_ERROR_NONE | Successful |
MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTROLLER_ERROR_PERMISSION_DENIED | Permission denied |
int mc_server_unset_playlist_cmd_received_cb | ( | mc_server_h | server | ) |
Unsets the callback for receiving playlist command from client.
[in] | server | The handle to media controller server |
0
on success, otherwise a negative error value MEDIA_CONTROLLER_ERROR_NONE | Successful |
MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTROLLER_ERROR_PERMISSION_DENIED | Permission denied |
int mc_server_unset_repeat_mode_cmd_received_cb | ( | mc_server_h | server | ) |
Unsets the callback for receiving repeat mode command from client.
[in] | server | The handle to media controller server |
0
on success, otherwise a negative error value MEDIA_CONTROLLER_ERROR_NONE | Successful |
MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTROLLER_ERROR_PERMISSION_DENIED | Permission denied |
int mc_server_unset_shuffle_mode_cmd_received_cb | ( | mc_server_h | server | ) |
Unsets the callback for receiving shuffle mode command from client.
[in] | server | The handle to media controller server |
0
on success, otherwise a negative error value MEDIA_CONTROLLER_ERROR_NONE | Successful |
MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTROLLER_ERROR_PERMISSION_DENIED | Permission denied |
int mc_server_update_metadata | ( | mc_server_h | server | ) |
Updates the modified metadata info.
If this function is called, the updated metadata will be sent to all clients.
[in] | server | The handle to media controller server |
0
on success, otherwise a negative error value MEDIA_CONTROLLER_ERROR_NONE | Successful |
MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTROLLER_ERROR_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTROLLER_ERROR_PERMISSION_DENIED | Permission denied |
int mc_server_update_playback_info | ( | mc_server_h | server | ) |
Updates the modified playback info.
If this function is called, the updated playback information will be sent to the controller.
[in] | server | The handle to media controller server |
0
on success, otherwise a negative error value MEDIA_CONTROLLER_ERROR_NONE | Successful |
MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTROLLER_ERROR_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTROLLER_ERROR_PERMISSION_DENIED | Permission denied |
int mc_server_update_playlist_done | ( | mc_server_h | server, |
mc_playlist_h | playlist | ||
) |
Registers items to the playlist.
[in] | server | The handle to media controller server |
[in] | playlist | The handle to the media controller playlist |
0
on success, otherwise a negative error valueMEDIA_CONTROLLER_ERROR_NONE | Successful |
MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTROLLER_ERROR_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTROLLER_ERROR_PERMISSION_DENIED | Permission denied |
int mc_server_update_repeat_mode | ( | mc_server_h | server, |
mc_repeat_mode_e | mode | ||
) |
Updates the modified repeat mode.
If this function is called, the updated mode information will be sent to all clients.
[in] | server | The handle to media controller server |
[in] | mode | The repeat mode to update the latest status |
0
on success, otherwise a negative error value MEDIA_CONTROLLER_ERROR_NONE | Successful |
MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTROLLER_ERROR_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTROLLER_ERROR_PERMISSION_DENIED | Permission denied |
int mc_server_update_shuffle_mode | ( | mc_server_h | server, |
mc_shuffle_mode_e | mode | ||
) |
Updates the modified shuffle mode.
If this function is called, the updated mode information will be sent to all clients.
[in] | server | The handle to media controller server |
[in] | mode | The shuffle mode to update the latest status |
0
on success, otherwise a negative error value MEDIA_CONTROLLER_ERROR_NONE | Successful |
MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTROLLER_ERROR_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTROLLER_ERROR_PERMISSION_DENIED | Permission denied |