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

Issue 2830793005: Reuse allocated encoders in SimulcastEncoderAdapter. (Closed)

Created:
3 years, 8 months ago by brandtr
Modified:
3 years, 7 months ago
CC:
webrtc-reviews_webrtc.org, tterriberry_mozilla.com, zhengzhonghou_agora.io, video-team_agora.io, stefan-webrtc, mflodman
Target Ref:
refs/heads/master
Project:
webrtc
Visibility:
Public.

Description

Reuse allocated encoders in SimulcastEncoderAdapter. Prior to this change, the SimulcastEncoderAdapter would destroy and create encoders whenever it is being reinitialized. After this change, the SimulcastEncoderAdapter will cache the already allocated encoders, and reuse them after reinitialization. This change will help in reducing the number of PictureID "jumps" that have been seen around encoder reinitialization. TESTED=AppRTCMobile, Chrome desktop, and internal app, with forced encoder reinits every 30 frames and https://codereview.webrtc.org/2833493003/ applied. BUG=webrtc:7475 Review-Url: https://codereview.webrtc.org/2830793005 Cr-Commit-Position: refs/heads/master@{#18215} Committed: https://chromium.googlesource.com/external/webrtc/+/0b8bfb9d98b7a2011d80bcdf3f430bc040370dad

Patch Set 1 : Cleanups and task checker. #

Patch Set 2 : Reuse allocated encoders. #

Patch Set 3 : Fix gn. #

Total comments: 5

Patch Set 4 : Rebase. #

Patch Set 5 : Add unit tests that verify that reinits do not lead to encoder reordering. #

Total comments: 5

Patch Set 6 : holmer comments 1: use stack instead of vector. #

Total comments: 3

Patch Set 7 : Rebase. #

Patch Set 8 : sprang comments 1a: E2E test. #

Patch Set 9 : Forgot to upload change that detaches sequenced task checker. Also deregister callbacks when Releas… #

Total comments: 6

Patch Set 10 : sprang comments 1b: atomics. #

Total comments: 1

Patch Set 11 : sprang comments 2. Remove VideoSendStream recreations due to flakyness. #

Patch Set 12 : Fix race in callback adapter destruction and use after free in test. #

Patch Set 13 : Remove one sequence check to pass mac tests. #

Patch Set 14 : Rebase. #

Patch Set 15 : Disable new test on tsan due to pre-existing race in libvpx. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+620 lines, -72 lines) Patch
M webrtc/modules/video_coding/BUILD.gn View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.h View 1 2 3 4 5 6 7 8 9 3 chunks +32 lines, -21 lines 0 comments Download
M webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc View 1 2 3 4 5 6 7 8 9 10 11 12 14 chunks +101 lines, -39 lines 0 comments Download
M webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 9 chunks +231 lines, -9 lines 0 comments Download
M webrtc/video/BUILD.gn View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M webrtc/video/DEPS View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M webrtc/video/end_to_end_tests.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 5 chunks +253 lines, -3 lines 0 comments Download

Messages

