Commit graph

221 commits

Author SHA1 Message Date
Henrik Boström
523eff622e [Stats] Delete unused RTCStatsMember type alias.
With this CL the migration to absl::optional<T> is complete.

Bug: webrtc:15164
Change-Id: I978d86833fbd39154ed9026206a02ea7496f8c4f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/335640
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@google.com>
Cr-Commit-Position: refs/heads/main@{#41616}
2024-01-26 06:59:32 +00:00
Henrik Boström
ac58a334f7 [Stats] Migrate from the RTCStatsMember type alias to absl::optional.
With this CL, the only usage of RTCStatsMember within WebRTC is the
actual type alias declaration. It's not referenced anywhere anymore.

This allows us to deleting the type alias, but let's do that in a
standalone CL in case it gets reverted.

Bug: webrtc:15164
Change-Id: I766d07abb62b5ddd524859b8ed749394fc439e52
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/335621
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@google.com>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41612}
2024-01-25 21:56:08 +00:00
Henrik Boström
5372bcec52 Reland "[Stats] Make RTCStatsMember<T> a type alias for absl::optional<T>."
This is a reland of commit 79ac694d9b

Original change's description:
> [Stats] Make RTCStatsMember<T> a type alias for absl::optional<T>.
>
> The moment we've all been waiting for.
>
> Step 1: Add type alias (this CL).
> Step 2: Migrate all uses of RTCStatsMember<T> to absl::optional<T>.
> Step 3: Delete type alias.
>
> Bug: webrtc:15164
> Change-Id: I00a7202c0b684fb2c57fcad4f501bccc167f1fa3
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/334680
> Commit-Queue: Henrik Boström <hbos@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Reviewed-by: Evan Shrubsole <eshr@google.com>
> Cr-Commit-Position: refs/heads/main@{#41593}

# Only unrelated bot failures
NOTRY=True

Bug: webrtc:15164
Change-Id: I0f1991409326679a260cb24907808eaa28385350
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/335960
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@google.com>
Cr-Commit-Position: refs/heads/main@{#41603}
2024-01-24 12:26:45 +00:00
Henrik Boström
fd54a619a5 Revert "[Stats] Make RTCStatsMember<T> a type alias for absl::optional<T>."
This reverts commit 79ac694d9b.

Reason for revert: Breaks downstream (found another use of
ValueOrDefault instead of value_or)...

Original change's description:
> [Stats] Make RTCStatsMember<T> a type alias for absl::optional<T>.
>
> The moment we've all been waiting for.
>
> Step 1: Add type alias (this CL).
> Step 2: Migrate all uses of RTCStatsMember<T> to absl::optional<T>.
> Step 3: Delete type alias.
>
> Bug: webrtc:15164
> Change-Id: I00a7202c0b684fb2c57fcad4f501bccc167f1fa3
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/334680
> Commit-Queue: Henrik Boström <hbos@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Reviewed-by: Evan Shrubsole <eshr@google.com>
> Cr-Commit-Position: refs/heads/main@{#41593}

Bug: webrtc:15164
Change-Id: Ice3f44057b82a7ba9be000d9a0b714152fd07d2f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/335701
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@google.com>
Reviewed-by: Christoffer Dewerin <jansson@google.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41595}
2024-01-22 15:40:52 +00:00
Henrik Boström
79ac694d9b [Stats] Make RTCStatsMember<T> a type alias for absl::optional<T>.
The moment we've all been waiting for.

Step 1: Add type alias (this CL).
Step 2: Migrate all uses of RTCStatsMember<T> to absl::optional<T>.
Step 3: Delete type alias.

Bug: webrtc:15164
Change-Id: I00a7202c0b684fb2c57fcad4f501bccc167f1fa3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/334680
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@google.com>
Cr-Commit-Position: refs/heads/main@{#41593}
2024-01-22 12:48:07 +00:00
Henrik Boström
348438154a [Stats] Delete ValueToString/ToJson, ToString does the job.
There can only be one!

Bug: webrtc:15164
Change-Id: Ib7265bf2103f24a6dab07737b2caed7f39ba75c3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/334643
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@google.com>
Cr-Commit-Position: refs/heads/main@{#41591}
2024-01-22 08:39:08 +00:00
Henrik Boström
7209548090 Reland "[Stats] Attribute::ToString(), to replace member ValueToString/ToJson."
This is a reland of commit 54be7084e0

Previously reverted due to an importer issue (b/320646178) and later a
dependency on RTCStatsMember<T>::ValueToString().

In this reland, we add Attribute::ToString() but we don't delete the
RTCStatsMember<T> stringifier methods, allowing downstream to migrate
before they are deleted.

Original change's description:
> [Stats] Attribute::ToString(), to replace member ValueToString/ToJson.
>
> Delete RTCStatsMember<T>::ValueToString() and ValueToJson() in favor of
> Attribute::ToString().
>
> The difference between "ToString" and "ToJson" is that the "ToJson"
> version converts 64-bit integers and doubles to floating points with no
> more than ~15 digits of precision as to not exceed JSON's precision
> limitations. So only in edge cases of really large numbers or numbers
> with a silly number of digits will the two methods produce different
> results. Also JSON puts '\"' around map key names, e.g. "{\"foo\":123}"
> as opposed to "{foo:123}".
>
> Going forward we see no reason to maintain two different string
> converted paths that are this similar, so we only implement one
> Attribute::ToString() method which does what "ToJson" did.
>
> In the next CL we can delete RTCStatsMember<T>.
>
> Bug: webrtc:15164
> Change-Id: Iaa8cf3bf14b40dc44664f75989832469603131c5
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/334640
> Commit-Queue: Henrik Boström <hbos@webrtc.org>
> Reviewed-by: Evan Shrubsole <eshr@google.com>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#41544}

Bug: webrtc:15164
Change-Id: I281ccf5b23d8f194b5ce00186a32846c757b46fc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/334860
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41575}
2024-01-19 14:42:10 +00:00
Henrik Boström
ed1d084d0a [Stats] Replace all uses of is_defined() with has_value().
Same method, different name. Unblocks replacing RTCStatsMember<T> with
absl::optional<T>.

Bug: webrtc:15164
Change-Id: I251dd44d3b0f9576b3b68915fe0406d1b3381e5c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/334641
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41573}
2024-01-19 12:26:56 +00:00
Mirko Bonadei
4d706a9fd1 Revert "Reland "[Stats] Attribute::ToString(), to replace member ValueToString/ToJson.""
This reverts commit 55cdc29b9d.

Reason for revert: Breaks downstream project.

Original change's description:
> Reland "[Stats] Attribute::ToString(), to replace member ValueToString/ToJson."
>
> This is a reland of commit 54be7084e0
>
> Original change's description:
> > [Stats] Attribute::ToString(), to replace member ValueToString/ToJson.
> >
> > Delete RTCStatsMember<T>::ValueToString() and ValueToJson() in favor of
> > Attribute::ToString().
> >
> > The difference between "ToString" and "ToJson" is that the "ToJson"
> > version converts 64-bit integers and doubles to floating points with no
> > more than ~15 digits of precision as to not exceed JSON's precision
> > limitations. So only in edge cases of really large numbers or numbers
> > with a silly number of digits will the two methods produce different
> > results. Also JSON puts '\"' around map key names, e.g. "{\"foo\":123}"
> > as opposed to "{foo:123}".
> >
> > Going forward we see no reason to maintain two different string
> > converted paths that are this similar, so we only implement one
> > Attribute::ToString() method which does what "ToJson" did.
> >
> > In the next CL we can delete RTCStatsMember<T>.
> >
> > Bug: webrtc:15164
> > Change-Id: Iaa8cf3bf14b40dc44664f75989832469603131c5
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/334640
> > Commit-Queue: Henrik Boström <hbos@webrtc.org>
> > Reviewed-by: Evan Shrubsole <eshr@google.com>
> > Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> > Cr-Commit-Position: refs/heads/main@{#41544}
>
> Bug: webrtc:15164
> Change-Id: If34509ebf3d7c0291442ae11596e7c2d3978fb64
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/335240
> Reviewed-by: Henrik Boström <hbos@webrtc.org>
> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#41566}

Bug: webrtc:15164
Change-Id: I5819811237a6dbd85a8c738ca0180039fc705909
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/335280
Reviewed-by: Christoffer Dewerin <jansson@google.com>
Owners-Override: Mirko Bonadei <mbonadei@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Jeremy Leconte <jleconte@google.com>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41567}
2024-01-19 08:03:48 +00:00
Henrik Boström
55cdc29b9d Reland "[Stats] Attribute::ToString(), to replace member ValueToString/ToJson."
This is a reland of commit 54be7084e0

Original change's description:
> [Stats] Attribute::ToString(), to replace member ValueToString/ToJson.
>
> Delete RTCStatsMember<T>::ValueToString() and ValueToJson() in favor of
> Attribute::ToString().
>
> The difference between "ToString" and "ToJson" is that the "ToJson"
> version converts 64-bit integers and doubles to floating points with no
> more than ~15 digits of precision as to not exceed JSON's precision
> limitations. So only in edge cases of really large numbers or numbers
> with a silly number of digits will the two methods produce different
> results. Also JSON puts '\"' around map key names, e.g. "{\"foo\":123}"
> as opposed to "{foo:123}".
>
> Going forward we see no reason to maintain two different string
> converted paths that are this similar, so we only implement one
> Attribute::ToString() method which does what "ToJson" did.
>
> In the next CL we can delete RTCStatsMember<T>.
>
> Bug: webrtc:15164
> Change-Id: Iaa8cf3bf14b40dc44664f75989832469603131c5
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/334640
> Commit-Queue: Henrik Boström <hbos@webrtc.org>
> Reviewed-by: Evan Shrubsole <eshr@google.com>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#41544}

Bug: webrtc:15164
Change-Id: If34509ebf3d7c0291442ae11596e7c2d3978fb64
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/335240
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41566}
2024-01-19 07:21:51 +00:00
Henrik Boström
df0b363cf0 Reland "[Stats] Add value_or() and migrate from ValueOrDefault()."
This is a reland of commit 9e4a97bb02

Original change's description:
> [Stats] Add value_or() and migrate from ValueOrDefault().
>
> Yet another prerequisite for replacing RTCStatsMember<T> with
> absl::optional<T>, but this looks like the last one.
>
> Bug: webrtc:15164
> Change-Id: I2cde51e8c8c951f71b48ccd45e07146091a99616
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/334647
> Commit-Queue: Henrik Boström <hbos@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#41541}

Bug: webrtc:15164
Change-Id: I5fdba499383e5d9efe0a1dcef6bf6c2e0a812857
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/335102
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41564}
2024-01-18 22:07:18 +00:00
Henrik Boström
c0ac4df7a5 Reland "[Stats] Move metric names to Attribute, constructed via AttributeInit."
This is a reland of commit 84c48ae751

