blob: 2c921c5c253d5dbbd3c16723ef01d5882791f2cc [file] [log] [blame]
henrike@webrtc.org28e20752013-07-10 00:45:36 +00001/*
kjellander1afca732016-02-07 20:46:45 -08002 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
henrike@webrtc.org28e20752013-07-10 00:45:36 +00003 *
kjellander1afca732016-02-07 20:46:45 -08004 * 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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
henrike@webrtc.org28e20752013-07-10 00:45:36 +00009 */
10
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020011#ifndef MEDIA_ENGINE_WEBRTCVIDEODECODERFACTORY_H_
12#define MEDIA_ENGINE_WEBRTCVIDEODECODERFACTORY_H_
henrike@webrtc.org28e20752013-07-10 00:45:36 +000013
Mirko Bonadei71207422017-09-15 13:58:09 +020014#include "common_types.h" // NOLINT(build/include)
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020015#include "media/base/codec.h"
16#include "rtc_base/refcount.h"
henrike@webrtc.org28e20752013-07-10 00:45:36 +000017
18namespace webrtc {
19class VideoDecoder;
20}
21
22namespace cricket {
23
sakal1fd95952016-06-22 00:46:15 -070024struct VideoDecoderParams {
25 std::string receive_stream_id;
26};
27
Magnus Jedvertd4b0c052017-09-14 10:24:54 +020028// Deprecated. Use webrtc::VideoDecoderFactory instead.
29// https://bugs.chromium.org/p/webrtc/issues/detail?id=7925
henrike@webrtc.org28e20752013-07-10 00:45:36 +000030class WebRtcVideoDecoderFactory {
31 public:
32 // Caller takes the ownership of the returned object and it should be released
33 // by calling DestroyVideoDecoder().
kthelgasonebd4f792017-09-04 04:36:21 -070034 virtual webrtc::VideoDecoder* CreateVideoDecoderWithParams(
35 const VideoCodec& codec,
36 VideoDecoderParams params) {
37 // Default implementation that delegates to old version in order to preserve
38 // backwards-compatability.
39 webrtc::VideoCodecType type = webrtc::PayloadStringToCodecType(codec.name);
40 return CreateVideoDecoderWithParams(type, params);
41 }
42 // DEPRECATED.
43 // These methods should not be used by new code and will eventually be
44 // removed. See http://crbug.com/webrtc/8140.
henrike@webrtc.org28e20752013-07-10 00:45:36 +000045 virtual webrtc::VideoDecoder* CreateVideoDecoder(
kthelgasonebd4f792017-09-04 04:36:21 -070046 webrtc::VideoCodecType type) {
47 RTC_NOTREACHED();
48 return nullptr;
49 };
50
sakal1fd95952016-06-22 00:46:15 -070051 virtual webrtc::VideoDecoder* CreateVideoDecoderWithParams(
52 webrtc::VideoCodecType type,
53 VideoDecoderParams params) {
54 return CreateVideoDecoder(type);
55 }
henrike@webrtc.org28e20752013-07-10 00:45:36 +000056 virtual ~WebRtcVideoDecoderFactory() {}
57
58 virtual void DestroyVideoDecoder(webrtc::VideoDecoder* decoder) = 0;
59};
60
61} // namespace cricket
62
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020063#endif // MEDIA_ENGINE_WEBRTCVIDEODECODERFACTORY_H_