ObjC SDK: Stop using built-in SW video codecs
This CL removes the use of default built-in SW in the ObjC layer. If a client want to depend on the video SW codecs, they must inject them explicitly. Bug: webrtc:7925 Change-Id: If752e7f02109ff768dc5ec38d935203de85987c2 Reviewed-on: https://webrtc-review.googlesource.com/69800 Commit-Queue: Magnus Jedvert <magjed@webrtc.org> Reviewed-by: Anders Carlsson <andersc@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23073}
This commit is contained in:
committed by
Commit Bot
parent
be80681295
commit
8b4e92d0a5
@ -13,16 +13,12 @@
|
||||
|
||||
#include "api/video_codecs/video_decoder_factory.h"
|
||||
#include "media/base/codec.h"
|
||||
#include "media/engine/webrtcvideodecoderfactory.h"
|
||||
|
||||
@protocol RTCVideoDecoderFactory;
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
// TODO(andersc): Remove the inheritance from cricket::WebRtcVideoDecoderFactory
|
||||
// when the legacy path in [RTCPeerConnectionFactory init] is no longer needed.
|
||||
class ObjCVideoDecoderFactory : public VideoDecoderFactory,
|
||||
public cricket::WebRtcVideoDecoderFactory {
|
||||
class ObjCVideoDecoderFactory : public VideoDecoderFactory {
|
||||
public:
|
||||
explicit ObjCVideoDecoderFactory(id<RTCVideoDecoderFactory>);
|
||||
~ObjCVideoDecoderFactory();
|
||||
@ -33,13 +29,6 @@ class ObjCVideoDecoderFactory : public VideoDecoderFactory,
|
||||
std::unique_ptr<VideoDecoder> CreateVideoDecoder(
|
||||
const SdpVideoFormat& format) override;
|
||||
|
||||
// Needed for WebRtcVideoDecoderFactory interface.
|
||||
VideoDecoder* CreateVideoDecoderWithParams(
|
||||
const cricket::VideoCodec& codec,
|
||||
cricket::VideoDecoderParams params) override;
|
||||
VideoDecoder* CreateVideoDecoder(VideoCodecType type) override;
|
||||
void DestroyVideoDecoder(VideoDecoder* decoder) override;
|
||||
|
||||
private:
|
||||
id<RTCVideoDecoderFactory> decoder_factory_;
|
||||
};
|
||||
|
||||
@ -150,22 +150,4 @@ std::vector<SdpVideoFormat> ObjCVideoDecoderFactory::GetSupportedFormats() const
|
||||
return supported_formats;
|
||||
}
|
||||
|
||||
// WebRtcVideoDecoderFactory
|
||||
|
||||
VideoDecoder *ObjCVideoDecoderFactory::CreateVideoDecoderWithParams(
|
||||
const cricket::VideoCodec &codec, cricket::VideoDecoderParams params) {
|
||||
return CreateVideoDecoder(SdpVideoFormat(codec.name, codec.params)).release();
|
||||
}
|
||||
|
||||
VideoDecoder *ObjCVideoDecoderFactory::CreateVideoDecoder(VideoCodecType type) {
|
||||
// This is implemented to avoid hiding an overloaded virtual function
|
||||
RTC_NOTREACHED();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void ObjCVideoDecoderFactory::DestroyVideoDecoder(VideoDecoder *decoder) {
|
||||
delete decoder;
|
||||
decoder = nullptr;
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -14,16 +14,12 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#include "api/video_codecs/video_encoder_factory.h"
|
||||
#include "media/engine/webrtcvideoencoderfactory.h"
|
||||
|
||||
@protocol RTCVideoEncoderFactory;
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
// TODO(andersc): Remove the inheritance from cricket::WebRtcVideoEncoderFactory
|
||||
// when the legacy path in [RTCPeerConnectionFactory init] is no longer needed.
|
||||
class ObjCVideoEncoderFactory : public VideoEncoderFactory,
|
||||
public cricket::WebRtcVideoEncoderFactory {
|
||||
class ObjCVideoEncoderFactory : public VideoEncoderFactory {
|
||||
public:
|
||||
explicit ObjCVideoEncoderFactory(id<RTCVideoEncoderFactory>);
|
||||
~ObjCVideoEncoderFactory();
|
||||
@ -35,16 +31,8 @@ class ObjCVideoEncoderFactory : public VideoEncoderFactory,
|
||||
const SdpVideoFormat& format) override;
|
||||
CodecInfo QueryVideoEncoder(const SdpVideoFormat& format) const override;
|
||||
|
||||
// Needed for WebRtcVideoEncoderFactory interface.
|
||||
VideoEncoder* CreateVideoEncoder(const cricket::VideoCodec& codec) override;
|
||||
const std::vector<cricket::VideoCodec>& supported_codecs() const override;
|
||||
void DestroyVideoEncoder(VideoEncoder* encoder) override;
|
||||
|
||||
private:
|
||||
id<RTCVideoEncoderFactory> encoder_factory_;
|
||||
|
||||
// Needed for WebRtcVideoEncoderFactory interface.
|
||||
mutable std::vector<cricket::VideoCodec> supported_codecs_;
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -160,28 +160,4 @@ std::unique_ptr<VideoEncoder> ObjCVideoEncoderFactory::CreateVideoEncoder(
|
||||
}
|
||||
}
|
||||
|
||||
// WebRtcVideoEncoderFactory
|
||||
|
||||
VideoEncoder *ObjCVideoEncoderFactory::CreateVideoEncoder(const cricket::VideoCodec &codec) {
|
||||
RTCVideoCodecInfo *info = [[RTCVideoCodecInfo alloc]
|
||||
initWithNativeSdpVideoFormat:SdpVideoFormat(codec.name, codec.params)];
|
||||
id<RTCVideoEncoder> encoder = [encoder_factory_ createEncoder:info];
|
||||
return new ObjCVideoEncoder(encoder);
|
||||
}
|
||||
|
||||
const std::vector<cricket::VideoCodec> &ObjCVideoEncoderFactory::supported_codecs() const {
|
||||
supported_codecs_.clear();
|
||||
for (RTCVideoCodecInfo *supportedCodec in encoder_factory_.supportedCodecs) {
|
||||
SdpVideoFormat format = [supportedCodec nativeSdpVideoFormat];
|
||||
supported_codecs_.push_back(cricket::VideoCodec(format));
|
||||
}
|
||||
|
||||
return supported_codecs_;
|
||||
}
|
||||
|
||||
void ObjCVideoEncoderFactory::DestroyVideoEncoder(VideoEncoder *encoder) {
|
||||
delete encoder;
|
||||
encoder = nullptr;
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
Reference in New Issue
Block a user