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

Issue 3007643002: Clean up ownership of webrtc::VideoEncoder (Closed)

Created:
3 years, 3 months ago by magjed_webrtc
Modified:
3 years, 3 months ago
Reviewers:
andersc
CC:
webrtc-reviews_webrtc.org, tterriberry_mozilla.com, the sun
Target Ref:
refs/heads/master
Project:
webrtc
Visibility:
Public.

Description

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} Committed: https://chromium.googlesource.com/external/webrtc/+/3f8975839865d668b993d3f84824167672830235

Patch Set 1 #

Patch Set 2 : Fix #

Unified diffs Side-by-side diffs Delta from patch set Stats (+276 lines, -170 lines) Patch
M webrtc/media/BUILD.gn View 1 chunk +2 lines, -0 lines 0 comments Download
A webrtc/media/engine/scopedvideoencoder.h View 1 chunk +33 lines, -0 lines 0 comments Download
A webrtc/media/engine/scopedvideoencoder.cc View 1 chunk +126 lines, -0 lines 0 comments Download
M webrtc/media/engine/simulcast_encoder_adapter.h View 2 chunks +4 lines, -5 lines 0 comments Download
M webrtc/media/engine/simulcast_encoder_adapter.cc View 4 chunks +11 lines, -10 lines 0 comments Download
M webrtc/media/engine/webrtcvideoengine.h View 1 2 chunks +35 lines, -14 lines 0 comments Download
M webrtc/media/engine/webrtcvideoengine.cc View 1 9 chunks +65 lines, -141 lines 0 comments Download

Messages

Total messages: 21 (17 generated)
magjed_webrtc
Anders - please take a look.
3 years, 3 months ago (2017-08-28 10:26:58 UTC) #13
andersc
Looks like a nice improvement! lgtm
3 years, 3 months ago (2017-08-28 12:13:24 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/3007643002/40001
3 years, 3 months ago (2017-08-28 15:03:41 UTC) #18
commit-bot: I haz the power
3 years, 3 months ago (2017-08-28 15:05:48 UTC) #21
Message was sent while issue was closed.
Committed patchset #2 (id:40001) as
https://chromium.googlesource.com/external/webrtc/+/3f8975839865d668b993d3f84...

Powered by Google App Engine
This is Rietveld 408576698