Add new statistics type for 'remote-inbound-rtp' 05/272705/4
authorSangchul Lee <sc11.lee@samsung.com>
Wed, 23 Mar 2022 02:19:37 +0000 (11:19 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Fri, 25 Mar 2022 01:30:54 +0000 (10:30 +0900)
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 <sc11.lee@samsung.com>
include/webrtc.h
packaging/capi-media-webrtc.spec
src/webrtc_stats.c

index ae3ed1abe28eb424a3c35559d40e2c8f0ab8ca6a..0b5d3c73fbdadcc7259d73440804fac407b6db7e 100644 (file)
@@ -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;
 
 /**
index 6e0a4034aba1fb826e4d494009376c3dd7c3f51a..c2cd6eebd0d597ccf8fe9aa823ce4924028039bd 100644 (file)
@@ -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
index 7b92da18b5cb856422d52573f18f84e7165ab115..a6ab3e6f9c1f256c99fd16c9ffd87b2ca930408b 100644 (file)
@@ -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 */