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

Issue 414643003: Support configuring the audio buffer duration in the Pepper MediaStream API. (Closed)

Created:
6 years, 5 months ago by Anand Mistry (off Chromium)
Modified:
6 years, 4 months ago
CC:
chromium-reviews, darin-cc_chromium.org, jam, chrome-apps-syd-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Support configuring the audio buffer duration in the Pepper MediaStream API. Increasing the buffer duration allows the Pepper plugin the sleep for longer between buffers and reduces the per-sample overhead. This all translates to lower power consumption, at the expense of latency. BUG=330851 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=286774

Patch Set 1 #

Patch Set 2 : Tests! #

Total comments: 23

Patch Set 3 : Address review comments #

Total comments: 12

Patch Set 4 : More review comments #

Total comments: 7

Patch Set 5 : Rebase after 417753002 was committed #

Total comments: 2

Patch Set 6 : Add clarifying comment about buffer size. #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+257 lines, -63 lines) Patch
M content/renderer/pepper/pepper_media_stream_audio_track_host.h View 1 2 3 4 4 chunks +26 lines, -4 lines 0 comments Download
M content/renderer/pepper/pepper_media_stream_audio_track_host.cc View 1 2 3 4 5 9 chunks +102 lines, -32 lines 2 comments Download
M content/renderer/pepper/pepper_media_stream_track_host_base.cc View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M ppapi/proxy/media_stream_audio_track_resource.cc View 1 chunk +3 lines, -1 line 0 comments Download
M ppapi/proxy/ppapi_messages.h View 1 chunk +1 line, -0 lines 0 comments Download
M ppapi/shared_impl/media_stream_audio_track_shared.h View 1 chunk +2 lines, -1 line 0 comments Download
M ppapi/shared_impl/media_stream_audio_track_shared.cc View 1 chunk +3 lines, -0 lines 0 comments Download
M ppapi/shared_impl/media_stream_audio_track_shared_unittest.cc View 1 1 chunk +22 lines, -0 lines 0 comments Download
M ppapi/tests/test_media_stream_audio_track.h View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M ppapi/tests/test_media_stream_audio_track.cc View 1 2 3 4 chunks +92 lines, -25 lines 0 comments Download

Messages

