From 0196ab2d12104c528a02bb0a5d1d7e910b0cf758 Mon Sep 17 00:00:00 2001 From: Gilbok Lee Date: Mon, 26 Dec 2016 15:10:33 +0900 Subject: [PATCH] Add TIZEN_FEATURE_STREAMING define didn't support streaming [Version] 0.1.15 [Profile] Common, Mobile, Wearable, TV [Issue Type] Add feature Change-Id: I382d81788c784ebf9b863d0bc73dfc522abd41e0 --- packaging/capi-mediademuxer.spec | 2 +- src/mediademuxer_port.c | 14 +++++++++++++- src/port_gst/mediademuxer_port_gst.c | 9 +++++++++ 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/packaging/capi-mediademuxer.spec b/packaging/capi-mediademuxer.spec index 92f18b4..c29c5c1 100755 --- a/packaging/capi-mediademuxer.spec +++ b/packaging/capi-mediademuxer.spec @@ -1,6 +1,6 @@ Name: capi-mediademuxer Summary: A Media Demuxer library in Tizen Native API -Version: 0.1.14 +Version: 0.1.15 Release: 1 Group: Multimedia/API License: Apache-2.0 diff --git a/src/mediademuxer_port.c b/src/mediademuxer_port.c index 2a503de..0d5dd63 100755 --- a/src/mediademuxer_port.c +++ b/src/mediademuxer_port.c @@ -177,8 +177,13 @@ mediademuxer_src_type __md_util_media_type(char **uri) file_stat = __md_util_exist_file_path(path + 7); if (file_stat == MD_ERROR_NONE) { if (__md_util_is_sdp_file(path)) { +#ifdef TIZEN_FEATURE_STREAMING MD_L("uri is actually a file but it's sdp file. giving it to rtspsrc\n"); return MEDIADEMUXER_SRC_RTSP; +#else + MD_L("uri is actually a file but it's sdp file. didn't support streaming uri"); + return MEDIADEMUXER_SRC_INVALID; +#endif } else { return MEDIADEMUXER_SRC_FILE; } @@ -187,6 +192,7 @@ mediademuxer_src_type __md_util_media_type(char **uri) MD_E("could not access %s.\n", path); goto ERROR; } +#ifdef TIZEN_FEATURE_STREAMING } else if ((path = strstr(*uri, "rtsp://"))) { if (strlen(path)) { if ((path = strstr(*uri, "/wfd1.0/"))) @@ -203,6 +209,7 @@ mediademuxer_src_type __md_util_media_type(char **uri) return (MEDIADEMUXER_SRC_HTTP); } } +#endif } else { int file_stat = MD_ERROR_NONE; file_stat = __md_util_exist_file_path(*uri); @@ -226,8 +233,13 @@ mediademuxer_src_type __md_util_media_type(char **uri) free(old_uristr); old_uristr = NULL; if (__md_util_is_sdp_file((char *)(*uri))) { +#ifdef TIZEN_FEATURE_STREAMING MD_L("uri is actually a file but it's sdp file. giving it to rtspsrc\n"); - return (MEDIADEMUXER_SRC_RTSP); + return MEDIADEMUXER_SRC_RTSP; +#else + MD_L("uri is actually a file but it's sdp file. didn't support streaming uri"); + return MEDIADEMUXER_SRC_INVALID; +#endif } else { return (MEDIADEMUXER_SRC_FILE); } diff --git a/src/port_gst/mediademuxer_port_gst.c b/src/port_gst/mediademuxer_port_gst.c index 38a3ac8..1cef964 100755 --- a/src/port_gst/mediademuxer_port_gst.c +++ b/src/port_gst/mediademuxer_port_gst.c @@ -875,7 +875,9 @@ static int _gst_create_pipeline(mdgst_handle_t *gst_handle, char *uri) int ret = MD_ERROR_NONE; GstBus *bus = NULL; char *path = NULL; +#ifdef TIZEN_FEATURE_STREAMING int remote_streaming = 0; +#endif /* Initialize GStreamer */ /* Note: Replace the arguments of gst_init to pass the command line args to GStreamer. */ gst_init(NULL, NULL); @@ -890,9 +892,14 @@ static int _gst_create_pipeline(mdgst_handle_t *gst_handle, char *uri) /* Create the elements */ if ((path = strstr(uri, "http://"))) { +#ifdef TIZEN_FEATURE_STREAMING gst_handle->filesrc = gst_element_factory_make("souphttpsrc", NULL); remote_streaming = 1; MD_I("Source is http stream. \n"); +#else + MD_I("Source is http stream. Didn't support streaming\n"); + goto ERROR; +#endif } else { gst_handle->filesrc = gst_element_factory_make("filesrc", NULL); MD_I("Source is file stream \n"); @@ -904,9 +911,11 @@ static int _gst_create_pipeline(mdgst_handle_t *gst_handle, char *uri) } /* Modify the source's properties */ +#ifdef TIZEN_FEATURE_STREAMING if (remote_streaming == 1) g_object_set(G_OBJECT(gst_handle->filesrc), "location", uri, NULL); else +#endif g_object_set(G_OBJECT(gst_handle->filesrc), "location", uri + 7, NULL); gst_handle->typefind = gst_element_factory_make("typefind", NULL); if (!gst_handle->typefind) { -- 2.7.4