webrtc/api/test/mock_transformable_video_frame.h
Henrik Boström 3dd73ae6f4 Surface the SetMetadata() method so that Chromium can use it.
RTPVideoHeader is changed to non-const to allow modifying it. We want
to do this when implementing setMetadata() in JavaScript or when
refactoring clone() as "construct + set bytes + setMetadata".

Unblocks
https://chromium-review.googlesource.com/c/chromium/src/+/4164979.

Bug: webrtc:14709
Change-Id: I6089df9c03e9aa33feeb0830dd240dd456cb565e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/290981
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39113}
2023-01-16 10:54:17 +00:00

42 lines
1.4 KiB
C++

/*
* Copyright (c) 2020 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef API_TEST_MOCK_TRANSFORMABLE_VIDEO_FRAME_H_
#define API_TEST_MOCK_TRANSFORMABLE_VIDEO_FRAME_H_
#include <vector>
#include "api/frame_transformer_interface.h"
#include "test/gmock.h"
namespace webrtc {
class MockTransformableVideoFrame
: public webrtc::TransformableVideoFrameInterface {
public:
MOCK_METHOD(rtc::ArrayView<const uint8_t>, GetData, (), (const, override));
MOCK_METHOD(void, SetData, (rtc::ArrayView<const uint8_t> data), (override));
MOCK_METHOD(uint32_t, GetTimestamp, (), (const, override));
MOCK_METHOD(uint32_t, GetSsrc, (), (const, override));
MOCK_METHOD(bool, IsKeyFrame, (), (const, override));
MOCK_METHOD(std::vector<uint8_t>, GetAdditionalData, (), (const, override));
MOCK_METHOD(const webrtc::VideoFrameMetadata&,
GetMetadata,
(),
(const, override));
MOCK_METHOD(void,
SetMetadata,
(const webrtc::VideoFrameMetadata&),
(override));
};
} // namespace webrtc
#endif // API_TEST_MOCK_TRANSFORMABLE_VIDEO_FRAME_H_