* <td>called during content buffering </td>
* </tr>
* <tr>
- * <td>player_set_progressive_download_message_cb()</td>
- * <td>player_unset_progressive_download_message_cb()</td>
- * <td>player_pd_message_cb()</td>
- * <td>called when a progressive download starts or completes</td>
- * </tr>
- * <tr>
* <td>player_set_subtitle_updated_cb()</td>
* <td>player_unset_subtitle_updated_cb()</td>
* <td>player_subtitle_updated_cb()</td>
} player_interrupted_code_e;
/**
- * @brief Enumeration for progressive download message type.
- * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
- */
-typedef enum {
- PLAYER_PD_STARTED = 0, /**< Progressive download is started */
- PLAYER_PD_COMPLETED, /**< Progressive download is completed */
-} player_pd_message_type_e;
-
-/**
* @brief Enumeration for display type.
* @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
*/
typedef enum {
PLAYER_DISPLAY_TYPE_OVERLAY = 0, /**< Overlay surface display */
- PLAYER_DISPLAY_TYPE_OBSOLETE_EVAS_WNONE = 1,
- /**< Obsolete. Acts as #PLAYER_DISPLAY_TYPE_NONE on Wearable,
- #PLAYER_DISPLAY_TYPE_EVAS in all other cases.
- This symbol was added for backward compatibility reasons.
- It should not be used. (Deprecated since 4.0) */
-
- PLAYER_DISPLAY_TYPE_OBSOLETE_NONE_WEVAS = 2,
- /**< Obsolete. Acts as #PLAYER_DISPLAY_TYPE_EVAS on Wearable 3.0 and later,
- #PLAYER_DISPLAY_TYPE_NONE in all other cases.
- This symbol was added for backward compatibility reasons.
- It should not be used. (Deprecated since 4.0) */
-
PLAYER_DISPLAY_TYPE_EVAS = 3, /**< Evas image object surface display (Since 4.0) */
PLAYER_DISPLAY_TYPE_NONE = 4, /**< This disposes of buffers (Since 4.0) */
} player_display_type_e;
typedef void (*player_buffering_cb)(int percent, void *user_data);
/**
- * @brief Called when progressive download is started or completed.
- * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
- * @param[in] type The message type for progressive download
- * @param[in] user_data The user data passed from the callback registration function
- */
-typedef void (*player_pd_message_cb)(player_pd_message_type_e type, void *user_data);
-
-/**
* @brief Called to notify the streaming variant information.
* @details The adaptive streaming protocol(hls, mpeg dash) can support variant stream condition.
* All the streaming variant information can be shared by calling player_foreach_adaptive_variant().
* @retval #PLAYER_ERROR_SOUND_POLICY Sound policy error
* @pre The player state must be set to #PLAYER_STATE_PLAYING by calling player_start() or set to #PLAYER_STATE_PAUSED by calling player_pause().
* @post The player state will be #PLAYER_STATE_READY.
- * @post The downloading will be aborted if you use progressive download.
* @see player_start()
* @see player_pause()
*/
int player_unset_buffering_cb(player_h player);
/**
- * @deprecated Deprecated since 4.0.
- * @brief Sets a path to download, progressively.
- * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
- * @remarks Progressive download will be started when you invoke player_start().
- * @remarks This function must be called before calling the player_prepare() or player_prepare_async() to reflect the download path when the player is building.
- * @remarks The mediastorage privilege(http://tizen.org/privilege/mediastorage) must be added if any files are used to download and play located in the internal storage.
- * @remarks The externalstorage privilege(http://tizen.org/privilege/externalstorage) must be added if any files are used to download and play located in the external storage.
- *
- * @param[in] player The handle to the media player
- * @param[in] path The absolute path to download
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #PLAYER_ERROR_NONE Successful
- * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
- * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
- * @if WEARABLE @retval #PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE Unsupported feature @endif
- * @retval #PLAYER_ERROR_PERMISSION_DENIED Permission denied
- * @pre The player state must be set to #PLAYER_STATE_IDLE by calling player_create() or player_unprepare().
- */
-int player_set_progressive_download_path(player_h player, const char *path) TIZEN_DEPRECATED_API;
-
-/**
- * @deprecated Deprecated since 4.0.
- * @brief Gets the status of progressive download.
- * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
- * @param[in] player The handle to the media player
- * @param[out] current The current download position (bytes)
- * @param[out] total_size The total size of the file (bytes)
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #PLAYER_ERROR_NONE Successful
- * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
- * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
- * @pre The progressive download path must be set by calling player_set_progressive_download_path().
- * @pre The player state must be set to #PLAYER_STATE_PLAYING by calling player_start() or set to #PLAYER_STATE_PAUSED by calling player_pause().
- */
-int player_get_progressive_download_status(player_h player, unsigned long *current, unsigned long *total_size) TIZEN_DEPRECATED_API;
-
-/**
- * @deprecated Deprecated since 4.0.
- * @brief Sets a callback function to be invoked when progressive download is started or completed.
- * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
- * @param[in] player The handle to the media player
- * @param[in] callback The callback function to register
- * @param[in] user_data The user data to be passed to the callback function
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #PLAYER_ERROR_NONE Successful
- * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
- * @if WEARABLE @retval #PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE Unsupported feature @endif
- * @pre The path to download must be set by calling player_set_progressive_download_path().
- * @post player_pd_message_cb() will be invoked.
- */
-int player_set_progressive_download_message_cb(player_h player, player_pd_message_cb callback, void *user_data) TIZEN_DEPRECATED_API;
-
-/**
- * @deprecated Deprecated since 4.0.
- * @brief Unsets the progressive download message callback function.
- * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
- * @param[in] player The handle to the media player
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #PLAYER_ERROR_NONE Successful
- * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
- */
-int player_unset_progressive_download_message_cb(player_h player) TIZEN_DEPRECATED_API;
-
-/**
* @}
*/
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
-typedef enum {
- TIZEN_PROFILE_UNKNOWN = 0,
- TIZEN_PROFILE_MOBILE = 0x1,
- TIZEN_PROFILE_WEARABLE = 0x2,
- TIZEN_PROFILE_TV = 0x4,
- TIZEN_PROFILE_IVI = 0x8,
- TIZEN_PROFILE_COMMON = 0x10,
-} tizen_profile_t;
typedef struct {
tbm_fd tfd[MUSE_NUM_FD];
return PLAYER_ERROR_NONE;
}
-static tizen_profile_t _get_tizen_profile()
-{
- char *profileName;
- static tizen_profile_t profile = TIZEN_PROFILE_UNKNOWN;
-
- if (__builtin_expect(profile != TIZEN_PROFILE_UNKNOWN, 1))
- return profile;
-
- system_info_get_platform_string("http://tizen.org/feature/profile", &profileName);
- switch (*profileName) {
- case 'm':
- case 'M':
- profile = TIZEN_PROFILE_MOBILE;
- break;
- case 'w':
- case 'W':
- profile = TIZEN_PROFILE_WEARABLE;
- break;
- case 't':
- case 'T':
- profile = TIZEN_PROFILE_TV;
- break;
- case 'i':
- case 'I':
- profile = TIZEN_PROFILE_IVI;
- break;
- default: // common or unknown ==> ALL ARE COMMON.
- profile = TIZEN_PROFILE_COMMON;
- }
- free(profileName);
-
- return profile;
-}
-
static int _get_current_state(player_cli_s *pc, player_state_e *pstate)
{
PLAYER_INSTANCE_CHECK(pc);
{
}
-static void __pd_cb_handler(callback_cb_info_s * cb_info, _player_recv_data *recv_data)
-{
- int type;
- muse_player_event_e ev = MUSE_PLAYER_EVENT_TYPE_PD;
-
- if (player_msg_get(type, recv_data->buffer))
- ((player_pd_message_cb) cb_info->user_cb[ev]) (type, cb_info->user_data[ev]);
-}
-
static void __supported_audio_effect_cb_handler(callback_cb_info_s * cb_info, _player_recv_data *recv_data)
{
}
__media_packet_video_frame_cb_handler, /* MUSE_PLAYER_EVENT_TYPE_MEDIA_PACKET_VIDEO_FRAME */
__audio_frame_cb_handler, /* MUSE_PLAYER_EVENT_TYPE_AUDIO_FRAME */
__video_frame_render_error_cb_handler, /* MUSE_PLAYER_EVENT_TYPE_VIDEO_FRAME_RENDER_ERROR */
- __pd_cb_handler, /* MUSE_PLAYER_EVENT_TYPE_PD */
__supported_audio_effect_cb_handler, /* MUSE_PLAYER_EVENT_TYPE_SUPPORTED_AUDIO_EFFECT */
__supported_audio_effect_preset_cb_handler, /* MUSE_PLAYER_EVENT_TYPE_SUPPORTED_AUDIO_EFFECT_PRESET */
__missed_plugin_cb_handler, /* MUSE_PLAYER_EVENT_TYPE_MISSED_PLUGIN */
{
if ((event_id == MUSE_PLAYER_EVENT_TYPE_INTERRUPT) ||
(event_id == MUSE_PLAYER_EVENT_TYPE_BUFFERING) ||
- (event_id == MUSE_PLAYER_EVENT_TYPE_PD) ||
(event_id == MUSE_PLAYER_EVENT_TYPE_COMPLETE) ||
(event_id == MUSE_PLAYER_EVENT_TYPE_ERROR) ||
(event_id == MUSE_PLAYER_EVENT_TYPE_SERVICE_DISCONNECTED) ||
case PLAYER_DISPLAY_TYPE_OVERLAY:
*out_type = PLAYER_PRIVATE_DISPLAY_TYPE_OVERLAY;
break;
- case PLAYER_DISPLAY_TYPE_OBSOLETE_EVAS_WNONE:
- if (_get_tizen_profile() == TIZEN_PROFILE_WEARABLE)
- *out_type = PLAYER_PRIVATE_DISPLAY_TYPE_NONE;
- else
- *out_type = PLAYER_PRIVATE_DISPLAY_TYPE_EVAS;
- break;
- case PLAYER_DISPLAY_TYPE_OBSOLETE_NONE_WEVAS:
- if (_get_tizen_profile() == TIZEN_PROFILE_WEARABLE)
- *out_type = PLAYER_PRIVATE_DISPLAY_TYPE_EVAS;
- else
- *out_type = PLAYER_PRIVATE_DISPLAY_TYPE_NONE;
- break;
case PLAYER_DISPLAY_TYPE_EVAS:
*out_type = PLAYER_PRIVATE_DISPLAY_TYPE_EVAS;
break;
wl_win_msg_type wl_win;
char *wl_win_msg = (char *)&wl_win;
unsigned int wl_surface_id;
- player_private_display_type_e conv_type;
+ player_private_display_type_e conv_type = PLAYER_DISPLAY_TYPE_NONE;
unsigned int (*p_disp_set_wl_display)(int, void *) = NULL;
int arr_msg_len = 0;
#ifdef TIZEN_FEATURE_EVAS_RENDERER
PLAYER_VIDEO_SUPPORTABLE_CHECK(pc);
LOGD("ENTER type: %d", type);
- if (type == PLAYER_DISPLAY_TYPE_OBSOLETE_EVAS_WNONE ||
- type == PLAYER_DISPLAY_TYPE_OBSOLETE_NONE_WEVAS) {
- LOGW("DEPRECATION WARNING: display type(%d) is deprecated and will be removed from next release. Use newly defined type value instead.", type);
- }
/* before setting display, player state have to be checked. */
PLAYER_STATE_CHECK(pc, PLAYER_STATE_IDLE);
return ret;
}
-int player_set_progressive_download_path(player_h player, const char *path)
-{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(path);
- int ret = PLAYER_ERROR_NONE;
- muse_player_api_e api = MUSE_PLAYER_API_SET_PROGRESSIVE_DOWNLOAD_PATH;
- player_cli_s *pc = (player_cli_s *) player;
- char *ret_buf = NULL;
- char dw_path[MAX_URL_LEN] = {0, };
-
- LOGD("ENTER");
- LOGW("DEPRECATION WARNING: player_set_progressive_download_path() is deprecated and will be removed from next release.");
-
- if (!_player_check_network_availability())
- return PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE;
-
- if (_player_get_valid_path(path, dw_path) != PLAYER_ERROR_NONE)
- return PLAYER_ERROR_INVALID_PARAMETER;
-
- PLAYER_SEND_MSG(api, pc, ret_buf, ret, MUSE_TYPE_STRING, "dw_path", (const char*)dw_path);
- g_free(ret_buf);
- return ret;
-}
-
-int player_get_progressive_download_status(player_h player, unsigned long *pcurrent, unsigned long *ptotal_size)
-{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(pcurrent && ptotal_size);
- int ret = PLAYER_ERROR_NONE;
- muse_player_api_e api = MUSE_PLAYER_API_GET_PROGRESSIVE_DOWNLOAD_STATUS;
- player_cli_s *pc = (player_cli_s *) player;
- char *ret_buf = NULL;
- unsigned long current, total_size;
-
- LOGD("ENTER");
- LOGW("DEPRECATION WARNING: player_get_progressive_download_status() is deprecated and will be removed from next release.");
-
- PLAYER_SEND_MSG(api, pc, ret_buf, ret);
- if (ret == PLAYER_ERROR_NONE) {
- bool ret_val = true;
- ret_val = _player_get_param_value(ret_buf,
- MUSE_TYPE_POINTER, "current", (void *)¤t,
- MUSE_TYPE_POINTER, "total_size", (void *)&total_size,
- INVALID_MUSE_TYPE_VALUE);
- if (ret_val) {
- *pcurrent = current;
- *ptotal_size = total_size;
- } else {
- ret = PLAYER_ERROR_INVALID_OPERATION;
- }
- }
- g_free(ret_buf);
- return ret;
-
-}
-
int player_capture_video(player_h player, player_video_captured_cb callback, void *user_data)
{
PLAYER_INSTANCE_CHECK(player);
return __unset_callback(MUSE_PLAYER_EVENT_TYPE_SUBTITLE, player);
}
-int player_set_progressive_download_message_cb(player_h player, player_pd_message_cb callback, void *user_data)
-{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(callback);
- int ret = PLAYER_ERROR_NONE;
- player_cli_s *pc = (player_cli_s *) player;
- muse_player_api_e api = MUSE_PLAYER_API_SET_CALLBACK;
- char *ret_buf = NULL;
- muse_player_event_e type = MUSE_PLAYER_EVENT_TYPE_PD;
- int set = 1;
-
- LOGD("ENTER");
- LOGW("DEPRECATION WARNING: player_set_progressive_download_message_cb() is deprecated and will be removed from next release.");
-
- if (!_player_check_network_availability())
- return PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE;
-
- PLAYER_SEND_MSG(api, pc, ret_buf, ret,
- MUSE_TYPE_INT, "type", type,
- MUSE_TYPE_INT, "set", set);
-
- if (ret == PLAYER_ERROR_NONE) {
- pc->cb_info->user_cb[type] = callback;
- pc->cb_info->user_data[type] = user_data;
- LOGI("Event type : %d ", type);
- }
-
- g_free(ret_buf);
- return ret;
-}
-
-int player_unset_progressive_download_message_cb(player_h player)
-{
- PLAYER_INSTANCE_CHECK(player);
- int ret = PLAYER_ERROR_NONE;
- player_cli_s *pc = (player_cli_s *) player;
- muse_player_api_e api = MUSE_PLAYER_API_SET_CALLBACK;
- char *ret_buf = NULL;
- muse_player_event_e type = MUSE_PLAYER_EVENT_TYPE_PD;
- int set = 0;
-
- LOGD("ENTER");
- LOGW("DEPRECATION WARNING: player_unset_progressive_download_message_cb() is deprecated and will be removed from next release.");
-
- set_null_user_cb_lock(pc->cb_info, type);
-
- PLAYER_SEND_MSG(api, pc, ret_buf, ret,
- MUSE_TYPE_INT, "type", type,
- MUSE_TYPE_INT, "set", set);
-
- g_free(ret_buf);
- return ret;
-
-}
-
int player_set_media_packet_video_frame_decoded_cb(player_h player, player_media_packet_video_decoded_cb callback, void *user_data)
{
PLAYER_INSTANCE_CHECK(player);
#endif
}
-static void progress_down_cb(player_pd_message_type_e type, void *user_data)
-{
- g_print("[Player_Audio_Test] progress_down_cb!!!! type : %d\n", type);
-}
-
static void buffering_cb(int percent, void *user_data)
{
g_print("[Player_Audio_Test] buffering_cb!!!! percent : %d\n", percent);
g_print(" ==> [Player_Audio_Test] Current Player State : %d\n", state);
}
-static void _player_set_progressive_download()
-{
- player_set_progressive_download_path(g_player[0], "/tmp/test.pd");
- player_set_progressive_download_message_cb(g_player[0], progress_down_cb, (void *)g_player[0]);
-}
-
-static void _player_get_progressive_download_status()
-{
- int bRet = 0;
- unsigned long curr = 0, total = 0;
- bRet = player_get_progressive_download_status(g_player[0], &curr, &total);
- g_print("player_get_progressive_download_status return[%d] ==> [Player_Audio_Test] progressive download status : %lu/%lu\n", bRet, curr, total);
-}
-
static void set_next_uri(char * uri)
{
if (TIZEN_TV) {
_player_unprepare();
} else if (strncmp(cmd, "dt", 2) == 0) {
_player_destroy();
- } else if (strncmp(cmd, "sp", 2) == 0) {
- _player_set_progressive_download();
- } else if (strncmp(cmd, "gp", 2) == 0) {
- _player_get_progressive_download_status();
} else if (strncmp(cmd, "mp", 2) == 0) {
g_memory_playback = (g_memory_playback ? FALSE : TRUE);
g_print("memory playback = %d\n", g_memory_playback);
#endif
}
-static void progress_down_cb(player_pd_message_type_e type, void *user_data)
-{
- g_print("[Player_Test] progress_down_cb!!!! type : %d\n", type);
-}
-
static void buffering_cb(int percent, void *user_data)
{
g_print("[Player_Test] buffering_cb!!!! percent : %d\n", percent);
g_print(" ==> [Player_Test] Current Player State : %d\n", state);
}
-static void _player_set_progressive_download()
-{
- player_set_progressive_download_path(g_player[0], "/tmp/test.pd");
- player_set_progressive_download_message_cb(g_player[0], progress_down_cb, (void *)g_player[0]);
-}
-
-static void _player_get_progressive_download_status()
-{
- int bRet = 0;
- unsigned long curr = 0, total = 0;
- bRet = player_get_progressive_download_status(g_player[0], &curr, &total);
- g_print("player_get_progressive_download_status return[%d] ==> [Player_Test] progressive download status : %lu/%lu\n", bRet, curr, total);
-}
-
static void _player_enable_tsurf_pool(void)
{
bool enabled = FALSE;
_player_unprepare();
} else if (strncmp(cmd, "dt", 2) == 0) {
_player_destroy();
- } else if (strncmp(cmd, "sp", 2) == 0) {
- _player_set_progressive_download();
- } else if (strncmp(cmd, "gp", 2) == 0) {
- _player_get_progressive_download_status();
} else if (strncmp(cmd, "mp", 2) == 0) {
g_memory_playback = (g_memory_playback ? FALSE : TRUE);
g_print("memory playback = %d\n", g_memory_playback);