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

@ -41,7 +41,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 TestEncodedFrame : public EncodedFrame {
@ -126,7 +129,7 @@ TEST_F(VideoReceiver2Test, RegisterReceiveCodecs) {
EXPECT_TRUE(receiver_.IsExternalDecoderRegistered(kPayloadType));
EXPECT_CALL(receive_callback_, OnIncomingPayloadType(kPayloadType));
EXPECT_CALL(receive_callback_, OnDecoderImplementationName);
EXPECT_CALL(receive_callback_, OnDecoderInfoChanged);
// Call `Decode`. This triggers the above call expectations.
EXPECT_EQ(receiver_.Decode(&frame), VCM_OK);