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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/media/engine/webrtcvideoengine.cc » ('j') | webrtc/media/engine/webrtcvideoengine.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/media/engine/webrtcvideodecoderfactory.h
diff --git a/webrtc/media/engine/webrtcvideodecoderfactory.h b/webrtc/media/engine/webrtcvideodecoderfactory.h
index 64a8faa1e4e24ecedacf52bb867ad23a865b76c8..3ce6e22ca6c0147a3a08887967c74a16d69ee1e3 100644
--- a/webrtc/media/engine/webrtcvideodecoderfactory.h
+++ b/webrtc/media/engine/webrtcvideodecoderfactory.h
@@ -12,6 +12,7 @@
#define WEBRTC_MEDIA_ENGINE_WEBRTCVIDEODECODERFACTORY_H_
#include "webrtc/common_types.h"
+#include "webrtc/media/base/codec.h"
#include "webrtc/rtc_base/refcount.h"
namespace webrtc {
@@ -29,7 +30,24 @@ class WebRtcVideoDecoderFactory {
// Caller takes the ownership of the returned object and it should be released
// by calling DestroyVideoDecoder().
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
- webrtc::VideoCodecType type) = 0;
+ const cricket::VideoCodec& codec) {
+ // Default implementation that delegates to old version in order to preserve
+ // backwards-compatability.
+ webrtc::VideoCodecType type = webrtc::PayloadNameToCodecType(codec.name);
+ return CreateVideoDecoder(type);
+ }
+ 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.
+ const cricket::VideoCodec& codec,
+ VideoDecoderParams params) {
+ 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
+ }
+ // DEPRECATED.
+ // These methods should not be used by new code and will eventually be
+ // removed. See http://crbug.com/webrtc/8140.
+ virtual webrtc::VideoDecoder* CreateVideoDecoder(
+ webrtc::VideoCodecType type) {
+ RTC_NOTREACHED();
+ };
virtual webrtc::VideoDecoder* CreateVideoDecoderWithParams(
webrtc::VideoCodecType type,
VideoDecoderParams params) {
« 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