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

Issue 9632024: Create video and audio decoder threads on demand. (Closed)

Created:
8 years, 9 months ago by tommi (sloooow) - chröme
Modified:
8 years, 9 months ago
CC:
chromium-reviews, pam+watch_chromium.org, feature-media-reviews_chromium.org, sadrul, darin-cc_chromium.org
Visibility:
Public.

Description

Create video and audio decoder threads on demand. Instead of creating these worker threads when the decoder objects are instantiated, we now do it when Initialize is called. Doing this avoids spinning a video decoder thread for an audio tag. BUG=114699, 116873 TEST=Thread count in the renderer process goes up by 3 and not 4 when an audio element is created. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=126077

Patch Set 1 #

Total comments: 4

Patch Set 2 : Switched to base::Bind() and reverted gyp change+new files #

Total comments: 23

Patch Set 3 : Address review comments #

Patch Set 4 : Log an error when Initialize is called more than once. #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+82 lines, -18 lines) Patch
M media/filters/ffmpeg_audio_decoder.h View 1 2 3 chunks +4 lines, -1 line 0 comments Download
M media/filters/ffmpeg_audio_decoder.cc View 1 2 3 2 chunks +12 lines, -2 lines 0 comments Download
M media/filters/ffmpeg_audio_decoder_unittest.cc View 1 2 2 chunks +5 lines, -3 lines 0 comments Download
A media/filters/ffmpeg_decoder_unittest.h View 1 2 1 chunk +13 lines, -0 lines 1 comment Download
M media/filters/ffmpeg_video_decoder.h View 1 2 3 chunks +5 lines, -1 line 0 comments Download
M media/filters/ffmpeg_video_decoder.cc View 1 2 3 2 chunks +13 lines, -2 lines 0 comments Download
M media/filters/ffmpeg_video_decoder_unittest.cc View 1 2 2 chunks +3 lines, -1 line 0 comments Download
M media/filters/pipeline_integration_test_base.cc View 1 1 chunk +6 lines, -2 lines 0 comments Download
M media/media.gyp View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M media/tools/player_wtl/movie.cc View 1 2 chunks +7 lines, -2 lines 0 comments Download
M media/tools/player_x11/player_x11.cc View 1 2 1 chunk +6 lines, -2 lines 0 comments Download
M webkit/media/filter_helpers.cc View 1 2 chunks +7 lines, -2 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
tommi (sloooow) - chröme
8 years, 9 months ago (2012-03-08 14:26:28 UTC) #1
Ami GONE FROM CHROMIUM
Nice idea! I think you can simplify the CL significantly though; see comments below. Obviously, ...
8 years, 9 months ago (2012-03-08 16:32:07 UTC) #2
scherkus (not reviewing)
cool! the much-more-awesome fix is to have a single thread and inject the msgloop via ...
8 years, 9 months ago (2012-03-08 19:12:44 UTC) #3
tommi (sloooow) - chröme
Thanks for suggesting the callback solution. The change is much simpler now. https://chromiumcodereview.appspot.com/9632024/diff/1/media/filters/ffmpeg_audio_decoder.h File media/filters/ffmpeg_audio_decoder.h ...
8 years, 9 months ago (2012-03-09 10:07:13 UTC) #4
Ami GONE FROM CHROMIUM
Basically LGTM; thanks for simplifying. I made some comments on only video or audio side ...
8 years, 9 months ago (2012-03-09 16:15:05 UTC) #5
scherkus (not reviewing)
LGTM mod similar style-y bits thanks! https://chromiumcodereview.appspot.com/9632024/diff/7001/media/filters/ffmpeg_audio_decoder.cc File media/filters/ffmpeg_audio_decoder.cc (right): https://chromiumcodereview.appspot.com/9632024/diff/7001/media/filters/ffmpeg_audio_decoder.cc#newcode11 media/filters/ffmpeg_audio_decoder.cc:11: #include "media/base/message_loop_factory.h" not ...
8 years, 9 months ago (2012-03-09 20:01:16 UTC) #6
tommi (sloooow) - chröme
all done. https://chromiumcodereview.appspot.com/9632024/diff/7001/media/filters/ffmpeg_audio_decoder.cc File media/filters/ffmpeg_audio_decoder.cc (right): https://chromiumcodereview.appspot.com/9632024/diff/7001/media/filters/ffmpeg_audio_decoder.cc#newcode11 media/filters/ffmpeg_audio_decoder.cc:11: #include "media/base/message_loop_factory.h" On 2012/03/09 20:01:16, scherkus wrote: ...
8 years, 9 months ago (2012-03-11 18:49:36 UTC) #7
Ami GONE FROM CHROMIUM
https://chromiumcodereview.appspot.com/9632024/diff/18002/media/filters/ffmpeg_decoder_unittest.h File media/filters/ffmpeg_decoder_unittest.h (right): https://chromiumcodereview.appspot.com/9632024/diff/18002/media/filters/ffmpeg_decoder_unittest.h#newcode10 media/filters/ffmpeg_decoder_unittest.h:10: template<class T> T Identity(T t) { return t; } ...
8 years, 9 months ago (2012-03-11 23:43:12 UTC) #8
tommi (sloooow) - chröme
8 years, 9 months ago (2012-03-12 10:07:57 UTC) #9
On 2012/03/11 23:43:12, Ami Fischman wrote:
>
https://chromiumcodereview.appspot.com/9632024/diff/18002/media/filters/ffmpe...
> File media/filters/ffmpeg_decoder_unittest.h (right):
> 
>
https://chromiumcodereview.appspot.com/9632024/diff/18002/media/filters/ffmpe...
> media/filters/ffmpeg_decoder_unittest.h:10: template<class T> T Identity(T t)
{
> return t; }
> I think you misunderstood my comment about namespace/static.
> My point was that instead of using an anonymous namespace:
> 
> namespace {
> template<class T> T Identity(T t) { return t; }
> }
> 
> media code makes such things file-static:
> template<class T> static T Identity(T t) { return t; }
> 
> , not that you should move it into the media namespace (or need a new .h).
> This function is simple enough that duplicating its code in two test.cc files
> seems fine to me.

Ah, sorry about that Ami.  I'll fix it in a subsequent cl.

Powered by Google App Engine
This is Rietveld 408576698