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