Add options parameter to webrtc_create_offer()/answer() 60/256460/3
authorSangchul Lee <sc11.lee@samsung.com>
Mon, 5 Apr 2021 03:10:18 +0000 (12:10 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Tue, 6 Apr 2021 02:11:25 +0000 (11:11 +0900)
This parameter is added to support offer/answer options of
https://www.w3.org/TR/webrtc/#offer-answer-options.

It currently has no effect, because the Gstreamer side also
does not support it yet.

[Version] 0.1.138
[Issue Type] API

Change-Id: Ied29c6a918a7634afaea4716e51358e5666ba506
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
include/webrtc.h
packaging/capi-media-webrtc.spec
src/webrtc.c
test/webrtc_test.c

index 448324e1f15ba99004f053cc92d7d2d46789c6f7..b2a9837bf6030ee1dcdac55e57880ee38ba125a1 100644 (file)
@@ -738,8 +738,10 @@ int webrtc_unset_ice_candidate_cb(webrtc_h webrtc);
 /**
  * @brief Creates SDP offer to start a new WebRTC connection to a remote peer.
  * @since_tizen 6.5
- * @remarks The @a offer should be released using free().
+ * @remarks The @a offer should be released using free().\n
+ *          The @a options currently has no effect.
  * @param[in] webrtc      WebRTC handle
+ * @param[in] options     Configuration options for the offer (optional, this can be NULL)
  * @param[out] offer      SDP offer
  * @return @c 0 on success,
  *         otherwise a negative error value
@@ -751,13 +753,15 @@ int webrtc_unset_ice_candidate_cb(webrtc_h webrtc);
  * @see webrtc_negotiation_needed_cb()
  * @see webrtc_set_local_description()
  */
-int webrtc_create_offer(webrtc_h webrtc, char **offer);
+int webrtc_create_offer(webrtc_h webrtc, bundle *options, char **offer);
 
 /**
  * @brief Creates SDP answer to an offer received from a remote peer during the negotiation of a WebRTC connection.
  * @since_tizen 6.5
  * @remarks The @a answer should be released using free().
+ *          The @a options currently has no effect.
  * @param[in] webrtc      WebRTC handle
+ * @param[in] options     Configuration options for the answer (optional, this can be NULL)
  * @param[out] answer     SDP answer
  * @return @c 0 on success,
  *         otherwise a negative error value
@@ -770,7 +774,7 @@ int webrtc_create_offer(webrtc_h webrtc, char **offer);
  * @see webrtc_set_remote_description()
  * @see webrtc_set_local_description()
  */
-int webrtc_create_answer(webrtc_h webrtc, char **answer);
+int webrtc_create_answer(webrtc_h webrtc, bundle *options, char **answer);
 
 /**
  * @brief Sets the session description for a local peer associated with a WebRTC connection.
index 8d200c041628f91c85e0bc437e3f5bd6358ae6c7..8a923f2a608484b3558b9645919c877acbc7eaec 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-webrtc
 Summary:    A WebRTC library in Tizen Native API
-Version:    0.1.137
+Version:    0.1.138
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index 2d24774ab5ba852ff584c43d8eda6aca44d2ec3c..f2f6d9f1ed98a8a0fabf0bc8380f4ea4beccd334 100644 (file)
@@ -728,7 +728,7 @@ int webrtc_unset_encoded_video_frame_cb(webrtc_h webrtc)
        return WEBRTC_ERROR_NONE;
 }
 
-int webrtc_create_offer(webrtc_h webrtc, char **offer)
+int webrtc_create_offer(webrtc_h webrtc, bundle *options, char **offer)
 {
        int ret = WEBRTC_ERROR_NONE;
        webrtc_s *_webrtc = (webrtc_s*)webrtc;
@@ -749,7 +749,7 @@ int webrtc_create_offer(webrtc_h webrtc, char **offer)
        return ret;
 }
 
-int webrtc_create_answer(webrtc_h webrtc, char **answer)
+int webrtc_create_answer(webrtc_h webrtc, bundle *options, char **answer)
 {
        int ret = WEBRTC_ERROR_NONE;
        webrtc_s *_webrtc = (webrtc_s*)webrtc;
index 36951303938b5b7ce9c28bf24e01a03ac02f62a0..8f3623ead70fdc598e4b37e8ef7c960df86d8ae6 100644 (file)
@@ -1387,7 +1387,7 @@ static void _webrtc_create_offer(int index)
                g_conns[index].offer = NULL;
        }
 
-       ret = webrtc_create_offer(g_conns[index].webrtc, &g_conns[index].offer);
+       ret = webrtc_create_offer(g_conns[index].webrtc, NULL, &g_conns[index].offer);
        if (ret != WEBRTC_ERROR_NONE)
                g_print("failed to webrtc_create_offer()\n");
        else
@@ -1403,7 +1403,7 @@ static void _webrtc_create_answer(int index)
                g_conns[index].answer = NULL;
        }
 
-       ret = webrtc_create_answer(g_conns[index].webrtc, &g_conns[index].answer);
+       ret = webrtc_create_answer(g_conns[index].webrtc, NULL, &g_conns[index].answer);
        if (ret != WEBRTC_ERROR_NONE)
                g_print("failed to webrtc_create_answer()\n");
        else