mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-14 22:30:40 +01:00

Passing of ownership of codecs to tester is not strictly needed. We may need to continue using a codec after test. For example, to check codec state or to use the same codec instance in next test. Bug: b/261160916, webrtc:14852 Change-Id: I179b262116d7de76b8171f0409f943ad6d87433e Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/291802 Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Commit-Queue: Sergey Silkin <ssilkin@webrtc.org> Reviewed-by: Rasmus Brandt <brandtr@webrtc.org> Cr-Commit-Position: refs/heads/main@{#39256}
53 lines
1.7 KiB
C++
53 lines
1.7 KiB
C++
/*
|
|
* Copyright (c) 2022 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 MODULES_VIDEO_CODING_CODECS_TEST_VIDEO_CODEC_TESTER_IMPL_H_
|
|
#define MODULES_VIDEO_CODING_CODECS_TEST_VIDEO_CODEC_TESTER_IMPL_H_
|
|
|
|
#include <memory>
|
|
|
|
#include "api/task_queue/task_queue_factory.h"
|
|
#include "api/test/video_codec_tester.h"
|
|
|
|
namespace webrtc {
|
|
namespace test {
|
|
|
|
// A stateless implementation of `VideoCodecTester`. This class is thread safe.
|
|
class VideoCodecTesterImpl : public VideoCodecTester {
|
|
public:
|
|
VideoCodecTesterImpl();
|
|
explicit VideoCodecTesterImpl(TaskQueueFactory* task_queue_factory);
|
|
|
|
std::unique_ptr<VideoCodecStats> RunDecodeTest(
|
|
CodedVideoSource* video_source,
|
|
Decoder* decoder,
|
|
const DecoderSettings& decoder_settings) override;
|
|
|
|
std::unique_ptr<VideoCodecStats> RunEncodeTest(
|
|
RawVideoSource* video_source,
|
|
Encoder* encoder,
|
|
const EncoderSettings& encoder_settings) override;
|
|
|
|
std::unique_ptr<VideoCodecStats> RunEncodeDecodeTest(
|
|
RawVideoSource* video_source,
|
|
Encoder* encoder,
|
|
Decoder* decoder,
|
|
const EncoderSettings& encoder_settings,
|
|
const DecoderSettings& decoder_settings) override;
|
|
|
|
protected:
|
|
std::unique_ptr<TaskQueueFactory> owned_task_queue_factory_;
|
|
TaskQueueFactory* task_queue_factory_;
|
|
};
|
|
|
|
} // namespace test
|
|
} // namespace webrtc
|
|
|
|
#endif // MODULES_VIDEO_CODING_CODECS_TEST_VIDEO_CODEC_TESTER_IMPL_H_
|