MMPLAYER_INI_GET_STRING(dict, ini->httpsrc_element, "http streaming:httpsrc element", DEFAULT_HTTPSRC);
ini->http_use_file_buffer = iniparser_getboolean(dict, "http streaming:http use file buffer", DEFAULT_HTTP_USE_FILE_BUFFER);
ini->http_ring_buffer_size = iniparser_getint(dict, "http streaming:http ring buffer size", DEFAULT_HTTP_RING_BUFFER_SIZE);
- ini->http_buffering_limit = iniparser_getdouble(dict, "http streaming:http buffering high limit", DEFAULT_HTTP_BUFFERING_LIMIT);
ini->http_max_size_bytes = iniparser_getint(dict, "http streaming:http max size bytes", DEFAULT_HTTP_MAX_SIZE_BYTES);
ini->http_buffering_time = (gint)(iniparser_getdouble(dict, "http streaming:http buffering time", DEFAULT_HTTP_BUFFERING_TIME) * 1000);
ini->http_timeout = iniparser_getint(dict, "http streaming:http timeout", DEFAULT_HTTP_TIMEOUT);
/* http streaming */
strncpy(ini->httpsrc_element, DEFAULT_HTTPSRC, PLAYER_INI_MAX_STRLEN - 1);
- ini->http_buffering_limit = DEFAULT_HTTP_BUFFERING_LIMIT;
ini->http_use_file_buffer = DEFAULT_HTTP_USE_FILE_BUFFER;
ini->http_ring_buffer_size = DEFAULT_HTTP_RING_BUFFER_SIZE;
ini->http_max_size_bytes = DEFAULT_HTTP_MAX_SIZE_BYTES;
/* http streaming */
LOGD("httpsrc element : %s\n", ini->httpsrc_element);
- LOGD("http buffering limit : %f \n", ini->http_buffering_limit);
LOGD("http use file buffer : %d \n", ini->http_use_file_buffer);
LOGD("http ring buffer size : %d \n", ini->http_ring_buffer_size);
LOGD("http max_size bytes : %d \n", ini->http_max_size_bytes);
TRUE, /* use_buffering */
buffer_bytes,
init_buffering_time,
- 1.0, /* low percent */
- player->ini.http_buffering_limit, /* high percent */
MUXED_BUFFER_TYPE_MAX, /* use previous buffer type setting */
NULL,
((dur_bytes > 0) ? ((guint64)dur_bytes) : 0));
FALSE,
max_buffer_size_bytes,
player->ini.http_buffering_time,
- 1.0, /* no meaning */
- player->ini.http_buffering_limit, /* no meaning */
type,
player->http_file_buffering_path,
(guint64)dur_bytes);
g_object_set(G_OBJECT(decodebin), "use-buffering", TRUE,
"high-percent", (gint)high_percent,
- "low-percent", (gint)DEFAULT_BUFFER_LOW_PERCENT,
"max-size-bytes", GET_MAX_BUFFER_BYTES(player->streamer),
"max-size-time", (guint64)(GET_MAX_BUFFER_TIME(player->streamer) * GST_MSECOND),
"max-size-buffers", 0, NULL); // disable or automatic
(MMPLAYER_IS_HTTP_LIVE_STREAMING(player)) ||
(MMPLAYER_IS_DASH_STREAMING(player))) {
/* in case of multiqueue, max bytes size is defined with fixed value in mm_player_streaming.h*/
- __mm_player_streaming_set_multiqueue(player->streamer, element, player->ini.http_buffering_time, 1.0, player->ini.http_buffering_limit);
+ __mm_player_streaming_set_multiqueue(player->streamer, element, player->ini.http_buffering_time);
__mm_player_streaming_sync_property(player->streamer, player->pipeline->mainbin[MMPLAYER_M_AUTOPLUG].gst);
}
gdouble percent_time;
} streaming_buffer_info_t;
-static void streaming_check_buffer_percent(gdouble in_low, gdouble in_high, gdouble *out_low, gdouble *out_high);
-static void streaming_set_buffer_percent(mm_player_streaming_t* streamer, BufferType type, gdouble low_percent, gdouble high_percent_byte, gdouble high_percent_time);
+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);
buffer_handle->buffering_bytes = DEFAULT_BUFFER_SIZE_BYTES;
buffer_handle->buffering_time = DEFAULT_BUFFERING_TIME;
- buffer_handle->buffer_low_percent = DEFAULT_BUFFER_LOW_PERCENT;
buffer_handle->buffer_high_percent = DEFAULT_BUFFER_HIGH_PERCENT;
buffer_handle->is_live = FALSE;
}
static void
-streaming_check_buffer_percent(gdouble in_low, gdouble in_high, gdouble *out_low, gdouble *out_high)
-{
- gdouble buffer_low_percent = DEFAULT_BUFFER_LOW_PERCENT;
- gdouble buffer_high_percent = DEFAULT_BUFFER_HIGH_PERCENT;
-
- MMPLAYER_FENTER();
-
- MMPLAYER_RETURN_IF_FAIL(out_low && out_high);
-
- if (in_low <= MIN_BUFFER_PERCENT || in_low >= MAX_BUFFER_PERCENT)
- LOGW("buffer low percent is out of range. use defaut value.");
- else
- buffer_low_percent = in_low;
-
- if (in_high <= MIN_BUFFER_PERCENT || in_high >= MAX_BUFFER_PERCENT)
- LOGW("buffer high percent is out of range. use defaut value.");
- else
- buffer_high_percent = in_high;
-
- if (buffer_high_percent <= buffer_low_percent)
- buffer_high_percent = buffer_low_percent + 1.0;
-
- LOGD("set buffer percent to %2.3f ~ %2.3f.", buffer_low_percent, buffer_high_percent);
-
- *out_low = buffer_low_percent;
- *out_high = buffer_high_percent;
-}
-
-static void
streaming_set_buffer_percent(mm_player_streaming_t* streamer,
BufferType type,
- gdouble low_percent,
gdouble high_percent_byte,
gdouble high_percent_time)
{
- gdouble confirmed_low = DEFAULT_BUFFER_LOW_PERCENT;
- gdouble confirmed_high = DEFAULT_BUFFER_HIGH_PERCENT;
gdouble high_percent = 0.0;
streaming_buffer_t* buffer_handle = NULL;
else
high_percent = MAX(high_percent_time, high_percent_byte);
- streaming_check_buffer_percent(low_percent, high_percent, &confirmed_low, &confirmed_high);
+ if (high_percent <= MIN_BUFFER_PERCENT || high_percent >= MAX_BUFFER_PERCENT)
+ high_percent = DEFAULT_BUFFER_HIGH_PERCENT;
/* if use-buffering is disabled, this settings do not have any meaning. */
- LOGD("target buffer elem : %s (%2.3f ~ %2.3f)",
- GST_ELEMENT_NAME(buffer_handle->buffer), confirmed_low, confirmed_high);
-
- if ((confirmed_low == DEFAULT_BUFFER_LOW_PERCENT) ||
- (buffer_handle->buffer_low_percent != confirmed_low))
- g_object_set(G_OBJECT(buffer_handle->buffer), "low-percent", (gint)confirmed_low, NULL);
+ LOGD("target buffer elem : %s (~ %2.3f)",
+ GST_ELEMENT_NAME(buffer_handle->buffer), high_percent);
- if ((confirmed_high == DEFAULT_BUFFER_HIGH_PERCENT) ||
- (buffer_handle->buffer_high_percent != confirmed_high))
- g_object_set(G_OBJECT(buffer_handle->buffer), "high-percent", (gint)confirmed_high, NULL);
+ if ((high_percent == DEFAULT_BUFFER_HIGH_PERCENT) ||
+ (buffer_handle->buffer_high_percent != high_percent))
+ g_object_set(G_OBJECT(buffer_handle->buffer), "high-percent", (gint)high_percent, NULL);
- buffer_handle->buffer_low_percent = confirmed_low;
- buffer_handle->buffer_high_percent = confirmed_high;
+ buffer_handle->buffer_high_percent = high_percent;
MMPLAYER_FLEAVE();
return;
gboolean use_buffering,
guint buffering_bytes,
gint buffering_time,
- gdouble low_percent,
- gdouble high_percent,
MuxedBufferType type,
gchar* file_path,
guint64 content_size)
/* initial setting */
streaming_set_buffer_size(streamer, BUFFER_TYPE_MUXED, buffering_bytes, buffering_time);
- streaming_set_buffer_percent(streamer, BUFFER_TYPE_MUXED, low_percent, high_percent, 0);
+ streaming_set_buffer_percent(streamer, BUFFER_TYPE_MUXED, DEFAULT_BUFFER_HIGH_PERCENT, 0);
if (type < MUXED_BUFFER_TYPE_MAX)
streaming_set_queue2_queue_type(streamer, type, file_path, content_size);
g_object_set(G_OBJECT(decodebin),
"max-size-bytes", buffer_handle->buffering_bytes,
"max-size-time", (guint64)(buffer_handle->buffering_time * GST_MSECOND),
- "low-percent", (gint)buffer_handle->buffer_low_percent,
"high-percent", (gint)buffer_handle->buffer_high_percent, NULL);
}
void __mm_player_streaming_set_multiqueue(mm_player_streaming_t* streamer,
GstElement* buffer,
- gint buffering_time,
- gdouble low_percent,
- gdouble high_percent)
+ gint buffering_time)
{
streaming_buffer_t* buffer_handle = NULL;
+ gdouble high_percent = 0.0;
MMPLAYER_FENTER();
MMPLAYER_RETURN_IF_FAIL(streamer && buffer);
/* initial setting */
streaming_set_buffer_size(streamer, BUFFER_TYPE_DEMUXED, GET_MAX_BUFFER_BYTES(streamer), GET_MAX_BUFFER_TIME(streamer));
- streaming_set_buffer_percent(streamer, BUFFER_TYPE_DEMUXED, low_percent, 0, high_percent);
+ streaming_set_buffer_percent(streamer, BUFFER_TYPE_DEMUXED, 0, high_percent);
streamer->need_sync = TRUE;
streaming_content_info_t content_info;
streaming_bitrate_info_t bitrate_info;
- gdouble low_percent = 0.0;
-
MMPLAYER_FENTER();
MMPLAYER_RETURN_IF_FAIL(streamer);
buffering_mode, bitrate_info.byte_in_rate, bitrate_info.byte_out_rate,
bitrate_info.buffer_criteria, bitrate_info.time_rate);
- /* calculate buffer low/high percent */
- low_percent = DEFAULT_BUFFER_LOW_PERCENT;
-
if (buffering_mode == MM_PLAYER_BUFFERING_MODE_FIXED) {
/********************
* (1) fixed mode *
streaming_set_buffer_size(streamer, streamer->streaming_buffer_type, buffer_info.buffering_bytes, buffer_info.buffering_time);
}
- streaming_set_buffer_percent(streamer, streamer->streaming_buffer_type, low_percent, buffer_info.percent_byte, buffer_info.percent_time);
+ 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),