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

Issue 254473010: Refactor MSE implementation on Android to simplify the logic and improve the performance (Closed)

Created:
6 years, 8 months ago by qinmin
Modified:
6 years, 6 months ago
CC:
chromium-reviews, fischman+watch_chromium.org, avayvod+watch_chromium.org, jam, mcasas+watch_chromium.org, feature-media-reviews_chromium.org, darin-cc_chromium.org, wjia+watch_chromium.org
Visibility:
Public.

Description

Refactor MSE implementation on Android to simplify the logic and improve the performance The MediaSourcePlayer processes several pending events, and some of them it should not care. For example: SURFACE_CHANGE and CONFIG_CHANGE. This change pushes the handling of surface change and config change into the MediaDecoderJob, and simplifies a lot of logic: 1. MSP now assumes that AudioDecoderJob and VideoDecoderJob is always around, it is up to AudioDecoderJob/VideoDecoderJob to handle MediaCodecBridge recreation. 2. When config changes, MediaDecoderJob will not immediately recreate a new MediaCodecBridge. Instead, it will drain the current MediaCodecBridge until all the buffered data are decoded. Then it starts creating the new MediaCodecBridge. BUG=357726 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=275063

Patch Set 1 : #

Total comments: 14

Patch Set 2 : addressing comments #

Total comments: 4

Patch Set 3 : nits #

Patch Set 4 : rebase after recent config IPC change #

Total comments: 31

Patch Set 5 : addressing comments #

Total comments: 12

Patch Set 6 : addressing comments #

Total comments: 29

Patch Set 7 : addressing xhwang's comments #

Patch Set 8 : fixing eme playback issue #

Patch Set 9 : passing an EOS access unit during config change #

Total comments: 37

Patch Set 10 : addressing comments on unit tests #

Total comments: 6

Patch Set 11 : fixing nits #

Unified diffs Side-by-side diffs Delta from patch set Stats (+991 lines, -839 lines) Patch
M media/base/android/audio_decoder_job.h View 1 2 3 4 5 6 7 8 3 chunks +29 lines, -22 lines 0 comments Download
M media/base/android/audio_decoder_job.cc View 1 2 3 4 5 6 4 chunks +77 lines, -36 lines 0 comments Download
M media/base/android/media_decoder_job.h View 1 2 3 4 5 6 7 8 9 10 11 chunks +116 lines, -38 lines 0 comments Download
M media/base/android/media_decoder_job.cc View 1 2 3 4 5 6 7 8 9 19 chunks +180 lines, -54 lines 0 comments Download
M media/base/android/media_source_player.h View 1 2 3 4 5 6 7 8 9 9 chunks +16 lines, -51 lines 0 comments Download
M media/base/android/media_source_player.cc View 1 2 3 4 5 6 7 8 9 24 chunks +94 lines, -384 lines 0 comments Download
M media/base/android/media_source_player_unittest.cc View 1 2 3 4 5 6 7 8 9 10 64 chunks +337 lines, -203 lines 0 comments Download
M media/base/android/video_decoder_job.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +49 lines, -23 lines 0 comments Download
M media/base/android/video_decoder_job.cc View 1 2 3 4 5 6 4 chunks +93 lines, -28 lines 0 comments Download

Messages

