Fix codes along with GStreamer 1.19.3 update 56/270656/4 accepted/tizen/unified/20220217.153515 submit/tizen/20220216.051033
authorSangchul Lee <sc11.lee@samsung.com>
Mon, 7 Feb 2022 09:15:28 +0000 (18:15 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Wed, 16 Feb 2022 02:39:15 +0000 (11:39 +0900)
[Version] 0.3.55
[Issue Type] Update

Change-Id: Icc8b596b7261e7e1a632edb9457e2be599bd01c9
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
include/webrtc_private.h
packaging/capi-media-webrtc.spec
src/webrtc_private.c
src/webrtc_sink.c
src/webrtc_source.c

index e5ea597d11348bc2eabe5f6bf234ef82f838ccb9..e193d252c64a7138250bb50cacf202de02d0f697 100644 (file)
@@ -24,6 +24,7 @@
 #define GST_USE_UNSTABLE_API
 #include <gst/webrtc/webrtc.h>
 #endif
+#include <gst/video/videooverlay.h>
 #include <iniparser.h>
 #include <mm_display_interface.h>
 #ifndef TIZEN_TV
index e3b8da97f80665d35d5703a47d66f61e69e5c2a0..aa70443e2c5790be0a8d9601d36e0d823cf6034e 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-webrtc
 Summary:    A WebRTC library in Tizen Native API
-Version:    0.3.54
+Version:    0.3.55
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index 9c711978334cdd7296f78144c4ea37d819d74a4e..91c4a7326bab1f9a34506a8f9aa7c83794dea881 100644 (file)
@@ -1393,23 +1393,36 @@ static void __webrtcbin_on_new_transceiver_cb(GstElement *webrtcbin, GstWebRTCRT
        gpointer key, value;
        webrtc_gst_slot_s *source;
        int i;
+       guint mlineindex;
+       gchar *mid;
+       GstWebRTCRTPTransceiverDirection direction;
+       GstWebRTCKind kind;
+       GstCaps *caps;
 
        RET_IF(webrtcbin == NULL, "webrtcbin is NULL");
        RET_IF(transceiver == NULL, "transceiver is NULL");
        RET_IF(webrtc == NULL, "webrtc is NULL");
 
-       LOG_INFO("webrtc[%p] new transceiver[%p, mline:%u, mid:%s, direction:%d, kind:%d] user_data[%p]",
-               webrtc, transceiver, transceiver->mline, transceiver->mid, transceiver->direction, transceiver->kind, user_data);
-       PRINT_CAPS(transceiver->codec_preferences, "codec preferences");
+       g_object_get(G_OBJECT(transceiver),
+               "mlineindex", &mlineindex,
+               "mid", &mid,
+               "direction", &direction,
+               "kind", &kind,
+               "codec-preferences", &caps,
+               NULL);
+
+       LOG_INFO("webrtc[%p] new transceiver[%p, mlineindex:%u, mid:%s, direction:%d, kind:%d] user_data[%p]",
+               webrtc, transceiver, mlineindex, mid, direction, kind, user_data);
+       PRINT_CAPS(caps, "codec preferences");
 
        if (g_hash_table_size(webrtc->gst.source_slots) == 0) {
-               if (transceiver->mline >= MAX_MLINE_NUM) {
-                       LOG_ERROR("mline[%u] exceeds the max value", transceiver->mline);
+               if (mlineindex >= MAX_MLINE_NUM) {
+                       LOG_ERROR("mlineindex[%u] exceeds the max value", mlineindex);
                        return;
                }
                /* In this case, it might be an answerer without setting any media source. */
-               if (webrtc->data_recovery_types[transceiver->mline].red &&
-                       webrtc->data_recovery_types[transceiver->mline].ulpfec)
+               if (webrtc->data_recovery_types[mlineindex].red &&
+                       webrtc->data_recovery_types[mlineindex].ulpfec)
                        __webrtcbin_transceiver_set_ulpfec_red(webrtc, transceiver);
                return;
        }
@@ -1439,6 +1452,8 @@ void _update_transceivers_fec(webrtc_s *webrtc, bool is_offer)
        gpointer key, value;
        webrtc_gst_slot_s *source;
        int i;
+       guint mlineindex;
+       GstWebRTCRTPTransceiverDirection direction;
 
        RET_IF(webrtc == NULL, "webrtc is NULL");
 
@@ -1451,6 +1466,11 @@ void _update_transceivers_fec(webrtc_s *webrtc, bool is_offer)
                        if (!(transceiver = source->av[i].transceiver))
                                continue;
 
+                       g_object_get(G_OBJECT(transceiver),
+                               "mlineindex", &mlineindex,
+                               "direction", &direction,
+                               NULL);
+
                        ini_source = _ini_get_source_by_type(&webrtc->ini, source->type);
                        if (ini_source == NULL)
                                ini_source = &(webrtc->ini.media_source);
@@ -1462,18 +1482,18 @@ void _update_transceivers_fec(webrtc_s *webrtc, bool is_offer)
                        } else {
                                /* NOTE that this maximum value exists only for data_recovery_types due to the scenario an answerer
                                 * without any added media sources. It would be moved to the source slot without this scenario. */
-                               if (transceiver->mline >= MAX_MLINE_NUM) {
-                                       LOG_ERROR("mline[%u] exceeds the max value", transceiver->mline);
+                               if (mlineindex >= MAX_MLINE_NUM) {
+                                       LOG_ERROR("mline[%u] exceeds the max value", mlineindex);
                                        continue;
                                }
-                               if (!webrtc->data_recovery_types[transceiver->mline].red ||
-                                       !webrtc->data_recovery_types[transceiver->mline].ulpfec)
+                               if (!webrtc->data_recovery_types[mlineindex].red ||
+                                       !webrtc->data_recovery_types[mlineindex].ulpfec)
                                        continue;
                                __webrtcbin_transceiver_set_ulpfec_red(webrtc, transceiver);
                        }
 
-                       if (transceiver->direction == GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_SENDONLY ||
-                               transceiver->direction == GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_SENDRECV)
+                       if (direction == GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_SENDONLY ||
+                               direction == GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_SENDRECV)
                                __webrtcbin_transceiver_set_fec_percentage(webrtc, transceiver, ini_source->fec_percentage);
                }
        }
@@ -2177,4 +2197,4 @@ int _get_packet_drop_probability(webrtc_s *webrtc, bool sender, float *probabili
        LOG_INFO("webrtc[%p] [%s] is [%f]", webrtc, prop_name, *probability);
 
        return WEBRTC_ERROR_NONE;
-}
\ No newline at end of file
+}
index 48b9b864df1995ac658f1b9c3f12886a8a4f1b57..43e6b7c424d56cdc1fb878072e7cce276fc9ecdb 100644 (file)
@@ -16,7 +16,6 @@
 
 #include "webrtc.h"
 #include "webrtc_private.h"
