Name: libmm-player
Summary: Multimedia Framework Player Library
-Version: 0.6.160
+Version: 0.6.161
Release: 0
Group: Multimedia/Libraries
License: Apache-2.0
* @code
int start_pos = 0, stop_pos = 0;
-mm_player_get_buffer_position(g_player, MM_PLAYER_POS_FORMAT_PERCENT, &start_pos, &stop_pos );
+mm_player_get_buffer_position(g_player, &start_pos, &end_pos );
-LOGD("buffer position: [%d] ~ [%d] \%\n", start_pos, stop_pos );
+LOGD("buffer position: [%d] ~ [%d] \%\n", start_pos, end_pos );
* @endcode
*/
-int mm_player_get_buffer_position(MMHandleType player, MMPlayerPosFormatType format, unsigned long *start_pos, unsigned long *stop_pos);
+int mm_player_get_buffer_position(MMHandleType player, int *start_pos, int *end_pos);
/**
* This function sets callback function for receiving messages from player.
gint64 cur, GstSeekType stop_type, gint64 stop);
int __mmplayer_gst_set_position(mm_player_t* player, gint64 position, gboolean internal_called);
int __mmplayer_gst_get_position(mm_player_t* player, gint64* position);
-int __mmplayer_gst_get_buffer_position(mm_player_t* player, int format, unsigned long* start_pos, unsigned long* stop_pos);
+int __mmplayer_gst_get_buffer_position(mm_player_t *player, int *start_pos, int *end_pos);
GstElement* __mmplayer_gst_create_source(mm_player_t* player);
int __mmplayer_gst_build_es_pipeline(mm_player_t* player);
int __mmplayer_gst_build_pipeline(mm_player_t* player);
int _mmplayer_set_subtitle_silent(MMHandleType hplayer, int silent);
int _mmplayer_get_subtitle_silent(MMHandleType hplayer, int *silent);
int _mmplayer_set_external_subtitle_path(MMHandleType hplayer, const char *filepath);
-int _mmplayer_get_buffer_position(MMHandleType hplayer, int format, unsigned long *start_pos, unsigned long *stop_pos);
+int _mmplayer_get_buffer_position(MMHandleType hplayer, int *start_pos, int *end_pos);
int _mmplayer_update_video_param(mm_player_t *player, char *param_name);
int _mmplayer_change_videosink(MMHandleType handle, MMDisplaySurfaceType surface_type, void *display_overlay);
int _mmplayer_audio_effect_custom_apply(mm_player_t *player);
}
-int mm_player_get_buffer_position(MMHandleType player, MMPlayerPosFormatType format, unsigned long *start_pos, unsigned long *stop_pos)
+int mm_player_get_buffer_position(MMHandleType player, int *start_pos, int *end_pos)
{
int result = MM_ERROR_NONE;
MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
- MMPLAYER_RETURN_VAL_IF_FAIL(start_pos && stop_pos, MM_ERROR_COMMON_INVALID_ARGUMENT);
+ MMPLAYER_RETURN_VAL_IF_FAIL(start_pos && end_pos, MM_ERROR_COMMON_INVALID_ARGUMENT);
MMPLAYER_CMD_LOCK(player);
- result = _mmplayer_get_buffer_position(player, (int)format, start_pos, stop_pos);
+ result = _mmplayer_get_buffer_position(player, start_pos, end_pos);
MMPLAYER_CMD_UNLOCK(player);
return result;
}
-int mm_player_set_external_subtitle_path(MMHandleType player, const char* path)
+int mm_player_set_external_subtitle_path(MMHandleType player, const char *path)
{
int result = MM_ERROR_NONE;
return MM_ERROR_NONE;
}
-int __mmplayer_gst_get_buffer_position(mm_player_t* player, int format, unsigned long* start_pos, unsigned long* stop_pos)
+int __mmplayer_gst_get_buffer_position(mm_player_t *player, int *start_pos, int *end_pos)
{
#define STREAMING_IS_FINISHED 0
#define BUFFERING_MAX_PER 100
#define CHECK_PERCENT_VALUE(a, min, max)(((a) > (min)) ? (((a) < (max)) ? (a) : (max)) : (min))
MMPlayerGstElement *mainbin = NULL;
- gint start_per = DEFAULT_PER_VALUE, stop_per = DEFAULT_PER_VALUE;
+ gint start_per = DEFAULT_PER_VALUE, end_per = DEFAULT_PER_VALUE;
gint64 buffered_total = 0;
gint64 position = 0;
gint buffered_sec = -1;
player->pipeline->mainbin,
MM_ERROR_PLAYER_NOT_INITIALIZED);
- MMPLAYER_RETURN_VAL_IF_FAIL(start_pos && stop_pos, MM_ERROR_INVALID_ARGUMENT);
+ MMPLAYER_RETURN_VAL_IF_FAIL(start_pos && end_pos, MM_ERROR_INVALID_ARGUMENT);
*start_pos = 0;
- *stop_pos = 0;
+ *end_pos = 0;
if (!MMPLAYER_IS_HTTP_STREAMING(player)) {
/* and rtsp is not ready yet. */
return MM_ERROR_PLAYER_NO_OP;
}
- if (format != MM_PLAYER_POS_FORMAT_PERCENT) {
- LOGW("Time format is not supported yet");
- return MM_ERROR_INVALID_ARGUMENT;
- }
-
if (content_size_time <= 0 || content_size_bytes <= 0) {
LOGW("there is no content size");
return MM_ERROR_NONE;
if (gst_element_query_position(mainbin[MMPLAYER_M_SRC].gst,
GST_FORMAT_BYTES, &buffered_total)) {
LOGD("buffered_total %"G_GINT64_FORMAT, buffered_total);
- stop_per = 100 * buffered_total / content_size_bytes;
+ end_per = 100 * buffered_total / content_size_bytes;
}
} else {
/* GST_BUFFERING_TIMESHIFT or GST_BUFFERING_DOWNLOAD */
buffered_total += (stop_byte - start_byte);
}
} else
- stop_per = BUFFERING_MAX_PER;
+ end_per = BUFFERING_MAX_PER;
}
gst_query_unref(query);
}
- if (stop_per == DEFAULT_PER_VALUE) {
+ if (end_per == DEFAULT_PER_VALUE) {
guint dur_sec = (guint)(content_size_time/GST_SECOND);
if (dur_sec > 0) {
guint avg_byterate = (guint)(content_size_bytes/dur_sec);
buffered_sec = (gint)(ceil((gdouble)GET_BIT_FROM_BYTE(buffered_total)/(gdouble)player->total_bitrate));
if (buffered_sec >= 0)
- stop_per = start_per +(gint)(ceil)(100*(gdouble)buffered_sec/(gdouble)dur_sec);
+ end_per = start_per +(gint)(ceil)(100*(gdouble)buffered_sec/(gdouble)dur_sec);
}
}
*start_pos = CHECK_PERCENT_VALUE(start_per, 0, 100);
- *stop_pos = CHECK_PERCENT_VALUE(stop_per, *start_pos, 100);
+ *end_pos = CHECK_PERCENT_VALUE(end_per, *start_pos, 100);
- LOGD("buffered info: %"G_GINT64_FORMAT" bytes, %d sec, per %lu~%lu",
- buffered_total, buffered_sec, *start_pos, *stop_pos);
+ LOGD("buffered info: %"G_GINT64_FORMAT" bytes, %d sec, per %d~%d",
+ buffered_total, buffered_sec, *start_pos, *end_pos);
return MM_ERROR_NONE;
}
if (!__mmplayer_create_audio_sink_path(player, audio_selector))
goto EXIT;
-
/* create text path followed by text-select */
__mmplayer_create_text_sink_path(player, text_selector);
}
int
-_mmplayer_get_buffer_position(MMHandleType hplayer, int format, unsigned long* start_pos, unsigned long* stop_pos)
+_mmplayer_get_buffer_position(MMHandleType hplayer, int *start_pos, int *end_pos)
{
- mm_player_t* player = (mm_player_t*)hplayer;
+ mm_player_t *player = (mm_player_t*)hplayer;
int ret = MM_ERROR_NONE;
MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
- ret = __mmplayer_gst_get_buffer_position(player, format, start_pos, stop_pos);
+ ret = __mmplayer_gst_get_buffer_position(player, start_pos, end_pos);
return ret;
}
if (MMPLAYER_CURRENT_STATE(player) != MM_PLAYER_STATE_NULL)
LOGW("buffer_ms will not be applied.");
-
LOGD("set buffering time %d ms / %d ms", buffer_ms, rebuffer_ms);
if (player->streamer == NULL) {