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
@ -12,6 +12,8 @@
|
||||
#ifndef MODULES_VIDEO_CODING_CODECS_VP9_INCLUDE_VP9_H_
|
||||
#define MODULES_VIDEO_CODING_CODECS_VP9_INCLUDE_VP9_H_
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "modules/video_coding/include/video_codec_interface.h"
|
||||
|
||||
namespace webrtc {
|
||||
@ -19,7 +21,7 @@ namespace webrtc {
|
||||
class VP9Encoder : public VideoEncoder {
|
||||
public:
|
||||
static bool IsSupported();
|
||||
static VP9Encoder* Create();
|
||||
static std::unique_ptr<VP9Encoder> Create();
|
||||
|
||||
virtual ~VP9Encoder() {}
|
||||
};
|
||||
@ -27,7 +29,7 @@ class VP9Encoder : public VideoEncoder {
|
||||
class VP9Decoder : public VideoDecoder {
|
||||
public:
|
||||
static bool IsSupported();
|
||||
static VP9Decoder* Create();
|
||||
static std::unique_ptr<VP9Decoder> Create();
|
||||
|
||||
virtual ~VP9Decoder() {}
|
||||
};
|
||||
|
||||
@ -20,9 +20,13 @@ constexpr uint32_t kTimestampIncrementPerFrame = 3000;
|
||||
|
||||
class TestVp9Impl : public VideoCodecTest {
|
||||
protected:
|
||||
VideoEncoder* CreateEncoder() override { return VP9Encoder::Create(); }
|
||||
std::unique_ptr<VideoEncoder> CreateEncoder() override {
|
||||
return VP9Encoder::Create();
|
||||
}
|
||||
|
||||
VideoDecoder* CreateDecoder() override { return VP9Decoder::Create(); }
|
||||
std::unique_ptr<VideoDecoder> CreateDecoder() override {
|
||||
return VP9Decoder::Create();
|
||||
}
|
||||
|
||||
VideoCodec codec_settings() override {
|
||||
VideoCodec codec_settings;
|
||||
|
||||
@ -27,6 +27,7 @@
|
||||
#include "rtc_base/checks.h"
|
||||
#include "rtc_base/keep_ref_until_done.h"
|
||||
#include "rtc_base/logging.h"
|
||||
#include "rtc_base/ptr_util.h"
|
||||
#include "rtc_base/random.h"
|
||||
#include "rtc_base/timeutils.h"
|
||||
#include "rtc_base/trace_event.h"
|
||||
@ -52,8 +53,8 @@ bool VP9Encoder::IsSupported() {
|
||||
return true;
|
||||
}
|
||||
|
||||
VP9Encoder* VP9Encoder::Create() {
|
||||
return new VP9EncoderImpl();
|
||||
std::unique_ptr<VP9Encoder> VP9Encoder::Create() {
|
||||
return rtc::MakeUnique<VP9EncoderImpl>();
|
||||
}
|
||||
|
||||
void VP9EncoderImpl::EncoderOutputCodedPacketCallback(vpx_codec_cx_pkt* pkt,
|
||||
@ -841,8 +842,8 @@ bool VP9Decoder::IsSupported() {
|
||||
return true;
|
||||
}
|
||||
|
||||
VP9Decoder* VP9Decoder::Create() {
|
||||
return new VP9DecoderImpl();
|
||||
std::unique_ptr<VP9Decoder> VP9Decoder::Create() {
|
||||
return rtc::MakeUnique<VP9DecoderImpl>();
|
||||
}
|
||||
|
||||
VP9DecoderImpl::VP9DecoderImpl()
|
||||
|
||||
@ -22,7 +22,7 @@ bool VP9Encoder::IsSupported() {
|
||||
return false;
|
||||
}
|
||||
|
||||
VP9Encoder* VP9Encoder::Create() {
|
||||
std::unique_ptr<VP9Encoder> VP9Encoder::Create() {
|
||||
RTC_NOTREACHED();
|
||||
return nullptr;
|
||||
}
|
||||
@ -31,7 +31,7 @@ bool VP9Decoder::IsSupported() {
|
||||
return false;
|
||||
}
|
||||
|
||||
VP9Decoder* VP9Decoder::Create() {
|
||||
std::unique_ptr<VP9Decoder> VP9Decoder::Create() {
|
||||
RTC_NOTREACHED();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user