Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(635)

Side by Side Diff: webrtc/media/engine/videoencodersoftwarefallbackwrapper.h

Issue 3007683002: Let VideoEncoderSoftwareFallbackWrapper own the wrapped encoder (Closed)
Patch Set: Created 3 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/api/video_codecs/video_encoder.h" 18 #include "webrtc/api/video_codecs/video_encoder.h"
19 #include "webrtc/media/base/codec.h" 19 #include "webrtc/media/base/codec.h"
20 20
21 namespace webrtc { 21 namespace webrtc {
22 22
23 // 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
24 // 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
25 // hardware restrictions, such as max resolution. 25 // hardware restrictions, such as max resolution.
26 class VideoEncoderSoftwareFallbackWrapper : public VideoEncoder { 26 class VideoEncoderSoftwareFallbackWrapper : public VideoEncoder {
27 public: 27 public:
28 VideoEncoderSoftwareFallbackWrapper(const cricket::VideoCodec& codec, 28 VideoEncoderSoftwareFallbackWrapper(
29 webrtc::VideoEncoder* encoder); 29 const cricket::VideoCodec& codec,
30 std::unique_ptr<webrtc::VideoEncoder> encoder);
30 31
31 int32_t InitEncode(const VideoCodec* codec_settings, 32 int32_t InitEncode(const VideoCodec* codec_settings,
32 int32_t number_of_cores, 33 int32_t number_of_cores,
33 size_t max_payload_size) override; 34 size_t max_payload_size) override;
34 35
35 int32_t RegisterEncodeCompleteCallback( 36 int32_t RegisterEncodeCompleteCallback(
36 EncodedImageCallback* callback) override; 37 EncodedImageCallback* callback) override;
37 38
38 int32_t Release() override; 39 int32_t Release() override;
39 int32_t Encode(const VideoFrame& frame, 40 int32_t Encode(const VideoFrame& frame,
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 bool rates_set_; 90 bool rates_set_;
90 BitrateAllocation bitrate_allocation_; 91 BitrateAllocation bitrate_allocation_;
91 uint32_t framerate_; 92 uint32_t framerate_;
92 93
93 // The last channel parameters set, and a flag for noting they are set. 94 // The last channel parameters set, and a flag for noting they are set.
94 bool channel_parameters_set_; 95 bool channel_parameters_set_;
95 uint32_t packet_loss_; 96 uint32_t packet_loss_;
96 int64_t rtt_; 97 int64_t rtt_;
97 98
98 cricket::VideoCodec codec_; 99 cricket::VideoCodec codec_;
99 webrtc::VideoEncoder* const encoder_; 100 std::unique_ptr<webrtc::VideoEncoder> encoder_;
brandtr 2017/08/29 11:54:27 drive-by question: Does this mean that it's OK to
100 101
101 std::unique_ptr<webrtc::VideoEncoder> fallback_encoder_; 102 std::unique_ptr<webrtc::VideoEncoder> fallback_encoder_;
102 std::string fallback_implementation_name_; 103 std::string fallback_implementation_name_;
103 EncodedImageCallback* callback_; 104 EncodedImageCallback* callback_;
104 105
105 bool forced_fallback_possible_; 106 bool forced_fallback_possible_;
106 ForcedFallbackParams forced_fallback_; 107 ForcedFallbackParams forced_fallback_;
107 }; 108 };
108 109
109 } // namespace webrtc 110 } // namespace webrtc
110 111
111 #endif // WEBRTC_MEDIA_ENGINE_VIDEOENCODERSOFTWAREFALLBACKWRAPPER_H_ 112 #endif // WEBRTC_MEDIA_ENGINE_VIDEOENCODERSOFTWAREFALLBACKWRAPPER_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/media/engine/videoencodersoftwarefallbackwrapper.cc » ('j') | webrtc/media/engine/webrtcvideoengine.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698