commit | 3f8975839865d668b993d3f84824167672830235 | [log] [tgz] |
---|---|---|
author | magjed <magjed@webrtc.org> | Mon Aug 28 08:05:42 2017 -0700 |
committer | Commit Bot <commit-bot@chromium.org> | Mon Aug 28 15:05:42 2017 +0000 |
tree | 6a95d5796d375dcbd618885dc4e707a7da65702b | |
parent | 673caedc39f8fc0975fb902041c9000c271bfccf [diff] |
Clean up ownership of webrtc::VideoEncoder Currently, webrtc::VideoEncoders are supposed to be deleted through the factory that created them with the WebRtcVideoEncoderFactory::DestroyVideoEncoder method. In practice, we sometimes use this method and sometimes we just call delete on the webrtc::VideoEncoder pointer. We want to be able to consistently use the normal destructor of webrtc::VideoEncoder instead of having to call DestroyVideoEncoder so that we can put webrtc::VideoEncoder inside an std::unique_ptr and make ownership more clear. As part of webrtc:7925 we also want to make a new encoder factory class that does not have the DestroyVideoEncoder() method, and this CL is a step in that direction. This CL introduces a helper function CreateScopedVideoEncoder that takes a webrtc::VideoEncoder and a WebRtcVideoEncoderFactory pointer, and returns a new webrtc::VideoEncoder instance that can be deleted through the regular destructor. This CL also removes WebRtcSimulcastEncoderFactory that almost only contains logic for handling the DestroyVideoEncoder calls that we no longer need, and inlines the rest of the logic inside the WebRtcVideoChannel::WebRtcVideoSendStream::CreateVideoEncoder method. BUG=webrtc:7925 Review-Url: https://codereview.webrtc.org/3007643002 Cr-Commit-Position: refs/heads/master@{#19564}
WebRTC is a free, open software project that provides browsers and mobile applications with Real-Time Communications (RTC) capabilities via simple APIs. The WebRTC components have been optimized to best serve this purpose.
Our mission: To enable rich, high-quality RTC applications to be developed for the browser, mobile platforms, and IoT devices, and allow them all to communicate via a common set of protocols.
The WebRTC initiative is a project supported by Google, Mozilla and Opera, amongst others.
See http://www.webrtc.org/native-code/development for instructions on how to get started developing with the native code.