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

Issue 1732953003: Fix VideoToolbox backgrounding issues (Closed)

Created:
4 years, 10 months ago by tkchin_webrtc
Modified:
4 years, 9 months ago
CC:
webrtc-reviews_webrtc.org, tterriberry_mozilla.com, zhengzhonghou_agora.io, video-team_agora.io, stefan-webrtc, mflodman
Base URL:
https://chromium.googlesource.com/external/webrtc.git@master
Target Ref:
refs/pending/heads/master
Project:
webrtc
Visibility:
Public.

Description

Fix VideoToolbox backgrounding issues. When the iOS application is not in the foreground, the hardware encoder and decoder become invalidated. There doesn't seem to be a way to query their state so we don't know they're invalid until we get an error code after an encode/decode request. To solve the issue, we just don't encode/decode when the app is not active, and reinitialize the encoder/decoder when the app is active again. Also fixes a leak in the decoder. BUG=webrtc:4081 Committed: https://crrev.com/5ed5ed953d2d0d667892a0bf528f65eb430cab18 Cr-Commit-Position: refs/heads/master@{#11916}

Patch Set 1 : #

Patch Set 2 : Update gyp #

Total comments: 2

Patch Set 3 : Update return codes. #

Patch Set 4 : Remove unneeded include. #

Total comments: 2

Patch Set 5 : Update comments. #

Total comments: 10

Patch Set 6 : Remove local bool #

Total comments: 4

Patch Set 7 : CR comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+217 lines, -58 lines) Patch
M webrtc/base/BUILD.gn View 1 chunk +2 lines, -0 lines 0 comments Download
M webrtc/base/base.gyp View 1 chunk +2 lines, -0 lines 0 comments Download
A + webrtc/base/objc/RTCUIApplication.h View 1 chunk +11 lines, -5 lines 0 comments Download
A + webrtc/base/objc/RTCUIApplication.mm View 1 chunk +12 lines, -5 lines 0 comments Download
M webrtc/build/WebRTC-Prefix.pch View 3 chunks +3 lines, -3 lines 0 comments Download
M webrtc/modules/video_coding/codecs/h264/h264.gypi View 1 1 chunk +4 lines, -0 lines 0 comments Download
M webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_decoder.cc View 1 2 3 4 5 5 chunks +50 lines, -7 lines 0 comments Download
M webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_encoder.cc View 1 2 3 4 5 6 4 chunks +30 lines, -2 lines 0 comments Download
M webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_nalu.h View 1 2 3 4 1 chunk +12 lines, -0 lines 0 comments Download
M webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_nalu.cc View 4 chunks +56 lines, -36 lines 0 comments Download
M webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_nalu_unittest.cc View 1 2 3 4 5 6 2 chunks +35 lines, -0 lines 0 comments Download

Messages

Total messages: 29 (13 generated)
tkchin_webrtc
4 years, 9 months ago (2016-03-02 23:35:15 UTC) #5
pbos-webrtc
Hoping the others can review the code better, can you put a more descriptive description ...
4 years, 9 months ago (2016-03-03 10:08:14 UTC) #6
tkchin_webrtc
On 2016/03/03 10:08:14, pbos-webrtc wrote: > Hoping the others can review the code better, can ...
4 years, 9 months ago (2016-03-03 21:47:02 UTC) #9
Chuck
lgtm
4 years, 9 months ago (2016-03-03 21:59:11 UTC) #10
noahric
lgtm https://codereview.webrtc.org/1732953003/diff/100001/webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_nalu.h File webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_nalu.h (right): https://codereview.webrtc.org/1732953003/diff/100001/webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_nalu.h#newcode47 webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_nalu.h:47: bool H264AnnexBBufferHasVideoFormatDescription(const uint8_t* annexb_buffer, Comments, since the rest ...
4 years, 9 months ago (2016-03-03 22:10:55 UTC) #11
pbos-webrtc
+R stefan@, do you think an encoder that just stops producing bits has any adverse ...
4 years, 9 months ago (2016-03-04 10:38:34 UTC) #13
pbos-webrtc
lgtm https://codereview.webrtc.org/1732953003/diff/120001/webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_decoder.cc File webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_decoder.cc (right): https://codereview.webrtc.org/1732953003/diff/120001/webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_decoder.cc#newcode135 webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_decoder.cc:135: bool is_app_active = RTCIsUIApplicationActive(); Do you need to ...
4 years, 9 months ago (2016-03-04 10:44:16 UTC) #14
tkchin_webrtc
Thanks folks! +kjellander@ for build file OWNERS. https://codereview.webrtc.org/1732953003/diff/100001/webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_nalu.h File webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_nalu.h (right): https://codereview.webrtc.org/1732953003/diff/100001/webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_nalu.h#newcode47 webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_nalu.h:47: bool H264AnnexBBufferHasVideoFormatDescription(const ...
4 years, 9 months ago (2016-03-04 19:03:07 UTC) #16
stefan-webrtc
https://codereview.webrtc.org/1732953003/diff/60001/webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_nalu.h File webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_nalu.h (right): https://codereview.webrtc.org/1732953003/diff/60001/webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_nalu.h#newcode52 webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_nalu.h:52: size_t annexb_buffer_size); Add unittests for these methods. https://codereview.webrtc.org/1732953003/diff/140001/webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_decoder.cc File ...
4 years, 9 months ago (2016-03-07 15:00:02 UTC) #17
kjellander_webrtc
*.gyp*,*.gn: lgtm
4 years, 9 months ago (2016-03-07 21:52:08 UTC) #19
tkchin_webrtc
PTAL https://codereview.webrtc.org/1732953003/diff/140001/webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_decoder.cc File webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_decoder.cc (right): https://codereview.webrtc.org/1732953003/diff/140001/webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_decoder.cc#newcode289 webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_decoder.cc:289: CFRelease(decompression_session_); On 2016/03/07 15:00:02, stefan-webrtc (holmer) wrote: > ...
4 years, 9 months ago (2016-03-08 04:51:41 UTC) #20
tkchin_webrtc
https://codereview.webrtc.org/1732953003/diff/60001/webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_nalu.h File webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_nalu.h (right): https://codereview.webrtc.org/1732953003/diff/60001/webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_nalu.h#newcode52 webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_nalu.h:52: size_t annexb_buffer_size); On 2016/03/07 15:00:02, stefan-webrtc (holmer) wrote: > ...
4 years, 9 months ago (2016-03-08 04:52:09 UTC) #21
stefan-webrtc
lgtm
4 years, 9 months ago (2016-03-08 10:06:56 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1732953003/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1732953003/160001
4 years, 9 months ago (2016-03-08 18:50:18 UTC) #25
commit-bot: I haz the power
Committed patchset #7 (id:160001)
4 years, 9 months ago (2016-03-08 18:51:59 UTC) #27
commit-bot: I haz the power
4 years, 9 months ago (2016-03-08 18:52:07 UTC) #29
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/5ed5ed953d2d0d667892a0bf528f65eb430cab18
Cr-Commit-Position: refs/heads/master@{#11916}

Powered by Google App Engine
This is Rietveld 408576698