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" |
18 #include "webrtc/video_encoder.h" | 19 #include "webrtc/video_encoder.h" |
19 | 20 |
20 namespace webrtc { | 21 namespace webrtc { |
21 | 22 |
22 // Class used to wrap external VideoEncoders to provide a fallback option on | 23 // Class used to wrap external VideoEncoders to provide a fallback option on |
23 // software encoding when a hardware encoder fails to encode a stream due to | 24 // software encoding when a hardware encoder fails to encode a stream due to |
24 // hardware restrictions, such as max resolution. | 25 // hardware restrictions, such as max resolution. |
25 class VideoEncoderSoftwareFallbackWrapper : public VideoEncoder { | 26 class VideoEncoderSoftwareFallbackWrapper : public VideoEncoder { |
26 public: | 27 public: |
27 VideoEncoderSoftwareFallbackWrapper(VideoCodecType codec_type, | 28 VideoEncoderSoftwareFallbackWrapper(const cricket::VideoCodec& codec, |
28 webrtc::VideoEncoder* encoder); | 29 webrtc::VideoEncoder* encoder); |
29 | 30 |
30 int32_t InitEncode(const VideoCodec* codec_settings, | 31 int32_t InitEncode(const VideoCodec* codec_settings, |
31 int32_t number_of_cores, | 32 int32_t number_of_cores, |
32 size_t max_payload_size) override; | 33 size_t max_payload_size) override; |
33 | 34 |
34 int32_t RegisterEncodeCompleteCallback( | 35 int32_t RegisterEncodeCompleteCallback( |
35 EncodedImageCallback* callback) override; | 36 EncodedImageCallback* callback) override; |
36 | 37 |
37 int32_t Release() override; | 38 int32_t Release() override; |
(...skipping 18 matching lines...) Expand all Loading... |
56 // The last bitrate/framerate set, and a flag for noting they are set. | 57 // The last bitrate/framerate set, and a flag for noting they are set. |
57 bool rates_set_; | 58 bool rates_set_; |
58 uint32_t bitrate_; | 59 uint32_t bitrate_; |
59 uint32_t framerate_; | 60 uint32_t framerate_; |
60 | 61 |
61 // The last channel parameters set, and a flag for noting they are set. | 62 // The last channel parameters set, and a flag for noting they are set. |
62 bool channel_parameters_set_; | 63 bool channel_parameters_set_; |
63 uint32_t packet_loss_; | 64 uint32_t packet_loss_; |
64 int64_t rtt_; | 65 int64_t rtt_; |
65 | 66 |
66 const EncoderType encoder_type_; | 67 const cricket::VideoCodec codec_; |
67 webrtc::VideoEncoder* const encoder_; | 68 webrtc::VideoEncoder* const encoder_; |
68 | 69 |
69 std::unique_ptr<webrtc::VideoEncoder> fallback_encoder_; | 70 std::unique_ptr<webrtc::VideoEncoder> fallback_encoder_; |
70 std::string fallback_implementation_name_; | 71 std::string fallback_implementation_name_; |
71 EncodedImageCallback* callback_; | 72 EncodedImageCallback* callback_; |
72 }; | 73 }; |
73 | 74 |
74 } // namespace webrtc | 75 } // namespace webrtc |
75 | 76 |
76 #endif // WEBRTC_MEDIA_ENGINE_VIDEOENCODERSOFTWAREFALLBACKWRAPPER_H_ | 77 #endif // WEBRTC_MEDIA_ENGINE_VIDEOENCODERSOFTWAREFALLBACKWRAPPER_H_ |
OLD | NEW |