Total messages: 20 (0 generated)
Anand Mistry (off Chromium)
cevans@chromium.org: Please review changes in ppapi_messages.h dmichael@chromium.org: Please review changes in... everything else.
6 years, 5 months ago (2014-07-23 07:53:49 UTC) #1
dmichael (off chromium)
+penghuang https://codereview.chromium.org/414643003/diff/20001/content/renderer/pepper/pepper_media_stream_audio_track_host.cc File content/renderer/pepper/pepper_media_stream_audio_track_host.cc (right): https://codereview.chromium.org/414643003/diff/20001/content/renderer/pepper/pepper_media_stream_audio_track_host.cc#newcode31 content/renderer/pepper/pepper_media_stream_audio_track_host.cc:31: const uint32_t kDefaultDuration = 123; This seems like ...
6 years, 5 months ago (2014-07-23 20:08:42 UTC) #2
Peng
https://codereview.chromium.org/414643003/diff/20001/content/renderer/pepper/pepper_media_stream_audio_track_host.cc File content/renderer/pepper/pepper_media_stream_audio_track_host.cc (right): https://codereview.chromium.org/414643003/diff/20001/content/renderer/pepper/pepper_media_stream_audio_track_host.cc#newcode127 content/renderer/pepper/pepper_media_stream_audio_track_host.cc:127: // TODO(amistry): Fix me! On 2014/07/23 20:08:41, dmichael wrote: ...
6 years, 5 months ago (2014-07-23 20:40:31 UTC) #3
Anand Mistry (off Chromium)
PTAL https://codereview.chromium.org/414643003/diff/20001/content/renderer/pepper/pepper_media_stream_audio_track_host.cc File content/renderer/pepper/pepper_media_stream_audio_track_host.cc (right): https://codereview.chromium.org/414643003/diff/20001/content/renderer/pepper/pepper_media_stream_audio_track_host.cc#newcode31 content/renderer/pepper/pepper_media_stream_audio_track_host.cc:31: const uint32_t kDefaultDuration = 123; On 2014/07/23 20:08:41, ...
6 years, 5 months ago (2014-07-24 01:28:29 UTC) #4
Peng
https://codereview.chromium.org/414643003/diff/40001/content/renderer/pepper/pepper_media_stream_audio_track_host.cc File content/renderer/pepper/pepper_media_stream_audio_track_host.cc (right): https://codereview.chromium.org/414643003/diff/40001/content/renderer/pepper/pepper_media_stream_audio_track_host.cc#newcode184 content/renderer/pepper/pepper_media_stream_audio_track_host.cc:184: uint32_t output_buffer_size = 0; Why not use output_buffer_size_ directly? ...
6 years, 5 months ago (2014-07-24 15:38:37 UTC) #5
Anand Mistry (off Chromium)
https://codereview.chromium.org/414643003/diff/40001/content/renderer/pepper/pepper_media_stream_audio_track_host.cc File content/renderer/pepper/pepper_media_stream_audio_track_host.cc (right): https://codereview.chromium.org/414643003/diff/40001/content/renderer/pepper/pepper_media_stream_audio_track_host.cc#newcode184 content/renderer/pepper/pepper_media_stream_audio_track_host.cc:184: uint32_t output_buffer_size = 0; On 2014/07/24 15:38:37, Peng wrote: ...
6 years, 5 months ago (2014-07-25 03:38:15 UTC) #6
Peng
lgtm. https://codereview.chromium.org/414643003/diff/60001/ppapi/tests/test_media_stream_audio_track.cc File ppapi/tests/test_media_stream_audio_track.cc (right): https://codereview.chromium.org/414643003/diff/60001/ppapi/tests/test_media_stream_audio_track.cc#newcode238 ppapi/tests/test_media_stream_audio_track.cc:238: { kMaxDuration + 1, PP_ERROR_BADARGUMENT }, Seems this ...
6 years, 5 months ago (2014-07-25 14:16:52 UTC) #7
Anand Mistry (off Chromium)
https://codereview.chromium.org/414643003/diff/60001/ppapi/tests/test_media_stream_audio_track.cc File ppapi/tests/test_media_stream_audio_track.cc (right): https://codereview.chromium.org/414643003/diff/60001/ppapi/tests/test_media_stream_audio_track.cc#newcode238 ppapi/tests/test_media_stream_audio_track.cc:238: { kMaxDuration + 1, PP_ERROR_BADARGUMENT }, On 2014/07/25 14:16:51, ...
6 years, 5 months ago (2014-07-26 07:15:47 UTC) #8
Anand Mistry (off Chromium)
PTAL. Rebased after https://codereview.chromium.org/417753002/ was committed.
6 years, 4 months ago (2014-07-29 03:37:11 UTC) #9
dmichael (off chromium)
Sorry for being slow. Looks good overall, but I'm still wondering if we need the ...
6 years, 4 months ago (2014-07-29 16:41:24 UTC) #10
Anand Mistry (off Chromium)
https://codereview.chromium.org/414643003/diff/20001/content/renderer/pepper/pepper_media_stream_audio_track_host.cc File content/renderer/pepper/pepper_media_stream_audio_track_host.cc (right): https://codereview.chromium.org/414643003/diff/20001/content/renderer/pepper/pepper_media_stream_audio_track_host.cc#newcode157 content/renderer/pepper/pepper_media_stream_audio_track_host.cc:157: DCHECK_EQ(number_of_frames, audio_params_.frames_per_buffer()); On 2014/07/29 16:41:24, dmichael wrote: > On ...
6 years, 4 months ago (2014-07-30 00:22:05 UTC) #11
dmichael (off chromium)
lgtm https://codereview.chromium.org/414643003/diff/20001/content/renderer/pepper/pepper_media_stream_audio_track_host.cc File content/renderer/pepper/pepper_media_stream_audio_track_host.cc (right): https://codereview.chromium.org/414643003/diff/20001/content/renderer/pepper/pepper_media_stream_audio_track_host.cc#newcode157 content/renderer/pepper/pepper_media_stream_audio_track_host.cc:157: DCHECK_EQ(number_of_frames, audio_params_.frames_per_buffer()); On 2014/07/30 00:22:05, Anand Mistry wrote: ...
6 years, 4 months ago (2014-07-30 23:09:22 UTC) #12
Anand Mistry (off Chromium)
Chris: Can you take a look at ppapi_messages.h https://codereview.chromium.org/414643003/diff/20001/content/renderer/pepper/pepper_media_stream_audio_track_host.cc File content/renderer/pepper/pepper_media_stream_audio_track_host.cc (right): https://codereview.chromium.org/414643003/diff/20001/content/renderer/pepper/pepper_media_stream_audio_track_host.cc#newcode157 content/renderer/pepper/pepper_media_stream_audio_track_host.cc:157: DCHECK_EQ(number_of_frames, ...
6 years, 4 months ago (2014-07-31 00:41:21 UTC) #13
Anand Mistry (off Chromium)
tsepez: Can you take a look at ppapi_messages.h?
6 years, 4 months ago (2014-07-31 00:57:57 UTC) #14
Tom Sepez
Messages LGTM
6 years, 4 months ago (2014-07-31 01:16:46 UTC) #15
Anand Mistry (off Chromium)
The CQ bit was checked by amistry@chromium.org
6 years, 4 months ago (2014-07-31 02:48:23 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/amistry@chromium.org/414643003/100001
6 years, 4 months ago (2014-07-31 02:50:10 UTC) #17
commit-bot: I haz the power
Change committed as 286774
6 years, 4 months ago (2014-07-31 12:54:18 UTC) #18
thembrown
I think the number of samples is not set correctly anymore. https://codereview.chromium.org/414643003/diff/100001/content/renderer/pepper/pepper_media_stream_audio_track_host.cc File content/renderer/pepper/pepper_media_stream_audio_track_host.cc (right): ...
6 years, 4 months ago (2014-08-15 15:01:23 UTC) #19
Anand Mistry (off Chromium)
6 years, 4 months ago (2014-08-18 01:15:15 UTC) #20
Message was sent while issue was closed.
https://codereview.chromium.org/414643003/diff/100001/content/renderer/pepper...
File content/renderer/pepper/pepper_media_stream_audio_track_host.cc (right):

https://codereview.chromium.org/414643003/diff/100001/content/renderer/pepper...
content/renderer/pepper/pepper_media_stream_audio_track_host.cc:217:
buffer->number_of_samples = buffer->data_size / bytes_per_frame;
On 2014/08/15 15:01:23, thembrown wrote:
> Shouldn't this read:
> buffer->number_of_samples = buffer->data_size * number_of_channels /
> bytes_per_frame;
> 
> instead? Now number of samples is set to the number of frames, while in the
old
> code it was set to number_of_frames * number_of_channels

Oops. I'll fix it right away.

Powered by Google App Engine
This is Rietveld 408576698