henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 1 | /* |
kjellander | 1afca73 | 2016-02-07 20:46:45 -0800 | [diff] [blame] | 2 | * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 3 | * |
kjellander | 1afca73 | 2016-02-07 20:46:45 -0800 | [diff] [blame] | 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 |
| 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.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 9 | */ |
| 10 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 11 | #ifndef MEDIA_ENGINE_WEBRTCVIDEOENCODERFACTORY_H_ |
| 12 | #define MEDIA_ENGINE_WEBRTCVIDEOENCODERFACTORY_H_ |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 13 | |
magjed | 1e45cc6 | 2016-10-28 07:43:45 -0700 | [diff] [blame] | 14 | #include <vector> |
| 15 | |
Mirko Bonadei | 7120742 | 2017-09-15 13:58:09 +0200 | [diff] [blame^] | 16 | #include "common_types.h" // NOLINT(build/include) |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 17 | #include "media/base/codec.h" |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 18 | |
| 19 | namespace webrtc { |
| 20 | class VideoEncoder; |
| 21 | } |
| 22 | |
| 23 | namespace cricket { |
| 24 | |
Magnus Jedvert | d4b0c05 | 2017-09-14 10:24:54 +0200 | [diff] [blame] | 25 | // Deprecated. Use webrtc::VideoEncoderFactory instead. |
| 26 | // https://bugs.chromium.org/p/webrtc/issues/detail?id=7925 |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 27 | class WebRtcVideoEncoderFactory { |
| 28 | public: |
buildbot@webrtc.org | 3c16d8b | 2014-10-13 06:35:10 +0000 | [diff] [blame] | 29 | virtual ~WebRtcVideoEncoderFactory() {} |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 30 | |
| 31 | // Caller takes the ownership of the returned object and it should be released |
| 32 | // by calling DestroyVideoEncoder(). |
| 33 | virtual webrtc::VideoEncoder* CreateVideoEncoder( |
magjed | c1a8974 | 2017-05-12 00:24:40 -0700 | [diff] [blame] | 34 | const cricket::VideoCodec& codec) = 0; |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 35 | |
| 36 | // Returns a list of supported codecs in order of preference. |
magjed | c1a8974 | 2017-05-12 00:24:40 -0700 | [diff] [blame] | 37 | virtual const std::vector<cricket::VideoCodec>& supported_codecs() const = 0; |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 38 | |
pthatcher@webrtc.org | 52cd828 | 2015-03-18 02:24:43 +0000 | [diff] [blame] | 39 | // 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 Jedvert | d4b0c05 | 2017-09-14 10:24:54 +0200 | [diff] [blame] | 41 | // frames to be delivered via webrtc::VideoEncoder::Encode. |
pthatcher@webrtc.org | 52cd828 | 2015-03-18 02:24:43 +0000 | [diff] [blame] | 42 | virtual bool EncoderTypeHasInternalSource(webrtc::VideoCodecType type) const { |
| 43 | return false; |
| 44 | } |
| 45 | |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 46 | virtual void DestroyVideoEncoder(webrtc::VideoEncoder* encoder) = 0; |
| 47 | }; |
| 48 | |
| 49 | } // namespace cricket |
| 50 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 51 | #endif // MEDIA_ENGINE_WEBRTCVIDEOENCODERFACTORY_H_ |