Add powerEfficientDecoder and powerEfficientEncoder stats

The spec for these are at https://w3c.github.io/webrtc-stats/#dom-rtcinboundrtpstreamstats-powerefficientdecoder and https://w3c.github.io/webrtc-stats/#dom-rtcinboundrtpstreamstats-powerefficientdecoder

These stats are based on the is_hardware_accelerated boolean in both the
DecoderInfo and EncoderInfo structs.

Bug: webrtc:14483
Change-Id: I4610da3c6ae977f5853a3b3424d91d864fe72592
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/274409
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38441}
This commit is contained in:
Evan Shrubsole
2022-10-14 14:38:31 +00:00
committed by WebRTC LUCI CQ
parent 6253a4ff9a
commit 09da10e24f
27 changed files with 111 additions and 51 deletions

View File

@ -44,7 +44,10 @@ class MockVCMReceiveCallback : public VCMReceiveCallback {
(VideoFrame&, absl::optional<uint8_t>, TimeDelta, VideoContentType),
(override));
MOCK_METHOD(void, OnIncomingPayloadType, (int), (override));
MOCK_METHOD(void, OnDecoderImplementationName, (const char*), (override));
MOCK_METHOD(void,
OnDecoderInfoChanged,
(const VideoDecoder::DecoderInfo&),
(override));
};
class TestVideoReceiver : public ::testing::Test {
@ -74,8 +77,7 @@ class TestVideoReceiver : public ::testing::Test {
// Since we call Decode, we need to provide a valid receive callback.
// However, for the purposes of these tests, we ignore the callbacks.
EXPECT_CALL(receive_callback_, OnIncomingPayloadType(_)).Times(AnyNumber());
EXPECT_CALL(receive_callback_, OnDecoderImplementationName(_))
.Times(AnyNumber());
EXPECT_CALL(receive_callback_, OnDecoderInfoChanged).Times(AnyNumber());
receiver_.RegisterReceiveCallback(&receive_callback_);
}