Original change's description:
> [Stats] Move metric names to Attribute, constructed via AttributeInit.
>
> As of this CL, Attribute no longer implements RTCStatsMemberInterface
> and a member no longer owns knowing its own name. The attribute knows
> the name because we pass it down at construction time.
>
> To achieve this, the WEBRTC_RTCSTATS_IMPL() macro is updated to take
> AttributeInits instead of raw member pointers, i.e. (name, ptr) pairs.
>
> By constructing RTCStatsMember<T> without a name parameter, it does the
> same thing as the absl::optional<T> constructor. So RTCStatsMember<T>'s
> days are numbered!
>
> Bug: webrtc:15164
> Change-Id: I560c0134bae1c2d7218426a1576425ecc1b677a7
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/334203
> Commit-Queue: Henrik Boström <hbos@webrtc.org>
> Reviewed-by: Evan Shrubsole <eshr@google.com>
> Cr-Commit-Position: refs/heads/main@{#41540}

Bug: webrtc:15164
Change-Id: I28f3d588004ff185e5820347ad9513f2f7a6cc66
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/335020
Auto-Submit: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41556}
2024-01-18 10:10:57 +00:00
Mirko Bonadei
df3b3bd06f Revert "[Stats] Move metric names to Attribute, constructed via AttributeInit."
This reverts commit 84c48ae751.