-#include <gst/video/videooverlay.h>
 #include <media_packet_internal.h>
 
 //LCOV_EXCL_START
@@ -1114,4 +1113,4 @@ int _get_display_visible_from_sink(webrtc_s *webrtc, unsigned int track_id, bool
 
        return WEBRTC_ERROR_NONE;
 }
-//LCOV_EXCL_STOP
\ No newline at end of file
+//LCOV_EXCL_STOP
index b5b028db8703980076396f38ee5ea79a46fcb790..c8679783ccc267f8543af4eea3994fa9cc263980 100644 (file)
@@ -2928,8 +2928,9 @@ int _set_transceiver_direction(webrtc_s *webrtc, unsigned int source_id, webrtc_
 
        RET_VAL_IF(trans == NULL, WEBRTC_ERROR_INVALID_OPERATION, "transceiver of source[media_type:%d, id:%u] is NULL", media_type, source_id);
 
-       trans->direction = __direction_info[direction].gst;
-       LOG_DEBUG("Set direction to transceiver[%p, mline:%u, direction:%s]", trans, trans->mline, __direction_info[direction].str);
+       g_object_set(G_OBJECT(trans), "direction", __direction_info[direction].gst, NULL);
+
+       LOG_DEBUG("Set direction to transceiver[%p, direction:%s]", trans, __direction_info[direction].str);
 
        return WEBRTC_ERROR_NONE;
 }
@@ -2939,6 +2940,9 @@ int _get_transceiver_direction(webrtc_s *webrtc, unsigned int source_id, webrtc_
        int ret;
        const webrtc_gst_slot_s *source;
        const GstWebRTCRTPTransceiver *trans;
+       guint mlineindex;
+       gchar *mid;
+       GstWebRTCRTPTransceiverDirection gst_direction;
 
        RET_VAL_IF(webrtc == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "webrtc is NULL");
        RET_VAL_IF(direction == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "direction is NULL");
@@ -2959,9 +2963,15 @@ int _get_transceiver_direction(webrtc_s *webrtc, unsigned int source_id, webrtc_
 
        RET_VAL_IF(trans == NULL, WEBRTC_ERROR_INVALID_OPERATION, "transceiver of source[media_type:%d, id:%u] is NULL", media_type, source_id);
 
-       ret = __convert_direction(trans->direction, direction);
+       g_object_get(G_OBJECT(trans),
+               "mlineindex", &mlineindex,
+               "mid", &mid,
+               "direction", &gst_direction,
+               NULL);
+
+       ret = __convert_direction(gst_direction, direction);
        if (ret == WEBRTC_ERROR_NONE)
-               LOG_DEBUG("transceiver[%p, mline:%u, mid:%s, direction:%s]", trans, trans->mline, trans->mid, __direction_info[*direction].str);
+               LOG_DEBUG("transceiver[%p, mlineindex:%u, mid:%s, direction:%s]", trans, mlineindex, mid, __direction_info[*direction].str);
 
        return ret;
 }