static bool __mmplayer_commit_enable_video_decoded_cb(MMHandleType handle, int attr_idx, const MMAttrsValue *value);
static bool __mmplayer_commit_audio_pitch_value(MMHandleType handle, int attr_idx, const MMAttrsValue *value);
-/*-----------------------------------------------------------------------
-| LOCAL VARIABLE DEFINITIONS for internal |
------------------------------------------------------------------------*/
-mmplayer_attrs_spec_t player_attrs[] = {
- {
- MMPLAYER_ATTRS_PROFILE_URI, /* ID */
- (char *)"profile_uri", /* Name */
- MM_ATTRS_TYPE_STRING, /* Value Type */
- MM_ATTRS_FLAG_RW, /* Flag */
- {(void *)NULL}, /* default value */
- MM_ATTRS_VALID_TYPE_NONE, /* validity type */
- {0}, /* validity min value */
- {0}, /* validity max value */
- NULL, /* Runtime setting function of the attribute */
- },
- {
- MMPLAYER_ATTRS_PROFILE_USER_PARAM,
- (char *)"profile_user_param",
- MM_ATTRS_TYPE_DATA,
- MM_ATTRS_FLAG_RW,
- {(void *)NULL},
- MM_ATTRS_VALID_TYPE_NONE,
- {0},
- {0},
- NULL,
- },
- {
- MMPLAYER_ATTRS_PROFILE_PLAY_COUNT,
- (char *)"profile_play_count",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- {(void *)1}, /* -1 : repeat continually */
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- {.int_min = -1},
- {.int_max = 1},
- NULL,
- },
- {
- MMPLAYER_ATTRS_PROFILE_PREPARE_ASYNC,
- (char *)"profile_prepare_async",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- {(void *)0},
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- {.int_min = 0},
- {.int_max = 1},
- NULL,
- },
- {
- MMPLAYER_ATTRS_STREAMING_USER_AGENT,
- (char *)"streaming_user_agent",
- MM_ATTRS_TYPE_STRING,
- MM_ATTRS_FLAG_RW,
- {(void *)NULL},
- MM_ATTRS_VALID_TYPE_NONE,
- {0},
- {0},
- NULL,
- },
- {
- MMPLAYER_ATTRS_STREAMING_COOKIE,
- (char *)"streaming_cookie",
- MM_ATTRS_TYPE_STRING,
- MM_ATTRS_FLAG_RW,
- {(void *)NULL},
- MM_ATTRS_VALID_TYPE_NONE,
- {0},
- {0},
- NULL,
- },
- {
- MMPLAYER_ATTRS_SUBTITLE_URI,
- (char *)"subtitle_uri",
- MM_ATTRS_TYPE_STRING,
- MM_ATTRS_FLAG_RW,
- {(void *)NULL},
- MM_ATTRS_VALID_TYPE_NONE,
- {0},
- {0},
- NULL,
- },
- {
- MMPLAYER_ATTRS_CONTENT_BITRATE,
- (char *)"content_bitrate",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- {(void *)0},
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- {.int_min = 0},
- {.int_max = MMPLAYER_MAX_INT},
- NULL,
- },
- {
- MMPLAYER_ATTRS_CONTENT_MAX_BITRATE,
- (char *)"content_max_bitrate",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- {(void *)0},
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- {.int_min = 0},
- {.int_max = MMPLAYER_MAX_INT},
- NULL,
- },
- {
- MMPLAYER_ATTRS_CONTENT_VIDEO_FOUND,
- (char *)"content_video_found",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- {(void *)0},
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- {.int_min = 0},
- {.int_max = 1},
- NULL,
- },
- {
- MMPLAYER_ATTRS_CONTENT_VIDEO_CODEC,
- (char *)"content_video_codec",
- MM_ATTRS_TYPE_STRING,
- MM_ATTRS_FLAG_RW,
- {(void *)NULL},
- MM_ATTRS_VALID_TYPE_NONE,
- {0},
- {0},
- NULL,
- },
- {
- MMPLAYER_ATTRS_CONTENT_VIDEO_BITRATE,
- (char *)"content_video_bitrate",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- {(void *)0},
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- {.int_min = 0},
- {.int_max = MMPLAYER_MAX_INT},
- NULL,
- },
- {
- MMPLAYER_ATTRS_CONTENT_VIDEO_FPS,
- (char *)"content_video_fps",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- {(void *)0},
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- {.int_min = 0},
- {.int_max = MMPLAYER_MAX_INT},
- NULL,
- },
- {
- MMPLAYER_ATTRS_CONTENT_VIDEO_WIDTH,
- (char *)"content_video_width",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- {(void *)0},
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- {.int_min = 0},
- {.int_max = MMPLAYER_MAX_INT},
- NULL,
- },
- {
- MMPLAYER_ATTRS_CONTENT_VIDEO_HEIGHT,
- (char *)"content_video_height",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- {(void *)0},
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- {.int_min = 0},
- {.int_max = MMPLAYER_MAX_INT},
- NULL,
- },
- {
- MMPLAYER_ATTRS_CONTENT_VIDEO_ORIENTATION,
- (char *)"content_video_orientation", /* orientation of video content */
- MM_ATTRS_TYPE_STRING,
- MM_ATTRS_FLAG_RW,
- {(void *)NULL},
- MM_ATTRS_VALID_TYPE_NONE,
- {0},
- {0},
- NULL,
- },
- {
- MMPLAYER_ATTRS_CONTENT_VIDEO_IS_SPHERICAL,
- (char *)"content_video_is_spherical",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- {(void *)-1},
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- {.int_min = -1},
- {.int_max = MMPLAYER_MAX_INT},
- NULL,
- },
- {
- MMPLAYER_ATTRS_CONTENT_AUDIO_CODEC,
- (char *)"content_audio_codec",
- MM_ATTRS_TYPE_STRING,
- MM_ATTRS_FLAG_RW,
- {(void *)NULL},
- MM_ATTRS_VALID_TYPE_NONE,
- {0},
- {0},
- NULL,
- },
- {
- MMPLAYER_ATTRS_CONTENT_AUDIO_BITRATE,
- (char *)"content_audio_bitrate",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- {(void *)0},
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- {.int_min = 0},
- {.int_max = MMPLAYER_MAX_INT},
- NULL,
- },
- {
- MMPLAYER_ATTRS_CONTENT_AUDIO_CHANNELS,
- (char *)"content_audio_channels",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- {(void *)0},
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- {.int_min = 0},
- {.int_max = MMPLAYER_MAX_INT},
- NULL,
- },
- {
- MMPLAYER_ATTRS_CONTENT_AUDIO_SAMPLERATE,
- (char *)"content_audio_samplerate",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- {(void *)0},
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- {.int_min = 0},
- {.int_max = MMPLAYER_MAX_INT},
- NULL,
- },
- {
- MMPLAYER_ATTRS_CONTENT_AUDIO_FORMAT,
- (char *)"content_audio_format",
- MM_ATTRS_TYPE_STRING,
- MM_ATTRS_FLAG_RW,
- {(void *)NULL},
- MM_ATTRS_VALID_TYPE_NONE,
- {0},
- {0},
- NULL,
- },
- {
- MMPLAYER_ATTRS_CONTENT_TEXT_TRACK_NUM,
- (char *)"content_text_track_num",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- {(void *)0},
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- {.int_min = 0},
- {.int_max = MMPLAYER_MAX_INT},
- NULL,
- },
- {
- MMPLAYER_ATTRS_CONTENT_TEXT_TRACK_INDEX,
- (char *)"current_text_track_index",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- {(void *)-1},
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- {.int_min = -1},
- {.int_max = MMPLAYER_MAX_INT},
- NULL,
- },
- {
- MMPLAYER_ATTRS_TAG_ARTIST,
- (char *)"tag_artist",
- MM_ATTRS_TYPE_STRING,
- MM_ATTRS_FLAG_RW,
- {(void *)NULL},
- MM_ATTRS_VALID_TYPE_NONE,
- {0},
- {0},
- NULL,
- },
- {
- MMPLAYER_ATTRS_TAG_TITLE,
- (char *)"tag_title",
- MM_ATTRS_TYPE_STRING,
- MM_ATTRS_FLAG_RW,
- {(void *)NULL},
- MM_ATTRS_VALID_TYPE_NONE,
- {0},
- {0},
- NULL,
- },
- {
- MMPLAYER_ATTRS_TAG_ALBUM,
- (char *)"tag_album",
- MM_ATTRS_TYPE_STRING,
- MM_ATTRS_FLAG_RW,
- {(void *)NULL},
- MM_ATTRS_VALID_TYPE_NONE,
- {0},
- {0},
- NULL,
- },
- {
- MMPLAYER_ATTRS_TAG_GENRE,
- (char *)"tag_genre",
- MM_ATTRS_TYPE_STRING,
- MM_ATTRS_FLAG_RW,
- {(void *)NULL},
- MM_ATTRS_VALID_TYPE_NONE,
- {0},
- {0},
- NULL,
- },
- {
- MMPLAYER_ATTRS_TAG_AUTHOR,
- (char *)"tag_author",
- MM_ATTRS_TYPE_STRING,
- MM_ATTRS_FLAG_RW,
- {(void *)NULL},
- MM_ATTRS_VALID_TYPE_NONE,
- {0},
- {0},
- NULL,
- },
- {
- MMPLAYER_ATTRS_TAG_COPYRIGHT,
- (char *)"tag_copyright",
- MM_ATTRS_TYPE_STRING,
- MM_ATTRS_FLAG_RW,
- {(void *)NULL},
- MM_ATTRS_VALID_TYPE_NONE,
- {0},
- {0},
- NULL,
- },
- {
- MMPLAYER_ATTRS_TAG_DATE,
- (char *)"tag_date",
- MM_ATTRS_TYPE_STRING,
- MM_ATTRS_FLAG_RW,
- {(void *)NULL},
- MM_ATTRS_VALID_TYPE_NONE,
- {0},
- {0},
- NULL,
- },
- {
- MMPLAYER_ATTRS_TAG_DESCRIPTION,
- (char *)"tag_description",
- MM_ATTRS_TYPE_STRING,
- MM_ATTRS_FLAG_RW,
- {(void *)NULL},
- MM_ATTRS_VALID_TYPE_NONE,
- {0},
- {0},
- NULL,
- },
- {
- MMPLAYER_ATTRS_TAG_TRACK_NUM,
- (char *)"tag_track_num",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- {(void *)0},
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- {.int_min = 0},
- {.int_max = MMPLAYER_MAX_INT},
- NULL,
- },
- {
- MMPLAYER_ATTRS_TAG_ALBUM_COVER,
- (char *)"tag_album_cover",
- MM_ATTRS_TYPE_DATA,
- MM_ATTRS_FLAG_RW,
- {(void *)NULL},
- MM_ATTRS_VALID_TYPE_NONE,
- {0},
- {0},
- NULL,
- },
- {
- MMPLAYER_ATTRS_DISPLAY_ROTATION,
- (char *)"display_rotation",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- {(void *)MM_DISPLAY_ROTATION_NONE},
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- {.int_min = MM_DISPLAY_ROTATION_NONE},
- {.int_max = MM_DISPLAY_ROTATION_270},
- NULL,
- },
- {
- MMPLAYER_ATTRS_DISPLAY_VISIBLE,
- (char *)"display_visible",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- {(void *)FALSE},
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- {.int_min = FALSE},
- {.int_max = TRUE},
- NULL,
- },
- {
- MMPLAYER_ATTRS_DISPLAY_METHOD,
- (char *)"display_method",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- {(void *)MM_DISPLAY_METHOD_LETTER_BOX},
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- {.int_min = MM_DISPLAY_METHOD_LETTER_BOX},
- {.int_max = MM_DISPLAY_METHOD_CUSTOM_ROI},
- NULL,
- },
- {
- MMPLAYER_ATTRS_DISPLAY_OVERLAY,
- (char *)"display_overlay",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- {(void *)0},
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- {.int_min = 0},
- {.int_max = MMPLAYER_MAX_INT},
- NULL,
- },
- {
- MMPLAYER_ATTRS_DISPLAY_WIN_ROI_X,
- (char *)"display_win_roi_x",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- {(void *)0},
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- {.int_min = MMPLAYER_MIN_INT},
- {.int_max = MMPLAYER_MAX_INT},
- NULL,
- },
- {
- MMPLAYER_ATTRS_DISPLAY_WIN_ROI_Y,
- (char *)"display_win_roi_y",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- {(void *)0},
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- {.int_min = MMPLAYER_MIN_INT},
- {.int_max = MMPLAYER_MAX_INT},
- NULL,
- },
- {
- MMPLAYER_ATTRS_DISPLAY_WIN_ROI_WIDTH,
- (char *)"display_win_roi_width",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- {(void *)0},
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- {.int_min = 0},
- {.int_max = MMPLAYER_MAX_INT},
- NULL,
- },
- {
- MMPLAYER_ATTRS_DISPLAY_WIN_ROI_HEIGHT,
- (char *)"display_win_roi_height",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- {(void *)0},
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- {.int_min = 0},
- {.int_max = MMPLAYER_MAX_INT},
- NULL,
- },
- {
- MMPLAYER_ATTRS_DISPLAY_SURFACE_TYPE,
- (char *)"display_surface_type",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- {(void *)MM_DISPLAY_SURFACE_NULL},
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- {.int_min = MM_DISPLAY_SURFACE_OVERLAY},
- {.int_max = MM_DISPLAY_SURFACE_NUM - 1},
- NULL,
- },
- {
- MMPLAYER_ATTRS_SOUND_STREAM_TYPE,
- (char *)"sound_stream_type",
- MM_ATTRS_TYPE_STRING,
- MM_ATTRS_FLAG_RW,
- {(void *)NULL},
- MM_ATTRS_VALID_TYPE_NONE,
- {0},
- {0},
- NULL,
- },
- {
- MMPLAYER_ATTRS_SOUND_STREAM_INDEX,
- (char *)"sound_stream_index",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- {(void *)0},
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- {.int_min = -1},
- {.int_max = MMPLAYER_MAX_INT},
- NULL,
- },
- {
- MMPLAYER_ATTRS_SOUND_LATENCY_MODE,
- (char *)"sound_latency_mode",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- {(void *)1}, /* 0: low latency, 1: middle latency 2: high latency */
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- {.int_min = 0},
- {.int_max = 2},
- NULL,
- },
- {
- MMPLAYER_ATTRS_PCM_EXTRACTION_SAMPLERATE,
- (char *)"pcm_extraction_samplerate", /* set samplerate for pcm extraction */
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- {(void *)44100},
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- {.int_min = 0},
- {.int_max = MMPLAYER_MAX_INT},
- NULL,
- },
- {
- MMPLAYER_ATTRS_PCM_EXTRACTION_CHANNELS,
- (char *)"pcm_extraction_channels", /* set channels for pcm extraction */
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- {(void *)1},
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- {.int_min = 0},
- {.int_max = MMPLAYER_MAX_INT},
- NULL,
- },
- {
- MMPLAYER_ATTRS_ACCURATE_SEEK,
- (char *)"accurate_seek",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- {(void *)0},
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- {.int_min = 0},
- {.int_max = 1},
- NULL,
- },
- {
- MMPLAYER_ATTRS_PCM_EXTRACTION_FORMAT,
- (char *)"pcm_extraction_format",
- MM_ATTRS_TYPE_STRING,
- MM_ATTRS_FLAG_RW,
- {(void *)NULL},
- MM_ATTRS_VALID_TYPE_NONE,
- {0},
- {0},
- NULL,
- },
- {
- MMPLAYER_ATTRS_DRC_MODE,
- (char *)"drc_mode",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- {(void *)FALSE},
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- {.int_min = FALSE},
- {.int_max = TRUE},
- NULL,
- },
- {
- MMPLAYER_ATTRS_GAPLESS_MODE,
- (char *)"gapless_mode",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- {(void *)FALSE},
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- {.int_min = FALSE},
- {.int_max = TRUE},
- __mmplayer_commit_gapless_mode,
- },
- {
- MMPLAYER_ATTRS_ENABLE_VIDEO_DECODED_CB,
- (char *)"enable_video_decoded_cb",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- {(void *)FALSE},
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- {.int_min = FALSE},
- {.int_max = TRUE},
- __mmplayer_commit_enable_video_decoded_cb,
- },
- {
- MMPLAYER_ATTRS_VIDEO_CODEC_TYPE,
- (char *)"video_codec_type",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- {(void *)MM_PLAYER_CODEC_TYPE_DEFAULT},
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- {.int_min = MM_PLAYER_CODEC_TYPE_DEFAULT},
- {.int_max = MM_PLAYER_CODEC_TYPE_SW},
- NULL,
- },
- {
- MMPLAYER_ATTRS_AUDIO_CODEC_TYPE,
- (char *)"audio_codec_type",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- {(void *)MM_PLAYER_CODEC_TYPE_DEFAULT},
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- {.int_min = MM_PLAYER_CODEC_TYPE_DEFAULT},
- {.int_max = MM_PLAYER_CODEC_TYPE_SW},
- NULL,
- },
- {
- MMPLAYER_ATTRS_VIDEO_BUFFER_TOTAL_SIZE,
- (char *)"video_buffer_total_size",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- {(void *)DEFAULT_NUM_OF_V_OUT_BUFFER},
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- {.int_min = MMPLAYER_MIN_INT},
- {.int_max = MMPLAYER_MAX_INT},
- NULL,
- },
- {
- MMPLAYER_ATTRS_VIDEO_BUFFER_EXTRA_SIZE,
- (char *)"video_buffer_extra_size",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- {(void *)DEFAULT_NUM_OF_V_OUT_BUFFER},
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- {.int_min = MMPLAYER_MIN_INT},
- {.int_max = MMPLAYER_MAX_INT},
- NULL,
- },
- {
- MMPLAYER_ATTRS_PREBUFFER_MS,
- (char *)"prebuffer_ms", /* user setting */
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- {(void *) MIN_BUFFERING_TIME},
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- {.int_min = MIN_BUFFERING_TIME},
- {.int_max = MMPLAYER_MAX_INT},
- NULL,
- },
- {
- MMPLAYER_ATTRS_REBUFFER_MS,
- (char *)"rebuffer_ms", /* user setting */
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- {(void *) MIN_BUFFERING_TIME},
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- {.int_min = MIN_BUFFERING_TIME},
- {.int_max = MMPLAYER_MAX_INT},
- NULL,
- },
- {
- MMPLAYER_ATTRS_PITCH_CONTROL,
- (char *)"pitch_control", /* MM_PLAYER_PITCH_CONTROL */
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- {(void *)FALSE},
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- {.int_min = FALSE},
- {.int_max = TRUE},
- NULL,
- },
- {
- MMPLAYER_ATTRS_PITCH_VALUE,
- (char *)"pitch_value", /* MM_PLAYER_PITCH_VALUE */
- MM_ATTRS_TYPE_DOUBLE,
- MM_ATTRS_FLAG_RW,
- {.value_double = 1.0},
- MM_ATTRS_VALID_TYPE_DOUBLE_RANGE,
- {.double_min = 0.5},
- {.double_max = 2},
- __mmplayer_commit_audio_pitch_value,
- },
- {
- MMPLAYER_ATTRS_AUDIO_OFFLOAD,
- (char *)"audio_offload", /* MM_PLAYER_AUDIO_OFFLOAD */
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- {(void *)FALSE},
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- {.int_min = FALSE},
- {.int_max = TRUE},
- NULL,
- },
- {
- MMPLAYER_ATTRS_AUDIO_OFFLOAD_FORMAT,
- (char *)"audio_offload_format", /* MM_PLAYER_AUDIO_OFFLOAD_FORMAT, array of media_format_mimetype_e */
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- {(void *)NULL},
- MM_ATTRS_VALID_TYPE_INT_ARRAY,
- {.int_array = NULL},
- {.count = 0},
- NULL,
- },
- {
- MMPLAYER_ATTRS_MEDIA_STREAM_INPUT_FORMAT, /* MM_PLAYER_MEDIA_STREAM_INPUT_FORMAT */
- (char *)"media_stream_input_format",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- {(void *)NULL},
- MM_ATTRS_VALID_TYPE_INT_ARRAY,
- {.int_array = NULL},
- {.count = 0},
- NULL,
- },
-};
-
/*===========================================================================================
| |
| FUNCTION DEFINITIONS |
MMPLAYER_FENTER();
MMPLAYER_RETURN_VAL_IF_FAIL(player && value, false);
- MMPLAYER_RETURN_VAL_IF_FAIL(player->pipeline && player->pipeline->mainbin, true);
+ MMPLAYER_RETURN_VAL_IF_FAIL(player->pipeline && player->pipeline->audiobin, true);
pipeline = player->pipeline;
mm_attrs_get_int_by_name(player->attrs, MM_PLAYER_PITCH_CONTROL, &pitch_control);
static int __mmplayer_get_array_count(MMHandleType handle, int type)
{
- mmplayer_t *player = (mmplayer_t *)handle;
+ mmplayer_t *player = MM_PLAYER_CAST(handle);
int count = 0;
int i = 0;
static media_format_mimetype_e __mmplayer_get_supported_format_mimetype(MMHandleType handle, int type, int i)
{
- char *name = NULL;
+ mmplayer_t *player = MM_PLAYER_CAST(handle);
media_format_mimetype_e format = MEDIA_FORMAT_MAX;
-
- mmplayer_t *player = (mmplayer_t *)handle;
+ char *name = NULL;
if (type == KEYWORD_A_OFFLOAD_MEDIA_FORMAT) {
name = player->ini.audio_offload_media_format[i];
format = MEDIA_FORMAT_PCM_F32LE;
else if (!strcmp(name, "PCM_F32BE"))
format = MEDIA_FORMAT_PCM_F32BE;
- else if (!strcmp(name, "PCM_S16LE"))
+ else if (!strcmp(name, "PCM_U16LE"))
format = MEDIA_FORMAT_PCM_U16LE;
else if (!strcmp(name, "PCM_U24LE"))
format = MEDIA_FORMAT_PCM_U24LE;
static int __mmplayer_set_ini_to_valid_info(MMHandleType handle)
{
+ mmplayer_t *player = MM_PLAYER_CAST(handle);
int *format = NULL;
int total_count = 0;
/* supported format of audio offload */
total_count = __mmplayer_get_available_format(handle, KEYWORD_A_OFFLOAD_MEDIA_FORMAT, &format);
if (format && total_count > 0) {
- player_attrs[MMPLAYER_ATTRS_AUDIO_OFFLOAD_FORMAT].validity_value_1.int_array = format;
- player_attrs[MMPLAYER_ATTRS_AUDIO_OFFLOAD_FORMAT].validity_value_2.count = total_count;
+ player->default_attrs[MMPLAYER_ATTRS_AUDIO_OFFLOAD_FORMAT].validity_value_1.int_array = format;
+ player->default_attrs[MMPLAYER_ATTRS_AUDIO_OFFLOAD_FORMAT].validity_value_2.count = total_count;
}
/* supported format of media stream input */
total_count = __mmplayer_get_available_format(handle, KEYWORD_MEDIA_STREAM_IN_FORMAT, &format);
if (format && total_count > 0) {
- player_attrs[MMPLAYER_ATTRS_MEDIA_STREAM_INPUT_FORMAT].validity_value_1.int_array = format;
- player_attrs[MMPLAYER_ATTRS_MEDIA_STREAM_INPUT_FORMAT].validity_value_2.count = total_count;
+ player->default_attrs[MMPLAYER_ATTRS_MEDIA_STREAM_INPUT_FORMAT].validity_value_1.int_array = format;
+ player->default_attrs[MMPLAYER_ATTRS_MEDIA_STREAM_INPUT_FORMAT].validity_value_2.count = total_count;
}
+ /* default codec type */
+ if (!strcmp(player->ini.audiocodec_default_type, "sw"))
+ player->default_attrs[MMPLAYER_ATTRS_AUDIO_CODEC_TYPE].default_value.value_int = MM_PLAYER_CODEC_TYPE_SW;
+
+ if (!strcmp(player->ini.videocodec_default_type, "sw"))
+ player->default_attrs[MMPLAYER_ATTRS_VIDEO_CODEC_TYPE].default_value.value_int = MM_PLAYER_CODEC_TYPE_SW;
+
return MM_ERROR_NONE;
}
-static int __mmplayer_release_ini_info(void)
+static int __mmplayer_release_ini_info(MMHandleType handle)
{
+ mmplayer_t *player = MM_PLAYER_CAST(handle);
int *mem = NULL;
MMPLAYER_FENTER();
- mem = (int *)(player_attrs[MMPLAYER_ATTRS_AUDIO_OFFLOAD_FORMAT].validity_value_1.int_array);
+ mem = (int *)(player->default_attrs[MMPLAYER_ATTRS_AUDIO_OFFLOAD_FORMAT].validity_value_1.int_array);
g_free(mem);
- player_attrs[MMPLAYER_ATTRS_AUDIO_OFFLOAD_FORMAT].validity_value_1.int_array = NULL;
- player_attrs[MMPLAYER_ATTRS_AUDIO_OFFLOAD_FORMAT].validity_value_2.count = 0;
+ player->default_attrs[MMPLAYER_ATTRS_AUDIO_OFFLOAD_FORMAT].validity_value_1.int_array = NULL;
+ player->default_attrs[MMPLAYER_ATTRS_AUDIO_OFFLOAD_FORMAT].validity_value_2.count = 0;
- mem = (int *)(player_attrs[MMPLAYER_ATTRS_MEDIA_STREAM_INPUT_FORMAT].validity_value_1.int_array);
+ mem = (int *)(player->default_attrs[MMPLAYER_ATTRS_MEDIA_STREAM_INPUT_FORMAT].validity_value_1.int_array);
g_free(mem);
- player_attrs[MMPLAYER_ATTRS_MEDIA_STREAM_INPUT_FORMAT].validity_value_1.int_array = NULL;
- player_attrs[MMPLAYER_ATTRS_MEDIA_STREAM_INPUT_FORMAT].validity_value_2.count = 0;
+ player->default_attrs[MMPLAYER_ATTRS_MEDIA_STREAM_INPUT_FORMAT].validity_value_1.int_array = NULL;
+ player->default_attrs[MMPLAYER_ATTRS_MEDIA_STREAM_INPUT_FORMAT].validity_value_2.count = 0;
MMPLAYER_FLEAVE();
return MM_ERROR_NONE;
return;
}
-bool _mmplayer_commit_attribute(int attr_idx, const char *attr_name, const MMAttrsValue *value, void *user_data)
+bool _mmplayer_commit_attribute(int attr_idx, const char *attr_name, const MMAttrsValue *value, void *commit_param)
{
bool ret = false;
- mmplayer_t *player = MM_PLAYER_CAST(user_data);
+ mmplayer_t *player = MM_PLAYER_CAST(commit_param);
MMPLAYER_RETURN_VAL_IF_FAIL(player && (attr_idx >= 0) && attr_name && value, false);
- if (player_attrs[attr_idx].attr_commit) {
+ if (player->default_attrs[attr_idx].attr_commit) {
__mmplayer_print_attrs(attr_name, value, "Dynamic");
- ret = player_attrs[attr_idx].attr_commit((MMHandleType)user_data, attr_idx, value);
+ ret = player->default_attrs[attr_idx].attr_commit((MMHandleType)commit_param, attr_idx, value);
} else {
__mmplayer_print_attrs(attr_name, value, "Static");
ret = true;
player = MM_PLAYER_CAST(handle);
- /* apply display attr value to player handle */
- if (!g_strrstr(attribute_name, "display"))
+ if (!g_strrstr(attribute_name, "display") || !g_strcmp0(attribute_name, "exported_shell_handle"))
return MM_ERROR_NONE;
if (!_mmplayer_is_videosink_ready(player, MM_DISPLAY_SURFACE_NUM)) {
MMHandleType _mmplayer_construct_attribute(MMHandleType handle)
{
+ mmplayer_t *player = MM_PLAYER_CAST(handle);
int result = MM_ERROR_NONE;
int idx = 0;
MMHandleType attrs = NULL;
int num_of_attrs = 0;
MMAttrsConstructInfo *base = NULL;
+ mmplayer_attrs_spec_t player_attrs[] = {
+ {
+ MMPLAYER_ATTRS_PROFILE_URI, /* ID */
+ (char *)"profile_uri", /* Name */
+ MM_ATTRS_TYPE_STRING, /* Value Type */
+ MM_ATTRS_FLAG_RW, /* Flag */
+ {(void *)NULL}, /* default value */
+ MM_ATTRS_VALID_TYPE_NONE, /* validity type */
+ {0}, /* validity min value */
+ {0}, /* validity max value */
+ NULL, /* Runtime setting function of the attribute */
+ },
+ {
+ MMPLAYER_ATTRS_PROFILE_USER_PARAM,
+ (char *)"profile_user_param",
+ MM_ATTRS_TYPE_DATA,
+ MM_ATTRS_FLAG_RW,
+ {(void *)NULL},
+ MM_ATTRS_VALID_TYPE_NONE,
+ {0},
+ {0},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_PROFILE_PLAY_COUNT,
+ (char *)"profile_play_count",
+ MM_ATTRS_TYPE_INT,
+ MM_ATTRS_FLAG_RW,
+ {(void *)1}, /* -1 : repeat continually */
+ MM_ATTRS_VALID_TYPE_INT_RANGE,
+ {.int_min = -1},
+ {.int_max = 1},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_PROFILE_PREPARE_ASYNC,
+ (char *)"profile_prepare_async",
+ MM_ATTRS_TYPE_INT,
+ MM_ATTRS_FLAG_RW,
+ {(void *)0},
+ MM_ATTRS_VALID_TYPE_INT_RANGE,
+ {.int_min = 0},
+ {.int_max = 1},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_STREAMING_USER_AGENT,
+ (char *)"streaming_user_agent",
+ MM_ATTRS_TYPE_STRING,
+ MM_ATTRS_FLAG_RW,
+ {(void *)NULL},
+ MM_ATTRS_VALID_TYPE_NONE,
+ {0},
+ {0},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_STREAMING_COOKIE,
+ (char *)"streaming_cookie",
+ MM_ATTRS_TYPE_STRING,
+ MM_ATTRS_FLAG_RW,
+ {(void *)NULL},
+ MM_ATTRS_VALID_TYPE_NONE,
+ {0},
+ {0},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_SUBTITLE_URI,
+ (char *)"subtitle_uri",
+ MM_ATTRS_TYPE_STRING,
+ MM_ATTRS_FLAG_RW,
+ {(void *)NULL},
+ MM_ATTRS_VALID_TYPE_NONE,
+ {0},
+ {0},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_CONTENT_BITRATE,
+ (char *)"content_bitrate",
+ MM_ATTRS_TYPE_INT,
+ MM_ATTRS_FLAG_RW,
+ {(void *)0},
+ MM_ATTRS_VALID_TYPE_INT_RANGE,
+ {.int_min = 0},
+ {.int_max = MMPLAYER_MAX_INT},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_CONTENT_MAX_BITRATE,
+ (char *)"content_max_bitrate",
+ MM_ATTRS_TYPE_INT,
+ MM_ATTRS_FLAG_RW,
+ {(void *)0},
+ MM_ATTRS_VALID_TYPE_INT_RANGE,
+ {.int_min = 0},
+ {.int_max = MMPLAYER_MAX_INT},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_CONTENT_VIDEO_FOUND,
+ (char *)"content_video_found",
+ MM_ATTRS_TYPE_INT,
+ MM_ATTRS_FLAG_RW,
+ {(void *)0},
+ MM_ATTRS_VALID_TYPE_INT_RANGE,
+ {.int_min = 0},
+ {.int_max = 1},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_CONTENT_VIDEO_CODEC,
+ (char *)"content_video_codec",
+ MM_ATTRS_TYPE_STRING,
+ MM_ATTRS_FLAG_RW,
+ {(void *)NULL},
+ MM_ATTRS_VALID_TYPE_NONE,
+ {0},
+ {0},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_CONTENT_VIDEO_BITRATE,
+ (char *)"content_video_bitrate",
+ MM_ATTRS_TYPE_INT,
+ MM_ATTRS_FLAG_RW,
+ {(void *)0},
+ MM_ATTRS_VALID_TYPE_INT_RANGE,
+ {.int_min = 0},
+ {.int_max = MMPLAYER_MAX_INT},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_CONTENT_VIDEO_FPS,
+ (char *)"content_video_fps",
+ MM_ATTRS_TYPE_INT,
+ MM_ATTRS_FLAG_RW,
+ {(void *)0},
+ MM_ATTRS_VALID_TYPE_INT_RANGE,
+ {.int_min = 0},
+ {.int_max = MMPLAYER_MAX_INT},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_CONTENT_VIDEO_WIDTH,
+ (char *)"content_video_width",
+ MM_ATTRS_TYPE_INT,
+ MM_ATTRS_FLAG_RW,
+ {(void *)0},
+ MM_ATTRS_VALID_TYPE_INT_RANGE,
+ {.int_min = 0},
+ {.int_max = MMPLAYER_MAX_INT},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_CONTENT_VIDEO_HEIGHT,
+ (char *)"content_video_height",
+ MM_ATTRS_TYPE_INT,
+ MM_ATTRS_FLAG_RW,
+ {(void *)0},
+ MM_ATTRS_VALID_TYPE_INT_RANGE,
+ {.int_min = 0},
+ {.int_max = MMPLAYER_MAX_INT},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_CONTENT_VIDEO_ORIENTATION,
+ (char *)"content_video_orientation", /* orientation of video content */
+ MM_ATTRS_TYPE_STRING,
+ MM_ATTRS_FLAG_RW,
+ {(void *)NULL},
+ MM_ATTRS_VALID_TYPE_NONE,
+ {0},
+ {0},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_CONTENT_VIDEO_IS_SPHERICAL,
+ (char *)"content_video_is_spherical",
+ MM_ATTRS_TYPE_INT,
+ MM_ATTRS_FLAG_RW,
+ {(void *)-1},
+ MM_ATTRS_VALID_TYPE_INT_RANGE,
+ {.int_min = -1},
+ {.int_max = MMPLAYER_MAX_INT},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_CONTENT_AUDIO_CODEC,
+ (char *)"content_audio_codec",
+ MM_ATTRS_TYPE_STRING,
+ MM_ATTRS_FLAG_RW,
+ {(void *)NULL},
+ MM_ATTRS_VALID_TYPE_NONE,
+ {0},
+ {0},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_CONTENT_AUDIO_BITRATE,
+ (char *)"content_audio_bitrate",
+ MM_ATTRS_TYPE_INT,
+ MM_ATTRS_FLAG_RW,
+ {(void *)0},
+ MM_ATTRS_VALID_TYPE_INT_RANGE,
+ {.int_min = 0},
+ {.int_max = MMPLAYER_MAX_INT},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_CONTENT_AUDIO_CHANNELS,
+ (char *)"content_audio_channels",
+ MM_ATTRS_TYPE_INT,
+ MM_ATTRS_FLAG_RW,
+ {(void *)0},
+ MM_ATTRS_VALID_TYPE_INT_RANGE,
+ {.int_min = 0},
+ {.int_max = MMPLAYER_MAX_INT},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_CONTENT_AUDIO_SAMPLERATE,
+ (char *)"content_audio_samplerate",
+ MM_ATTRS_TYPE_INT,
+ MM_ATTRS_FLAG_RW,
+ {(void *)0},
+ MM_ATTRS_VALID_TYPE_INT_RANGE,
+ {.int_min = 0},
+ {.int_max = MMPLAYER_MAX_INT},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_CONTENT_AUDIO_FORMAT,
+ (char *)"content_audio_format",
+ MM_ATTRS_TYPE_STRING,
+ MM_ATTRS_FLAG_RW,
+ {(void *)NULL},
+ MM_ATTRS_VALID_TYPE_NONE,
+ {0},
+ {0},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_CONTENT_TEXT_TRACK_NUM,
+ (char *)"content_text_track_num",
+ MM_ATTRS_TYPE_INT,
+ MM_ATTRS_FLAG_RW,
+ {(void *)0},
+ MM_ATTRS_VALID_TYPE_INT_RANGE,
+ {.int_min = 0},
+ {.int_max = MMPLAYER_MAX_INT},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_CONTENT_TEXT_TRACK_INDEX,
+ (char *)"current_text_track_index",
+ MM_ATTRS_TYPE_INT,
+ MM_ATTRS_FLAG_RW,
+ {(void *)-1},
+ MM_ATTRS_VALID_TYPE_INT_RANGE,
+ {.int_min = -1},
+ {.int_max = MMPLAYER_MAX_INT},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_TAG_ARTIST,
+ (char *)"tag_artist",
+ MM_ATTRS_TYPE_STRING,
+ MM_ATTRS_FLAG_RW,
+ {(void *)NULL},
+ MM_ATTRS_VALID_TYPE_NONE,
+ {0},
+ {0},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_TAG_TITLE,
+ (char *)"tag_title",
+ MM_ATTRS_TYPE_STRING,
+ MM_ATTRS_FLAG_RW,
+ {(void *)NULL},
+ MM_ATTRS_VALID_TYPE_NONE,
+ {0},
+ {0},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_TAG_ALBUM,
+ (char *)"tag_album",
+ MM_ATTRS_TYPE_STRING,
+ MM_ATTRS_FLAG_RW,
+ {(void *)NULL},
+ MM_ATTRS_VALID_TYPE_NONE,
+ {0},
+ {0},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_TAG_GENRE,
+ (char *)"tag_genre",
+ MM_ATTRS_TYPE_STRING,
+ MM_ATTRS_FLAG_RW,
+ {(void *)NULL},
+ MM_ATTRS_VALID_TYPE_NONE,
+ {0},
+ {0},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_TAG_AUTHOR,
+ (char *)"tag_author",
+ MM_ATTRS_TYPE_STRING,
+ MM_ATTRS_FLAG_RW,
+ {(void *)NULL},
+ MM_ATTRS_VALID_TYPE_NONE,
+ {0},
+ {0},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_TAG_COPYRIGHT,
+ (char *)"tag_copyright",
+ MM_ATTRS_TYPE_STRING,
+ MM_ATTRS_FLAG_RW,
+ {(void *)NULL},
+ MM_ATTRS_VALID_TYPE_NONE,
+ {0},
+ {0},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_TAG_DATE,
+ (char *)"tag_date",
+ MM_ATTRS_TYPE_STRING,
+ MM_ATTRS_FLAG_RW,
+ {(void *)NULL},
+ MM_ATTRS_VALID_TYPE_NONE,
+ {0},
+ {0},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_TAG_DESCRIPTION,
+ (char *)"tag_description",
+ MM_ATTRS_TYPE_STRING,
+ MM_ATTRS_FLAG_RW,
+ {(void *)NULL},
+ MM_ATTRS_VALID_TYPE_NONE,
+ {0},
+ {0},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_TAG_TRACK_NUM,
+ (char *)"tag_track_num",
+ MM_ATTRS_TYPE_INT,
+ MM_ATTRS_FLAG_RW,
+ {(void *)0},
+ MM_ATTRS_VALID_TYPE_INT_RANGE,
+ {.int_min = 0},
+ {.int_max = MMPLAYER_MAX_INT},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_TAG_ALBUM_COVER,
+ (char *)"tag_album_cover",
+ MM_ATTRS_TYPE_DATA,
+ MM_ATTRS_FLAG_RW,
+ {(void *)NULL},
+ MM_ATTRS_VALID_TYPE_NONE,
+ {0},
+ {0},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_DISPLAY_ROTATION,
+ (char *)"display_rotation",
+ MM_ATTRS_TYPE_INT,
+ MM_ATTRS_FLAG_RW,
+ {(void *)MM_DISPLAY_ROTATION_NONE},
+ MM_ATTRS_VALID_TYPE_INT_RANGE,
+ {.int_min = MM_DISPLAY_ROTATION_NONE},
+ {.int_max = MM_DISPLAY_ROTATION_270},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_DISPLAY_VISIBLE,
+ (char *)"display_visible",
+ MM_ATTRS_TYPE_INT,
+ MM_ATTRS_FLAG_RW,
+ {(void *)FALSE},
+ MM_ATTRS_VALID_TYPE_INT_RANGE,
+ {.int_min = FALSE},
+ {.int_max = TRUE},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_DISPLAY_METHOD,
+ (char *)"display_method",
+ MM_ATTRS_TYPE_INT,
+ MM_ATTRS_FLAG_RW,
+ {(void *)MM_DISPLAY_METHOD_LETTER_BOX},
+ MM_ATTRS_VALID_TYPE_INT_RANGE,
+ {.int_min = MM_DISPLAY_METHOD_LETTER_BOX},
+ {.int_max = MM_DISPLAY_METHOD_CUSTOM_ROI},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_DISPLAY_OVERLAY,
+ (char *)"display_overlay",
+ MM_ATTRS_TYPE_INT,
+ MM_ATTRS_FLAG_RW,
+ {(void *)0},
+ MM_ATTRS_VALID_TYPE_INT_RANGE,
+ {.int_min = 0},
+ {.int_max = MMPLAYER_MAX_INT},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_DISPLAY_WIN_ROI_X,
+ (char *)"display_win_roi_x",
+ MM_ATTRS_TYPE_INT,
+ MM_ATTRS_FLAG_RW,
+ {(void *)0},
+ MM_ATTRS_VALID_TYPE_INT_RANGE,
+ {.int_min = MMPLAYER_MIN_INT},
+ {.int_max = MMPLAYER_MAX_INT},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_DISPLAY_WIN_ROI_Y,
+ (char *)"display_win_roi_y",
+ MM_ATTRS_TYPE_INT,
+ MM_ATTRS_FLAG_RW,
+ {(void *)0},
+ MM_ATTRS_VALID_TYPE_INT_RANGE,
+ {.int_min = MMPLAYER_MIN_INT},
+ {.int_max = MMPLAYER_MAX_INT},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_DISPLAY_WIN_ROI_WIDTH,
+ (char *)"display_win_roi_width",
+ MM_ATTRS_TYPE_INT,
+ MM_ATTRS_FLAG_RW,
+ {(void *)0},
+ MM_ATTRS_VALID_TYPE_INT_RANGE,
+ {.int_min = 0},
+ {.int_max = MMPLAYER_MAX_INT},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_DISPLAY_WIN_ROI_HEIGHT,
+ (char *)"display_win_roi_height",
+ MM_ATTRS_TYPE_INT,
+ MM_ATTRS_FLAG_RW,
+ {(void *)0},
+ MM_ATTRS_VALID_TYPE_INT_RANGE,
+ {.int_min = 0},
+ {.int_max = MMPLAYER_MAX_INT},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_DISPLAY_SURFACE_TYPE,
+ (char *)"display_surface_type",
+ MM_ATTRS_TYPE_INT,
+ MM_ATTRS_FLAG_RW,
+ {(void *)MM_DISPLAY_SURFACE_NULL},
+ MM_ATTRS_VALID_TYPE_INT_RANGE,
+ {.int_min = MM_DISPLAY_SURFACE_OVERLAY},
+ {.int_max = MM_DISPLAY_SURFACE_NUM - 1},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_DISPLAY_EXPORTED_SHELL_HANDLE,
+ (char *)"exported_shell_handle",
+ MM_ATTRS_TYPE_STRING,
+ MM_ATTRS_FLAG_RW,
+ {(void *)NULL},
+ MM_ATTRS_VALID_TYPE_NONE,
+ {0},
+ {0},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_SOUND_STREAM_TYPE,
+ (char *)"sound_stream_type",
+ MM_ATTRS_TYPE_STRING,
+ MM_ATTRS_FLAG_RW,
+ {(void *)NULL},
+ MM_ATTRS_VALID_TYPE_NONE,
+ {0},
+ {0},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_SOUND_STREAM_INDEX,
+ (char *)"sound_stream_index",
+ MM_ATTRS_TYPE_INT,
+ MM_ATTRS_FLAG_RW,
+ {(void *)0},
+ MM_ATTRS_VALID_TYPE_INT_RANGE,
+ {.int_min = -1},
+ {.int_max = MMPLAYER_MAX_INT},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_SOUND_LATENCY_MODE,
+ (char *)"sound_latency_mode",
+ MM_ATTRS_TYPE_INT,
+ MM_ATTRS_FLAG_RW,
+ {(void *)1}, /* 0: low latency, 1: middle latency 2: high latency */
+ MM_ATTRS_VALID_TYPE_INT_RANGE,
+ {.int_min = 0},
+ {.int_max = 2},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_PCM_EXTRACTION_SAMPLERATE,
+ (char *)"pcm_extraction_samplerate", /* set samplerate for pcm extraction */
+ MM_ATTRS_TYPE_INT,
+ MM_ATTRS_FLAG_RW,
+ {(void *)44100},
+ MM_ATTRS_VALID_TYPE_INT_RANGE,
+ {.int_min = 0},
+ {.int_max = MMPLAYER_MAX_INT},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_PCM_EXTRACTION_CHANNELS,
+ (char *)"pcm_extraction_channels", /* set channels for pcm extraction */
+ MM_ATTRS_TYPE_INT,
+ MM_ATTRS_FLAG_RW,
+ {(void *)1},
+ MM_ATTRS_VALID_TYPE_INT_RANGE,
+ {.int_min = 0},
+ {.int_max = MMPLAYER_MAX_INT},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_ACCURATE_SEEK,
+ (char *)"accurate_seek",
+ MM_ATTRS_TYPE_INT,
+ MM_ATTRS_FLAG_RW,
+ {(void *)0},
+ MM_ATTRS_VALID_TYPE_INT_RANGE,
+ {.int_min = 0},
+ {.int_max = 1},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_PCM_EXTRACTION_FORMAT,
+ (char *)"pcm_extraction_format",
+ MM_ATTRS_TYPE_STRING,
+ MM_ATTRS_FLAG_RW,
+ {(void *)NULL},
+ MM_ATTRS_VALID_TYPE_NONE,
+ {0},
+ {0},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_DRC_MODE,
+ (char *)"drc_mode",
+ MM_ATTRS_TYPE_INT,
+ MM_ATTRS_FLAG_RW,
+ {(void *)FALSE},
+ MM_ATTRS_VALID_TYPE_INT_RANGE,
+ {.int_min = FALSE},
+ {.int_max = TRUE},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_GAPLESS_MODE,
+ (char *)"gapless_mode",
+ MM_ATTRS_TYPE_INT,
+ MM_ATTRS_FLAG_RW,
+ {(void *)FALSE},
+ MM_ATTRS_VALID_TYPE_INT_RANGE,
+ {.int_min = FALSE},
+ {.int_max = TRUE},
+ __mmplayer_commit_gapless_mode,
+ },
+ {
+ MMPLAYER_ATTRS_ENABLE_VIDEO_DECODED_CB,
+ (char *)"enable_video_decoded_cb",
+ MM_ATTRS_TYPE_INT,
+ MM_ATTRS_FLAG_RW,
+ {(void *)FALSE},
+ MM_ATTRS_VALID_TYPE_INT_RANGE,
+ {.int_min = FALSE},
+ {.int_max = TRUE},
+ __mmplayer_commit_enable_video_decoded_cb,
+ },
+ {
+ MMPLAYER_ATTRS_VIDEO_CODEC_TYPE,
+ (char *)"video_codec_type",
+ MM_ATTRS_TYPE_INT,
+ MM_ATTRS_FLAG_RW,
+ {(void *)MM_PLAYER_CODEC_TYPE_HW},
+ MM_ATTRS_VALID_TYPE_INT_RANGE,
+ {.int_min = MM_PLAYER_CODEC_TYPE_HW},
+ {.int_max = MM_PLAYER_CODEC_TYPE_SW},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_AUDIO_CODEC_TYPE,
+ (char *)"audio_codec_type",
+ MM_ATTRS_TYPE_INT,
+ MM_ATTRS_FLAG_RW,
+ {(void *)MM_PLAYER_CODEC_TYPE_HW},
+ MM_ATTRS_VALID_TYPE_INT_RANGE,
+ {.int_min = MM_PLAYER_CODEC_TYPE_HW},
+ {.int_max = MM_PLAYER_CODEC_TYPE_SW},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_VIDEO_BUFFER_TOTAL_SIZE,
+ (char *)"video_buffer_total_size",
+ MM_ATTRS_TYPE_INT,
+ MM_ATTRS_FLAG_RW,
+ {(void *)DEFAULT_NUM_OF_V_OUT_BUFFER},
+ MM_ATTRS_VALID_TYPE_INT_RANGE,
+ {.int_min = MMPLAYER_MIN_INT},
+ {.int_max = MMPLAYER_MAX_INT},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_VIDEO_BUFFER_EXTRA_SIZE,
+ (char *)"video_buffer_extra_size",
+ MM_ATTRS_TYPE_INT,
+ MM_ATTRS_FLAG_RW,
+ {(void *)DEFAULT_NUM_OF_V_OUT_BUFFER},
+ MM_ATTRS_VALID_TYPE_INT_RANGE,
+ {.int_min = MMPLAYER_MIN_INT},
+ {.int_max = MMPLAYER_MAX_INT},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_PREBUFFER_MS,
+ (char *)"prebuffer_ms", /* user setting */
+ MM_ATTRS_TYPE_INT,
+ MM_ATTRS_FLAG_RW,
+ {(void *) MIN_BUFFERING_TIME},
+ MM_ATTRS_VALID_TYPE_INT_RANGE,
+ {.int_min = MIN_BUFFERING_TIME},
+ {.int_max = MMPLAYER_MAX_INT},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_REBUFFER_MS,
+ (char *)"rebuffer_ms", /* user setting */
+ MM_ATTRS_TYPE_INT,
+ MM_ATTRS_FLAG_RW,
+ {(void *) MIN_BUFFERING_TIME},
+ MM_ATTRS_VALID_TYPE_INT_RANGE,
+ {.int_min = MIN_BUFFERING_TIME},
+ {.int_max = MMPLAYER_MAX_INT},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_PITCH_CONTROL,
+ (char *)"pitch_control", /* MM_PLAYER_PITCH_CONTROL */
+ MM_ATTRS_TYPE_INT,
+ MM_ATTRS_FLAG_RW,
+ {(void *)FALSE},
+ MM_ATTRS_VALID_TYPE_INT_RANGE,
+ {.int_min = FALSE},
+ {.int_max = TRUE},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_PITCH_VALUE,
+ (char *)"pitch_value", /* MM_PLAYER_PITCH_VALUE */
+ MM_ATTRS_TYPE_DOUBLE,
+ MM_ATTRS_FLAG_RW,
+ {.value_double = 1.0},
+ MM_ATTRS_VALID_TYPE_DOUBLE_RANGE,
+ {.double_min = 0.5},
+ {.double_max = 2},
+ __mmplayer_commit_audio_pitch_value,
+ },
+ {
+ MMPLAYER_ATTRS_AUDIO_OFFLOAD,
+ (char *)"audio_offload", /* MM_PLAYER_AUDIO_OFFLOAD */
+ MM_ATTRS_TYPE_INT,
+ MM_ATTRS_FLAG_RW,
+ {(void *)FALSE},
+ MM_ATTRS_VALID_TYPE_INT_RANGE,
+ {.int_min = FALSE},
+ {.int_max = TRUE},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_AUDIO_OFFLOAD_FORMAT,
+ (char *)"audio_offload_format", /* MM_PLAYER_AUDIO_OFFLOAD_FORMAT, array of media_format_mimetype_e */
+ MM_ATTRS_TYPE_INT,
+ MM_ATTRS_FLAG_RW,
+ {(void *)NULL},
+ MM_ATTRS_VALID_TYPE_INT_ARRAY,
+ {.int_array = NULL},
+ {.count = 0},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_MEDIA_STREAM_INPUT_FORMAT, /* MM_PLAYER_MEDIA_STREAM_INPUT_FORMAT */
+ (char *)"media_stream_input_format",
+ MM_ATTRS_TYPE_INT,
+ MM_ATTRS_FLAG_RW,
+ {(void *)NULL},
+ MM_ATTRS_VALID_TYPE_INT_ARRAY,
+ {.int_array = NULL},
+ {.count = 0},
+ NULL,
+ },
+ {
+ MMPLAYER_ATTRS_AUDIO_ONLY,
+ (char *)"audio_only", /* MM_PLAYER_AUDIO_ONLY */
+ MM_ATTRS_TYPE_INT,
+ MM_ATTRS_FLAG_RW,
+ {(void *)FALSE},
+ MM_ATTRS_VALID_TYPE_INT_RANGE,
+ {.int_min = FALSE},
+ {.int_max = TRUE},
+ NULL,
+ },
+ };
+
MMPLAYER_RETURN_VAL_IF_FAIL(handle, 0);
num_of_attrs = ARRAY_SIZE(player_attrs);
return NULL;
}
+ /* alloc default attribute info */
+ player->default_attrs = (mmplayer_attrs_spec_t *)g_try_malloc(sizeof(mmplayer_attrs_spec_t) * num_of_attrs);
+ if (player->default_attrs == NULL) {
+ LOGE("failed to alloc default attribute info");
+ goto ERROR;
+ }
+
+ memcpy(player->default_attrs, player_attrs, sizeof(mmplayer_attrs_spec_t) * num_of_attrs);
+ __mmplayer_set_ini_to_valid_info(handle);
+
/* initialize values of attributes */
for (idx = 0; idx < num_of_attrs; idx++) {
- base[idx].name = player_attrs[idx].name;
- base[idx].value_type = player_attrs[idx].value_type;
- base[idx].flags = player_attrs[idx].flags;
- base[idx].default_value = player_attrs[idx].default_value.value_void; /* FIXME: need to consider the double data type */
+ base[idx].name = player->default_attrs[idx].name;
+ base[idx].value_type = player->default_attrs[idx].value_type;
+ base[idx].flags = player->default_attrs[idx].flags;
+ base[idx].default_value = player->default_attrs[idx].default_value.value_void; /* FIXME: need to consider the double data type */
}
result = mm_attrs_new(base, num_of_attrs, "mmplayer_attrs",
/* clean */
MMPLAYER_FREEIF(base);
- if (result) {
+ if (result != MM_ERROR_NONE) {
LOGE("failed to create player attrs");
- return NULL;
+ goto ERROR;
}
- __mmplayer_set_ini_to_valid_info(handle);
-
/* set validity type and range */
for (idx = 0; idx < num_of_attrs; idx++) {
- mm_attrs_set_valid_type(attrs, idx, player_attrs[idx].valid_type);
- switch (player_attrs[idx].valid_type) {
+ mm_attrs_set_valid_type(attrs, idx, player->default_attrs[idx].valid_type);
+ switch (player->default_attrs[idx].valid_type) {
case MM_ATTRS_VALID_TYPE_INT_RANGE:
mm_attrs_set_valid_range(attrs, idx,
- player_attrs[idx].validity_value_1.int_min,
- player_attrs[idx].validity_value_2.int_max,
- player_attrs[idx].default_value.value_int);
+ player->default_attrs[idx].validity_value_1.int_min,
+ player->default_attrs[idx].validity_value_2.int_max,
+ player->default_attrs[idx].default_value.value_int);
break;
case MM_ATTRS_VALID_TYPE_INT_ARRAY:
- if (player_attrs[idx].validity_value_1.int_array &&
- player_attrs[idx].validity_value_2.count > 0)
+ if (player->default_attrs[idx].validity_value_1.int_array &&
+ player->default_attrs[idx].validity_value_2.count > 0)
mm_attrs_set_valid_array(attrs, idx,
- (const int *)(player_attrs[idx].validity_value_1.int_array),
- player_attrs[idx].validity_value_2.count,
- player_attrs[idx].default_value.value_int);
+ (const int *)(player->default_attrs[idx].validity_value_1.int_array),
+ player->default_attrs[idx].validity_value_2.count,
+ player->default_attrs[idx].default_value.value_int);
break;
case MM_ATTRS_VALID_TYPE_DOUBLE_RANGE:
mm_attrs_set_valid_double_range(attrs, idx,
- player_attrs[idx].validity_value_1.double_min,
- player_attrs[idx].validity_value_2.double_max,
- player_attrs[idx].default_value.value_double);
+ player->default_attrs[idx].validity_value_1.double_min,
+ player->default_attrs[idx].validity_value_2.double_max,
+ player->default_attrs[idx].default_value.value_double);
break;
case MM_ATTRS_VALID_TYPE_DOUBLE_ARRAY:
LOGW("FIXME: need to set range value if required.");
/* commit */
if (mm_attrs_commit_all(attrs)) {
LOGE("failed to update attributes");
- mm_attrs_free(attrs);
- return NULL;
+ goto ERROR;
}
- __mmplayer_release_ini_info();
+ __mmplayer_release_ini_info(handle);
return attrs;
+
+ERROR:
+ MMPLAYER_FREEIF(base);
+ MMPLAYER_FREEIF(player->default_attrs);
+
+ if (attrs)
+ mm_attrs_free(attrs);
+
+ return NULL;
}
bool _mmplayer_deconstruct_attribute(MMHandleType handle)
player->attrs = NULL;
}
+ MMPLAYER_FREEIF(player->default_attrs);
+
return true;
}