Reason for revert: Breaks downstream project

Original change's description:
> [Stats] Move metric names to Attribute, constructed via AttributeInit.
>
> As of this CL, Attribute no longer implements RTCStatsMemberInterface
> and a member no longer owns knowing its own name. The attribute knows
> the name because we pass it down at construction time.
>
> To achieve this, the WEBRTC_RTCSTATS_IMPL() macro is updated to take
> AttributeInits instead of raw member pointers, i.e. (name, ptr) pairs.
>
> By constructing RTCStatsMember<T> without a name parameter, it does the
> same thing as the absl::optional<T> constructor. So RTCStatsMember<T>'s
> days are numbered!
>
> Bug: webrtc:15164
> Change-Id: I560c0134bae1c2d7218426a1576425ecc1b677a7
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/334203
> Commit-Queue: Henrik Boström <hbos@webrtc.org>
> Reviewed-by: Evan Shrubsole <eshr@google.com>
> Cr-Commit-Position: refs/heads/main@{#41540}

Bug: webrtc:15164
Change-Id: I9f416838153b26d4560ae98c37fb18a803d0295d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/334901
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Owners-Override: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41550}
2024-01-17 17:00:22 +00:00
Mirko Bonadei
111e381822 Revert "[Stats] Add value_or() and migrate from ValueOrDefault()."
This reverts commit 9e4a97bb02.

Reason for revert: Breaks downstream project

Original change's description:
> [Stats] Add value_or() and migrate from ValueOrDefault().
>
> Yet another prerequisite for replacing RTCStatsMember<T> with
> absl::optional<T>, but this looks like the last one.
>
> Bug: webrtc:15164
> Change-Id: I2cde51e8c8c951f71b48ccd45e07146091a99616
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/334647
> Commit-Queue: Henrik Boström <hbos@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#41541}

Bug: webrtc:15164
Change-Id: I89af6470c82d07981d8d064aa6ff8b50fae42b12
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/334801
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Owners-Override: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41548}
2024-01-17 14:38:25 +00:00
Mirko Bonadei
1fee69cfff Revert "[Stats] Attribute::ToString(), to replace member ValueToString/ToJson."
This reverts commit 54be7084e0.

