Tizen Native API
|
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_update_playback_info (mc_server_h server) |
Update 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) |
Update the modified metadata info. | |
int | mc_server_update_shuffle_mode (mc_server_h server, mc_shuffle_mode_e mode) |
Update 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) |
Sets the callback for receiving playback state command from client. | |
int | mc_server_unset_playback_state_command_received_cb (mc_server_h server) |
Unsets the callback for receiving playback state 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) |
Sets the callback for receiving custom command from client. | |
int | mc_server_unset_custom_command_received_cb (mc_server_h server) |
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) |
Sends a reply for the requested command to the client. | |
int | mc_server_destroy (mc_server_h server) |
Destroys 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 received playback state command from the client. | |
typedef void(* | mc_server_custom_command_received_cb )(const char *client_name, const char *command, bundle *data, void *user_data) |
Called when the Server received custom command from the client. |
The Media Controller Server API provides functions for sending the server information to the client.
Required Header
#include <media_controller_server.h>
Overview
The Media Controller Server API allows you to send the playback info(mc_server_set_playback_state(), mc_server_set_playback_position), or the metadata(mc_server_set_metadata()). and to receive the custom command(mc_server_set_custom_command_received_cb()), to update the status information on the latest server(mc_server_update_playback_info, mc_server_update_metadata), or to create/destroy the handle(mc_server_create()/mc_server_destroy()).
Typedef Documentation
typedef void(* mc_server_custom_command_received_cb)(const char *client_name, const char *command, bundle *data, void *user_data) |
Called when the Server received custom command from the client.
- Since :
- 2.4
This callback is called when server received custom recommand from client. If there is reply for command, call mc_server_send_command_reply() function.
- Parameters:
-
[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() fuction
- Precondition:
- mc_server_set_custom_command_received_cb()
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 received playback state command from the client.
- Since :
- 2.4
This callback is called when server received playback state recommand from client.
- Parameters:
-
[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() fuction
- Precondition:
- mc_server_set_playback_state_command_received_cb()
Function Documentation
int mc_server_create | ( | mc_server_h * | server | ) |
Creates a media controller server.
- Since :
- 2.4
- Remarks:
- You must release server using mc_server_destroy().
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/mediacontroller.server
- Parameters:
-
[out] server The handle to media controller server
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_CONTROLLER_ERROR_NONE Successful MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_CONTROLLER_ERROR_OUT_OF_MEMORY Not enough memory is available MEDIA_CONTROLLER_ERROR_PERMISSION_DENIED Permission denied
- See also:
- mc_server_destroy()
int mc_server_destroy | ( | mc_server_h | server | ) |
Destroys media controller server.
- Since :
- 2.4
- Parameters:
-
[in] server The handle to media controller server
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
METADATA_EXTRACTOR_ERROR_NONE Successful METADATA_EXTRACTOR_ERROR_INVALID_PARAMETER Invalid parameter
- Precondition:
- Create a media controller server handle by calling mc_server_create().
- See also:
- mc_server_create()
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.
- Since :
- 2.4
- Remarks:
- When server recieve command, this API can be called by mc_server_custom_command_received_cb().
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/mediacontroller.server
- Parameters:
-
[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
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_CONTROLLER_ERROR_NONE Successful MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_CONTROLLER_ERROR_PERMISSION_DENIED Permission denied
- Precondition:
- Create a media controller server handle by calling mc_server_create().
- mc_server_set_custom_command_received_cb()
- See also:
- mc_server_create()
- mc_server_destroy()
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.
- Since :
- 2.4
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/mediacontroller.server
- Parameters:
-
[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
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_CONTROLLER_ERROR_NONE Successful MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_CONTROLLER_ERROR_PERMISSION_DENIED Permission denied
- Precondition:
- Create a media controller server handle by calling mc_server_create().
- See also:
- mc_server_create()
- mc_server_destroy()
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.
- Since :
- 2.4
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/mediacontroller.server
- Parameters:
-
[in] server The handle to media controller server [in] attribute The key attribute name to set [in] value The value of the attribute
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_CONTROLLER_ERROR_NONE Successful MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_CONTROLLER_ERROR_OUT_OF_MEMORY File does not exist MEDIA_CONTROLLER_ERROR_PERMISSION_DENIED Permission denied
- Precondition:
- Create a media controller server handle by calling mc_server_create().
- Postcondition:
- Apply the updated metadata information by calling mc_server_update_metadata().
int mc_server_set_playback_position | ( | mc_server_h | server, |
unsigned long long | position | ||
) |
Sets the playback position to update the latest playback info.
- Since :
- 2.4
- Parameters:
-
[in] server The handle to media controller server [in] position The position to set in milliseconds
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_CONTROLLER_ERROR_NONE Successful MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_CONTROLLER_ERROR_OUT_OF_MEMORY File does not exist
- Precondition:
- Create a media controller server handle by calling mc_server_create().
- Postcondition:
- Apply the updated playback information by calling mc_server_update_playback_info().
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.
- Since :
- 2.4
- Parameters:
-
[in] server The handle to media controller server [in] state The state to set
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_CONTROLLER_ERROR_NONE Successful MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_CONTROLLER_ERROR_OUT_OF_MEMORY File does not exist
- Precondition:
- Create a media controller server handle by calling mc_server_create().
- Postcondition:
- Apply the updated playback information by calling mc_server_update_playback_info().
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.
- Since :
- 2.4
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/mediacontroller.server
- Parameters:
-
[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
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_CONTROLLER_ERROR_NONE Successful MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_CONTROLLER_ERROR_PERMISSION_DENIED Permission denied
- Precondition:
- Create a media controller server handle by calling mc_server_create().
- See also:
- mc_server_create()
- mc_server_destroy()
int mc_server_unset_custom_command_received_cb | ( | mc_server_h | server | ) |
Unsets the callback for receiving custom command from client.
- Since :
- 2.4
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/mediacontroller.server
- Parameters:
-
[in] server The handle to media controller server
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_CONTROLLER_ERROR_NONE Successful MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_CONTROLLER_ERROR_PERMISSION_DENIED Permission denied
- Precondition:
- Create a media controller server handle by calling mc_server_create().
- See also:
- mc_server_create()
- mc_server_destroy()
Unsets the callback for receiving playback state command from client.
- Since :
- 2.4
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/mediacontroller.server
- Parameters:
-
[in] server The handle to media controller server
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_CONTROLLER_ERROR_NONE Successful MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_CONTROLLER_ERROR_PERMISSION_DENIED Permission denied
- Precondition:
- Create a media controller server handle by calling mc_server_create().
- See also:
- mc_server_create()
- mc_server_destroy()
int mc_server_update_metadata | ( | mc_server_h | server | ) |
Update the modified metadata info.
If this API is called, the updated metadata will be sent to all controllers.
- Since :
- 2.4
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/mediacontroller.server
- Parameters:
-
[in] server The handle to media controller server
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_CONTROLLER_ERROR_NONE Successful MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_CONTROLLER_ERROR_OUT_OF_MEMORY File does not exist MEDIA_CONTROLLER_ERROR_PERMISSION_DENIED Permission denied
- Precondition:
- Create a media controller server handle by calling mc_server_create().
- See also:
- mc_server_create()
- mc_server_destroy()
int mc_server_update_playback_info | ( | mc_server_h | server | ) |
Update the modified playback info.
If this API is called, the updated playback information will be sent to the controller.
- Since :
- 2.4
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/mediacontroller.server
- Parameters:
-
[in] server The handle to media controller server
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_CONTROLLER_ERROR_NONE Successful MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_CONTROLLER_ERROR_OUT_OF_MEMORY File does not exist MEDIA_CONTROLLER_ERROR_PERMISSION_DENIED Permission denied
- Precondition:
- Create a media controller server handle by calling mc_server_create().
- See also:
- mc_server_create()
- mc_server_destroy()
int mc_server_update_repeat_mode | ( | mc_server_h | server, |
mc_repeat_mode_e | mode | ||
) |
Updates the modified repeat mode.
If this API is called, the updated mode information will be sent to all controllers.
- Since :
- 2.4
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/mediacontroller.server
- Parameters:
-
[in] server The handle to media controller server [in] mode The repeat mode to update the latest status
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_CONTROLLER_ERROR_NONE Successful MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_CONTROLLER_ERROR_OUT_OF_MEMORY File does not exist MEDIA_CONTROLLER_ERROR_PERMISSION_DENIED Permission denied
- Precondition:
- Create a media controller server handle by calling mc_server_create().
- See also:
- mc_server_create()
- mc_server_destroy()
int mc_server_update_shuffle_mode | ( | mc_server_h | server, |
mc_shuffle_mode_e | mode | ||
) |
Update the modified shuffle mode.
If this API is called, the updated mode information will be sent to all controllers.
- Since :
- 2.4
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/mediacontroller.server
- Parameters:
-
[in] server The handle to media controller server [in] mode The shuffle mode to update the latest status
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_CONTROLLER_ERROR_NONE Successful MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_CONTROLLER_ERROR_OUT_OF_MEMORY File does not exist MEDIA_CONTROLLER_ERROR_PERMISSION_DENIED Permission denied
- Precondition:
- Create a media controller server handle by calling mc_server_create().
- See also:
- mc_server_create()
- mc_server_destroy()