OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 | 60 |
61 // WebRtcVideoDecoderFactory implementation. | 61 // WebRtcVideoDecoderFactory implementation. |
62 webrtc::VideoDecoder* InternalDecoderFactory::CreateVideoDecoder( | 62 webrtc::VideoDecoder* InternalDecoderFactory::CreateVideoDecoder( |
63 webrtc::VideoCodecType type) { | 63 webrtc::VideoCodecType type) { |
64 switch (type) { | 64 switch (type) { |
65 case webrtc::kVideoCodecH264: | 65 case webrtc::kVideoCodecH264: |
66 if (webrtc::H264Decoder::IsSupported()) | 66 if (webrtc::H264Decoder::IsSupported()) |
67 return webrtc::H264Decoder::Create(); | 67 return webrtc::H264Decoder::Create(); |
68 // This could happen in a software-fallback for a codec type only | 68 // This could happen in a software-fallback for a codec type only |
69 // supported externally (e.g. H.264 on iOS or Android) or in current usage | 69 // supported externally (e.g. H.264 on iOS or Android) or in current usage |
70 // in WebRtcVideoEngine2 if the external decoder fails to be created. | 70 // in WebRtcVideoEngine if the external decoder fails to be created. |
71 LOG(LS_ERROR) << "Unable to create an H.264 decoder fallback. " | 71 LOG(LS_ERROR) << "Unable to create an H.264 decoder fallback. " |
72 << "Decoding of this stream will be broken."; | 72 << "Decoding of this stream will be broken."; |
73 return new NullVideoDecoder(); | 73 return new NullVideoDecoder(); |
74 case webrtc::kVideoCodecVP8: | 74 case webrtc::kVideoCodecVP8: |
75 return webrtc::VP8Decoder::Create(); | 75 return webrtc::VP8Decoder::Create(); |
76 case webrtc::kVideoCodecVP9: | 76 case webrtc::kVideoCodecVP9: |
77 RTC_DCHECK(webrtc::VP9Decoder::IsSupported()); | 77 RTC_DCHECK(webrtc::VP9Decoder::IsSupported()); |
78 return webrtc::VP9Decoder::Create(); | 78 return webrtc::VP9Decoder::Create(); |
79 default: | 79 default: |
80 LOG(LS_ERROR) << "Creating NullVideoDecoder for unsupported codec."; | 80 LOG(LS_ERROR) << "Creating NullVideoDecoder for unsupported codec."; |
81 return new NullVideoDecoder(); | 81 return new NullVideoDecoder(); |
82 } | 82 } |
83 } | 83 } |
84 | 84 |
85 void InternalDecoderFactory::DestroyVideoDecoder( | 85 void InternalDecoderFactory::DestroyVideoDecoder( |
86 webrtc::VideoDecoder* decoder) { | 86 webrtc::VideoDecoder* decoder) { |
87 delete decoder; | 87 delete decoder; |
88 } | 88 } |
89 | 89 |
90 } // namespace cricket | 90 } // namespace cricket |
OLD | NEW |