Reason for revert: Breaks downstream project.

Original change's description:
> [Stats] Attribute::ToString(), to replace member ValueToString/ToJson.
>
> Delete RTCStatsMember<T>::ValueToString() and ValueToJson() in favor of
> Attribute::ToString().
>
> The difference between "ToString" and "ToJson" is that the "ToJson"
> version converts 64-bit integers and doubles to floating points with no
> more than ~15 digits of precision as to not exceed JSON's precision
> limitations. So only in edge cases of really large numbers or numbers
> with a silly number of digits will the two methods produce different
> results. Also JSON puts '\"' around map key names, e.g. "{\"foo\":123}"
> as opposed to "{foo:123}".
>
> Going forward we see no reason to maintain two different string
> converted paths that are this similar, so we only implement one
> Attribute::ToString() method which does what "ToJson" did.
>
> In the next CL we can delete RTCStatsMember<T>.
>
> Bug: webrtc:15164
> Change-Id: Iaa8cf3bf14b40dc44664f75989832469603131c5
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/334640
> Commit-Queue: Henrik Boström <hbos@webrtc.org>
> Reviewed-by: Evan Shrubsole <eshr@google.com>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#41544}

Bug: webrtc:15164
Change-Id: I187d7dff6f330a4a440279e6c32d88eb6ddefac8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/334820
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Owners-Override: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41546}
2024-01-17 14:06:34 +00:00
Henrik Boström
54be7084e0 [Stats] Attribute::ToString(), to replace member ValueToString/ToJson.
Delete RTCStatsMember<T>::ValueToString() and ValueToJson() in favor of
Attribute::ToString().

The difference between "ToString" and "ToJson" is that the "ToJson"
version converts 64-bit integers and doubles to floating points with no
more than ~15 digits of precision as to not exceed JSON's precision
limitations. So only in edge cases of really large numbers or numbers
with a silly number of digits will the two methods produce different
results. Also JSON puts '\"' around map key names, e.g. "{\"foo\":123}"
as opposed to "{foo:123}".

Going forward we see no reason to maintain two different string
converted paths that are this similar, so we only implement one
Attribute::ToString() method which does what "ToJson" did.

In the next CL we can delete RTCStatsMember<T>.

Bug: webrtc:15164
Change-Id: Iaa8cf3bf14b40dc44664f75989832469603131c5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/334640
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@google.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41544}
2024-01-17 12:36:46 +00:00
Henrik Boström
9e4a97bb02 [Stats] Add value_or() and migrate from ValueOrDefault().
Yet another prerequisite for replacing RTCStatsMember<T> with
absl::optional<T>, but this looks like the last one.

Bug: webrtc:15164
Change-Id: I2cde51e8c8c951f71b48ccd45e07146091a99616
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/334647
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41541}
2024-01-17 10:35:14 +00:00
Henrik Boström
84c48ae751 [Stats] Move metric names to Attribute, constructed via AttributeInit.
As of this CL, Attribute no longer implements RTCStatsMemberInterface
and a member no longer owns knowing its own name. The attribute knows
the name because we pass it down at construction time.

To achieve this, the WEBRTC_RTCSTATS_IMPL() macro is updated to take
AttributeInits instead of raw member pointers, i.e. (name, ptr) pairs.

By constructing RTCStatsMember<T> without a name parameter, it does the
same thing as the absl::optional<T> constructor. So RTCStatsMember<T>'s
days are numbered!

Bug: webrtc:15164
Change-Id: I560c0134bae1c2d7218426a1576425ecc1b677a7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/334203
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@google.com>
Cr-Commit-Position: refs/heads/main@{#41540}
2024-01-17 09:10:10 +00:00
Henrik Boström
1ac0bea35f [Stats] Delete unused method RTCStats::Members().
For iteration of metrics, use RTCStats::Attributes() instead.

In a follow-up CL, RTCStatsMember<T> types will be replaced by
absl::optional<T> and RTCStatsMemberInterface and friends will be
deleted.

Bug: webrtc:15164
Change-Id: Ifca1d36abac3068abd299df49da36cacea1898fa
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/334202
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41534}
2024-01-16 09:28:29 +00:00
Henrik Boström
40dcdf7fac [Stats] Migrate integration test to Attributes().
To unblock replacing RTCStatsMember<T> with absl::optional<T>.
RTCStats::GetAttribute() is added to allow obtaining the name of a
metric even after the replacement, the only usage of this AFAIK is this
test file.

