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

Side by Side Diff: webrtc/media/engine/webrtcvideoengine.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) 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2014 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
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 webrtc::VideoEncoderConfig encoder_config; 310 webrtc::VideoEncoderConfig encoder_config;
311 }; 311 };
312 312
313 class AllocatedEncoder { 313 class AllocatedEncoder {
314 public: 314 public:
315 AllocatedEncoder() = default; 315 AllocatedEncoder() = default;
316 AllocatedEncoder(AllocatedEncoder&&) = default; 316 AllocatedEncoder(AllocatedEncoder&&) = default;
317 AllocatedEncoder& operator=(AllocatedEncoder&&) = default; 317 AllocatedEncoder& operator=(AllocatedEncoder&&) = default;
318 318
319 AllocatedEncoder(std::unique_ptr<webrtc::VideoEncoder> encoder, 319 AllocatedEncoder(std::unique_ptr<webrtc::VideoEncoder> encoder,
320 std::unique_ptr<webrtc::VideoEncoder> external_encoder, 320 bool is_external,
321 const cricket::VideoCodec& codec, 321 const cricket::VideoCodec& codec,
322 bool has_internal_source); 322 bool has_internal_source);
323 323
324 // Returns a raw pointer to the allocated encoder. This object still has 324 // Returns a raw pointer to the allocated encoder. This object still has
325 // ownership of the encoder and is responsible for deleting it. 325 // ownership of the encoder and is responsible for deleting it.
326 webrtc::VideoEncoder* encoder() { return encoder_.get(); } 326 webrtc::VideoEncoder* encoder() { return encoder_.get(); }
327 327
328 // Returns true if the encoder is external. 328 // Returns true if the encoder is external.
329 bool IsExternal() { return static_cast<bool>(external_encoder_); } 329 bool IsExternal() { return is_external_; }
330 330
331 cricket::VideoCodec codec() { return codec_; } 331 cricket::VideoCodec codec() { return codec_; }
332 332
333 bool HasInternalSource() { return has_internal_source_; } 333 bool HasInternalSource() { return has_internal_source_; }
334 334
335 // Release the encoders this object manages. 335 // Release the encoders this object manages.
336 void Reset(); 336 void Reset();
337 337
338 private: 338 private:
339 std::unique_ptr<webrtc::VideoEncoder> encoder_; 339 std::unique_ptr<webrtc::VideoEncoder> encoder_;
340 // TODO(magjed): |external_encoder_| is not used except for managing 340 bool is_external_;
341 // the lifetime when we use VideoEncoderSoftwareFallbackWrapper. Let
342 // VideoEncoderSoftwareFallbackWrapper own the external encoder instead
343 // and remove this member variable.
344 std::unique_ptr<webrtc::VideoEncoder> external_encoder_;
345 cricket::VideoCodec codec_; 341 cricket::VideoCodec codec_;
346 bool has_internal_source_; 342 bool has_internal_source_;
347 }; 343 };
348 344
349 rtc::scoped_refptr<webrtc::VideoEncoderConfig::EncoderSpecificSettings> 345 rtc::scoped_refptr<webrtc::VideoEncoderConfig::EncoderSpecificSettings>
350 ConfigureVideoEncoderSettings(const VideoCodec& codec); 346 ConfigureVideoEncoderSettings(const VideoCodec& codec);
351 // Creates and returns a new AllocatedEncoder of the specified codec type. 347 // Creates and returns a new AllocatedEncoder of the specified codec type.
352 AllocatedEncoder CreateVideoEncoder(const VideoCodec& codec); 348 AllocatedEncoder CreateVideoEncoder(const VideoCodec& codec);
353 void SetCodec(const VideoCodecSettings& codec, 349 void SetCodec(const VideoCodecSettings& codec,
354 bool force_encoder_allocation); 350 bool force_encoder_allocation);
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
567 const std::string codec_name_; 563 const std::string codec_name_;
568 const int max_qp_; 564 const int max_qp_;
569 const int max_framerate_; 565 const int max_framerate_;
570 const bool is_screencast_; 566 const bool is_screencast_;
571 const bool conference_mode_; 567 const bool conference_mode_;
572 }; 568 };
573 569
574 } // namespace cricket 570 } // namespace cricket
575 571
576 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOENGINE_H_ 572 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOENGINE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698