gdouble percent_time;
} streaming_buffer_info_t;
-static void streaming_set_buffer_percent(mm_player_streaming_t* streamer, BufferType type, gdouble high_percent_byte, gdouble high_percent_time);
-static void streaming_set_queue2_queue_type(mm_player_streaming_t* streamer, MuxedBufferType type, gchar * file_path, guint64 content_size);
-static void streaming_set_buffer_size(mm_player_streaming_t* streamer, BufferType type, guint buffering_bytes, gint buffering_time);
-static void streaming_update_buffering_status(mm_player_streaming_t* streamer, GstMessage *buffering_msg, gint64 position);
-static void streaming_get_current_bitrate_info(mm_player_streaming_t* streamer,
+static void streaming_set_buffer_percent(mm_player_streaming_t *streamer, BufferType type, gdouble high_percent_byte, gdouble high_percent_time);
+static void streaming_set_queue2_queue_type(mm_player_streaming_t *streamer, MuxedBufferType type, gchar *file_path, guint64 content_size);
+static void streaming_set_buffer_size(mm_player_streaming_t *streamer, BufferType type, guint buffering_bytes, gint buffering_time);
+static void streaming_update_buffering_status(mm_player_streaming_t *streamer, GstMessage *buffering_msg, gint64 position);
+static void streaming_get_current_bitrate_info(mm_player_streaming_t *streamer,
GstMessage *buffering_msg,
streaming_content_info_t content_info,
- streaming_bitrate_info_t* bitrate_info);
+ streaming_bitrate_info_t *bitrate_info);
static void
-streaming_handle_fixed_buffering_mode(mm_player_streaming_t* streamer,
+streaming_handle_fixed_buffering_mode(mm_player_streaming_t *streamer,
gint byte_out_rate,
gint fixed_buffering_time,
- streaming_buffer_info_t* buffer_info);
+ streaming_buffer_info_t *buffer_info);
static void
-streaming_handle_adaptive_buffering_mode(mm_player_streaming_t* streamer,
- streaming_content_info_t content_info,
- streaming_bitrate_info_t bitrate_info,
- streaming_buffer_info_t* buffer_info,
- gint expected_play_time);
+streaming_handle_adaptive_buffering_mode(mm_player_streaming_t *streamer,
+ streaming_content_info_t content_info,
+ streaming_bitrate_info_t bitrate_info,
+ streaming_buffer_info_t *buffer_info,
+ gint expected_play_time);
static void
-streaming_update_buffer_setting(mm_player_streaming_t* streamer,
- GstMessage *buffering_msg,
- guint64 content_size,
- gint64 position,
- gint64 duration);
+streaming_update_buffer_setting(mm_player_streaming_t *streamer,
+ GstMessage *buffering_msg,
+ guint64 content_size,
+ gint64 position,
+ gint64 duration);
mm_player_streaming_t *
__mm_player_streaming_create(void)
MMPLAYER_FENTER();
- streamer = (mm_player_streaming_t *) g_malloc0(sizeof(mm_player_streaming_t));
+ streamer = (mm_player_streaming_t *)g_try_malloc0(sizeof(mm_player_streaming_t));
if (!streamer) {
- LOGE("fail to create streaming player handle..\n");
+ LOGE("fail to create streaming player handle..");
return NULL;
}
}
static void
-streaming_buffer_initialize(streaming_buffer_t* buffer_handle, gboolean buffer_init)
+streaming_buffer_initialize(streaming_buffer_t *buffer_handle, gboolean buffer_init)
{
if (buffer_init)
buffer_handle->buffer = NULL;
}
-void __mm_player_streaming_initialize(mm_player_streaming_t* streamer)
+void
+__mm_player_streaming_initialize(mm_player_streaming_t *streamer)
{
MMPLAYER_FENTER();
return;
}
-void __mm_player_streaming_deinitialize(mm_player_streaming_t* streamer)
+void
+__mm_player_streaming_deinitialize(mm_player_streaming_t *streamer)
{
MMPLAYER_FENTER();
MMPLAYER_RETURN_IF_FAIL(streamer);
return;
}
-void __mm_player_streaming_destroy(mm_player_streaming_t* streamer)
+void
+__mm_player_streaming_destroy(mm_player_streaming_t *streamer)
{
MMPLAYER_FENTER();
- g_free(streamer);
+ MMPLAYER_FREEIF(streamer);
MMPLAYER_FLEAVE();
return;
}
-void __mm_player_streaming_set_content_bitrate(mm_player_streaming_t* streamer, guint max_bitrate, guint avg_bitrate)
+void
+__mm_player_streaming_set_content_bitrate(mm_player_streaming_t *streamer, guint max_bitrate, guint avg_bitrate)
{
MMPLAYER_FENTER();
MMPLAYER_RETURN_IF_FAIL(streamer);
/* Note : Update buffering criterion bytes
- * 1. maximum bitrate is considered first.
- * 2. average bitrage * 3 is next.
- * 3. if there are no updated bitrate, use default buffering limit.
- */
+ * 1. maximum bitrate is considered first.
+ * 2. average bitrage * 3 is next.
+ * 3. if there are no updated bitrate, use default buffering limit.
+ */
if (max_bitrate > 0 && streamer->buffer_max_bitrate != max_bitrate) {
- LOGD("set maximum bitrate(%dbps).\n", max_bitrate);
+ LOGD("set maximum bitrate(%dbps).", max_bitrate);
streamer->buffer_max_bitrate = max_bitrate;
if (streamer->buffering_req.is_pre_buffering == FALSE) {
streamer->need_update = TRUE;
} else {
- LOGD("pre-buffering...\n");
+ LOGD("pre-buffering...");
if (IS_MUXED_BUFFERING_MODE(streamer))
streaming_update_buffer_setting(streamer, NULL, 0, 0, 0);
}
if (avg_bitrate > 0 && streamer->buffer_avg_bitrate != avg_bitrate) {
- LOGD("set averate bitrate(%dbps).\n", avg_bitrate);
+ LOGD("set averate bitrate(%dbps).", avg_bitrate);
streamer->buffer_avg_bitrate = avg_bitrate;
if (streamer->buffering_req.is_pre_buffering == FALSE) {
streamer->need_update = TRUE;
} else {
- LOGD("pre-buffering...\n");
+ LOGD("pre-buffering...");
if (IS_MUXED_BUFFERING_MODE(streamer))
streaming_update_buffer_setting(streamer, NULL, 0, 0, 0);
}
static void
-streaming_set_buffer_percent(mm_player_streaming_t* streamer,
- BufferType type,
- gdouble high_percent_byte,
- gdouble high_percent_time)
+streaming_set_buffer_percent(mm_player_streaming_t *streamer,
+ BufferType type,
+ gdouble high_percent_byte,
+ gdouble high_percent_time)
{
gdouble high_percent = 0.0;
- streaming_buffer_t* buffer_handle = NULL;
- gchar* factory_name = NULL;
+ streaming_buffer_t *buffer_handle = NULL;
+ gchar *factory_name = NULL;
MMPLAYER_FENTER();
MMPLAYER_RETURN_IF_FAIL(streamer);
}
static void
-streaming_set_queue2_queue_type(mm_player_streaming_t* streamer, MuxedBufferType type, gchar * file_path, guint64 content_size)
+streaming_set_queue2_queue_type(mm_player_streaming_t *streamer, MuxedBufferType type, gchar *file_path, guint64 content_size)
{
- streaming_buffer_t* buffer_handle = NULL;
+ streaming_buffer_t *buffer_handle = NULL;
guint64 storage_available_size = 0; /* bytes */
guint64 buffer_size = 0; /* bytes */
gchar file_buffer_name[MM_MAX_URL_LEN] = {0};
struct statfs buf = {0};
- gchar* factory_name = NULL;
+ gchar *factory_name = NULL;
MMPLAYER_FENTER();
MMPLAYER_RETURN_IF_FAIL(streamer);
}
factory_name = GST_OBJECT_NAME(gst_element_get_factory(buffer_handle->buffer));
-
if (!factory_name) {
LOGE("Fail to get factory name!");
return;
LOGD("target buffer elem : %s", GST_ELEMENT_NAME(buffer_handle->buffer));
if (!g_strrstr(factory_name, "queue2")) {
- LOGD("only queue2 can use file buffer. not decodebin2 or multiQ\n");
+ LOGD("only queue2 can use file buffer. not decodebin2 or multiQ");
return;
}
return;
}
- LOGD("[Queue2] buffering type : %d. streaming is played on pull-based. \n", type);
+ LOGD("[Queue2] buffering type : %d. streaming is played on pull-based.", type);
if (type == MUXED_BUFFER_TYPE_FILE && file_path && strlen(file_path) > 0) {
if (statfs((const char *)file_path, &buf) < 0) {
- LOGW("[Queue2] fail to get available storage capacity. set mem ring buffer instead of file buffer.\n");
+ LOGW("[Queue2] fail to get available storage capacity. set mem ring buffer instead of file buffer.");
buffer_size = (guint64)((streamer->ring_buffer_size > 0) ? (streamer->ring_buffer_size) : DEFAULT_RING_BUFFER_SIZE);
} else {
storage_available_size = (guint64)buf.f_bavail * (guint64)buf.f_bsize; //bytes
LOGD("[Queue2] the number of available blocks : %"G_GUINT64_FORMAT
- ", the block size is %"G_GUINT64_FORMAT".\n",
+ ", the block size is %"G_GUINT64_FORMAT".",
(guint64)buf.f_bavail, (guint64)buf.f_bsize);
LOGD("[Queue2] calculated available storage size is %"
- G_GUINT64_FORMAT" Bytes.\n", storage_available_size);
+ G_GUINT64_FORMAT" Bytes.", storage_available_size);
if (content_size <= 0 || content_size >= storage_available_size)
buffer_size = storage_available_size;
buffer_size = 0L;
g_snprintf(file_buffer_name, MM_MAX_URL_LEN, "%sXXXXXX", file_path);
- SECURE_LOGD("[Queue2] the buffering file name is %s.\n", file_buffer_name);
+ SECURE_LOGD("[Queue2] the buffering file name is %s.", file_buffer_name);
g_object_set(G_OBJECT(buffer_handle->buffer), "temp-template", file_buffer_name, NULL);
}
}
static void
-streaming_set_buffer_size(mm_player_streaming_t* streamer, BufferType type, guint buffering_bytes, gint buffering_time)
+streaming_set_buffer_size(mm_player_streaming_t *streamer, BufferType type, guint buffering_bytes, gint buffering_time)
{
- streaming_buffer_t* buffer_handle = NULL;
+ streaming_buffer_t *buffer_handle = NULL;
MMPLAYER_FENTER();
if (buffer_handle->is_live)
g_object_set(G_OBJECT(buffer_handle->buffer),
"max-size-bytes", buffering_bytes,
- "max-size-time", (guint64)(buffering_time*GST_MSECOND),
+ "max-size-time", (guint64)(buffering_time * GST_MSECOND),
"max-size-buffers", 0,
"use-rate-estimate", TRUE, NULL);
else
return;
}
-void __mm_player_streaming_set_queue2(mm_player_streaming_t* streamer,
- GstElement* buffer,
- gboolean use_buffering,
- guint buffering_bytes,
- gint buffering_time,
- MuxedBufferType type,
- gchar* file_path,
- guint64 content_size)
+void
+__mm_player_streaming_set_queue2(mm_player_streaming_t *streamer,
+ GstElement *buffer,
+ gboolean use_buffering,
+ guint buffering_bytes,
+ gint buffering_time,
+ MuxedBufferType type,
+ gchar *file_path,
+ guint64 content_size)
{
MMPLAYER_FENTER();
MMPLAYER_RETURN_IF_FAIL(streamer);
return;
}
-void __mm_player_streaming_sync_property(mm_player_streaming_t* streamer, GstElement* decodebin)
+void
+__mm_player_streaming_sync_property(mm_player_streaming_t *streamer, GstElement *decodebin)
{
- streaming_buffer_t* buffer_handle = NULL;
+ streaming_buffer_t *buffer_handle = NULL;
MMPLAYER_FENTER();
streamer->need_sync = FALSE;
}
-void __mm_player_streaming_set_multiqueue(mm_player_streaming_t* streamer,
- GstElement* buffer,
+void
+__mm_player_streaming_set_multiqueue(mm_player_streaming_t *streamer,
+ GstElement *buffer,
gint buffering_time)
{
- streaming_buffer_t* buffer_handle = NULL;
+ streaming_buffer_t *buffer_handle = NULL;
gdouble high_percent = 0.0;
MMPLAYER_FENTER();
g_object_set(G_OBJECT(buffer_handle->buffer), "use-buffering", TRUE, NULL);
- LOGD("pre_buffering: %d ms, during playing: %d ms\n", streamer->buffering_req.prebuffer_time, buffering_time);
+ LOGD("pre_buffering: %d ms, during playing: %d ms", streamer->buffering_req.prebuffer_time, buffering_time);
if (streamer->buffering_req.prebuffer_time > 0)
streamer->buffering_req.is_pre_buffering = TRUE;
streamer->buffering_req.prebuffer_time = GET_DEFAULT_PLAYING_TIME(streamer);
high_percent = (gdouble)(streamer->buffering_req.prebuffer_time * 100) / GET_MAX_BUFFER_TIME(streamer);
- LOGD("high_percent %2.3f %%\n", high_percent);
+ LOGD("high_percent %2.3f %%", high_percent);
/* initial setting */
streaming_set_buffer_size(streamer, BUFFER_TYPE_DEMUXED, GET_MAX_BUFFER_BYTES(streamer), GET_MAX_BUFFER_TIME(streamer));
}
static void
-streaming_get_current_bitrate_info(mm_player_streaming_t* streamer,
+streaming_get_current_bitrate_info(mm_player_streaming_t *streamer,
GstMessage *buffering_msg,
streaming_content_info_t content_info,
- streaming_bitrate_info_t* bitrate_info)
+ streaming_bitrate_info_t *bitrate_info)
{
GstQuery *query = NULL;
LOGD("Streaming Info : in %d, out %d, left %"G_GINT64_FORMAT, in_rate, out_rate, buffering_left);
- if ((content_info.content_size > 0) && (content_info.duration > 0) && ((content_info.duration/GST_SECOND) > 0))
- estimated_content_bitrate = GET_BIT_FROM_BYTE((guint)(content_info.content_size / (content_info.duration/GST_SECOND)));
+ if ((content_info.content_size > 0) && (content_info.duration > 0) && ((content_info.duration / GST_SECOND) > 0))
+ estimated_content_bitrate = GET_BIT_FROM_BYTE((guint)(content_info.content_size / (content_info.duration / GST_SECOND)));
if (streamer->buffer_max_bitrate > 0) {
streamer->buffer_max_bitrate = MAX(streamer->buffer_max_bitrate, streamer->buffer_avg_bitrate);
else
out_rate = GET_BYTE_FROM_BIT(streamer->buffer_max_bitrate/3);
- LOGD("(max)content_max_byte_rate %d, byte_out_rate %d\n", buffer_criteria, out_rate);
+ LOGD("(max)content_max_byte_rate %d, byte_out_rate %d", buffer_criteria, out_rate);
} else if (streamer->buffer_avg_bitrate > 0) {
buffer_criteria = GET_BYTE_FROM_BIT(streamer->buffer_avg_bitrate * 3);
out_rate = GET_BYTE_FROM_BIT(MAX(streamer->buffer_avg_bitrate, estimated_content_bitrate));
- LOGD("(avg)content_max_byte_rate %d, byte_out_rate %d\n", buffer_criteria, out_rate);
+ LOGD("(avg)content_max_byte_rate %d, byte_out_rate %d", buffer_criteria, out_rate);
} else {
- LOGW("There is no content bitrate information\n");
+ LOGW("There is no content bitrate information");
}
if ((in_rate > 0) && (out_rate > 0))
- buffer_buffering_time = (gint)(out_rate / in_rate)*1000;
+ buffer_buffering_time = (gint)(out_rate / in_rate) * 1000;
else if ((in_rate <= 0) && (out_rate > 0))
buffer_buffering_time = MAX_BUFFERING_TIME;
else
}
static void
-streaming_handle_fixed_buffering_mode(mm_player_streaming_t* streamer,
+streaming_handle_fixed_buffering_mode(mm_player_streaming_t *streamer,
gint byte_out_rate,
gint fixed_buffering_time,
- streaming_buffer_info_t* buffer_info)
+ streaming_buffer_info_t *buffer_info)
{
- streaming_buffer_t* buffer_handle = NULL;
+ streaming_buffer_t *buffer_handle = NULL;
guint buffering_bytes = 0;
gint buffering_time = 0;
buffer_handle = &(streamer->buffer_handle[streamer->streaming_buffer_type]);
buffering_time = fixed_buffering_time;
- LOGD("buffering time: %d ms, out rate: %d\n", buffering_time, byte_out_rate);
+ LOGD("buffering time: %d ms, out rate: %d", buffering_time, byte_out_rate);
if ((buffering_time > 0) && (byte_out_rate > 0)) {
- buffering_bytes = (guint)GET_NEW_BUFFERING_BYTE((gdouble)(byte_out_rate * buffering_time)/1000);
+ buffering_bytes = (guint)GET_NEW_BUFFERING_BYTE((gdouble)(byte_out_rate * buffering_time) / 1000);
} else {
if (buffering_time <= 0)
buffering_time = GET_CURRENT_BUFFERING_TIME(buffer_handle);
- LOGW("content bitrate is not updated yet.\n");
+ LOGW("content bitrate is not updated yet.");
buffering_bytes = GET_CURRENT_BUFFERING_BYTE(buffer_handle);
}
GET_PERCENT(buffering_time, GET_CURRENT_BUFFERING_TIME(buffer_handle), buffer_handle->buffer_high_percent, per_time);
GET_PERCENT(buffering_bytes, GET_CURRENT_BUFFERING_BYTE(buffer_handle), buffer_handle->buffer_high_percent, per_byte);
- LOGD("bytes %d, time %d, per_byte %f, per_time %f\n", buffering_bytes, buffering_time, per_byte, per_time);
+ LOGD("bytes %d, time %d, per_byte %f, per_time %f", buffering_bytes, buffering_time, per_byte, per_time);
(*buffer_info).buffering_bytes = buffering_bytes;
(*buffer_info).buffering_time = buffering_time;
}
static void
-streaming_handle_adaptive_buffering_mode(mm_player_streaming_t* streamer,
+streaming_handle_adaptive_buffering_mode(mm_player_streaming_t *streamer,
streaming_content_info_t content_info,
streaming_bitrate_info_t bitrate_info,
- streaming_buffer_info_t* buffer_info,
+ streaming_buffer_info_t *buffer_info,
gint expected_play_time)
{
- streaming_buffer_t* buffer_handle = NULL;
+ streaming_buffer_t *buffer_handle = NULL;
gint buffering_bytes = 0;
gint adj_buffering_bytes = 0;
MMPLAYER_RETURN_IF_FAIL(streamer);
MMPLAYER_RETURN_IF_FAIL(buffer_info);
- LOGD("pos %"G_GINT64_FORMAT", dur %"G_GINT64_FORMAT", size %"G_GUINT64_FORMAT", in/out:%d/%d, buffer_criteria:%d, time_rate:%d, need:%d ms\n",
+ LOGD("pos %"G_GINT64_FORMAT", dur %"G_GINT64_FORMAT", size %"G_GUINT64_FORMAT", in/out:%d/%d, buffer_criteria:%d, time_rate:%d, need:%d ms",
content_info.position, content_info.duration, content_info.content_size,
bitrate_info.byte_in_rate, bitrate_info.byte_out_rate,
bitrate_info.buffer_criteria, bitrate_info.time_rate, expected_play_time);
if ((content_info.duration <= 0) ||
(content_info.content_size <= 0)) {
- LOGW("keep previous setting.\n");
+ LOGW("keep previous setting.");
return;
}
if ((bitrate_info.byte_out_rate <= 0) || (bitrate_info.buffer_criteria == 0)) {
- LOGW("keep previous setting.\n");
+ LOGW("keep previous setting.");
return;
}
if (bitrate_info.byte_in_rate < bitrate_info.byte_out_rate) {
portion = (double)(expected_play_time * GST_MSECOND) / (double)content_info.duration;
buffering_bytes = GET_NEW_BUFFERING_BYTE(((double)content_info.content_size * portion) \
- * (1 - (double)bitrate_info.byte_in_rate/(double)bitrate_info.byte_out_rate));
+ * (1 - (double)bitrate_info.byte_in_rate / (double)bitrate_info.byte_out_rate));
} else {
/* buffering_bytes will be set as streamer->default_val.buffering_time *
* receiving rate is bigger than avg content bitrate
* so there is no reason to buffering. if the buffering msg is posted
* in-rate or contents bitrate has wrong value. */
- LOGW("don't need to do buffering.\n");
+ LOGW("don't need to do buffering.");
}
if (buffering_bytes > 0)
- buffer_buffering_time = (gint)(buffering_bytes / bitrate_info.byte_out_rate)*1000;
+ buffer_buffering_time = (gint)(buffering_bytes / bitrate_info.byte_out_rate) * 1000;
if (content_info.position <= 0) {
/* if the buffer is filled under 50%, MSL use the original default buffering time.
if not, MSL use just 2 sec as a default buffering time. (to reduce initial buffering time) */
- default_buffering_time = streamer->default_val.buffering_time - ((gdouble)streamer->buffering_percent/50)*1000;
+ default_buffering_time = streamer->default_val.buffering_time - ((gdouble)streamer->buffering_percent / 50) * 1000;
} else {
default_buffering_time = streamer->default_val.buffering_time;
}
if (buffer_buffering_time < default_buffering_time) {
- LOGD("adjusted time: %d -> %d ms\n", buffer_buffering_time, default_buffering_time);
- LOGD("adjusted bytes : %d or %d or %d\n",
+ LOGD("adjusted time: %d -> %d ms", buffer_buffering_time, default_buffering_time);
+ LOGD("adjusted bytes : %d or %d or %d",
buffering_bytes,
- (gint)(bitrate_info.byte_out_rate * buffer_buffering_time/1000),
- (gint)(bitrate_info.buffer_criteria * buffer_buffering_time/1000));
+ (gint)(bitrate_info.byte_out_rate * buffer_buffering_time / 1000),
+ (gint)(bitrate_info.buffer_criteria * buffer_buffering_time / 1000));
/* start monitoring the abmormal state */
if (content_info.position > 0)
streamer->default_val.buffering_monitor = TRUE;
buffer_buffering_time = default_buffering_time;
- adj_buffering_bytes = GET_NEW_BUFFERING_BYTE(bitrate_info.byte_out_rate * (gint)ceil((gdouble)buffer_buffering_time/1000));
+ adj_buffering_bytes = GET_NEW_BUFFERING_BYTE(bitrate_info.byte_out_rate * (gint)ceil((gdouble)buffer_buffering_time / 1000));
buffering_bytes = MAX(buffering_bytes, adj_buffering_bytes);
}
GET_PERCENT(buffering_bytes, GET_CURRENT_BUFFERING_BYTE(buffer_handle), buffer_handle->buffer_high_percent, per_byte);
GET_PERCENT(buffer_buffering_time, GET_CURRENT_BUFFERING_TIME(buffer_handle), buffer_handle->buffer_high_percent, per_time);
- LOGD("monitor %d, bytes %d, time %d, per_byte %f, per_time %f\n",
+ LOGD("monitor %d, bytes %d, time %d, per_byte %f, per_time %f",
streamer->default_val.buffering_monitor,
buffering_bytes, buffer_buffering_time, per_byte, per_time);
}
static void
-streaming_update_buffer_setting(mm_player_streaming_t* streamer,
- GstMessage *buffering_msg, /* can be null */
- guint64 content_size,
- gint64 position,
- gint64 duration)
+streaming_update_buffer_setting(mm_player_streaming_t *streamer,
+ GstMessage *buffering_msg, /* can be null */
+ guint64 content_size,
+ gint64 position,
+ gint64 duration)
{
- streaming_buffer_t* buffer_handle = NULL;
+ streaming_buffer_t *buffer_handle = NULL;
MMPlayerBufferingMode buffering_mode = MM_PLAYER_BUFFERING_MODE_ADAPTIVE;
streaming_buffer_info_t buffer_info;
streaming_get_current_bitrate_info(streamer, buffering_msg, content_info, &bitrate_info);
- LOGD("buffering mode %d, new info in_r:%d, out_r:%d, cb:%d, bt:%d\n",
+ LOGD("buffering mode %d, new info in_r:%d, out_r:%d, cb:%d, bt:%d",
buffering_mode, bitrate_info.byte_in_rate, bitrate_info.byte_out_rate,
bitrate_info.buffer_criteria, bitrate_info.time_rate);
buffer_handle->buffering_time = buffer_info.buffering_time;
}
- LOGD("adj buffer(%d) %d->%d bytes/%d->%d ms\n",
- streamer->streaming_buffer_type,
- GET_CURRENT_BUFFERING_BYTE(buffer_handle), buffer_info.buffering_bytes,
- GET_CURRENT_BUFFERING_TIME(buffer_handle), buffer_info.buffering_time);
+ LOGD("adj buffer(%d) %d->%d bytes/%d->%d ms",
+ streamer->streaming_buffer_type,
+ GET_CURRENT_BUFFERING_BYTE(buffer_handle), buffer_info.buffering_bytes,
+ GET_CURRENT_BUFFERING_TIME(buffer_handle), buffer_info.buffering_time);
/* queue2 : bytes, multiqueue : time */
if (((GET_CURRENT_BUFFERING_BYTE(buffer_handle) < buffer_info.buffering_bytes) && IS_MUXED_BUFFERING_MODE(streamer)) ||
((GET_CURRENT_BUFFERING_TIME(buffer_handle) < buffer_info.buffering_time) && IS_DEMUXED_BUFFERING_MODE(streamer))) {
if (duration > 0 && position > 0) {
- gint buffering_time_limit = (gint)(duration - position)/GST_MSECOND;
+ gint buffering_time_limit = (gint)(duration - position) / GST_MSECOND;
if (buffer_info.buffering_time > buffering_time_limit)
buffer_info.buffering_time = buffering_time_limit;
streaming_set_buffer_percent(streamer, streamer->streaming_buffer_type, buffer_info.percent_byte, buffer_info.percent_time);
- LOGD("buffer setting: size %d, time %d, per %f\n",
- GET_CURRENT_BUFFERING_BYTE(buffer_handle),
- GET_CURRENT_BUFFERING_TIME(buffer_handle),
- buffer_handle->buffer_high_percent);
+ LOGD("buffer setting: size %d, time %d, per %f",
+ GET_CURRENT_BUFFERING_BYTE(buffer_handle),
+ GET_CURRENT_BUFFERING_TIME(buffer_handle),
+ buffer_handle->buffer_high_percent);
streamer->need_sync = TRUE;
}
static void
-streaming_adjust_min_threshold(mm_player_streaming_t* streamer, gint64 position)
+streaming_adjust_min_threshold(mm_player_streaming_t *streamer, gint64 position)
{
#define DEFAULT_TIME_PAD 1000 /* ms */
gint playing_time = 0;
LOGD("buffering monitor = %s", (streamer->default_val.buffering_monitor) ? "ON" : "OFF");
LOGD("playing_time (%d ms) = %"G_GINT64_FORMAT" - %"G_GINT64_FORMAT, playing_time, position, streamer->default_val.prev_pos);
LOGD("default time : %d, prev buffering t : %d",
- streamer->default_val.buffering_time, streamer->buffer_handle[streamer->streaming_buffer_type].buffering_time);
+ streamer->default_val.buffering_time, streamer->buffer_handle[streamer->streaming_buffer_type].buffering_time);
if ((streamer->default_val.buffering_monitor) && (playing_time <= streamer->default_val.buffering_time)) {
gint time_gap = 0;
if (time_gap <= 0)
time_gap = DEFAULT_TIME_PAD;
- streamer->default_val.buffering_time += time_gap*2;
+ streamer->default_val.buffering_time += time_gap * 2;
streamer->default_val.buffering_time = MIN(streamer->default_val.buffering_time, MAX_BUFFERING_TIME);
} else {
streamer->default_val.buffering_time = DEFAULT_BUFFERING_TIME;
}
- LOGD("new default min value %d \n", streamer->default_val.buffering_time);
+ LOGD("new default min value %d", streamer->default_val.buffering_time);
streamer->default_val.buffering_monitor = FALSE;
streamer->default_val.prev_pos = position;
}
static void
-streaming_update_buffering_status(mm_player_streaming_t* streamer, GstMessage *buffering_msg, gint64 position)
+streaming_update_buffering_status(mm_player_streaming_t *streamer, GstMessage *buffering_msg, gint64 position)
{
gint buffer_percent = 0;
}
}
-void __mm_player_streaming_buffering(mm_player_streaming_t* streamer,
- GstMessage *buffering_msg,
- guint64 content_size,
- gint64 position,
- gint64 duration)
+void
+__mm_player_streaming_buffering(mm_player_streaming_t *streamer,
+ GstMessage *buffering_msg,
+ guint64 content_size,
+ gint64 position,
+ gint64 duration)
{
MMPLAYER_FENTER();