Update internal SW codecs to return unique_ptrs
TBR=stefan@webrtc.org Bug: webrtc:7925 Change-Id: I84239b071a2608d928f09b06809090eec5eafb14 Reviewed-on: https://webrtc-review.googlesource.com/21165 Commit-Queue: Magnus Jedvert <magjed@webrtc.org> Reviewed-by: Erik Språng <sprang@webrtc.org> Cr-Commit-Position: refs/heads/master@{#20650}
This commit is contained in:
committed by
Commit Bot
parent
8f91f1ee71
commit
4fe6adc06a
@ -13,9 +13,11 @@
|
||||
#include <vector>
|
||||
|
||||
#include "common_video/include/video_frame_buffer.h"
|
||||
#include "media/engine/internalencoderfactory.h"
|
||||
#include "media/engine/simulcast_encoder_adapter.h"
|
||||
#include "modules/video_coding/codecs/vp8/simulcast_test_utility.h"
|
||||
#include "modules/video_coding/include/video_codec_interface.h"
|
||||
#include "rtc_base/ptr_util.h"
|
||||
#include "test/gmock.h"
|
||||
|
||||
namespace webrtc {
|
||||
@ -23,39 +25,19 @@ namespace testing {
|
||||
|
||||
class TestSimulcastEncoderAdapter : public TestVp8Simulcast {
|
||||
public:
|
||||
TestSimulcastEncoderAdapter() : factory_(new Vp8EncoderFactory()) {}
|
||||
TestSimulcastEncoderAdapter()
|
||||
: factory_(new cricket::InternalEncoderFactory()) {}
|
||||
|
||||
protected:
|
||||
class Vp8EncoderFactory : public cricket::WebRtcVideoEncoderFactory {
|
||||
public:
|
||||
Vp8EncoderFactory() {
|
||||
supported_codecs_.push_back(cricket::VideoCodec("VP8"));
|
||||
}
|
||||
|
||||
const std::vector<cricket::VideoCodec>& supported_codecs() const override {
|
||||
return supported_codecs_;
|
||||
}
|
||||
|
||||
VideoEncoder* CreateVideoEncoder(
|
||||
const cricket::VideoCodec& codec) override {
|
||||
return VP8Encoder::Create();
|
||||
}
|
||||
|
||||
void DestroyVideoEncoder(VideoEncoder* encoder) override { delete encoder; }
|
||||
|
||||
virtual ~Vp8EncoderFactory() {}
|
||||
|
||||
private:
|
||||
std::vector<cricket::VideoCodec> supported_codecs_;
|
||||
};
|
||||
|
||||
VP8Encoder* CreateEncoder() override {
|
||||
return new SimulcastEncoderAdapter(factory_.get());
|
||||
std::unique_ptr<VP8Encoder> CreateEncoder() override {
|
||||
return rtc::MakeUnique<SimulcastEncoderAdapter>(factory_.get());
|
||||
}
|
||||
std::unique_ptr<VP8Decoder> CreateDecoder() override {
|
||||
return VP8Decoder::Create();
|
||||
}
|
||||
VP8Decoder* CreateDecoder() override { return VP8Decoder::Create(); }
|
||||
|
||||
private:
|
||||
std::unique_ptr<Vp8EncoderFactory> factory_;
|
||||
std::unique_ptr<cricket::WebRtcVideoEncoderFactory> factory_;
|
||||
};
|
||||
|
||||
TEST_F(TestSimulcastEncoderAdapter, TestKeyFrameRequestsOnAllStreams) {
|
||||
|
||||
Reference in New Issue
Block a user