Bug: webrtc:15164
Change-Id: I21e8b782ba86d9f864cb90885134c6724ba3398b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/334163
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41515}
2024-01-12 11:30:06 +00:00
Henrik Boström
bfee961786 [Stats] Migrate RTCStats/Test to Attributes.
One in series of CLs to migrate from Members() to Attributes() to
unblock code deletion.

Adds and makes use of has_value(), holds_alternative<T>() and get<T>()
convenience methods.

Bug: webrtc:15164
Change-Id: I2ae9869a5d1de3f3875c70494c9781d69da7f936
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/334160
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@google.com>
Cr-Commit-Position: refs/heads/main@{#41510}
2024-01-12 10:27:14 +00:00
Henrik Boström
7978cf1b43 [Stats] Introduce Attribute, implementing RTCStatsMemberInterface.
The plan is to replace Members() with Attributes() instead.
For backwards-compatability during the transition, Attribute implements
RTCStatsMemberInterface but the two classes serve the same purpose
which is to allow iterating all metrics of a stats object.

The reason for moving away from "members" is that we already have a way
to express a variable that maybe has a value: absl::optional<T>. The
only information the member adds is the const char* name(), which we'll
move to Attribute in a future CL.

We don't need to maintain an RTCStatsMemberInterface::Type enum in the
future because absl::variant<T> has absl::holds_alternative<T>.

Step 1: Add Attributes().
Step 2: Migrate to Attributes() and delete Members().
Step 3: Replaces all uses of RTCStatsMember<T> with absl::optional<T>
        and delete RTCStatsMember + RTCStatsMemberInterface.

Bug: webrtc:15164
Change-Id: I3fdd5b24214bb5cc340a54a0171df73b516e1803
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/333840
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41507}
2024-01-12 08:19:50 +00:00
Henrik Boström
98b0da181b Move RTCStatsMember+Interface to a separate file.
Pure move CL. Avoids circular dependency in a future CL.

Bug: webrtc:15164
Change-Id: Ide423be95db30b7f3cfaea946e18e12980175f2b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/333920
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41496}
2024-01-10 08:47:30 +00:00
Harald Alvestrand
78f905e5cc Move some users to use webrtc::RefCountInterface
Bug: webrtc:15622
Change-Id: I2d4c20c726af1a052e161b7689a73d1e5e3eb191
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/325526
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41067}
2023-11-02 14:45:57 +00:00
Henrik Boström
8005d5613e Add stats-related TODOs with crbugs.
Someone wondered why framesRendered has not been implemented. I had a
look, and discovered that a) we need to implement it, and b) our entire
inter-frame, pause, and freeze metrics are measured at the wrong time
because what WebRTC considered "OnRenderedFrame()" is not actually when
the frame was rendered.

So that we don't forget this again, I filed two crbugs and added TODOs
in the code for future reference to anyone interested in these metrics.

Bug: webrtc:15600, webrtc:15601
Change-Id: Id38df7874df715e9b9c0410efa4a9bc2af5d6232
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/324306
Auto-Submit: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40987}
2023-10-23 09:53:11 +00:00
Philipp Hancke
e2e04513e7 stats: implement fecSsrc on inbound-rtp
which is present if a fec mechanism like FlexFEC is negotiated

spec change:
  https://github.com/w3c/webrtc-stats/pull/765

BUG=webrtc:15250

Change-Id: I7d71d49fab0153d734f22831e6684d2acfc647fb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/314981
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40514}
2023-08-04 12:54:48 +00:00
Philipp Hancke
9b82b2f8d6 stats: implement RTX ssrc on inbound-rtp/outbound-rtp
spec change:
  https://github.com/w3c/webrtc-stats/pull/765

BUG=webrtc:15096

Change-Id: I7c72193c23460330b6bb612a9568641d187ee638
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/312362
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40510}
2023-08-04 08:41:52 +00:00
Henrik Boström
a6c4f12fad Set noparent in api/stats/OWNERS.
This avoids the risk of a higher level owner approving something getting
added to the getStats() API without +1s from stats owners.

Bug: None
Change-Id: Iedd7133d0e943d1db6977dc0e1d406e5b545e31a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/311543
Reviewed-by: Philipp Hancke <phancke@microsoft.com>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40412}
2023-07-10 12:25:04 +00:00
Philipp Hancke
17e8a5cc7d stats: implement flexfec fecBytesReceived stats for FlexFEC
specified in https://github.com/w3c/webrtc-stats/pull/762
and take FlexFEC into account for receive statistics.

BUG=webrtc:15250

Change-Id: Id85775ab1f29487d5b8bf478da6e22071005901a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/294881
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#40325}
2023-06-21 13:04:31 +00:00
Henrik Boström
c929ab49b9 Reland "[Stats] Remove enum-like structs in favor of strings."
This is a reland of commit ccc87ea3c6

Downstream project has been updated.

