PLAYER_ERROR_NOT_SUPPORTED_AUDIO_CODEC = PLAYER_ERROR_CLASS | 0x0e, /**< Not supported audio codec but video can be played (Since 4.0) */
PLAYER_ERROR_NOT_SUPPORTED_VIDEO_CODEC = PLAYER_ERROR_CLASS | 0x0f, /**< Not supported video codec but audio can be played (Since 4.0) */
PLAYER_ERROR_NOT_SUPPORTED_SUBTITLE = PLAYER_ERROR_CLASS | 0x10, /**< Not supported subtitle format (Since 4.0) */
+ PLAYER_ERROR_NOT_SUPPORTED_FORMAT = PLAYER_ERROR_CLASS | 0x11, /**< Not supported format (Since 5.5) */
} player_error_e;
/**
int legacy_player_push_media_stream(legacy_player_h player, media_packet_h packet);
/**
+ * @brief Retrieves all supported media format for playback of external media stream.
+ * @since_tizen 5.5
+ * @param[in] player The handle to the media player
+ * @param[out] format_info The supported media format info
+ * @param[out] len The length of format_info
+ * @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 legacy_player_get_media_stream_supported_format(legacy_player_h player, int **format_info, int *len);
+
+/**
* @brief Sets contents information for media stream
* @since_tizen 2.4
* @remarks AV format should be set before pushing elementary stream with legacy_player_push_media_stream().
int legacy_player_is_replaygain_enabled(legacy_player_h player, bool *enabled);
/* audio offload */
-int legacy_player_audio_offload_get_supported_format(legacy_player_h player, int *len, int **format_info);
+int legacy_player_audio_offload_get_supported_format(legacy_player_h player, int **format_info, int *len);
int legacy_player_audio_offload_set_enabled(legacy_player_h player, bool enabled);
int legacy_player_audio_offload_is_enabled(legacy_player_h player, bool *enabled);
int legacy_player_audio_offload_is_activated(legacy_player_h player, bool *activated);
#define PLAYER_NULL_ARG_CHECK(arg) \
PLAYER_CHECK_CONDITION((arg), PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER")
-#define PLAYER_RANGE_ARG_CHECK(arg, min, max) \
- do { \
- PLAYER_CHECK_CONDITION(arg <= max, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER"); \
- PLAYER_CHECK_CONDITION(arg >= min, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER"); \
- } while (0)
-
#ifdef TIZEN_TTRACE
#include <ttrace.h>
#define PLAYER_TRACE_BEGIN(NAME) traceBegin(TTRACE_TAG_VIDEO, NAME)
return PLAYER_ERROR_NONE;
}
+
int legacy_player_push_media_stream(legacy_player_h player, media_packet_h packet)
{
legacy_player_t *handle = (legacy_player_t *)player;
return PLAYER_ERROR_NONE;
}
-int legacy_player_set_media_stream_info(legacy_player_h player, player_stream_type_e type, media_format_h format)
+int legacy_player_get_media_stream_supported_format(legacy_player_h player, int **format_info, int *len)
{
+ int ret = MM_ERROR_NONE;
legacy_player_t *handle = (legacy_player_t *)player;
+ mmplayer_attrs_info_t info;
+
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(format_info);
+
+ ret = mm_player_get_attribute_info(handle->mm_handle, MM_PLAYER_MEDIA_STREAM_INPUT_FORMAT, &info);
+ if (ret != MM_ERROR_NONE) {
+ LOGE("failed to get attr info 0x%x", ret);
+ return _lplayer_convert_error_code(ret, (char *)__FUNCTION__);
+ }
+
+ LOGD("num of supported format : %d", info.int_array.count);
+ *len = info.int_array.count;
+ *format_info = info.int_array.array;
+
+ return PLAYER_ERROR_NONE;
+}
+
+static int __lplayer_check_supported_format(media_format_h format, mmplayer_attrs_info_t info)
+{
+ int i = 0;
+ media_format_type_e format_type = MEDIA_FORMAT_NONE;
+ media_format_mimetype_e mimetype = MEDIA_FORMAT_MAX;
+
+ media_format_get_type(format, &format_type);
+
+ if (format_type == MEDIA_FORMAT_AUDIO) {
+ if (media_format_get_audio_info(format, &mimetype,
+ NULL, NULL, NULL, NULL) != MEDIA_FORMAT_ERROR_NONE) {
+ LOGE("failed to get audio mimetype");
+ return PLAYER_ERROR_INVALID_OPERATION;
+ }
+ LOGD("Audio format 0x%X", mimetype);
+ } else if (format_type == MEDIA_FORMAT_VIDEO) {
+ if (media_format_get_video_info(format, &mimetype,
+ NULL, NULL, NULL, NULL) != MEDIA_FORMAT_ERROR_NONE) {
+ LOGE("failed to get video mimetype");
+ return PLAYER_ERROR_INVALID_OPERATION;
+ }
+ LOGD("Video format 0x%X", mimetype);
+ } else {
+ LOGE("not supported format type 0x%X", format_type);
+ return PLAYER_ERROR_NOT_SUPPORTED_FORMAT;
+ }
+
+ for (i = 0 ; i < info.int_array.count ; i++) {
+ if (info.int_array.array[i] == mimetype) {
+ LOGD("supported format 0x%X", mimetype);
+ return PLAYER_ERROR_NONE;
+ }
+ }
+
+ LOGE("not supported format mimetype 0x%X", mimetype);
+ return PLAYER_ERROR_NOT_SUPPORTED_FORMAT;
+}
+
+int legacy_player_set_media_stream_info(legacy_player_h player, player_stream_type_e type, media_format_h format)
+{
int ret = MM_ERROR_NONE;
+ legacy_player_t *handle = (legacy_player_t *)player;
+ mmplayer_attrs_info_t info;
+
PLAYER_INSTANCE_CHECK(player);
PLAYER_STATE_CHECK(handle, PLAYER_STATE_IDLE);
handle->is_media_stream = true;
+ /* check supported input format */
+ ret = mm_player_get_attribute_info(handle->mm_handle, MM_PLAYER_MEDIA_STREAM_INPUT_FORMAT, &info);
+ if (ret != MM_ERROR_NONE) {
+ LOGE("failed to get attr info 0x%x", ret);
+ return _lplayer_convert_error_code(ret, (char *)__FUNCTION__);
+ }
+
+ ret = __lplayer_check_supported_format(format, info);
+ if (ret != PLAYER_ERROR_NONE) {
+ LOGE("failed check supported format 0x%x", ret);
+ return ret;
+ }
+
if (type == PLAYER_STREAM_TYPE_VIDEO)
ret = mm_player_set_video_info(handle->mm_handle, format);
else if (type == PLAYER_STREAM_TYPE_AUDIO)
return PLAYER_ERROR_NONE;
}
-int legacy_player_audio_offload_get_supported_format(legacy_player_h player, int *len, int **format_info)
+int legacy_player_audio_offload_get_supported_format(legacy_player_h player, int **format_info, int *len)
{
int ret = MM_ERROR_NONE;
legacy_player_t *handle = (legacy_player_t *)player;
PLAYER_INSTANCE_CHECK(player);
PLAYER_NULL_ARG_CHECK(format_info);
- ret = mm_player_get_attribute_info(handle->mm_handle, "audio_offload_format", &info);
+ ret = mm_player_get_attribute_info(handle->mm_handle, MM_PLAYER_AUDIO_OFFLOAD_FORMAT, &info);
if (ret != MM_ERROR_NONE) {
LOGE("failed to get attr info 0x%x", ret);
return _lplayer_convert_error_code(ret, (char *)__FUNCTION__);
pause
set_memory_buffer
deinit_memory_buffer
+set_callback
get_state
set_volume
get_volume
set_subtitle_path
set_subtitle_position_offset
push_media_stream
+get_media_stream_supported_format
set_media_stream_info
-set_callback
-return_video_data
set_media_stream_buffer_max_size
get_media_stream_buffer_max_size
set_media_stream_buffer_min_threshold
get_media_stream_buffer_min_threshold
+return_video_data
get_track_count
get_current_track
select_track
pitch_is_enabled
pitch_set_value
pitch_get_value
-set_media_packet_audio_frame_decoded_cb
\ No newline at end of file
+set_media_packet_audio_frame_decoded_cb
return PLAYER_ERROR_NONE;
}
+int player_disp_set_callback(muse_module_h module)
+{
+ int ret = PLAYER_ERROR_NONE;
+ muse_player_handle_t *muse_player = NULL;
+ muse_player_event_e type;
+ int set = 0;
+ bool ret_val = true;
+
+ ret_val = __mplayer_disp_get_param_value(muse_server_module_get_msg(module),
+ MUSE_TYPE_INT, "type", (void *)&type,
+ MUSE_TYPE_INT, "set", (void *)&set,
+ INVALID_MUSE_TYPE_VALUE);
+
+ if (!ret_val) {
+ LOGE("failed to get param value");
+ ret = PLAYER_ERROR_INVALID_OPERATION;
+ goto EXIT;
+ }
+
+ if (type >= MUSE_PLAYER_EVENT_TYPE_NUM) {
+ LOGE("invalid type value %d", type);
+ ret = PLAYER_ERROR_INVALID_PARAMETER;
+ goto EXIT;
+ }
+
+ muse_player = (muse_player_handle_t *)muse_server_ipc_get_handle(module);
+ ret = __mplayer_set_callback_func(muse_player, type, set, module);
+ if (ret != PLAYER_ERROR_NONE) {
+ LOGE("failed to set callback type %d", type);
+ /* goto EXIT; */
+ }
+
+EXIT:
+ PLAYER_RETURN_MSG(MUSE_PLAYER_API_SET_CALLBACK, ret, module);
+ return ret;
+}
+
int player_disp_get_state(muse_module_h module)
{
int ret = PLAYER_ERROR_NONE;
return ret;
}
+int player_disp_get_media_stream_supported_format(muse_module_h module)
+{
+ int ret = PLAYER_ERROR_NONE;
+ muse_player_api_e api = MUSE_PLAYER_API_GET_MEDIA_STREAM_SUPPORTED_FORMAT;
+ muse_player_handle_t *muse_player = NULL;
+ int len = 0;
+ int *format_info = NULL;
+
+ muse_player = (muse_player_handle_t *)muse_server_ipc_get_handle(module);
+
+ ret = legacy_player_get_media_stream_supported_format(muse_player->player_handle, &format_info, &len);
+
+ if (ret != PLAYER_ERROR_NONE || len <= 0 || !format_info)
+ PLAYER_RETURN_MSG(api, ret, module);
+ else
+ PLAYER_RETURN_MSG(api, ret, module,
+ MUSE_TYPE_INT, "len", len,
+ MUSE_TYPE_ARRAY, "format_info", len, format_info);
+
+ return ret;
+}
+
int player_disp_set_media_stream_info(muse_module_h module)
{
int ret = PLAYER_ERROR_NONE;
return ret;
}
-
-int player_disp_set_callback(muse_module_h module)
-{
- int ret = PLAYER_ERROR_NONE;
- muse_player_handle_t *muse_player = NULL;
- muse_player_event_e type;
- int set = 0;
- bool ret_val = true;
-
- ret_val = __mplayer_disp_get_param_value(muse_server_module_get_msg(module),
- MUSE_TYPE_INT, "type", (void *)&type,
- MUSE_TYPE_INT, "set", (void *)&set,
- INVALID_MUSE_TYPE_VALUE);
-
- if (!ret_val) {
- LOGE("failed to get param value");
- ret = PLAYER_ERROR_INVALID_OPERATION;
- goto EXIT;
- }
-
- if (type >= MUSE_PLAYER_EVENT_TYPE_NUM) {
- LOGE("invalid type value %d", type);
- ret = PLAYER_ERROR_INVALID_PARAMETER;
- goto EXIT;
- }
-
- muse_player = (muse_player_handle_t *)muse_server_ipc_get_handle(module);
- ret = __mplayer_set_callback_func(muse_player, type, set, module);
- if (ret != PLAYER_ERROR_NONE) {
- LOGE("failed to set callback type %d", type);
- /* goto EXIT; */
- }
-
-EXIT:
- PLAYER_RETURN_MSG(MUSE_PLAYER_API_SET_CALLBACK, ret, module);
- return ret;
-}
-
-int player_disp_return_video_data(muse_module_h module) /* MUSE_PLAYER_API_RETURN_VIDEO_DATA */
-{
- mmplayer_video_decoded_data_info_t *v_data = NULL;
- muse_player_handle_t *muse_player = NULL;
- bool find_data = false;
-
- player_msg_get_type(v_data, muse_server_module_get_msg(module), POINTER);
-
- muse_player = (muse_player_handle_t *)muse_server_ipc_get_handle(module);
- if (muse_player && muse_player->video_data_list) {
- g_mutex_lock(&muse_player->list_lock);
- if (g_list_find(muse_player->video_data_list, v_data)) {
- muse_player->video_data_list = g_list_remove(muse_player->video_data_list, v_data);
- find_data = true;
- } else {
- LOGW("the v_data(%p) is not in the exported list.", v_data);
- }
- g_mutex_unlock(&muse_player->list_lock);
-
- if (find_data)
- __mplayer_remove_video_stream_data(module, v_data);
- }
-
- return PLAYER_ERROR_NONE;
-}
-
int player_disp_set_media_stream_buffer_max_size(muse_module_h module)
{
int ret = PLAYER_ERROR_NONE;
return ret;
}
+int player_disp_return_video_data(muse_module_h module) /* MUSE_PLAYER_API_RETURN_VIDEO_DATA */
+{
+ mmplayer_video_decoded_data_info_t *v_data = NULL;
+ muse_player_handle_t *muse_player = NULL;
+ bool find_data = false;
+
+ player_msg_get_type(v_data, muse_server_module_get_msg(module), POINTER);
+
+ muse_player = (muse_player_handle_t *)muse_server_ipc_get_handle(module);
+ if (muse_player && muse_player->video_data_list) {
+ g_mutex_lock(&muse_player->list_lock);
+ if (g_list_find(muse_player->video_data_list, v_data)) {
+ muse_player->video_data_list = g_list_remove(muse_player->video_data_list, v_data);
+ find_data = true;
+ } else {
+ LOGW("the v_data(%p) is not in the exported list.", v_data);
+ }
+ g_mutex_unlock(&muse_player->list_lock);
+
+ if (find_data)
+ __mplayer_remove_video_stream_data(module, v_data);
+ }
+
+ return PLAYER_ERROR_NONE;
+}
int player_disp_get_track_count(muse_module_h module)
{
muse_player = (muse_player_handle_t *)muse_server_ipc_get_handle(module);
- ret = legacy_player_audio_offload_get_supported_format(muse_player->player_handle, &len, &format_info);
+ ret = legacy_player_audio_offload_get_supported_format(muse_player->player_handle, &format_info, &len);
if (ret != PLAYER_ERROR_NONE || len <= 0 || !format_info)
PLAYER_RETURN_MSG(api, ret, module);
Name: mmsvc-player
Summary: A Media Player module for muse server
-Version: 0.2.118
+Version: 0.2.119
Release: 0
Group: Multimedia/Libraries
License: Apache-2.0