MM_PLAYER_BUFFERING_MODE_MAX = MM_PLAYER_BUFFERING_MODE_SLINK,
}MMPlayerBufferingMode;
-/**
- * Enumeration of audio channel for video share
- */
-typedef enum
-{
- MM_PLAYER_AUDIO_CH_MONO_LEFT = 0,
- MM_PLAYER_AUDIO_CH_MONO_RIGHT,
- MM_PLAYER_AUDIO_CH_STEREO,
-} MMPlayerAudioChannel;
-
typedef enum
{
MM_PLAYER_FOCUS_CHANGED_COMPLETED = 0,
* @remark None
*/
int mm_player_get_video_share_master_clock(MMHandleType player, long long *video_time, long long *media_clock, long long *audio_time);
-/**
- * This function is to set audio channel
- *
- * @param player [in] handle of player
- * @param ch [in] audio channel
- * @return This function returns zero on success, or negative value with error code.
- *
- * @see
- * @remark None
- */
-int mm_player_gst_set_audio_channel(MMHandleType player, MMPlayerAudioChannel ch);
/**
* This function is to get the content angle
}
}
-int _mmplayer_gst_set_audio_channel(MMHandleType hplayer, MMPlayerAudioChannel ch_idx)
-{
- int result = MM_ERROR_NONE;
-
- mm_player_t* player = (mm_player_t*)hplayer;
- MMPlayerGstElement* mainbin = NULL;
- gchar* change_pad_name = NULL;
- GstPad* sinkpad = NULL;
- GstCaps* caps = NULL;
-
- MMPLAYER_FENTER();
-
- MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
-
- LOGD("Change Audio mode to %d\n", ch_idx);
- player->use_deinterleave = TRUE;
-
- if ((!player->pipeline) || (!player->pipeline->mainbin)) {
- LOGD("pre setting : %d\n", ch_idx);
-
- player->audio_mode.active_pad_index = ch_idx;
- return result;
- }
-
- mainbin = player->pipeline->mainbin;
-
- if (mainbin[MMPLAYER_M_A_SELECTOR].gst == NULL) {
- if (player->max_audio_channels < 2) {
- LOGD("mono channel track only\n");
- return result;
- }
-
- LOGW("selector doesn't exist\n");
- return result; /* keep playing */
- }
-
- LOGD("total_ch_num : %d\n", player->audio_mode.total_track_num);
-
- if (player->audio_mode.total_track_num < 2) {
- LOGW("there is no another audio path\n");
- return result; /* keep playing */
- }
-
- if ((ch_idx < 0) || (ch_idx >= player->audio_mode.total_track_num)) {
- LOGW("Not a proper ch_idx : %d \n", ch_idx);
- return result; /* keep playing */
- }
-
- /*To get the new pad from the selector*/
- change_pad_name = g_strdup_printf("sink%d", ch_idx);
- if (change_pad_name == NULL) {
- LOGW("Pad does not exists\n");
- goto ERROR; /* keep playing */
- }
-
- LOGD("new active pad name: %s\n", change_pad_name);
-
- sinkpad = gst_element_get_static_pad(mainbin[MMPLAYER_M_A_SELECTOR].gst, change_pad_name);
- if (sinkpad == NULL)
- //result = MM_ERROR_PLAYER_INTERNAL;
- goto ERROR; /* keep playing */
-
- LOGD("Set Active Pad - %s:%s\n", GST_DEBUG_PAD_NAME(sinkpad));
- g_object_set(mainbin[MMPLAYER_M_A_SELECTOR].gst, "active-pad", sinkpad, NULL);
-
- caps = gst_pad_get_current_caps(sinkpad);
- MMPLAYER_LOG_GST_CAPS_TYPE(caps);
-
- __mmplayer_set_audio_attrs(player, caps);
- player->audio_mode.active_pad_index = ch_idx;
-
-ERROR:
-
- if (sinkpad)
- gst_object_unref(sinkpad);
-
- MMPLAYER_FREEIF(change_pad_name);
-
- MMPLAYER_FLEAVE();
- return result;
-}
-
-
-
static void
__mmplayer_gst_deinterleave_pad_added(GstElement *elem, GstPad *pad, gpointer data)
{
position, (guint)(content_size_time/GST_SECOND), content_size_bytes);
mainbin = player->pipeline->mainbin;
- start_per = ceil(100 *(position*GST_MSECOND) / content_size_time);
+ start_per = (gint)(ceil(100 *(gdouble)(position*GST_MSECOND) / (gdouble)content_size_time));
if (mainbin[MMPLAYER_M_MUXED_S_BUFFER].gst) {
GstQuery *query = NULL;
LOGD("mode %d\n", mode);
- if ((mode < 0) || (mode > MM_PLAYER_BUFFERING_MODE_MAX) ||
+ if ((mode > MM_PLAYER_BUFFERING_MODE_MAX) ||
((mode == MM_PLAYER_BUFFERING_MODE_FIXED) && (second <= 0)))
return MM_ERROR_INVALID_ARGUMENT;
MMPLAYER_RETURN_VAL_IF_FAIL(message, FALSE);
s = malloc(sizeof(GstStructure));
+ if (s == NULL) {
+ LOGE("failed to alloc data.");
+ return FALSE;
+ }
+
memcpy(s, gst_message_get_structure(message), sizeof(GstStructure));
if (!gst_structure_get_uint(s, "error_id", &error_id))
LOGD("release signals type : %d", type);
- if ((type < MM_PLAYER_SIGNAL_TYPE_AUTOPLUG) || (type >= MM_PLAYER_SIGNAL_TYPE_ALL)) {
+ if (type >= MM_PLAYER_SIGNAL_TYPE_ALL) {
__mmplayer_release_signal_connection(player, MM_PLAYER_SIGNAL_TYPE_AUTOPLUG);
__mmplayer_release_signal_connection(player, MM_PLAYER_SIGNAL_TYPE_VIDEOBIN);
__mmplayer_release_signal_connection(player, MM_PLAYER_SIGNAL_TYPE_AUDIOBIN);
player = MM_PLAYER_CAST(handle);
- if (surface_type < MM_DISPLAY_SURFACE_OVERLAY || surface_type >= MM_DISPLAY_SURFACE_NUM) {
+ if (surface_type >= MM_DISPLAY_SURFACE_NUM) {
LOGE("Not support this surface type(%d) for changing vidoesink", surface_type);
MMPLAYER_FLEAVE();
return MM_ERROR_INVALID_ARGUMENT;