Total messages: 44 (0 generated)
qinmin
PTAL
6 years, 8 months ago (2014-04-24 23:29:06 UTC) #1
wolenetz
Some preliminary comments (nits). Before I review everything together, is it possible/simple to split out ...
6 years, 8 months ago (2014-04-25 23:13:13 UTC) #2
qinmin
https://codereview.chromium.org/254473010/diff/20001/content/renderer/media/android/media_source_delegate.cc File content/renderer/media/android/media_source_delegate.cc (right): https://codereview.chromium.org/254473010/diff/20001/content/renderer/media/android/media_source_delegate.cc#newcode394 content/renderer/media/android/media_source_delegate.cc:394: gfx::Size size = video_stream_->video_decoder_config().coded_size(); Done. we should simply using ...
6 years, 8 months ago (2014-04-26 01:30:10 UTC) #3
wolenetz
Some further comments around the ConfigChange IPC change (part 2 of the currenty CL description). ...
6 years, 7 months ago (2014-04-28 19:48:02 UTC) #4
qinmin
Ok, split ConfigChange IPC into a separate CL: https://codereview.chromium.org/257323003/ https://codereview.chromium.org/254473010/diff/40001/content/renderer/media/android/media_source_delegate.cc File content/renderer/media/android/media_source_delegate.cc (right): https://codereview.chromium.org/254473010/diff/40001/content/renderer/media/android/media_source_delegate.cc#newcode395 content/renderer/media/android/media_source_delegate.cc:395: ...
6 years, 7 months ago (2014-04-29 23:57:22 UTC) #5
wolenetz
Thank you for splitting out the ConfigChange IPC piece. Please rebase this onto that other ...
6 years, 7 months ago (2014-05-02 22:31:00 UTC) #6
qinmin
On 2014/05/02 22:31:00, wolenetz wrote: > Thank you for splitting out the ConfigChange IPC piece. ...
6 years, 7 months ago (2014-05-02 22:41:13 UTC) #7
wolenetz
On 2014/05/02 22:41:13, qinmin wrote: > On 2014/05/02 22:31:00, wolenetz wrote: > > Thank you ...
6 years, 7 months ago (2014-05-02 22:47:19 UTC) #8
qinmin
On 2014/05/02 22:47:19, wolenetz wrote: > On 2014/05/02 22:41:13, qinmin wrote: > > On 2014/05/02 ...
6 years, 7 months ago (2014-05-02 22:50:01 UTC) #9
qinmin
PTAL again, rebased the change after recent DemuxerConfig IPC change.
6 years, 7 months ago (2014-05-13 22:13:54 UTC) #10
wolenetz
On 2014/05/13 22:13:54, qinmin wrote: > PTAL again, rebased the change after recent DemuxerConfig IPC ...
6 years, 7 months ago (2014-05-16 00:00:37 UTC) #11
wolenetz
On 2014/05/16 00:00:37, wolenetz wrote: > On 2014/05/13 22:13:54, qinmin wrote: > > PTAL again, ...
6 years, 7 months ago (2014-05-17 02:24:34 UTC) #12
qinmin
On 2014/05/17 02:24:34, wolenetz wrote: > On 2014/05/16 00:00:37, wolenetz wrote: > > On 2014/05/13 ...
6 years, 7 months ago (2014-05-17 03:02:16 UTC) #13
wolenetz
First round of comments (on PS4, excluding the unittests in this CR round): https://codereview.chromium.org/254473010/diff/100001/media/base/android/media_decoder_job.cc File ...
6 years, 7 months ago (2014-05-21 00:48:03 UTC) #14
qinmin
https://codereview.chromium.org/254473010/diff/100001/media/base/android/media_decoder_job.cc File media/base/android/media_decoder_job.cc (right): https://codereview.chromium.org/254473010/diff/100001/media/base/android/media_decoder_job.cc#newcode539 media/base/android/media_decoder_job.cc:539: if (release_resources_pending_) { We should leave it as it ...
6 years, 7 months ago (2014-05-22 00:35:54 UTC) #15
qinmin
ping, Matt, any further comments on this change?
6 years, 7 months ago (2014-05-27 16:13:47 UTC) #16
wolenetz
On 2014/05/27 16:13:47, qinmin wrote: > ping, Matt, any further comments on this change? I'll ...
6 years, 7 months ago (2014-05-27 17:23:49 UTC) #17
wolenetz
looking pretty good. Some comments, plus I will need to take a closer look at ...
6 years, 7 months ago (2014-05-27 22:21:13 UTC) #18
qinmin
+xhwang https://codereview.chromium.org/254473010/diff/120001/media/base/android/media_decoder_job.cc File media/base/android/media_decoder_job.cc (right): https://codereview.chromium.org/254473010/diff/120001/media/base/android/media_decoder_job.cc#newcode390 media/base/android/media_decoder_job.cc:390: if (unit.status == DemuxerStream::kAborted) { decoder draining only ...
6 years, 7 months ago (2014-05-28 00:28:16 UTC) #19
xhwang
I have to run for now. This is my first round of comments. I suspect ...
6 years, 6 months ago (2014-05-30 21:58:07 UTC) #20
qinmin
https://codereview.chromium.org/254473010/diff/140001/media/base/android/audio_decoder_job.cc File media/base/android/audio_decoder_job.cc (right): https://codereview.chromium.org/254473010/diff/140001/media/base/android/audio_decoder_job.cc#newcode101 media/base/android/audio_decoder_job.cc:101: set_is_content_encrypted(configs.is_audio_encrypted); is_content_encrypted_ is private in base class, so a ...
6 years, 6 months ago (2014-05-30 23:43:33 UTC) #21
qinmin
wolenetz@, xhwang@, PTAL again. MediaDecoderJob::Decode() could fail due to delayed AddKey() call for EME, and ...
6 years, 6 months ago (2014-05-31 01:32:04 UTC) #22
xhwang
EME part looks good! I also tested some EME test pages and they work fine. ...
6 years, 6 months ago (2014-06-02 23:07:11 UTC) #23
qinmin
https://codereview.chromium.org/254473010/diff/140001/media/base/android/audio_decoder_job.h File media/base/android/audio_decoder_job.h (right): https://codereview.chromium.org/254473010/diff/140001/media/base/android/audio_decoder_job.h#newcode31 media/base/android/audio_decoder_job.h:31: // Set the volume of the audio output. On ...
6 years, 6 months ago (2014-06-03 00:41:03 UTC) #24
wolenetz
Looking pretty good. This time, my comments include CR of the unit tests. https://codereview.chromium.org/254473010/diff/220001/media/base/android/media_decoder_job.cc File ...
6 years, 6 months ago (2014-06-04 00:21:47 UTC) #25
xhwang
EME part lgtm. I'll defer to wolenetz@ to finish the review.
6 years, 6 months ago (2014-06-04 17:57:56 UTC) #26
wolenetz
nit: Add 306314 to the BUGS line in description.
6 years, 6 months ago (2014-06-04 18:25:27 UTC) #27
qinmin
306314 should have been fixed by https://codereview.chromium.org/196133020 https://codereview.chromium.org/254473010/diff/220001/media/base/android/media_decoder_job.cc File media/base/android/media_decoder_job.cc (right): https://codereview.chromium.org/254473010/diff/220001/media/base/android/media_decoder_job.cc#newcode356 media/base/android/media_decoder_job.cc:356: decoder_task_runner_->PostTask(FROM_HERE, base::Bind( ...
6 years, 6 months ago (2014-06-04 19:29:14 UTC) #28
wolenetz
lgtm % nits: https://codereview.chromium.org/254473010/diff/220001/media/base/android/media_source_player_unittest.cc File media/base/android/media_source_player_unittest.cc (right): https://codereview.chromium.org/254473010/diff/220001/media/base/android/media_source_player_unittest.cc#newcode952 media/base/android/media_source_player_unittest.cc:952: player_.OnDemuxerDataAvailable(CreateAbortedAck(false)); On 2014/06/04 19:29:15, qinmin wrote: ...
6 years, 6 months ago (2014-06-04 21:42:23 UTC) #29
qinmin
https://codereview.chromium.org/254473010/diff/240001/media/base/android/media_source_player.cc File media/base/android/media_source_player.cc (right): https://codereview.chromium.org/254473010/diff/240001/media/base/android/media_source_player.cc#newcode291 media/base/android/media_source_player.cc:291: audio_decoder_job_->SetDrmBridge(drm_bridge_); This won't happen. RegisterPlayer() is a simple function ...
6 years, 6 months ago (2014-06-04 22:34:02 UTC) #30
qinmin
The CQ bit was checked by qinmin@chromium.org
6 years, 6 months ago (2014-06-04 22:34:10 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/qinmin@chromium.org/254473010/260001
6 years, 6 months ago (2014-06-04 22:34:59 UTC) #32
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: android_chromium_gn_compile_rel on tryserver.chromium ...
6 years, 6 months ago (2014-06-05 03:17:55 UTC) #33
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 6 months ago (2014-06-05 03:24:05 UTC) #34
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_gn_rel on tryserver.chromium (http://build.chromium.org/p/tryserver.chromium/builders/linux_chromium_gn_rel/builds/13633)
6 years, 6 months ago (2014-06-05 03:24:05 UTC) #35
qinmin
The CQ bit was checked by qinmin@chromium.org
6 years, 6 months ago (2014-06-05 03:36:49 UTC) #36
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/qinmin@chromium.org/254473010/260001
6 years, 6 months ago (2014-06-05 03:39:38 UTC) #37
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: android_clang_dbg on tryserver.chromium ...
6 years, 6 months ago (2014-06-05 03:46:00 UTC) #38
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 6 months ago (2014-06-05 03:52:02 UTC) #39
commit-bot: I haz the power
Try jobs failed on following builders: android_clang_dbg on tryserver.chromium (http://build.chromium.org/p/tryserver.chromium/builders/android_clang_dbg/builds/148923)
6 years, 6 months ago (2014-06-05 03:52:02 UTC) #40
qinmin
The CQ bit was checked by qinmin@chromium.org
6 years, 6 months ago (2014-06-05 07:02:04 UTC) #41
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/qinmin@chromium.org/254473010/250010
6 years, 6 months ago (2014-06-05 07:03:46 UTC) #42
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: linux_chromium_gn_rel on tryserver.chromium ...
6 years, 6 months ago (2014-06-05 09:52:43 UTC) #43
commit-bot: I haz the power
6 years, 6 months ago (2014-06-05 11:03:24 UTC) #44
Message was sent while issue was closed.
Change committed as 275063

Powered by Google App Engine
This is Rietveld 408576698