Let CreateVideoDecoder take a cricket::VideoCodec.
This makes it possible for decoder factories to actually provide any video codec, not just the ones WebRTC knows about. It also brings the decoder factory interface more in line with that of the encoder factory. BUG=webrtc:8140 Review-Url: https://codereview.webrtc.org/3007433002 Cr-Commit-Position: refs/heads/master@{#19654}
This commit is contained in:
@ -25,8 +25,10 @@ class ObjCVideoDecoderFactory : public cricket::WebRtcVideoDecoderFactory {
|
||||
|
||||
id<RTCVideoDecoderFactory> wrapped_decoder_factory() const;
|
||||
|
||||
webrtc::VideoDecoder* CreateVideoDecoder(
|
||||
webrtc::VideoCodecType type) override;
|
||||
VideoDecoder* CreateVideoDecoderWithParams(
|
||||
const cricket::VideoCodec& codec,
|
||||
cricket::VideoDecoderParams params) override;
|
||||
|
||||
void DestroyVideoDecoder(webrtc::VideoDecoder* decoder) override;
|
||||
|
||||
private:
|
||||
|
||||
@ -103,10 +103,9 @@ id<RTCVideoDecoderFactory> ObjCVideoDecoderFactory::wrapped_decoder_factory() co
|
||||
return decoder_factory_;
|
||||
}
|
||||
|
||||
VideoDecoder *ObjCVideoDecoderFactory::CreateVideoDecoder(VideoCodecType type) {
|
||||
const char *codec_name = CodecTypeToPayloadString(type);
|
||||
|
||||
NSString *codecName = [NSString stringWithUTF8String:codec_name];
|
||||
VideoDecoder *ObjCVideoDecoderFactory::CreateVideoDecoderWithParams(
|
||||
const cricket::VideoCodec &codec, cricket::VideoDecoderParams params) {
|
||||
NSString *codecName = [NSString stringWithUTF8String:codec.name.c_str()];
|
||||
for (RTCVideoCodecInfo *codecInfo in decoder_factory_.supportedCodecs) {
|
||||
if ([codecName isEqualToString:codecInfo.name]) {
|
||||
id<RTCVideoDecoder> decoder = [decoder_factory_ createDecoder:codecInfo];
|
||||
|
||||
Reference in New Issue
Block a user