Original change's description:
> [Stats] Remove enum-like structs in favor of strings.
>
> Due to a limitation of RTCStatsMember<T> not supporting enums, as well
> as the fact that in JavaScript enums are represented as basic strings,
> the stats enums have always been represented by T=std::string.
>
> Now that we have WebIDL-ified[1] all RTCStats dictionaries and enum
> values are simply string-copied (example: [2]) it seems safe to assume
> that "stats enums are just strings" is here to stay.
>
> Therefore there is little value in having C++ structs that look like
> enums so I'm deleting those in favor of std::string operator==()
> comparisons, e.g. `if (rtp_stream.kind == "audio")`. This removes some
> lines of code from our code base.
>
> I mostly want to get rid of these because they were taking up about 20%
> of the rtcstats_objects.h real estate...
>
> [1] https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/modules/peerconnection/rtc_stats_report.idl
> [2] https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/modules/peerconnection/rtc_stats_report.cc;l=667;drc=cf34e84c9df94256abfb1716ba075ed203975755
>
> Bug: webrtc:15245
> Change-Id: Iaf0827d7aecebc1cc02976a61663d5298d684f07
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/308680
> Commit-Queue: Henrik Boström <hbos@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#40295}

Bug: webrtc:15245
Change-Id: Ibc7aeb518ed0bd7f1d725f140132c99e5a89bcf3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/308880
Auto-Submit: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40305}
2023-06-17 15:41:44 +00:00
Christoffer Jansson
45666d4b01 Revert "[Stats] Remove enum-like structs in favor of strings."
This reverts commit ccc87ea3c6.

Reason for revert: Breaks downstream project

Original change's description:
> [Stats] Remove enum-like structs in favor of strings.
>
> Due to a limitation of RTCStatsMember<T> not supporting enums, as well
> as the fact that in JavaScript enums are represented as basic strings,
> the stats enums have always been represented by T=std::string.
>
> Now that we have WebIDL-ified[1] all RTCStats dictionaries and enum
> values are simply string-copied (example: [2]) it seems safe to assume
> that "stats enums are just strings" is here to stay.
>
> Therefore there is little value in having C++ structs that look like
> enums so I'm deleting those in favor of std::string operator==()
> comparisons, e.g. `if (rtp_stream.kind == "audio")`. This removes some
> lines of code from our code base.
>
> I mostly want to get rid of these because they were taking up about 20%
> of the rtcstats_objects.h real estate...
>
> [1] https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/modules/peerconnection/rtc_stats_report.idl
> [2] https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/modules/peerconnection/rtc_stats_report.cc;l=667;drc=cf34e84c9df94256abfb1716ba075ed203975755
>
> Bug: webrtc:15245
> Change-Id: Iaf0827d7aecebc1cc02976a61663d5298d684f07
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/308680
> Commit-Queue: Henrik Boström <hbos@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#40295}

Bug: webrtc:15245
Change-Id: I05db80ba9f29460239de82cea9d95136e4c708e4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/308860
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Christoffer Jansson <jansson@webrtc.org>
Owners-Override: Christoffer Jansson <jansson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40298}
2023-06-16 06:29:26 +00:00
Henrik Boström
ccc87ea3c6 [Stats] Remove enum-like structs in favor of strings.
Due to a limitation of RTCStatsMember<T> not supporting enums, as well
as the fact that in JavaScript enums are represented as basic strings,
the stats enums have always been represented by T=std::string.

Now that we have WebIDL-ified[1] all RTCStats dictionaries and enum
values are simply string-copied (example: [2]) it seems safe to assume
that "stats enums are just strings" is here to stay.

Therefore there is little value in having C++ structs that look like
enums so I'm deleting those in favor of std::string operator==()
comparisons, e.g. `if (rtp_stream.kind == "audio")`. This removes some
lines of code from our code base.

I mostly want to get rid of these because they were taking up about 20%
of the rtcstats_objects.h real estate...

[1] https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/modules/peerconnection/rtc_stats_report.idl
[2] https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/modules/peerconnection/rtc_stats_report.cc;l=667;drc=cf34e84c9df94256abfb1716ba075ed203975755

Bug: webrtc:15245
Change-Id: Iaf0827d7aecebc1cc02976a61663d5298d684f07
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/308680
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40295}
2023-06-15 16:11:27 +00:00
Henrik Boström
0f1376529a Delete RTC[NonStandard/Restricted]StatsMember.
Whether a metric is to be exposed to JavaScript or not is a blink
implementation detail that the WebRTC repository does not need to be
concerned with.

This CL removes unused code and paves the way for the possibility of
making the one and only RTCStatsMember class be absl::optional<>-based
in the future.

Bug: webrtc:15162
Change-Id: I578715f48b8fcc3534b72b4c700fd6567f8d553e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/304722
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40139}
2023-05-25 08:39:48 +00:00
Henrik Boström
979b0479a1 Revert "Temporarily add dummy trackId to unblock roll."
This reverts commit 3df4178d59.

