From: Sangchul Lee Date: Wed, 5 Jun 2024 03:12:49 +0000 (+0900) Subject: Change state constraint on webrtc_foreach_stats() X-Git-Tag: accepted/tizen/unified/20240618.010058~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F89%2F312189%2F2;p=platform%2Fcore%2Fapi%2Fwebrtc.git Change state constraint on webrtc_foreach_stats() 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 --- diff --git a/include/webrtc.h b/include/webrtc.h index 875c1404..fff6aee3 100644 --- a/include/webrtc.h +++ b/include/webrtc.h @@ -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 diff --git a/packaging/capi-media-webrtc.spec b/packaging/capi-media-webrtc.spec index 50f31ac2..fbba34bb 100644 --- a/packaging/capi-media-webrtc.spec +++ b/packaging/capi-media-webrtc.spec @@ -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 diff --git a/src/webrtc.c b/src/webrtc.c index 5f444bfe..be1ebffe 100644 --- a/src/webrtc.c +++ b/src/webrtc.c @@ -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 */