blob: 9f066167ec9d840f09ae6dc8216a37bfe78c8341 [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
magjed1e45cc62016-10-28 07:43:45 -070014#include <vector>
15
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020016#include "common_types.h"
17#include "media/base/codec.h"
henrike@webrtc.org28e20752013-07-10 00:45:36 +000018
19namespace webrtc {
20class VideoEncoder;
21}
22
23namespace cricket {
24
Magnus Jedvertd4b0c052017-09-14 10:24:54 +020025// Deprecated. Use webrtc::VideoEncoderFactory instead.
26// https://bugs.chromium.org/p/webrtc/issues/detail?id=7925
henrike@webrtc.org28e20752013-07-10 00:45:36 +000027class WebRtcVideoEncoderFactory {
28 public:
buildbot@webrtc.org3c16d8b2014-10-13 06:35:10 +000029 virtual ~WebRtcVideoEncoderFactory() {}
henrike@webrtc.org28e20752013-07-10 00:45:36 +000030
31 // Caller takes the ownership of the returned object and it should be released
32 // by calling DestroyVideoEncoder().
33 virtual webrtc::VideoEncoder* CreateVideoEncoder(
magjedc1a89742017-05-12 00:24:40 -070034 const cricket::VideoCodec& codec) = 0;
henrike@webrtc.org28e20752013-07-10 00:45:36 +000035
36 // Returns a list of supported codecs in order of preference.
magjedc1a89742017-05-12 00:24:40 -070037 virtual const std::vector<cricket::VideoCodec>& supported_codecs() const = 0;
henrike@webrtc.org28e20752013-07-10 00:45:36 +000038
pthatcher@webrtc.org52cd8282015-03-18 02:24:43 +000039 // Returns true if encoders created by this factory of the given codec type
40 // will use internal camera sources, meaning that they don't require/expect
Magnus Jedvertd4b0c052017-09-14 10:24:54 +020041 // frames to be delivered via webrtc::VideoEncoder::Encode.
pthatcher@webrtc.org52cd8282015-03-18 02:24:43 +000042 virtual bool EncoderTypeHasInternalSource(webrtc::VideoCodecType type) const {
43 return false;
44 }
45
henrike@webrtc.org28e20752013-07-10 00:45:36 +000046 virtual void DestroyVideoEncoder(webrtc::VideoEncoder* encoder) = 0;
47};
48
49} // namespace cricket
50
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020051#endif // MEDIA_ENGINE_WEBRTCVIDEOENCODERFACTORY_H_