#include <mm_attrs_private.h>
#include <mm_attrs.h>
#include <gst/interfaces/xoverlay.h>
-
+#include "mm_player_utils.h"
#include "mm_player_priv.h"
#include "mm_player_attrs.h"
int result = MM_ERROR_NONE;
MMHandleType attrs = 0;
- debug_fenter();
-
/* NOTE : Don't need to check err_attr_name because it can be set NULL */
/* if it's not want to know it. */
return_val_if_fail(attribute_name, MM_ERROR_COMMON_INVALID_ARGUMENT);
if ( result != MM_ERROR_NONE)
debug_error("failed to get %s attribute\n", attribute_name);
- debug_fleave();
-
return result;
}
int result = MM_ERROR_NONE;
MMHandleType attrs = 0;
- debug_fenter();
-
/* NOTE : Don't need to check err_attr_name because it can be set NULL */
/* if it's not want to know it. */
return_val_if_fail(attribute_name, MM_ERROR_COMMON_INVALID_ARGUMENT);
return result;
}
- debug_fleave();
-
return result;
}
MMHandleType attrs = 0;
MMAttrsInfo src_info = {0, };
- debug_fenter();
-
return_val_if_fail(attribute_name, MM_ERROR_COMMON_INVALID_ARGUMENT);
return_val_if_fail(dst_info, MM_ERROR_COMMON_INVALID_ARGUMENT);
return_val_if_fail(handle, MM_ERROR_COMMON_INVALID_ARGUMENT);
break;
}
- debug_fleave();
-
return result;
}
int
__mmplayer_apply_attribute(MMHandleType handle, const char *attribute_name)
{
- MMHandleType attrs = 0;
mm_player_t* player = 0;
- debug_fenter();
-
return_val_if_fail(handle, MM_ERROR_COMMON_INVALID_ARGUMENT);
return_val_if_fail(attribute_name, MM_ERROR_COMMON_INVALID_ARGUMENT);
- attrs = MM_PLAYER_GET_ATTRS(handle);;
player = MM_PLAYER_CAST(handle);
if ( g_strrstr(attribute_name, "display") )
{
/* check videosink element is created */
if ( !player->pipeline ||
- !player->pipeline->videobin ||
- !player->pipeline->videobin[MMPLAYER_V_SINK].gst )
+ !player->pipeline->videobin ||
+ !player->pipeline->videobin[MMPLAYER_V_SINK].gst )
{
- debug_warning("videosink element is not yet ready\n");
/*
* The attribute should be committed even though videobin is not created yet.
* So, true should be returned here.
if ( MM_ERROR_NONE != _mmplayer_update_video_param( player ) )
{
- debug_error("failed to update video param\n");
+ debug_error("failed to update video param");
return MM_ERROR_PLAYER_INTERNAL;
}
}
- debug_fleave();
-
return MM_ERROR_NONE;
}
MMHandleType
_mmplayer_construct_attribute(MMHandleType handle)
{
+ mm_player_t *player = NULL;
int idx = 0;
MMHandleType attrs = 0;
int num_of_attrs = 0;
mmf_attrs_construct_info_t *base = NULL;
- gchar *system_ua = NULL;
- gchar *system_proxy = NULL;
+ //gchar *system_ua = NULL;
- debug_fenter();
+ return_val_if_fail (handle, 0);
- return_if_fail(handle);
+ player = MM_PLAYER_CAST(handle);
MMPlayerAttrsSpec player_attrs[] =
{
{
- "profile_uri", // name
+ "profile_uri", // name
MM_ATTRS_TYPE_STRING, // type
- MM_ATTRS_FLAG_RW, // flag
- (void *) NULL, // default value
+ MM_ATTRS_FLAG_RW, // flag
+ (void *) NULL, // default value
MM_ATTRS_VALID_TYPE_NONE, // validity type
- 0, // validity min value
- 0 // validity max value
+ 0, // validity min value
+ 0 // validity max value
},
{
"profile_user_param",
MMPLAYER_MAX_INT
},
{
- "profile_async_start",
+ "profile_prepare_async",
MM_ATTRS_TYPE_INT,
MM_ATTRS_FLAG_RW,
- (void *) 1,
+ (void *) 0,
MM_ATTRS_VALID_TYPE_INT_RANGE,
0,
1
0
},
{
+ "streaming_timeout",
+ MM_ATTRS_TYPE_INT,
+ MM_ATTRS_FLAG_RW,
+ (void *) -1, // DEFAULT_HTTP_TIMEOUT
+ MM_ATTRS_VALID_TYPE_INT_RANGE,
+ -1,
+ MMPLAYER_MAX_INT
+ },
+ {
"subtitle_uri",
MM_ATTRS_TYPE_STRING,
MM_ATTRS_FLAG_RW,
MMPLAYER_MAX_INT
},
{
+ "content_text_track_num",
+ MM_ATTRS_TYPE_INT,
+ MM_ATTRS_FLAG_RW,
+ (void *) 0,
+ MM_ATTRS_VALID_TYPE_INT_RANGE,
+ 0,
+ MMPLAYER_MAX_INT
+ },
+ {
"tag_artist",
MM_ATTRS_TYPE_STRING,
MM_ATTRS_FLAG_RW,
0
},
{
+ "display_src_crop_x",
+ MM_ATTRS_TYPE_INT,
+ MM_ATTRS_FLAG_RW,
+ (void *) 0,
+ MM_ATTRS_VALID_TYPE_INT_RANGE,
+ 0,
+ MMPLAYER_MAX_INT
+ },
+ {
+ "display_src_crop_y",
+ MM_ATTRS_TYPE_INT,
+ MM_ATTRS_FLAG_RW,
+ (void *) 0,
+ MM_ATTRS_VALID_TYPE_INT_RANGE,
+ 0,
+ MMPLAYER_MAX_INT
+ },
+ {
+ "display_src_crop_width",
+ MM_ATTRS_TYPE_INT,
+ MM_ATTRS_FLAG_RW,
+ (void *) 0,
+ MM_ATTRS_VALID_TYPE_INT_RANGE,
+ 0,
+ MMPLAYER_MAX_INT
+ },
+ {
+ "display_src_crop_height",
+ MM_ATTRS_TYPE_INT,
+ MM_ATTRS_FLAG_RW,
+ (void *) 0,
+ MM_ATTRS_VALID_TYPE_INT_RANGE,
+ 0,
+ MMPLAYER_MAX_INT
+ },
+ {
"display_roi_x",
MM_ATTRS_TYPE_INT,
MM_ATTRS_FLAG_RW,
MMPLAYER_MAX_INT
},
{
+ "display_roi_mode",
+ MM_ATTRS_TYPE_INT,
+ MM_ATTRS_FLAG_RW,
+ (void *) MM_DISPLAY_METHOD_CUSTOM_ROI_FULL_SCREEN,
+ MM_ATTRS_VALID_TYPE_INT_RANGE,
+ MM_DISPLAY_METHOD_CUSTOM_ROI_FULL_SCREEN,
+ MM_DISPLAY_METHOD_CUSTOM_ROI_LETER_BOX
+ },
+ {
"display_rotation",
MM_ATTRS_TYPE_INT,
MM_ATTRS_FLAG_RW,
"display_visible",
MM_ATTRS_TYPE_INT,
MM_ATTRS_FLAG_RW,
- (void *) TRUE,
+ (void *) FALSE,
MM_ATTRS_VALID_TYPE_INT_RANGE,
0,
1
0
},
{
- "display_overlay_ext",
+ "display_overlay_user_data",
MM_ATTRS_TYPE_DATA,
MM_ATTRS_FLAG_RW,
(void *) NULL,
},
{
"display_zoom",
- MM_ATTRS_TYPE_INT,
+ MM_ATTRS_TYPE_DOUBLE,
MM_ATTRS_FLAG_RW,
(void *) 1,
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- 1,
- MMPLAYER_MAX_INT
+ MM_ATTRS_VALID_TYPE_DOUBLE_RANGE,
+ 1.0,
+ 9.0
},
{
"display_surface_type",
MM_ATTRS_TYPE_INT,
MM_ATTRS_FLAG_RW,
- (void *) 0,
+ (void *) MM_DISPLAY_SURFACE_NULL,
MM_ATTRS_VALID_TYPE_INT_RANGE,
MM_DISPLAY_SURFACE_X,
- MM_DISPLAY_SURFACE_NULL
- },
- {
- "display_surface_use_multi",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- (void *) FALSE,
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- FALSE,
- TRUE
+ MM_DISPLAY_SURFACE_X_EXT
},
{
"display_evas_surface_sink",
MM_ATTRS_TYPE_STRING,
MM_ATTRS_FLAG_READABLE,
- (void *) PLAYER_INI()->videosink_element_evas,
+ (void *) player->ini.videosink_element_evas,
MM_ATTRS_VALID_TYPE_NONE,
0,
0
MM_ATTRS_FLAG_RW,
(void *) MM_SOUND_VOLUME_TYPE_MEDIA,
MM_ATTRS_VALID_TYPE_INT_RANGE,
- MM_SOUND_VOLUME_TYPE_SYSTEM,
- MM_SOUND_VOLUME_TYPE_CALL
+ 0,
+ MMPLAYER_MAX_INT
},
{
"sound_route",
"sound_priority",
MM_ATTRS_TYPE_INT,
MM_ATTRS_FLAG_RW,
- (void *) 0, // 0: normal, 1: high 2: high with sound transition
+ (void *) 0, // 0: normal, 1: high 2: high with sound transition 3: mix with others regardless of priority
+ MM_ATTRS_VALID_TYPE_INT_RANGE,
+ 0,
+ 3
+ },
+ {
+ "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,
0,
2
"pcm_extraction_samplerate", // set samplerate for pcm extraction
MM_ATTRS_TYPE_INT,
MM_ATTRS_FLAG_RW,
- (void *) 8000, // hz
+ (void *) 44100, // hz
MM_ATTRS_VALID_TYPE_INT_RANGE,
0,
MMPLAYER_MAX_INT
MM_ATTRS_VALID_TYPE_NONE,
0,
0
+ },
+ {
+ "accurate_seek",
+ MM_ATTRS_TYPE_INT,
+ MM_ATTRS_FLAG_RW,
+ (void *) 0,
+ MM_ATTRS_VALID_TYPE_INT_RANGE,
+ 0,
+ 1
}
};
if ( !base )
{
- debug_error("Cannot create mmplayer attribute\n");
- goto ERROR;
+ debug_error("failed to alloc attrs constructor");
+ return 0;
}
/* initialize values of attributes */
if ( !attrs )
{
- debug_error("Cannot create mmplayer attribute\n");
- goto ERROR;
+ debug_error("failed to create player attrs");
+ return 0;
}
/* set validity type and range */
mmf_attrs_set_valid_range (attrs, idx,
player_attrs[idx].value_min,
player_attrs[idx].value_max,
- player_attrs[idx].default_value);
+ (int)(player_attrs[idx].default_value));
}
break;
}
}
- /* set proxy and user agent */
- system_ua = vconf_get_str(VCONFKEY_ADMIN_UAGENT);
- system_proxy = vconf_get_str(VCONFKEY_NETWORK_PROXY);
-
- if (system_ua)
- {
- mm_attrs_set_string_by_name(attrs, "streaming_user_agent", system_ua);
- g_free(system_ua);
- }
-
- if (system_proxy)
- {
- mm_attrs_set_string_by_name(attrs, "streaming_proxy", system_proxy);
- g_free(system_proxy);
- }
-
/* commit */
mmf_attrs_commit(attrs);
- debug_fleave();
-
return attrs;
-
-ERROR:
- _mmplayer_deconstruct_attribute(handle);
-
- return FALSE;
}
bool
_mmplayer_deconstruct_attribute(MMHandleType handle) // @
{
- debug_fenter();
-
mm_player_t *player = MM_PLAYER_CAST(handle);
- return_if_fail( player );
+ return_val_if_fail ( player, FALSE );
if (player->attrs)
{
player->attrs = 0;
}
- debug_fleave();
+ return TRUE;
}