Total messages: 62 (34 generated)
brandtr
Please take a look. holmer: general comments + OWNER noahric: You seem familiar with earlier ...
3 years, 8 months ago (2017-04-20 11:58:49 UTC) #5
AlexG
> > glaznev: Are you aware of any assumptions in MediaCodecVideoEncoder, relying on > it ...
3 years, 8 months ago (2017-04-20 19:05:13 UTC) #6
noahric
https://codereview.webrtc.org/2830793005/diff/80001/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc File webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc (right): https://codereview.webrtc.org/2830793005/diff/80001/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc#newcode229 webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc:229: encoder = stored_encoders_.back(); On 2017/04/20 11:58:49, brandtr wrote: > ...
3 years, 8 months ago (2017-04-24 17:27:01 UTC) #7
brandtr
Rebase.
3 years, 7 months ago (2017-04-26 11:41:23 UTC) #8
brandtr
https://codereview.webrtc.org/2830793005/diff/80001/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc File webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc (right): https://codereview.webrtc.org/2830793005/diff/80001/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc#newcode229 webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc:229: encoder = stored_encoders_.back(); > Two things: > 1) You ...
3 years, 7 months ago (2017-04-26 14:59:45 UTC) #9
noahric
https://codereview.webrtc.org/2830793005/diff/80001/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc File webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc (right): https://codereview.webrtc.org/2830793005/diff/80001/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc#newcode229 webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc:229: encoder = stored_encoders_.back(); On 2017/04/26 14:59:44, brandtr wrote: > ...
3 years, 7 months ago (2017-04-26 21:38:51 UTC) #10
brandtr
https://codereview.webrtc.org/2830793005/diff/80001/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc File webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc (right): https://codereview.webrtc.org/2830793005/diff/80001/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc#newcode229 webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc:229: encoder = stored_encoders_.back(); On 2017/04/26 21:38:51, noahric wrote: > ...
3 years, 7 months ago (2017-04-27 10:43:31 UTC) #11
brandtr
ping holmer. Also added some more unit tests, verifying that the outgoing frames belong to ...
3 years, 7 months ago (2017-04-27 10:44:15 UTC) #12
brandtr
Noah: does this LG? https://codereview.webrtc.org/2830793005/diff/120001/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc File webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc (left): https://codereview.webrtc.org/2830793005/diff/120001/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc#oldcode137 webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc:137: Release(); This change is needed ...
3 years, 7 months ago (2017-05-01 09:43:34 UTC) #13
stefan-webrtc
https://codereview.webrtc.org/2830793005/diff/120001/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc File webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc (right): https://codereview.webrtc.org/2830793005/diff/120001/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc#newcode503 webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc:503: for (const auto& encoder : stored_encoders_) { const VideoEncoder& ...
3 years, 7 months ago (2017-05-02 08:08:34 UTC) #14
brandtr
https://codereview.webrtc.org/2830793005/diff/120001/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc File webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc (right): https://codereview.webrtc.org/2830793005/diff/120001/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc#newcode503 webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc:503: for (const auto& encoder : stored_encoders_) { On 2017/05/02 ...
3 years, 7 months ago (2017-05-02 09:17:02 UTC) #15
sprang_webrtc
Code looks good, a few questions though. The code path from the external API surfaces ...
3 years, 7 months ago (2017-05-11 11:53:36 UTC) #17
brandtr
Rebase.
3 years, 7 months ago (2017-05-12 08:13:10 UTC) #18
brandtr
sprang comments 1a: E2E test.
3 years, 7 months ago (2017-05-15 10:08:26 UTC) #19
brandtr
Added E2E test that reinits encoder and recreates VideoSendStream. By reverting the changes to SimulcastEncoderAdapter, ...
3 years, 7 months ago (2017-05-15 10:10:23 UTC) #20
brandtr
https://codereview.webrtc.org/2830793005/diff/140001/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.h File webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.h (right): https://codereview.webrtc.org/2830793005/diff/140001/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.h#newcode112 webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.h:112: #endif On 2017/05/11 11:53:36, sprang_webrtc wrote: > Maybe you ...
3 years, 7 months ago (2017-05-15 10:12:01 UTC) #21
brandtr
Forgot to upload change that detaches sequenced task checker. Also deregister callbacks when Release()'ing.
3 years, 7 months ago (2017-05-15 10:19:20 UTC) #22
brandtr
https://codereview.webrtc.org/2830793005/diff/200001/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc File webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc (right): https://codereview.webrtc.org/2830793005/diff/200001/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc#newcode156 webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc:156: encoder->RegisterEncodeCompleteCallback(nullptr); As discussed offline with sprang@.
3 years, 7 months ago (2017-05-15 10:20:21 UTC) #23
brandtr
On 2017/05/11 11:53:36, sprang_webrtc wrote: > Code looks good, a few questions though. > > ...
3 years, 7 months ago (2017-05-15 10:49:06 UTC) #24
sprang_webrtc
Thanks for the e2e test! lgtm with nits https://codereview.webrtc.org/2830793005/diff/140001/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.h File webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.h (right): https://codereview.webrtc.org/2830793005/diff/140001/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.h#newcode112 webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.h:112: #endif ...
3 years, 7 months ago (2017-05-15 12:03:39 UTC) #25
brandtr
https://codereview.webrtc.org/2830793005/diff/200001/webrtc/video/end_to_end_tests.cc File webrtc/video/end_to_end_tests.cc (right): https://codereview.webrtc.org/2830793005/diff/200001/webrtc/video/end_to_end_tests.cc#newcode4067 webrtc/video/end_to_end_tests.cc:4067: SleepMs(100); On 2017/05/15 12:03:39, sprang_webrtc wrote: > This seems ...
3 years, 7 months ago (2017-05-15 17:14:04 UTC) #42
brandtr
ping holmer for video/. The tsan failure is a race in libvpx. I will check ...
3 years, 7 months ago (2017-05-15 17:16:13 UTC) #43
stefan-webrtc
lgtm for webrtc/video
3 years, 7 months ago (2017-05-16 08:42:31 UTC) #44
sprang_webrtc
lgtm
3 years, 7 months ago (2017-05-16 11:40:56 UTC) #45
brandtr
Rebase.
3 years, 7 months ago (2017-05-17 07:12:27 UTC) #46
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/2830793005/320001
3 years, 7 months ago (2017-05-19 13:49:09 UTC) #57
commit-bot: I haz the power
Committed patchset #15 (id:320001) as https://chromium.googlesource.com/external/webrtc/+/0b8bfb9d98b7a2011d80bcdf3f430bc040370dad
3 years, 7 months ago (2017-05-19 13:51:48 UTC) #60
brandtr
3 years, 7 months ago (2017-05-19 17:32:54 UTC) #61
Message was sent while issue was closed.
A revert of this CL (patchset #15 id:320001) has been created in
https://codereview.webrtc.org/2893003002/ by brandtr@webrtc.org.

The reason for reverting is: Breaks Chrome tests..

Powered by Google App Engine
This is Rietveld 408576698