blob: 97ac03b473f8f0c78c84ee865036560cad619213 [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_WEBRTCVIDEOENCODERFACTORY_H_
12#define MEDIA_ENGINE_WEBRTCVIDEOENCODERFACTORY_H_
henrike@webrtc.org28e20752013-07-10 00:45:36 +000013
Steve Antone78bcb92017-10-31 09:53:08 -070014#include <string>
magjed1e45cc62016-10-28 07:43:45 -070015#include <vector>
16
Mirko Bonadei71207422017-09-15 13:58:09 +020017#include "common_types.h" // NOLINT(build/include)
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020018#include "media/base/codec.h"
henrike@webrtc.org28e20752013-07-10 00:45:36 +000019
20namespace webrtc {
21class VideoEncoder;
22}
23
24namespace cricket {
25
Magnus Jedvertd4b0c052017-09-14 10:24:54 +020026// Deprecated. Use webrtc::VideoEncoderFactory instead.
27// https://bugs.chromium.org/p/webrtc/issues/detail?id=7925
henrike@webrtc.org28e20752013-07-10 00:45:36 +000028class WebRtcVideoEncoderFactory {
29 public:
buildbot@webrtc.org3c16d8b2014-10-13 06:35:10 +000030 virtual ~WebRtcVideoEncoderFactory() {}
henrike@webrtc.org28e20752013-07-10 00:45:36 +000031
32 // Caller takes the ownership of the returned object and it should be released
33 // by calling DestroyVideoEncoder().
34 virtual webrtc::VideoEncoder* CreateVideoEncoder(
magjedc1a89742017-05-12 00:24:40 -070035 const cricket::VideoCodec& codec) = 0;
henrike@webrtc.org28e20752013-07-10 00:45:36 +000036
37 // Returns a list of supported codecs in order of preference.
magjedc1a89742017-05-12 00:24:40 -070038 virtual const std::vector<cricket::VideoCodec>& supported_codecs() const = 0;
henrike@webrtc.org28e20752013-07-10 00:45:36 +000039
pthatcher@webrtc.org52cd8282015-03-18 02:24:43 +000040 // Returns true if encoders created by this factory of the given codec type
41 // will use internal camera sources, meaning that they don't require/expect
Magnus Jedvertd4b0c052017-09-14 10:24:54 +020042 // frames to be delivered via webrtc::VideoEncoder::Encode.
Magnus Jedvert244ad802017-09-28 21:19:18 +020043 virtual bool EncoderTypeHasInternalSource(webrtc::VideoCodecType type) const;
pthatcher@webrtc.org52cd8282015-03-18 02:24:43 +000044
henrike@webrtc.org28e20752013-07-10 00:45:36 +000045 virtual void DestroyVideoEncoder(webrtc::VideoEncoder* encoder) = 0;
46};
47
48} // namespace cricket
49
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020050#endif // MEDIA_ENGINE_WEBRTCVIDEOENCODERFACTORY_H_