Move MockVideoDecoder to api/test.
Move MockVideoDecoder from modules/video_coding/include/mock/mock_video_codec_interface.h to api/test/mock_video_decoder.h The mock encoder has already moved: https://webrtc-review.googlesource.com/c/src/+/105620 Keeping the old header until downstream projects have been updated. Bug: webrtc:9722 Change-Id: I4bc849173a04813064212f17761876695ca3fed4 Reviewed-on: https://webrtc-review.googlesource.com/c/105900 Reviewed-by: Niels Moller <nisse@webrtc.org> Reviewed-by: Per Kjellander <perkj@webrtc.org> Commit-Queue: Erik Språng <sprang@webrtc.org> Cr-Commit-Position: refs/heads/master@{#25170}
This commit is contained in:
17
api/BUILD.gn
17
api/BUILD.gn
@ -517,7 +517,24 @@ if (rtc_include_tests) {
|
||||
]
|
||||
}
|
||||
|
||||
rtc_source_set("mock_video_decoder") {
|
||||
visibility = [ "*" ]
|
||||
|
||||
testonly = true
|
||||
sources = [
|
||||
"test/mock_video_decoder.cc",
|
||||
"test/mock_video_decoder.h",
|
||||
]
|
||||
|
||||
deps = [
|
||||
"../api/video_codecs:video_codecs_api",
|
||||
"../test:test_support",
|
||||
]
|
||||
}
|
||||
|
||||
rtc_source_set("mock_video_encoder") {
|
||||
visibility = [ "*" ]
|
||||
|
||||
testonly = true
|
||||
sources = [
|
||||
"test/mock_video_encoder.cc",
|
||||
|
20
api/test/mock_video_decoder.cc
Normal file
20
api/test/mock_video_decoder.cc
Normal file
@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright (c) 2018 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.
|
||||
*/
|
||||
|
||||
#include "api/test/mock_video_decoder.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
MockDecodedImageCallback::MockDecodedImageCallback() = default;
|
||||
MockDecodedImageCallback::~MockDecodedImageCallback() = default;
|
||||
MockVideoDecoder::MockVideoDecoder() = default;
|
||||
MockVideoDecoder::~MockVideoDecoder() = default;
|
||||
|
||||
} // namespace webrtc
|
57
api/test/mock_video_decoder.h
Normal file
57
api/test/mock_video_decoder.h
Normal file
@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Copyright (c) 2018 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_VIDEO_DECODER_H_
|
||||
#define API_TEST_MOCK_VIDEO_DECODER_H_
|
||||
|
||||
#include "api/video_codecs/video_decoder.h"
|
||||
#include "test/gmock.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
class MockDecodedImageCallback : public DecodedImageCallback {
|
||||
public:
|
||||
MockDecodedImageCallback();
|
||||
~MockDecodedImageCallback() override;
|
||||
|
||||
MOCK_METHOD1(Decoded, int32_t(VideoFrame& decodedImage)); // NOLINT
|
||||
MOCK_METHOD2(Decoded,
|
||||
int32_t(VideoFrame& decodedImage, // NOLINT
|
||||
int64_t decode_time_ms));
|
||||
MOCK_METHOD3(Decoded,
|
||||
void(VideoFrame& decodedImage, // NOLINT
|
||||
absl::optional<int32_t> decode_time_ms,
|
||||
absl::optional<uint8_t> qp));
|
||||
MOCK_METHOD1(ReceivedDecodedReferenceFrame,
|
||||
int32_t(const uint64_t pictureId));
|
||||
MOCK_METHOD1(ReceivedDecodedFrame, int32_t(const uint64_t pictureId));
|
||||
};
|
||||
|
||||
class MockVideoDecoder : public VideoDecoder {
|
||||
public:
|
||||
MockVideoDecoder();
|
||||
~MockVideoDecoder() override;
|
||||
|
||||
MOCK_METHOD2(InitDecode,
|
||||
int32_t(const VideoCodec* codecSettings, int32_t numberOfCores));
|
||||
MOCK_METHOD4(Decode,
|
||||
int32_t(const EncodedImage& inputImage,
|
||||
bool missingFrames,
|
||||
const CodecSpecificInfo* codecSpecificInfo,
|
||||
int64_t renderTimeMs));
|
||||
MOCK_METHOD1(RegisterDecodeCompleteCallback,
|
||||
int32_t(DecodedImageCallback* callback));
|
||||
MOCK_METHOD0(Release, int32_t());
|
||||
MOCK_METHOD0(Copy, VideoDecoder*());
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // API_TEST_MOCK_VIDEO_DECODER_H_
|
@ -605,6 +605,8 @@ if (rtc_include_tests) {
|
||||
":video_coding",
|
||||
":video_coding_utility",
|
||||
"../../:webrtc_common",
|
||||
"../../api:mock_video_decoder",
|
||||
"../../api:mock_video_encoder",
|
||||
"../../api:simulcast_test_fixture_api",
|
||||
"../../api/video:encoded_image",
|
||||
"../../api/video:video_frame",
|
||||
@ -763,6 +765,8 @@ if (rtc_include_tests) {
|
||||
"../..:webrtc_common",
|
||||
"../../api:create_videocodec_test_fixture_api",
|
||||
"../../api:mock_video_codec_factory",
|
||||
"../../api:mock_video_decoder",
|
||||
"../../api:mock_video_encoder",
|
||||
"../../api:videocodec_test_fixture_api",
|
||||
"../../api/video:video_frame",
|
||||
"../../api/video:video_frame_i420",
|
||||
@ -882,6 +886,8 @@ if (rtc_include_tests) {
|
||||
"..:module_api",
|
||||
"../..:webrtc_common",
|
||||
"../../api:create_simulcast_test_fixture_api",
|
||||
"../../api:mock_video_decoder",
|
||||
"../../api:mock_video_encoder",
|
||||
"../../api:simulcast_test_fixture_api",
|
||||
"../../api:videocodec_test_fixture_api",
|
||||
"../../api/video:video_bitrate_allocator",
|
||||
|
@ -11,13 +11,14 @@
|
||||
#include <memory>
|
||||
|
||||
#include "absl/memory/memory.h"
|
||||
#include "api/test/mock_video_decoder.h"
|
||||
#include "api/test/mock_video_encoder.h"
|
||||
#include "api/test/videocodec_test_fixture.h"
|
||||
#include "api/video/i420_buffer.h"
|
||||
#include "common_types.h" // NOLINT(build/include)
|
||||
#include "media/base/mediaconstants.h"
|
||||
#include "modules/video_coding/codecs/test/videocodec_test_stats_impl.h"
|
||||
#include "modules/video_coding/codecs/test/videoprocessor.h"
|
||||
#include "modules/video_coding/include/mock/mock_video_codec_interface.h"
|
||||
#include "modules/video_coding/include/video_coding.h"
|
||||
#include "rtc_base/event.h"
|
||||
#include "rtc_base/task_queue_for_test.h"
|
||||
|
@ -12,13 +12,14 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "api/test/mock_video_decoder.h"
|
||||
#include "api/test/mock_video_encoder.h"
|
||||
#include "api/video_codecs/vp8_temporal_layers.h"
|
||||
#include "common_video/libyuv/include/webrtc_libyuv.h"
|
||||
#include "modules/video_coding/codecs/test/video_codec_unittest.h"
|
||||
#include "modules/video_coding/codecs/vp8/include/vp8.h"
|
||||
#include "modules/video_coding/codecs/vp8/libvpx_vp8_encoder.h"
|
||||
#include "modules/video_coding/codecs/vp8/test/mock_libvpx_interface.h"
|
||||
#include "modules/video_coding/include/mock/mock_video_codec_interface.h"
|
||||
#include "modules/video_coding/utility/vp8_header_parser.h"
|
||||
#include "rtc_base/timeutils.h"
|
||||
#include "test/video_codec_settings.h"
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
// NOTE: Deprecated file, include api/mock_video_(encoder|decoder).h instead.
|
||||
|
||||
class MockEncodedImageCallback : public EncodedImageCallback {
|
||||
public:
|
||||
MOCK_METHOD3(OnEncodedImage,
|
||||
|
@ -18,7 +18,7 @@
|
||||
#include "api/video/encoded_image.h"
|
||||
#include "api/video_codecs/sdp_video_format.h"
|
||||
#include "common_video/libyuv/include/webrtc_libyuv.h"
|
||||
#include "modules/video_coding/include/mock/mock_video_codec_interface.h"
|
||||
#include "modules/video_coding/include/video_codec_interface.h"
|
||||
#include "modules/video_coding/include/video_coding_defines.h"
|
||||
#include "rtc_base/checks.h"
|
||||
#include "test/gtest.h"
|
||||
|
@ -14,6 +14,8 @@
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "api/test/mock_video_decoder.h"
|
||||
#include "api/test/mock_video_encoder.h"
|
||||
#include "api/test/simulcast_test_fixture.h"
|
||||
#include "api/video/i420_buffer.h"
|
||||
#include "api/video/video_frame.h"
|
||||
@ -21,7 +23,6 @@
|
||||
#include "api/video_codecs/video_encoder_factory.h"
|
||||
#include "common_types.h" // NOLINT(build/include)
|
||||
#include "modules/video_coding/utility/simulcast_rate_allocator.h"
|
||||
#include "modules/video_coding/include/mock/mock_video_codec_interface.h"
|
||||
|
||||
namespace webrtc {
|
||||
namespace test {
|
||||
|
@ -11,8 +11,8 @@
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "api/test/mock_video_decoder.h"
|
||||
#include "modules/video_coding/include/mock/mock_vcm_callbacks.h"
|
||||
#include "modules/video_coding/include/mock/mock_video_codec_interface.h"
|
||||
#include "modules/video_coding/include/video_coding.h"
|
||||
#include "modules/video_coding/test/test_util.h"
|
||||
#include "modules/video_coding/timing.h"
|
||||
|
@ -11,11 +11,11 @@
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "api/test/mock_video_encoder.h"
|
||||
#include "api/video/i420_buffer.h"
|
||||
#include "api/video_codecs/vp8_temporal_layers.h"
|
||||
#include "modules/video_coding/codecs/vp8/include/vp8.h"
|
||||
#include "modules/video_coding/include/mock/mock_vcm_callbacks.h"
|
||||
#include "modules/video_coding/include/mock/mock_video_codec_interface.h"
|
||||
#include "modules/video_coding/include/video_coding.h"
|
||||
#include "modules/video_coding/utility/default_video_bitrate_allocator.h"
|
||||
#include "modules/video_coding/utility/simulcast_rate_allocator.h"
|
||||
|
Reference in New Issue
Block a user