if (MMPLAYER_IS_HTTP_STREAMING(player)) {
__mmplayer_http_src_setup(source, data);
+ } else if (MMPLAYER_IS_RTSP_STREAMING(player)) {
+ gchar *user_agent = NULL;
+
+ /* get attribute */
+ mm_attrs_get_string_by_name(player->attrs, "streaming_user_agent", &user_agent);
+
+ SECURE_LOGD("user_agent : %s", user_agent);
+
+ /* setting property to streaming source */
+ if (user_agent)
+ g_object_set(G_OBJECT(source), "user-agent", user_agent, NULL);
} else if (MMPLAYER_IS_SMOOTH_STREAMING(player)) {
g_object_set(G_OBJECT(source), "timeout", DEFAULT_HTTP_TIMEOUT, NULL);
} else if (player->profile.uri_type == MM_PLAYER_URI_TYPE_MEM) {
return;
}
- if (!mainbin[MMPLAYER_M_MUXED_S_BUFFER].gst && g_strrstr(factory_name, "queue2")) { // fix me :streaming only..
-
- gint64 dur_bytes = 0L;
- muxed_buffer_type_e type = MUXED_BUFFER_TYPE_MEM_QUEUE;
-
- mainbin[MMPLAYER_M_MUXED_S_BUFFER].id = MMPLAYER_M_MUXED_S_BUFFER;
- mainbin[MMPLAYER_M_MUXED_S_BUFFER].gst = element;
+ if ((MMPLAYER_IS_STREAMING(player)) && (!MMPLAYER_IS_RTSP_STREAMING(player))) {
+ /* update queue2 setting */
+ if (g_strrstr(factory_name, "queue2") && (!mainbin[MMPLAYER_M_MUXED_S_BUFFER].gst)) {
+ gint64 dur_bytes = 0L;
+ muxed_buffer_type_e type = MUXED_BUFFER_TYPE_MEM_QUEUE;
- if (!gst_element_query_duration(mainbin[MMPLAYER_M_SRC].gst, GST_FORMAT_BYTES, &dur_bytes))
- LOGW("failed to get duration from source %s", GST_ELEMENT_NAME(mainbin[MMPLAYER_M_SRC].gst));
+ mainbin[MMPLAYER_M_MUXED_S_BUFFER].id = MMPLAYER_M_MUXED_S_BUFFER;
+ mainbin[MMPLAYER_M_MUXED_S_BUFFER].gst = element;
- LOGD("type %s, dur_bytes = %"G_GINT64_FORMAT, player->type, dur_bytes);
+ if (!gst_element_query_duration(mainbin[MMPLAYER_M_SRC].gst, GST_FORMAT_BYTES, &dur_bytes))
+ LOGW("failed to get duration from source %s", GST_ELEMENT_NAME(mainbin[MMPLAYER_M_SRC].gst));
- /* NOTE : in case of ts streaming, player could not get the correct duration info *
- * skip the pull mode(file or ring buffering) setting. */
- if (dur_bytes > 0) {
- if ((!g_strrstr(player->type, "video/mpegts")) && (!g_strrstr(player->type, "application/x-hls"))) {
- type = MUXED_BUFFER_TYPE_MEM_RING_BUFFER;
- player->streamer->ring_buffer_size = player->ini.http_ring_buffer_size;
+ LOGD("type %s, dur_bytes = %"G_GINT64_FORMAT, player->type, dur_bytes);
+ /* NOTE : in case of ts streaming, player could not get the correct duration info *
+ * skip the pull mode(file or ring buffering) setting. */
+ if (dur_bytes > 0) {
+ if ((!g_strrstr(player->type, "video/mpegts")) && (!g_strrstr(player->type, "application/x-hls"))) {
+ type = MUXED_BUFFER_TYPE_MEM_RING_BUFFER;
+ player->streamer->ring_buffer_size = player->ini.http_ring_buffer_size;
+ }
+ } else {
+ dur_bytes = 0;
}
- } else {
- dur_bytes = 0;
- }
-
- _mm_player_streaming_set_queue2(player->streamer,
- element,
- FALSE,
- type,
- (guint64)dur_bytes); /* no meaning at the moment */
- return;
- }
+ _mm_player_streaming_set_queue2(player->streamer,
+ element,
+ FALSE,
+ type,
+ (guint64)dur_bytes); /* no meaning at the moment */
+ return;
+ }
- if (g_strrstr(factory_name, "parsebin")) {
- if (!mainbin[MMPLAYER_M_DEMUXED_S_BUFFER].gst) {
+ /* update mq setting */
+ if (g_strrstr(factory_name, "parsebin") && (!mainbin[MMPLAYER_M_DEMUXED_S_BUFFER].gst)) {
GstIterator *iter = NULL;
GValue item = {0, };
GstElement *ch_element = NULL;
while (gst_iterator_next(iter, &item) == GST_ITERATOR_OK) {
ch_element = g_value_get_object(&item);
ch_factory = gst_element_get_factory(ch_element);
-
+ LOGD("children factory %s", GST_OBJECT_NAME(ch_factory));
if (g_strrstr(GST_OBJECT_NAME(ch_factory), "multiqueue")) {
+ LOGD("get multiqueue");
player->pipeline->mainbin[MMPLAYER_M_DEMUXED_S_BUFFER].id = MMPLAYER_M_DEMUXED_S_BUFFER;
player->pipeline->mainbin[MMPLAYER_M_DEMUXED_S_BUFFER].gst = ch_element;
- if ((MMPLAYER_IS_HTTP_STREAMING(player)) ||
- (MMPLAYER_IS_HTTP_LIVE_STREAMING(player)) ||
- (MMPLAYER_IS_DASH_STREAMING(player))) {
- _mm_player_streaming_set_multiqueue(player->streamer, ch_element);
- }
+ /* in case of multiqueue, max bytes size is defined with fixed value in mm_player_streaming.h */
+ _mm_player_streaming_set_multiqueue(player->streamer, ch_element);
g_value_reset(&item);
break;
}
return MM_ERROR_NONE;
}
-static int
-__mmplayer_gst_build_pipeline_with_src(mmplayer_t *player)
+int
+_mmplayer_gst_build_pipeline_with_src(mmplayer_t *player)
{
mmplayer_gst_element_t *mainbin = NULL;
GstElement *autoplug_elem = NULL;
LOGD("uri type %d", player->profile.uri_type);
+ if ((player->profile.uri_type == MM_PLAYER_URI_TYPE_FILE) &&
+ (!_mmplayer_get_storage_info(player->profile.uri, &player->storage_info[MMPLAYER_PATH_VOD]))) {
+ return MM_ERROR_PLAYER_INTERNAL;
+ }
+
+ if (player->profile.uri_type == MM_PLAYER_URI_TYPE_MEM) {
+ g_strlcpy(player->profile.uri, "appsrc://", MM_MAX_URL_LEN);
+ }
+
autoplug_elem = __mmplayer_gst_make_uridecodebin(player);
if (!autoplug_elem) {
LOGE("failed to create uridecodebin3 element");
src_elem = __mmplayer_gst_make_rtsp_src(player);
break;
case MM_PLAYER_URI_TYPE_URL_HTTP:
- if (player->ini.use_uridecodebin3) {
- LOGD("uridecodebin include src element.");
- return __mmplayer_gst_build_pipeline_with_src(player);
- }
src_elem = __mmplayer_gst_make_http_src(player);
break;
case MM_PLAYER_URI_TYPE_FILE:
- if (player->ini.use_uridecodebin3) {
- if (!_mmplayer_get_storage_info(player->profile.uri, &player->storage_info[MMPLAYER_PATH_VOD])) {
- LOGE("failed to get storage info");
- break;
- }
- LOGD("uridecodebin include src element.");
- return __mmplayer_gst_build_pipeline_with_src(player);
- }
src_elem = __mmplayer_gst_make_file_src(player);
break;
case MM_PLAYER_URI_TYPE_SS:
{
gint http_timeout = DEFAULT_HTTP_TIMEOUT;
- if (player->ini.use_uridecodebin3) {
- LOGD("uridecodebin include src element.");
- return __mmplayer_gst_build_pipeline_with_src(player);
- }
-
src_elem = gst_element_factory_make("souphttpsrc", "http streaming source");
if (!src_elem) {
LOGE("failed to create http streaming source element[%s]", player->ini.httpsrc_element);
{
GstAppStreamType stream_type = GST_APP_STREAM_TYPE_RANDOM_ACCESS;
- if (player->ini.use_uridecodebin3) {
- LOGD("uridecodebin include src element.");
-
- g_strlcpy(player->profile.uri, "appsrc://", MM_MAX_URL_LEN);
- return __mmplayer_gst_build_pipeline_with_src(player);
- }
-
src_elem = gst_element_factory_make("appsrc", "mem-source");
if (!src_elem) {
LOGE("failed to create appsrc element");