Skip to content

Commit abcf8d3

Browse files
authored
Use track id in get_stats (#176)
1 parent 3fc9cd0 commit abcf8d3

File tree

4 files changed

+7
-0
lines changed

4 files changed

+7
-0
lines changed

lib/ex_webrtc/rtp_receiver.ex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ defmodule ExWebRTC.RTPReceiver do
262262

263263
%{
264264
id: id,
265+
track_identifier: id,
265266
rid: rid,
266267
codec: codec,
267268
type: :inbound_rtp,

lib/ex_webrtc/rtp_sender.ex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ defmodule ExWebRTC.RTPSender do
226226
timestamp: timestamp,
227227
type: :outbound_rtp,
228228
id: sender.id,
229+
track_identifier: if sender.track, do: sender.track.id,
229230
ssrc: sender.ssrc,
230231
packets_sent: sender.packets_sent,
231232
bytes_sent: sender.bytes_sent,

test/ex_webrtc/rtp_receiver_test.exs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ defmodule ExWebRTC.RTPReceiverTest do
2222
assert [
2323
%{
2424
id: receiver.track.id,
25+
track_identifier: receiver.track.id,
2526
rid: nil,
2627
type: :inbound_rtp,
2728
timestamp: timestamp,
@@ -42,6 +43,7 @@ defmodule ExWebRTC.RTPReceiverTest do
4243
assert [
4344
%{
4445
id: receiver.track.id,
46+
track_identifier: receiver.track.id,
4547
rid: nil,
4648
type: :inbound_rtp,
4749
timestamp: timestamp,

test/ex_webrtc/rtp_sender_test.exs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ defmodule ExWebRTC.RTPSenderTest do
6161
timestamp: timestamp,
6262
type: :outbound_rtp,
6363
id: sender.id,
64+
track_identifier: sender.track.id,
6465
ssrc: sender.ssrc,
6566
packets_sent: 0,
6667
bytes_sent: 0,
@@ -78,6 +79,7 @@ defmodule ExWebRTC.RTPSenderTest do
7879
timestamp: timestamp,
7980
type: :outbound_rtp,
8081
id: sender.id,
82+
track_identifier: sender.track.id,
8183
ssrc: sender.ssrc,
8284
packets_sent: 1,
8385
bytes_sent: byte_size(data1),
@@ -95,6 +97,7 @@ defmodule ExWebRTC.RTPSenderTest do
9597
timestamp: timestamp,
9698
type: :outbound_rtp,
9799
id: sender.id,
100+
track_identifier: sender.track.id,
98101
ssrc: sender.ssrc,
99102
packets_sent: 2,
100103
bytes_sent: byte_size(data1) + byte_size(data2),

0 commit comments

Comments
 (0)