Apply autoplug-select signal and callback to decodebin of WebRTC node 06/241406/3 accepted/tizen/unified/20200820.213432 submit/tizen/20200820.092401
authorHyunil <hyunil46.park@samsung.com>
Thu, 20 Aug 2020 01:57:45 +0000 (10:57 +0900)
committerHyunil <hyunil46.park@samsung.com>
Thu, 20 Aug 2020 06:57:45 +0000 (15:57 +0900)
[Version] 0.1.111
[Issue Type] Improvement

Change-Id: I0664417750676d809d0cf83359874554df16043b
Signed-off-by: Hyunil <hyunil46.park@samsung.com>
include/media_streamer_gst.h
packaging/capi-media-streamer.spec
src/media_streamer_gst.c
src/media_streamer_gst_webrtc.c

index 128ce54..dc4e7d3 100644 (file)
@@ -187,6 +187,7 @@ void ms_hlsdemux_pad_added_cb(GstElement *element, GstPad *new_pad, gpointer use
 
 void ms_demux_nomore_pads_cb(GstElement *element, gpointer user_data);
 
+int ms_decodebin_autoplug_select_cb(GstElement *bin, GstPad *pad, GstCaps *caps, GstElementFactory *factory, gpointer user_data);
 
 #ifdef __cplusplus
 }
index ffe4879..72b0968 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-streamer
 Summary:    A Media Streamer API
-Version:    0.1.110
+Version:    0.1.111
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index 3513db9..f7cb578 100644 (file)
@@ -650,7 +650,7 @@ static gboolean __need_to_skip_hw_video_decoder_klass(const gchar *klass)
        return FALSE;
 }
 
-static gint __decodebin_autoplug_select_cb(GstElement *bin, GstPad *pad, GstCaps *caps, GstElementFactory *factory, gpointer data)
+int ms_decodebin_autoplug_select_cb(GstElement *bin, GstPad *pad, GstCaps *caps, GstElementFactory *factory, gpointer user_data)
 {
        /* NOTE : GstAutoplugSelectResult is defined in gstplay-enum.h but not exposed */
        typedef enum {
@@ -663,7 +663,7 @@ static gint __decodebin_autoplug_select_cb(GstElement *bin, GstPad *pad, GstCaps
        gchar *factory_name = NULL;
        const gchar *klass = NULL;
        GstAutoplugSelectResult result = GST_AUTOPLUG_SELECT_TRY;
-       media_streamer_s *ms_streamer = (media_streamer_s *) data;
+       media_streamer_s *ms_streamer = (media_streamer_s *) user_data;
 
        ms_debug_fenter();
 
@@ -907,7 +907,7 @@ static GstElement *__ms_decodebin_create(media_streamer_s *ms_streamer, char *na
        gst_element_sync_state_with_parent(decodebin);
 
        ms_signal_create(&ms_streamer->autoplug_sig_list, decodebin, "pad-added", G_CALLBACK(__decodebin_pad_added_cb), ms_streamer);
-       ms_signal_create(&ms_streamer->autoplug_sig_list, decodebin, "autoplug-select", G_CALLBACK(__decodebin_autoplug_select_cb), ms_streamer);
+       ms_signal_create(&ms_streamer->autoplug_sig_list, decodebin, "autoplug-select", G_CALLBACK(ms_decodebin_autoplug_select_cb), ms_streamer);
        ms_signal_create(&ms_streamer->autoplug_sig_list, decodebin, "no-more-pads", G_CALLBACK(__decodebin_nomore_pads_cb), ms_streamer);
 
        ms_debug_fleave();
index af0b9be..c3d39be 100644 (file)
@@ -676,6 +676,7 @@ void ms_webrtcbin_pad_added_cb(GstElement *webrtcbin, GstPad *new_pad, gpointer
        ms_retm_if(new_pad == NULL, "new_pad is NULL");
        ms_retm_if(webrtc_node == NULL, "webrtc_node is NULL");
        ms_retm_if(webrtc_node->callbacks_structure == NULL, "callbacks_structure is NULL");
+       ms_retm_if(webrtc_node->parent_streamer == NULL, "media_streamer is NULL");
        ms_retm_if(GST_PAD_DIRECTION(new_pad) != GST_PAD_SRC, "new_pad is not for source");
 
        ms_debug_fenter();
@@ -696,6 +697,7 @@ void ms_webrtcbin_pad_added_cb(GstElement *webrtcbin, GstPad *new_pad, gpointer
        gst_element_sync_state_with_parent(decodebin);
 
        g_signal_connect(decodebin, "pad-added", G_CALLBACK(__decodebin_pad_added_cb), webrtc_node);
+       g_signal_connect(decodebin, "autoplug-select", G_CALLBACK(ms_decodebin_autoplug_select_cb), webrtc_node->parent_streamer);
        sink_pad = gst_element_get_static_pad(decodebin, "sink");
        ms_retm_if(sink_pad == NULL, "sink_pad is NULL");