*/
typedef enum {
WEBRTC_STATS_TYPE_CODEC = 0x0001, /**< Codec */
+ WEBRTC_STATS_TYPE_INBOUND_RTP = 0x0002, /**< Inbound RTP */
} webrtc_stats_type_e;
/**
* @since_tizen 7.0
* @see webrtc_foreach_stats()
*/
-#define WEBRTC_STATS_TYPE_ALL WEBRTC_STATS_TYPE_CODEC
+#define WEBRTC_STATS_TYPE_ALL \
+ WEBRTC_STATS_TYPE_CODEC | \
+ WEBRTC_STATS_TYPE_INBOUND_RTP
/**
- * @brief Definition for mask value used by #webrtc_stats_prop_e that represents properties of rtc stats.
+ * @brief Definition for mask value used by #webrtc_stats_prop_e that represents properties of RTC stats.
* @since_tizen 7.0
* @remarks It corresponds with the values described in https://www.w3.org/TR/webrtc-stats/#dom-rtcstats.
* @see webrtc_stats_prop_e
#define WEBRTC_STATS_COMMON 0x00000100
/**
- * @brief Definition for mask value used by #webrtc_stats_prop_e that represents properties of rtc codec stats.
+ * @brief Definition for mask value used by #webrtc_stats_prop_e that represents properties of RTC codec stats.
* @since_tizen 7.0
* @remarks It corresponds with the values described in https://www.w3.org/TR/webrtc-stats/#dom-rtccodecstats.
* @see webrtc_stats_prop_e
*/
-#define WEBRTC_STATS_CODEC 0x00000200
+#define WEBRTC_STATS_CODEC 0x00000200
+
+/**
+ * @brief Definition for mask value used by #webrtc_stats_prop_e that represents properties of RTC RTP stream stats.
+ * @since_tizen 7.0
+ * @remarks It corresponds with the values described in https://www.w3.org/TR/webrtc-stats/#dom-rtcrtpstreamstats.
+ * @see webrtc_stats_prop_e
+ */
+#define WEBRTC_STATS_RTP_STREAM 0x00000400
+
+/**
+ * @brief Definition for mask value used by #webrtc_stats_prop_e that represents properties of RTC received RTP stream stats.
+ * @since_tizen 7.0
+ * @remarks It corresponds with the values described in https://www.w3.org/TR/webrtc-stats/#dom-rtcreceivedrtpstreamstats.
+ * @see webrtc_stats_prop_e
+ */
+#define WEBRTC_STATS_RECEIVED_RTP_STREAM 0x00000800
+
+/**
+ * @brief Definition for mask value used by #webrtc_stats_prop_e that represents properties of RTC inbound RTP stream stats.
+ * @since_tizen 7.0
+ * @remarks It corresponds with the values described in https://www.w3.org/TR/webrtc-stats/#dom-rtcinboundrtpstreamstats.
+ * @see webrtc_stats_prop_e
+ */
+#define WEBRTC_STATS_INBOUND_RTP_STREAM 0x00000F00
/**
* @brief Enumeration for WebRTC statistics property.
* @since_tizen 7.0
*/
typedef enum {
- WEBRTC_STATS_PROP_TIMESTAMP = WEBRTC_STATS_COMMON | 0x01, /**< Timestamp */
- WEBRTC_STATS_PROP_ID = WEBRTC_STATS_COMMON | 0x02, /**< Id */
- WEBRTC_STATS_PROP_PAYLOAD_TYPE = WEBRTC_STATS_CODEC | 0x01, /**< Payload type */
- WEBRTC_STATS_PROP_CLOCK_RATE = WEBRTC_STATS_CODEC | 0x02, /**< Clock rate */
- WEBRTC_STATS_PROP_CHANNELS = WEBRTC_STATS_CODEC | 0x03, /**< Channels */
- WEBRTC_STATS_PROP_MIME_TYPE = WEBRTC_STATS_CODEC | 0x04, /**< MIME type */
- WEBRTC_STATS_PROP_CODEC_TYPE = WEBRTC_STATS_CODEC | 0x05, /**< Codec type */
- WEBRTC_STATS_PROP_SDP_FMTP_LINE = WEBRTC_STATS_CODEC | 0x06, /**< SDP FMTP line */
+ WEBRTC_STATS_PROP_TIMESTAMP = WEBRTC_STATS_COMMON | 0x01, /**< Timestamp */
+ WEBRTC_STATS_PROP_ID = WEBRTC_STATS_COMMON | 0x02, /**< Id */
+ WEBRTC_STATS_PROP_PAYLOAD_TYPE = WEBRTC_STATS_CODEC | 0x01, /**< Payload type */
+ WEBRTC_STATS_PROP_CLOCK_RATE = WEBRTC_STATS_CODEC | 0x02, /**< Clock rate */
+ WEBRTC_STATS_PROP_CHANNELS = WEBRTC_STATS_CODEC | 0x03, /**< Channels */
+ WEBRTC_STATS_PROP_MIME_TYPE = WEBRTC_STATS_CODEC | 0x04, /**< MIME type */
+ WEBRTC_STATS_PROP_CODEC_TYPE = WEBRTC_STATS_CODEC | 0x05, /**< Codec type */
+ WEBRTC_STATS_PROP_SDP_FMTP_LINE = WEBRTC_STATS_CODEC | 0x06, /**< SDP FMTP line */
+ WEBRTC_STATS_PROP_SSRC = WEBRTC_STATS_RTP_STREAM | 0x01, /**< SSRC */
+ WEBRTC_STATS_PROP_TRANSPORT_ID = WEBRTC_STATS_RTP_STREAM | 0x02, /**< Transport id */
+ WEBRTC_STATS_PROP_CODEC_ID = WEBRTC_STATS_RTP_STREAM | 0x03, /**< Codec id */
+ WEBRTC_STATS_PROP_PACKETS_RECEIVED = WEBRTC_STATS_RECEIVED_RTP_STREAM | 0x01, /**< Packets received */
+ WEBRTC_STATS_PROP_PACKETS_LOST = WEBRTC_STATS_RECEIVED_RTP_STREAM | 0x02, /**< Packets lost */
+ WEBRTC_STATS_PROP_PACKETS_DISCARDED = WEBRTC_STATS_RECEIVED_RTP_STREAM | 0x03, /**< Packets discarded */
+ WEBRTC_STATS_PROP_JITTER = WEBRTC_STATS_RECEIVED_RTP_STREAM | 0x05, /**< Jitter */
+ WEBRTC_STATS_PROP_REMOTE_ID = WEBRTC_STATS_INBOUND_RTP_STREAM | 0x01, /**< Remote id */
+ WEBRTC_STATS_PROP_BYTES_RECEIVED = WEBRTC_STATS_INBOUND_RTP_STREAM | 0x02, /**< Bytes received */
+ WEBRTC_STATS_PROP_PACKETS_DUPLICATED = WEBRTC_STATS_INBOUND_RTP_STREAM | 0x03, /**< Packets duplicated */
+ WEBRTC_STATS_PROP_FIR_COUNT = WEBRTC_STATS_INBOUND_RTP_STREAM | 0x04, /**< FIR packets */
+ WEBRTC_STATS_PROP_PLI_COUNT = WEBRTC_STATS_INBOUND_RTP_STREAM | 0x05, /**< PLI packets */
+ WEBRTC_STATS_PROP_NACK_COUNT = WEBRTC_STATS_INBOUND_RTP_STREAM | 0x06, /**< NACK packets */
} webrtc_stats_prop_e;
/**
* "ssrc" G_TYPE_STRING the rtp sequence src in use
* "transport-id" G_TYPE_STRING identifier for the associated RTCTransportStats for this stream
* "codec-id" G_TYPE_STRING identifier for the associated RTCCodecStats for this stream
- * "fir-count" G_TYPE_UINT FIR requests received by the sender (only for local statistics)
- * "pli-count" G_TYPE_UINT PLI requests received by the sender (only for local statistics)
- * "nack-count" G_TYPE_UINT NACK requests received by the sender (only for local statistics)
*/
static stats_field_s __stats_rtp_stream_fields[] = {
- { "ssrc", WEBRTC_STATS_PROP_NOT_EXPORTED, 0 },
- { "transport-id", WEBRTC_STATS_PROP_NOT_EXPORTED, 0 },
- { "codec-id", WEBRTC_STATS_PROP_NOT_EXPORTED, 0 },
- { "fir-count", WEBRTC_STATS_PROP_NOT_EXPORTED, 0 },
- { "pli-count", WEBRTC_STATS_PROP_NOT_EXPORTED, 0 },
- { "nack-count", WEBRTC_STATS_PROP_NOT_EXPORTED, 0 },
+ { "ssrc", WEBRTC_STATS_PROP_SSRC, 0 },
+ { "transport-id", WEBRTC_STATS_PROP_TRANSPORT_ID, 0 },
+ { "codec-id", WEBRTC_STATS_PROP_CODEC_ID, 0 },
{ NULL, 0, 0 }
};
* Description below is extracted from GstWebRTCBin::get-stats:
* RTCReceivedStreamStats supported fields (https://w3c.github.io/webrtc-stats/#receivedrtpstats-dict*)
*
- * "packets-received" G_TYPE_UINT64 number of packets received (only for local inbound)
- * "bytes-received" G_TYPE_UINT64 number of bytes received (only for local inbound)
- * "packets-lost" G_TYPE_UINT number of packets lost
- * "jitter" G_TYPE_DOUBLE packet jitter measured in seconds
+ * "packets-received" G_TYPE_UINT64 number of packets received (only for local inbound)
+ * "packets-lost" G_TYPE_UINT64 number of packets lost
+ * "packets-discarded" G_TYPE_UINT64 number of packets discarded
+ * "packets-repaired" G_TYPE_UINT64 number of packets repaired
+ * "jitter" G_TYPE_DOUBLE packet jitter measured in seconds
*/
static stats_field_s __stats_received_rtp_stream_fields[] = {
- { "packets-received", WEBRTC_STATS_PROP_NOT_EXPORTED, 0 },
- { "packets-lost", WEBRTC_STATS_PROP_NOT_EXPORTED, 0 },
- { "packets-discarded", WEBRTC_STATS_PROP_NOT_EXPORTED, 0 },
- { "packets-repaired", WEBRTC_STATS_PROP_NOT_EXPORTED, 0 },
- { "jitter", WEBRTC_STATS_PROP_NOT_EXPORTED, 0 },
+ { "packets-received", WEBRTC_STATS_PROP_PACKETS_RECEIVED, 0 },
+ { "packets-lost", WEBRTC_STATS_PROP_PACKETS_LOST, 0 },
+ { "packets-discarded", WEBRTC_STATS_PROP_PACKETS_DISCARDED, 0 },
+ { "packets-repaired", WEBRTC_STATS_PROP_NOT_EXPORTED, 0 }, /* It'll be exported after RTX verficiation */
+ { "jitter", WEBRTC_STATS_PROP_JITTER, 0 },
{ NULL, 0, 0 }
};
* RTCInboundRTPStreamStats supported fields (https://w3c.github.io/webrtc-stats/#inboundrtpstats-dict*)
*
* "remote-id" G_TYPE_STRING identifier for the associated RTCRemoteOutboundRTPStreamStats
+ * "bytes-received" G_TYPE_UINT64 number of bytes received (only for local inbound)
+ * "packets-duplicated" G_TYPE_UINT64 number of packets duplicated
+ * "fir-count" G_TYPE_UINT FIR requests sent by the receiver
+ * "pli-count" G_TYPE_UINT PLI requests sent by the receiver
+ * "nack-count" G_TYPE_UINT NACK requests sent by the receiver
*/
static stats_field_s __stats_inbound_rtp_stream_fields[] = {
- { "remote-id", WEBRTC_STATS_PROP_NOT_EXPORTED, 0 },
- { "bytes-received", WEBRTC_STATS_PROP_NOT_EXPORTED, 0 },
- { "packets-duplicated", WEBRTC_STATS_PROP_NOT_EXPORTED, 0 },
- { "fir-count", WEBRTC_STATS_PROP_NOT_EXPORTED, 0 },
- { "pli-count", WEBRTC_STATS_PROP_NOT_EXPORTED, 0 },
- { "nack-count", WEBRTC_STATS_PROP_NOT_EXPORTED, 0 },
+ { "remote-id", WEBRTC_STATS_PROP_REMOTE_ID, 0 },
+ { "bytes-received", WEBRTC_STATS_PROP_BYTES_RECEIVED, 0 },
+ { "packets-duplicated", WEBRTC_STATS_PROP_PACKETS_DUPLICATED, 0 },
+ { "fir-count", WEBRTC_STATS_PROP_FIR_COUNT, 0 },
+ { "pli-count", WEBRTC_STATS_PROP_PLI_COUNT, 0 },
+ { "nack-count", WEBRTC_STATS_PROP_NACK_COUNT, 0 },
{ NULL, 0, 0 }
};
static void __stats_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 };
GstStructure *rtpjitterbuffer_stats;
GstStructure *rtpsource_stats;
"gst-rtpjitterbuffer-stats", GST_TYPE_STRUCTURE, &rtpjitterbuffer_stats,
"gst-rtpsource-stats", GST_TYPE_STRUCTURE, &rtpsource_stats,
NULL);
+
+ stats_userdata.export = false; /* to skip invoking callback stats below */
LOG_DEBUG("gst-rtpjitterbuffer-stats ---> ");
gst_structure_foreach(rtpjitterbuffer_stats, __stats_field_foreach_cb, &stats_userdata);
LOG_DEBUG("gst-rtpsource-stats ---> ");
} parse_stats_s;
/* Definitions below are not exported types due to the incompletion. */
-#define WEBRTC_STATS_TYPE_INBOUND_RTP 0x0002 /**< Inbound RTP */
#define WEBRTC_STATS_TYPE_OUTBOUND_RTP 0x0004 /**< Outbound RTP */
#define WEBRTC_STATS_TYPE_REMOTE_INBOUND_RTP 0x0008 /**< Remote Inbound RTP */
#define WEBRTC_STATS_TYPE_REMOTE_OUTBOUND_RTP 0x000F /**< Remote Outbound RTP */