Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(270)

Side by Side Diff: webrtc/media/engine/webrtcvideodecoderfactory.h

Issue 3007433002: Let CreateVideoDecoder take a cricket::VideoCodec. (Closed)
Patch Set: Remove unrelated change Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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().
31 virtual webrtc::VideoDecoder* CreateVideoDecoder( 32 virtual webrtc::VideoDecoder* CreateVideoDecoder(
magjed_webrtc 2017/08/24 08:59:38 I want to have as few methods as possible in this
kthelgason 2017/08/24 10:49:46 I can see that. I was planning on moving callers o
32 webrtc::VideoCodecType type) = 0; 33 const cricket::VideoCodec& codec) {
34 // Default implementation that delegates to old version in order to preserve
35 // backwards-compatability.
36 webrtc::VideoCodecType type = webrtc::PayloadNameToCodecType(codec.name);
37 return CreateVideoDecoder(type);
38 }
39 virtual webrtc::VideoDecoder* CreateVideoDecoderWithParams(
magjed_webrtc 2017/08/24 08:59:39 Add an empty line between the methods.
kthelgason 2017/08/24 10:49:46 Done.
40 const cricket::VideoCodec& codec,
41 VideoDecoderParams params) {
42 return CreateVideoDecoder(codec);
magjed_webrtc 2017/08/24 08:59:39 We have to be careful with backwards-compatability
kthelgason 2017/08/24 10:49:47 Yeah, I guess subclasses can have overridden imple
43 }
44 // DEPRECATED.
45 // These methods should not be used by new code and will eventually be
46 // removed. See http://crbug.com/webrtc/8140.
47 virtual webrtc::VideoDecoder* CreateVideoDecoder(
48 webrtc::VideoCodecType type) {
49 RTC_NOTREACHED();
50 };
33 virtual webrtc::VideoDecoder* CreateVideoDecoderWithParams( 51 virtual webrtc::VideoDecoder* CreateVideoDecoderWithParams(
34 webrtc::VideoCodecType type, 52 webrtc::VideoCodecType type,
35 VideoDecoderParams params) { 53 VideoDecoderParams params) {
36 return CreateVideoDecoder(type); 54 return CreateVideoDecoder(type);
37 } 55 }
38 virtual ~WebRtcVideoDecoderFactory() {} 56 virtual ~WebRtcVideoDecoderFactory() {}
39 57
40 virtual void DestroyVideoDecoder(webrtc::VideoDecoder* decoder) = 0; 58 virtual void DestroyVideoDecoder(webrtc::VideoDecoder* decoder) = 0;
41 }; 59 };
42 60
43 } // namespace cricket 61 } // namespace cricket
44 62
45 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVIDEODECODERFACTORY_H_ 63 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVIDEODECODERFACTORY_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/media/engine/webrtcvideoengine.cc » ('j') | webrtc/media/engine/webrtcvideoengine.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698