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

Issue 1100643002: [cast] Handle frame size changes directly in the VideoToolbox encoder (v2). (Closed)

Created:
5 years, 8 months ago by jfroy
Modified:
5 years, 8 months ago
Reviewers:
miu, dcaiafa
CC:
chromium-reviews, hclam+watch_chromium.org, imcheng+watch_chromium.org, hguihot+watch_chromium.org, jasonroberts+watch_google.com, avayvod+watch_chromium.org, feature-media-reviews_chromium.org, hubbe+watch_chromium.org, miu+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[cast] Handle frame size changes directly in the VideoToolbox encoder. To implement various kinds of re-initialization conditions more easily, this CL subsumes responsibility for handling frame size changes directly in the VideoToolbox encoder. The design is very similar to the previous one with a proxy encoder. Instead of proxying the entire encoder, only the video frame factory is proxied. Both the encoder and the proxy own a ref-counted reference to the factory, which in turn owns a weak back-reference to the encoder and a ref-counted reference to the current pixel buffer pool. When a frame size change is detected either by the encoder or by the video frame factory, the internal compression session is reset. This is done synchronously when executing on the Cast main thread, and by posting a task to the cast main thread when not. The code to re-initialize the compression session will be re-used in upcoming work where additional conditions, such as backgrounding, need to be monitored for session reinitialization. This new CL fixes the cast unit tests by modifying the tests to handle encoders that do not have a frame delay when changing the video size. R=dcaiafa@chromium.org, miu@chromium.org BUG=477895 Committed: https://crrev.com/89a288bd741c318d11085c4b6fdbbfa32f746335 Cr-Commit-Position: refs/heads/master@{#326907}

Patch Set 1 #

Total comments: 2

Patch Set 2 : Only change the video_encoder unit tests to pass tests. #

Patch Set 3 : Formatting and cleanup. #

Patch Set 4 : DestroyCompressionSession now resets the video frame factory's pool. #

Patch Set 5 : Video frame factory rejects empty frame sizes. #

Total comments: 2

Patch Set 6 : Set the video frame factory's pool to null before destroying the compression session. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+299 lines, -276 lines) Patch
M media/cast/sender/h264_vt_encoder.h View 1 2 5 chunks +35 lines, -41 lines 0 comments Download
M media/cast/sender/h264_vt_encoder.cc View 1 2 3 4 5 14 chunks +233 lines, -205 lines 0 comments Download
M media/cast/sender/h264_vt_encoder_unittest.cc View 1 2 chunks +6 lines, -6 lines 0 comments Download
M media/cast/sender/video_encoder.cc View 1 chunk +2 lines, -5 lines 0 comments Download
M media/cast/sender/video_encoder_unittest.cc View 1 3 chunks +18 lines, -15 lines 0 comments Download
M media/cast/sender/video_frame_factory.h View 2 chunks +5 lines, -4 lines 0 comments Download

Messages

Total messages: 23 (3 generated)
jfroy
This version of the patch passes all unit tests. I'm really sorry for the churn.
5 years, 8 months ago (2015-04-20 23:32:31 UTC) #1
miu
In the future, for re-land attempts, please upload the old change as Patch Set 1, ...
5 years, 8 months ago (2015-04-21 07:20:01 UTC) #2
jfroy
On 2015/04/21 07:20:01, miu wrote: > In the future, for re-land attempts, please upload the ...
5 years, 8 months ago (2015-04-21 16:07:45 UTC) #3
jfroy
https://codereview.chromium.org/1100643002/diff/1/media/cast/sender/h264_vt_encoder.cc File media/cast/sender/h264_vt_encoder.cc (right): https://codereview.chromium.org/1100643002/diff/1/media/cast/sender/h264_vt_encoder.cc#newcode502 media/cast/sender/h264_vt_encoder.cc:502: // Tests and clients expect |EncodeVideoFrame| to fail on ...
5 years, 8 months ago (2015-04-21 16:07:54 UTC) #4
jfroy
5 years, 8 months ago (2015-04-21 16:07:55 UTC) #5
miu
On 2015/04/21 16:07:54, jfroy wrote: > On 2015/04/21 07:20:00, miu wrote: > > Wait. We ...
5 years, 8 months ago (2015-04-22 03:57:24 UTC) #6
jfroy
On 2015/04/22 03:57:24, miu wrote: > On 2015/04/21 16:07:54, jfroy wrote: > > On 2015/04/21 ...
5 years, 8 months ago (2015-04-22 04:19:51 UTC) #7
jfroy
On 2015/04/22 03:57:24, miu wrote: > On 2015/04/21 16:07:54, jfroy wrote: > > On 2015/04/21 ...
5 years, 8 months ago (2015-04-22 04:19:51 UTC) #8
jfroy
So apparently the Publish button doesn't get disabled after you click on it. Sending review ...
5 years, 8 months ago (2015-04-22 04:21:27 UTC) #9
jfroy
PTAL For the encoder tests, I added a utility method to return if the encoder ...
5 years, 8 months ago (2015-04-22 05:45:55 UTC) #10
miu
lgtm
5 years, 8 months ago (2015-04-22 17:19:11 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1100643002/40001
5 years, 8 months ago (2015-04-22 17:22:58 UTC) #13
jfroy
miu, PTAL at the latest patch set. This should address the issue you pointed out ...
5 years, 8 months ago (2015-04-23 02:26:03 UTC) #15
jfroy
Patch set 5 adds a check for empty frame sizes to the video frame factory ...
5 years, 8 months ago (2015-04-23 04:09:45 UTC) #16
miu
lgtm % one thing you should change before committing: https://codereview.chromium.org/1100643002/diff/80001/media/cast/sender/h264_vt_encoder.cc File media/cast/sender/h264_vt_encoder.cc (right): https://codereview.chromium.org/1100643002/diff/80001/media/cast/sender/h264_vt_encoder.cc#newcode491 media/cast/sender/h264_vt_encoder.cc:491: ...
5 years, 8 months ago (2015-04-24 20:28:54 UTC) #17
jfroy
https://codereview.chromium.org/1100643002/diff/80001/media/cast/sender/h264_vt_encoder.cc File media/cast/sender/h264_vt_encoder.cc (right): https://codereview.chromium.org/1100643002/diff/80001/media/cast/sender/h264_vt_encoder.cc#newcode491 media/cast/sender/h264_vt_encoder.cc:491: video_frame_factory_->Update( On 2015/04/24 20:28:54, miu wrote: > This should ...
5 years, 8 months ago (2015-04-24 20:52:23 UTC) #18
miu
Still lgtm.
5 years, 8 months ago (2015-04-24 21:23:27 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1100643002/100001
5 years, 8 months ago (2015-04-24 21:29:01 UTC) #21
commit-bot: I haz the power
Committed patchset #6 (id:100001)
5 years, 8 months ago (2015-04-24 22:30:16 UTC) #22
commit-bot: I haz the power
5 years, 8 months ago (2015-04-24 22:31:03 UTC) #23
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/89a288bd741c318d11085c4b6fdbbfa32f746335
Cr-Commit-Position: refs/heads/master@{#326907}

Powered by Google App Engine
This is Rietveld 408576698