Reason for revert: This dummy variable is no longer needed to make
importer happy

Original change's description:
> Temporarily add dummy trackId to unblock roll.
>
> NOTRY=True
>
> Bug: webrtc:15198
> Change-Id: I3090b90c549da3f2368001f2049bbf1d66042af4
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/306400
> Reviewed-by: Markus Handell <handellm@webrtc.org>
> Commit-Queue: Henrik Boström <hbos@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#40130}

Bug: webrtc:15198
Change-Id: Ib47471259de72771292887050d1576707a473eec
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/306401
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Reviewed-by: Markus Handell <handellm@webrtc.org>
Auto-Submit: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40135}
2023-05-24 15:50:44 +00:00
Henrik Boström
2057d71775 [Stats] Delete unused NonStandardGroupId.
NonStandardGroupId is no longer wired up to Chrome, but if we did want
to only expose certain metrics if a field trial was enabled then the
right place to do that would be in blink, where WebIDL lives.

This was only used prior to the WebRtcStatsReportIdl launch and
experiments haven't been active in several years so its dead code.

Blocked on:
- https://chromium-review.googlesource.com/c/chromium/src/+/4514754

Bug: webrtc:15162
Change-Id: Ia41a4d21d7e5f029ddb121183fbd69ae7f98fac4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/304720
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40132}
2023-05-24 14:08:32 +00:00
Henrik Boström
3df4178d59 Temporarily add dummy trackId to unblock roll.
NOTRY=True

Bug: webrtc:15198
Change-Id: I3090b90c549da3f2368001f2049bbf1d66042af4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/306400
Reviewed-by: Markus Handell <handellm@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40130}
2023-05-24 12:54:43 +00:00
Henrik Boström
4e231eedbd Delete deprecated 'track' and 'stream' metrics from WebRTC.
Track stats are roughly equal in size as the RTP stream stats which
are the largest objects making up the majority of the RTCStatsReport
size and scales with meeting size. Deleting track/stream reduces the
size in approximately half which should reduce performance overhead
and unblock code simplifications.

Blocked on:
- https://chromium-review.googlesource.com/c/chromium/src/+/4517530

# Relevant bots already passed
NOTRY=True

Bug: webrtc:14175, webrtc:14419
Change-Id: Ib7bdb84c10459b42b829228d11876498e5227312
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/289043
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40129}
2023-05-24 12:26:56 +00:00
Henrik Boström
36fd351562 [Stats] Align RTCStatsMember<T> closer to absl::optional<T>.
Step 1: Make reading RTCStatsMember look the same as reading
        absl::optional (this CL).
Step 2: Migrate uses of "is_defined()" to "has_value()".
Step 3: Delete "is_defined()".
Step 4: Make RTCStatsMember+Interface an implementation detail of
        RTCStats::Members(), only used for abstract iteration ("for
        each metric"). Lazy instantiate it upon Members().
Step 5: Replace RTCStatsMember with absl::optional for use in RTCStats
        dictionaries (rtcstats_objects.h/cc).

Bug: webrtc:15164
Change-Id: I5a2c9fe56707e3c7d89e8ea62fb37171ae806a7c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/304840
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40048}
2023-05-11 07:33:54 +00:00
Philipp Hancke
e0034a800e stats: remove media_type which was an alias for kind
The web compat requirement that was the reason for keeping
is now solved in Chromium and its stats bindings.

BUG=webrtc:9674

Change-Id: Ifb722769414b2bcc5f4d36d7dff87a875336e039
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/303860
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40024}
2023-05-09 11:46:52 +00:00
Jared Siskin
bceec84aee Format ^(api|call|common_audio|examples|media|net|p2p|pc)/
half of the remaining folders

git ls-files | grep -e  "\(\.h\|\.cc\)$" | grep -E "^(api|call|common_audio|examples|media|net|p2p|pc)/" | xargs clang-format -i ; git cl format
after landing: add to .git-blame-ignore-revs

Bug: webrtc:15082
Change-Id: I8b2cac13f4587d3ce9b2fccc7362967283f57ea2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/302062
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39977}
2023-05-03 11:09:26 +00:00
Philipp Hancke
f78d1f211a stats: Implement receive RTX stats
* retransmittedBytesReceived
* retransmittedPacketsReceived
added to the specification in
  https://github.com/w3c/webrtc-stats/pull/735

BUG=webrtc:15096

Change-Id: I6770e5d8d09ac1c2693c918fd943b0ab257ec7ba
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/295260
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#39959}
2023-04-27 09:53:00 +00:00
Philipp Hancke
2b72d84733 stats: fix type of inbound-rtp frames_received
which gets assigned from a uint32_t VideoReceiverInfo::frames_received so should remain an unsigned type

