OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #ifndef WEBRTC_MEDIA_ENGINE_VIDEOENCODERSOFTWAREFALLBACKWRAPPER_H_ | 11 #ifndef WEBRTC_MEDIA_ENGINE_VIDEOENCODERSOFTWAREFALLBACKWRAPPER_H_ |
12 #define WEBRTC_MEDIA_ENGINE_VIDEOENCODERSOFTWAREFALLBACKWRAPPER_H_ | 12 #define WEBRTC_MEDIA_ENGINE_VIDEOENCODERSOFTWAREFALLBACKWRAPPER_H_ |
13 | 13 |
14 #include <memory> | 14 #include <memory> |
15 #include <string> | 15 #include <string> |
16 #include <vector> | 16 #include <vector> |
17 | 17 |
18 #include "webrtc/media/base/codec.h" | |
19 #include "webrtc/video_encoder.h" | 18 #include "webrtc/video_encoder.h" |
20 | 19 |
21 namespace webrtc { | 20 namespace webrtc { |
22 | 21 |
23 // Class used to wrap external VideoEncoders to provide a fallback option on | 22 // Class used to wrap external VideoEncoders to provide a fallback option on |
24 // software encoding when a hardware encoder fails to encode a stream due to | 23 // software encoding when a hardware encoder fails to encode a stream due to |
25 // hardware restrictions, such as max resolution. | 24 // hardware restrictions, such as max resolution. |
26 class VideoEncoderSoftwareFallbackWrapper : public VideoEncoder { | 25 class VideoEncoderSoftwareFallbackWrapper : public VideoEncoder { |
27 public: | 26 public: |
28 VideoEncoderSoftwareFallbackWrapper(const cricket::VideoCodec& codec, | 27 VideoEncoderSoftwareFallbackWrapper(VideoCodecType codec_type, |
29 webrtc::VideoEncoder* encoder); | 28 webrtc::VideoEncoder* encoder); |
30 | 29 |
31 int32_t InitEncode(const VideoCodec* codec_settings, | 30 int32_t InitEncode(const VideoCodec* codec_settings, |
32 int32_t number_of_cores, | 31 int32_t number_of_cores, |
33 size_t max_payload_size) override; | 32 size_t max_payload_size) override; |
34 | 33 |
35 int32_t RegisterEncodeCompleteCallback( | 34 int32_t RegisterEncodeCompleteCallback( |
36 EncodedImageCallback* callback) override; | 35 EncodedImageCallback* callback) override; |
37 | 36 |
38 int32_t Release() override; | 37 int32_t Release() override; |
(...skipping 18 matching lines...) Expand all Loading... |
57 // The last bitrate/framerate set, and a flag for noting they are set. | 56 // The last bitrate/framerate set, and a flag for noting they are set. |
58 bool rates_set_; | 57 bool rates_set_; |
59 BitrateAllocation bitrate_allocation_; | 58 BitrateAllocation bitrate_allocation_; |
60 uint32_t framerate_; | 59 uint32_t framerate_; |
61 | 60 |
62 // The last channel parameters set, and a flag for noting they are set. | 61 // The last channel parameters set, and a flag for noting they are set. |
63 bool channel_parameters_set_; | 62 bool channel_parameters_set_; |
64 uint32_t packet_loss_; | 63 uint32_t packet_loss_; |
65 int64_t rtt_; | 64 int64_t rtt_; |
66 | 65 |
67 const cricket::VideoCodec codec_; | 66 const EncoderType encoder_type_; |
68 webrtc::VideoEncoder* const encoder_; | 67 webrtc::VideoEncoder* const encoder_; |
69 | 68 |
70 std::unique_ptr<webrtc::VideoEncoder> fallback_encoder_; | 69 std::unique_ptr<webrtc::VideoEncoder> fallback_encoder_; |
71 std::string fallback_implementation_name_; | 70 std::string fallback_implementation_name_; |
72 EncodedImageCallback* callback_; | 71 EncodedImageCallback* callback_; |
73 }; | 72 }; |
74 | 73 |
75 } // namespace webrtc | 74 } // namespace webrtc |
76 | 75 |
77 #endif // WEBRTC_MEDIA_ENGINE_VIDEOENCODERSOFTWAREFALLBACKWRAPPER_H_ | 76 #endif // WEBRTC_MEDIA_ENGINE_VIDEOENCODERSOFTWAREFALLBACKWRAPPER_H_ |
OLD | NEW |