From: Sangchul Lee Date: Wed, 23 Mar 2022 02:19:37 +0000 (+0900) Subject: Add new statistics type for 'remote-inbound-rtp' X-Git-Tag: submit/tizen/20220331.093038~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F05%2F272705%2F4;p=platform%2Fcore%2Fapi%2Fwebrtc.git Add new statistics type for 'remote-inbound-rtp' New statistics type is added as below. - WEBRTC_STATS_TYPE_REMOTE_INBOUND_RTP Property enums are added as below for this type - WEBRTC_STATS_PROP_LOCAL_ID - WEBRTC_STATS_PROP_ROUND_TRIP_TIME - WEBRTC_STATS_PROP_FRACTION_LOST [Version] 0.3.73 [Issue Type] API Change-Id: I9547674d2ca3e5a083bd649ae78880efaf2f1d5a Signed-off-by: Sangchul Lee --- diff --git a/include/webrtc.h b/include/webrtc.h index ae3ed1ab..0b5d3c73 100644 --- a/include/webrtc.h +++ b/include/webrtc.h @@ -280,7 +280,8 @@ typedef enum { typedef enum { WEBRTC_STATS_TYPE_CODEC = 0x0001, /**< Codec */ WEBRTC_STATS_TYPE_INBOUND_RTP = 0x0002, /**< Inbound RTP */ - WEBRTC_STATS_TYPE_OUTBOUND_RTP = 0x0004 /**< Outbound RTP */ + WEBRTC_STATS_TYPE_OUTBOUND_RTP = 0x0004, /**< Outbound RTP */ + WEBRTC_STATS_TYPE_REMOTE_INBOUND_RTP = 0x0008 /**< Remote inbound RTP */ } webrtc_stats_type_e; /** @@ -291,7 +292,8 @@ typedef enum { #define WEBRTC_STATS_TYPE_ALL \ WEBRTC_STATS_TYPE_CODEC | \ WEBRTC_STATS_TYPE_INBOUND_RTP | \ - WEBRTC_STATS_TYPE_OUTBOUND_RTP + WEBRTC_STATS_TYPE_OUTBOUND_RTP | \ + WEBRTC_STATS_TYPE_REMOTE_INBOUND_RTP /** * @brief Definition for mask value used by #webrtc_stats_prop_e that represents properties of RTC stats. @@ -349,6 +351,14 @@ typedef enum { */ #define WEBRTC_STATS_OUTBOUND_RTP_STREAM 0x00002000 +/** + * @brief Definition for mask value used by #webrtc_stats_prop_e that represents properties of RTC remote inbound RTP stream stats. + * @since_tizen 7.0 + * @remarks It corresponds with the values described in https://www.w3.org/TR/webrtc-stats/#dom-rtcremoteinboundrtpstreamstats. + * @see webrtc_stats_prop_e + */ +#define WEBRTC_STATS_REMOTE_INBOUND_RTP_STREAM 0x00004000 + /** * @brief Enumeration for WebRTC statistics property. * @since_tizen 7.0 @@ -377,6 +387,9 @@ typedef enum { WEBRTC_STATS_PROP_FIR_COUNT = WEBRTC_STATS_INBOUND_RTP_STREAM | WEBRTC_STATS_OUTBOUND_RTP_STREAM | 0x02, /**< FIR packets */ WEBRTC_STATS_PROP_PLI_COUNT = WEBRTC_STATS_INBOUND_RTP_STREAM | WEBRTC_STATS_OUTBOUND_RTP_STREAM | 0x03, /**< PLI packets */ WEBRTC_STATS_PROP_NACK_COUNT = WEBRTC_STATS_INBOUND_RTP_STREAM | WEBRTC_STATS_OUTBOUND_RTP_STREAM | 0x04, /**< NACK packets */ + WEBRTC_STATS_PROP_LOCAL_ID = WEBRTC_STATS_REMOTE_INBOUND_RTP_STREAM | 0x01, /**< Local id */ + WEBRTC_STATS_PROP_ROUND_TRIP_TIME = WEBRTC_STATS_REMOTE_INBOUND_RTP_STREAM | 0x02, /**< Round trip time */ + WEBRTC_STATS_PROP_FRACTION_LOST = WEBRTC_STATS_REMOTE_INBOUND_RTP_STREAM | 0x03, /**< Fraction lost */ } webrtc_stats_prop_e; /** diff --git a/packaging/capi-media-webrtc.spec b/packaging/capi-media-webrtc.spec index 6e0a4034..c2cd6eeb 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: 0.3.72 +Version: 0.3.73 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/src/webrtc_stats.c b/src/webrtc_stats.c index 7b92da18..a6ab3e6f 100644 --- a/src/webrtc_stats.c +++ b/src/webrtc_stats.c @@ -160,9 +160,9 @@ static stats_field_s __stats_outbound_rtp_stream_fields[] = { * "fraction-lost" G_TYPE_DOUBLE the fraction packet loss reported for this SSRC */ static stats_field_s __stats_remote_inbound_rtp_stream_fields[] = { - { "local-id", WEBRTC_STATS_PROP_NOT_EXPORTED, 0 }, - { "round-trip-time", WEBRTC_STATS_PROP_NOT_EXPORTED, 0 }, - { "fraction-lost", WEBRTC_STATS_PROP_NOT_EXPORTED, 0 }, + { "local-id", WEBRTC_STATS_PROP_LOCAL_ID, 0 }, + { "round-trip-time", WEBRTC_STATS_PROP_ROUND_TRIP_TIME, 0 }, + { "fraction-lost", WEBRTC_STATS_PROP_FRACTION_LOST, 0 }, { NULL, 0, 0 } }; @@ -496,7 +496,7 @@ static void __stats_outbound_rtp_invoke_callback(const GstStructure *s, webrtc_s static void __stats_remote_inbound_rtp_invoke_callback(const GstStructure *s, webrtc_stats_type_e type, stats_field_s **fields_list, promise_userdata_s *user_data) { - stats_userdata_s stats_userdata = { .p_userdata = user_data, .type = type, .fields_list = fields_list }; + stats_userdata_s stats_userdata = { .p_userdata = user_data, .type = type, .fields_list = fields_list, .export = true }; RET_IF(user_data == NULL, "user_data is NULL"); LOG_DEBUG_ENTER(); @@ -621,7 +621,6 @@ typedef struct { } parse_stats_s; /* Definitions below are not exported types due to the incompletion. */ -#define WEBRTC_STATS_TYPE_REMOTE_INBOUND_RTP 0x0008 /**< Remote Inbound RTP */ #define WEBRTC_STATS_TYPE_REMOTE_OUTBOUND_RTP 0x000F /**< Remote Outbound RTP */ #define WEBRTC_STATS_TYPE_PEER_CONNECTION 0x0010 /**< Peer Connection */ #define WEBRTC_STATS_TYPE_CSRC 0x0020 /**< CSRC */