Change state constraint on webrtc_foreach_stats() 89/312189/2
authorSangchul Lee <sc11.lee@samsung.com>
Wed, 5 Jun 2024 03:12:49 +0000 (12:12 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Mon, 10 Jun 2024 01:40:30 +0000 (10:40 +0900)
It has been changed to allow WEBRTC_STATE_NEGOTIATING state
to get some stats information in this state later.

[Version] 1.0.4
[Issue Type] Release state constraint

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

index 875c1404bfb63ddce60cba4bad621f2085b73f34..fff6aee391a1b5f4efe59f44b8d6aefac2750a00 100644 (file)
@@ -2912,6 +2912,7 @@ int webrtc_data_channel_unset_buffered_amount_low_cb(webrtc_data_channel_h chann
  * @brief Retrieves all the statistics properties.
  * @since_tizen 7.0
  * @remarks The registered callback will be invoked in an internal thread of the webrtc.
+ *          This function can be called in the state of #WEBRTC_STATE_NEGOTIATING. (Since 9.0)
  * @param[in] webrtc      WebRTC handle
  * @param[in] type_mask   The mask values of #webrtc_stats_type_e combined with bitwise 'or'
  * @param[in] callback    Callback function pointer
@@ -2921,7 +2922,7 @@ int webrtc_data_channel_unset_buffered_amount_low_cb(webrtc_data_channel_h chann
  * @retval #WEBRTC_ERROR_NONE    Successful
  * @retval #WEBRTC_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #WEBRTC_ERROR_INVALID_STATE Invalid state
- * @pre @a webrtc state must be set to #WEBRTC_STATE_PLAYING.
+ * @pre @a webrtc state must be set to #WEBRTC_STATE_NEGOTIATING or #WEBRTC_STATE_PLAYING.
  * @post webrtc_stats_cb() will be invoked.
  * @par Example
  * @code
index 50f31ac28f9f8c5d074c5978e33b12663c9b6ff6..fbba34bb7529a724fef46424ac5583670110798f 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-webrtc
 Summary:    A WebRTC library in Tizen Native API
-Version:    1.0.3
+Version:    1.0.4
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index 5f444bfeb3453d2d1a048974156199f4e45e0b2e..be1ebffeab329756a7c86a9ca198b86021977824 100644 (file)
@@ -2130,7 +2130,7 @@ int webrtc_foreach_stats(webrtc_h webrtc, int type_mask, webrtc_stats_cb callbac
 
        locker = g_mutex_locker_new(&_webrtc->mutex);
 
-       RET_VAL_IF(_webrtc->state != WEBRTC_STATE_PLAYING, WEBRTC_ERROR_INVALID_STATE, "the state should be PLAYING");
+       RET_VAL_IF(_webrtc->state == WEBRTC_STATE_IDLE, WEBRTC_ERROR_INVALID_STATE, "the state should not be IDLE");
 
        if (type_mask == WEBRTC_STATS_TYPE_ALL) {
                /* exported all types */