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}
7 files changed
tree: 6a95d5796d375dcbd618885dc4e707a7da65702b
  1. build_overrides/
  2. data/
  3. infra/
  4. resources/
  5. tools_webrtc/
  6. webrtc/
  7. .clang-format
  8. .git-blame-ignore-revs
  9. .gitignore
  10. .gn
  11. AUTHORS
  12. BUILD.gn
  13. CODE_OF_CONDUCT.md
  14. codereview.settings
  15. DEPS
  16. LICENSE
  17. license_template.txt
  18. LICENSE_THIRD_PARTY
  19. OWNERS
  20. PATENTS
  21. PRESUBMIT.py
  22. pylintrc
  23. README.md
  24. WATCHLISTS
README.md

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.

Development

See http://www.webrtc.org/native-code/development for instructions on how to get started developing with the native code.

More info