BUG=None

Change-Id: I1db6a3f96c4ff49eee72dcce54eb6fff346c128c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/302342
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#39958}
2023-04-26 15:57:46 +00:00
Philipp Hancke
f0f435e983 Remove deprecated RTCStatsReport(int64) and timestamp_us
BUG=webrtc:14813

Change-Id: I80c2ba8f57354ef63cf2cc7b767d1f64dd0dd766
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/298444
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#39633}
2023-03-22 08:00:53 +00:00
Philipp Hancke
b3e5969658 stats: use uint64_t for RTCSentRtpStreamStats.packetsSent
spec update from https://github.com/w3c/webrtc-stats/pull/744

BUG=webrtc:14989

Change-Id: I9d0adcf951501bc281054c77bb6bc03e47192523
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/295505
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#39575}
2023-03-16 06:46:19 +00:00
Philipp Hancke
d3289d2ec0 Reland "stats: remove RTCRtpInboundRTPStream and RTCRtpoutboundRTPStream aliases"
This is a reland of commit 9671d60925
after fixing more downstream dependencies

Original change's description:
> stats: remove RTCRtpInboundRTPStream and RTCRtpoutboundRTPStream aliases
>
> after upgrading downstream projects
>
> BUG=webrtc:14973
>
> Change-Id: I5df8e95a1c70b1d6078e255166c36ed01f868b6a
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/296820
> Reviewed-by: Christoffer Jansson <jansson@webrtc.org>
> Reviewed-by: Henrik Boström <hbos@webrtc.org>
> Commit-Queue: Philipp Hancke <phancke@microsoft.com>
> Cr-Commit-Position: refs/heads/main@{#39526}

No-Try: True
Bug: webrtc:14973
Change-Id: I33bd99ca211a82ed77e3e8676e00256915fde168
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/296881
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39533}
2023-03-10 15:22:01 +00:00
Henrik Boström
4463ff0296 Revert "stats: remove RTCRtpInboundRTPStream and RTCRtpoutboundRTPStream aliases"
This reverts commit 9671d60925.

Reason for revert: Breaks dependencies, will re-land after fixes

Original change's description:
> stats: remove RTCRtpInboundRTPStream and RTCRtpoutboundRTPStream aliases
>
> after upgrading downstream projects
>
> BUG=webrtc:14973
>
> Change-Id: I5df8e95a1c70b1d6078e255166c36ed01f868b6a
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/296820
> Reviewed-by: Christoffer Jansson <jansson@webrtc.org>
> Reviewed-by: Henrik Boström <hbos@webrtc.org>
> Commit-Queue: Philipp Hancke <phancke@microsoft.com>
> Cr-Commit-Position: refs/heads/main@{#39526}

Bug: webrtc:14973
Change-Id: I50878526566660d9772f7c8664970eec8bd86341
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/296940
Reviewed-by: Philipp Hancke <phancke@microsoft.com>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39530}
2023-03-10 13:24:32 +00:00
Philipp Hancke
9671d60925 stats: remove RTCRtpInboundRTPStream and RTCRtpoutboundRTPStream aliases
after upgrading downstream projects

BUG=webrtc:14973

Change-Id: I5df8e95a1c70b1d6078e255166c36ed01f868b6a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/296820
Reviewed-by: Christoffer Jansson <jansson@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#39526}
2023-03-10 12:12:41 +00:00
Philipp Hancke
1f98b466b8 stats: rename RTCInboundRTPStreamStats and RTCOutboundRTPStreamStats
to RTCInboundRtpStreamStats and RTCOutboundRtpStreamStats respectively
which follows the camel-casing convention used elsewhere.

The old name is kept around as an alias for a limited amount of time
to allow upgrading dependencies.

BUG=webrtc:14973

Change-Id: Ibf4e65933fd6cc2e7e89955042f6f8fb0f6c7853
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/296261
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#39497}
2023-03-07 14:27:47 +00:00
Philipp Hancke
1f80451932 Fix stats inheritance and rename RTP to Rtp
making RTCOutboundRtpStreamStats inherit from RTCSentRtpStreamStats
as defined in
  https://www.w3.org/TR/webrtc-stats/#outboundrtpstats-dict*

This removes the duplicated definitions of packetsSent and bytesSent.

BUG=webrtc:14948

Change-Id: I184998b65d59dbd0d1288733d55d8a884e6de970
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/295660
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39481}
2023-03-06 13:43:27 +00:00
Philipp Hancke
fe1b39a648 stats: Deprecate RTCStatsReport(int64 timestamp_us)
in favor of the variant with (or returning) a Timestamp object.

BUG=webrtc:14813,webrtc:13756

Change-Id: I7b40f48f640a8be40a134b380a7a1b99cc99913b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/294287
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#39366}
2023-02-22 12:32:02 +00:00