| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 |
| 11 #ifndef WEBRTC_MEDIA_ENGINE_WEBRTCVIDEODECODERFACTORY_H_ | 11 #ifndef WEBRTC_MEDIA_ENGINE_WEBRTCVIDEODECODERFACTORY_H_ |
| 12 #define WEBRTC_MEDIA_ENGINE_WEBRTCVIDEODECODERFACTORY_H_ | 12 #define WEBRTC_MEDIA_ENGINE_WEBRTCVIDEODECODERFACTORY_H_ |
| 13 | 13 |
| 14 #include "webrtc/common_types.h" | 14 #include "webrtc/common_types.h" |
| 15 #include "webrtc/media/base/codec.h" |
| 15 #include "webrtc/rtc_base/refcount.h" | 16 #include "webrtc/rtc_base/refcount.h" |
| 16 | 17 |
| 17 namespace webrtc { | 18 namespace webrtc { |
| 18 class VideoDecoder; | 19 class VideoDecoder; |
| 19 } | 20 } |
| 20 | 21 |
| 21 namespace cricket { | 22 namespace cricket { |
| 22 | 23 |
| 23 struct VideoDecoderParams { | 24 struct VideoDecoderParams { |
| 24 std::string receive_stream_id; | 25 std::string receive_stream_id; |
| 25 }; | 26 }; |
| 26 | 27 |
| 27 class WebRtcVideoDecoderFactory { | 28 class WebRtcVideoDecoderFactory { |
| 28 public: | 29 public: |
| 29 // Caller takes the ownership of the returned object and it should be released | 30 // Caller takes the ownership of the returned object and it should be released |
| 30 // by calling DestroyVideoDecoder(). | 31 // by calling DestroyVideoDecoder(). |
| 32 virtual webrtc::VideoDecoder* CreateVideoDecoderWithParams( |
| 33 const VideoCodec& codec, |
| 34 VideoDecoderParams params) { |
| 35 // Default implementation that delegates to old version in order to preserve |
| 36 // backwards-compatability. |
| 37 webrtc::VideoCodecType type = webrtc::PayloadStringToCodecType(codec.name); |
| 38 return CreateVideoDecoderWithParams(type, params); |
| 39 } |
| 40 // DEPRECATED. |
| 41 // These methods should not be used by new code and will eventually be |
| 42 // removed. See http://crbug.com/webrtc/8140. |
| 31 virtual webrtc::VideoDecoder* CreateVideoDecoder( | 43 virtual webrtc::VideoDecoder* CreateVideoDecoder( |
| 32 webrtc::VideoCodecType type) = 0; | 44 webrtc::VideoCodecType type) { |
| 45 RTC_NOTREACHED(); |
| 46 return nullptr; |
| 47 }; |
| 48 |
| 33 virtual webrtc::VideoDecoder* CreateVideoDecoderWithParams( | 49 virtual webrtc::VideoDecoder* CreateVideoDecoderWithParams( |
| 34 webrtc::VideoCodecType type, | 50 webrtc::VideoCodecType type, |
| 35 VideoDecoderParams params) { | 51 VideoDecoderParams params) { |
| 36 return CreateVideoDecoder(type); | 52 return CreateVideoDecoder(type); |
| 37 } | 53 } |
| 38 virtual ~WebRtcVideoDecoderFactory() {} | 54 virtual ~WebRtcVideoDecoderFactory() {} |
| 39 | 55 |
| 40 virtual void DestroyVideoDecoder(webrtc::VideoDecoder* decoder) = 0; | 56 virtual void DestroyVideoDecoder(webrtc::VideoDecoder* decoder) = 0; |
| 41 }; | 57 }; |
| 42 | 58 |
| 43 } // namespace cricket | 59 } // namespace cricket |
| 44 | 60 |
| 45 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVIDEODECODERFACTORY_H_ | 61 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVIDEODECODERFACTORY_H_ |
| OLD | NEW |