Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 /* | |
| 2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. | |
| 3 * | |
| 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. | |
| 9 */ | |
| 10 | |
| 11 #ifndef WEBRTC_API_VIDEO_CODECS_VIDEO_ENCODER_FACTORY_H_ | |
| 12 #define WEBRTC_API_VIDEO_CODECS_VIDEO_ENCODER_FACTORY_H_ | |
| 13 | |
| 14 #include <memory> | |
| 15 #include <vector> | |
| 16 | |
| 17 namespace cricket { | |
| 18 struct VideoCodec; | |
| 19 } // namespace cricket | |
| 20 | |
| 21 namespace webrtc { | |
| 22 | |
| 23 class VideoEncoder; | |
| 24 | |
| 25 // A factory that creates VideoEncoders. | |
| 26 // NOTE: This class is still under development and may change without notice. | |
| 27 class VideoEncoderFactory { | |
| 28 public: | |
| 29 // TODO(magjed): Try to get rid of this struct. | |
| 30 struct CodecInfo { | |
| 31 // |is_hardware_accelerated| is true if the encoders created by this factory | |
| 32 // of the given codec will use hardware support. | |
| 33 bool is_hardware_accelerated; | |
| 34 // |has_internal_source| is true if encoders created by this factory of the | |
| 35 // given codec will use internal camera sources, meaning that they don't | |
| 36 // require/expect frames to be delivered via webrtc::VideoEncoder::Encode. | |
| 37 // This flag is used as the internal_source parameter to | |
| 38 // webrtc::ViEExternalCodec::RegisterExternalSendCodec. | |
| 39 bool has_internal_source; | |
| 40 }; | |
| 41 | |
| 42 // Returns a list of supported video codecs in order of preference, to use for | |
| 43 // signaling etc. | |
| 44 virtual std::vector<cricket::VideoCodec> GetSupportedCodecs() const = 0; | |
| 45 | |
| 46 // Returns extra information about how the provided codec would be encoded, | |
|
stefan-webrtc
2017/09/06 12:40:42
What does "encoded" mean in this context? It sound
magjed_webrtc
2017/09/10 15:27:49
I updated the sentence to be more clear.
| |
| 47 // provided it's supported. | |
| 48 // TODO(magjed): Try to get rid of this method. | |
| 49 virtual CodecInfo QueryVideoEncoder( | |
| 50 const cricket::VideoCodec& codec) const = 0; | |
| 51 | |
| 52 // Creates a VideoEncoder for the specified codec. | |
| 53 virtual std::unique_ptr<VideoEncoder> CreateVideoEncoder( | |
| 54 const cricket::VideoCodec& codec) = 0; | |
| 55 | |
| 56 virtual ~VideoEncoderFactory() {} | |
| 57 }; | |
| 58 | |
| 59 } // namespace webrtc | |
| 60 | |
| 61 #endif // WEBRTC_API_VIDEO_CODECS_VIDEO_ENCODER_FACTORY_H_ | |
| OLD | NEW |