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

Issue 1610473002: MediaRecorder: wire the bitRate settings in Blink and content (2nd go) (Closed)

Created:
4 years, 11 months ago by mcasas
Modified:
4 years, 11 months ago
CC:
blink-reviews, blink-reviews-api_chromium.org, chromium-reviews, darin-cc_chromium.org, dglazkov+blink, eric.carlson_apple.com, feature-media-reviews_chromium.org, jam, mcasas+watch_chromium.org, mkwst+moarreviews-renderer_chromium.org, mlamouri+watch-content_chromium.org, mlamouri+watch-blink_chromium.org, philipj_slow, posciak+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

MediaRecorder: wire the bitRate settings in Blink and content (2nd go) (This is a refry of https://crrev.com/1566263002 with the bitrate allocation algorithm in Blink ISO Chrome). Original description: -------------------------------------- This CL updates MediaRecorderOptions to reflect the bitrate settings in the spec [1]. Those params are wired all the way down to {Video,Audio}TrackEncoder where they are used to configure libvpx and opus, resp. If param |bitsPerSecond| overrides the other two if specified and the spec leaves down to the UA to divide its value among video and audio: this CL allocates 90% to video and 10% to audio. Also added a DCHECK for opus #channels and sampling rate, which opus hardcode-limits in a pretty clumsy way (feast your eyes in [2]). -------------------------------------------------------------- Diffs with this previous CL: - Chrome gets just the consolidated audio and video bit rates. - The bit rate calculation micro algorithm is in MediaRecorder.cpp - Added a LayoutTest checking for throwing when the rates are too high. BUG=575301 [1] https://rawgit.com/w3c/mediacapture-record/master/MediaRecorder.html#MediaRecorderOptions [2] https://code.google.com/p/chromium/codesearch#chromium/src/third_party/opus/src/src/opus_encoder.c&sq=package:chromium&type=cs&l=169 BUG=575301 Committed: https://crrev.com/8408d85eedde8c47e73ed6aea331dfa28088c16d Cr-Commit-Position: refs/heads/master@{#370772}

Patch Set 1 #

Total comments: 18

Patch Set 2 : peter@s comments #

Total comments: 10

Patch Set 3 : comments addressed. Added TODO for unsigned->signed change #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+227 lines, -52 lines) Patch
M content/renderer/media/audio_track_recorder.h View 1 chunk +2 lines, -1 line 0 comments Download
M content/renderer/media/audio_track_recorder.cc View 1 7 chunks +32 lines, -13 lines 1 comment Download
M content/renderer/media/audio_track_recorder_unittest.cc View 1 chunk +2 lines, -1 line 0 comments Download
M content/renderer/media/media_recorder_handler.h View 2 chunks +7 lines, -1 line 0 comments Download
M content/renderer/media/media_recorder_handler.cc View 6 chunks +12 lines, -7 lines 0 comments Download
M content/renderer/media/media_recorder_handler_unittest.cc View 3 chunks +5 lines, -7 lines 0 comments Download
M content/renderer/media/video_track_recorder.h View 1 chunk +2 lines, -1 line 0 comments Download
M content/renderer/media/video_track_recorder.cc View 1 5 chunks +26 lines, -12 lines 0 comments Download
M content/renderer/media/video_track_recorder_unittest.cc View 1 chunk +3 lines, -3 lines 0 comments Download
A third_party/WebKit/LayoutTests/fast/mediarecorder/MediaRecorder-bitrates.html View 1 chunk +42 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp View 1 2 4 chunks +89 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/modules/mediarecorder/MediaRecorderOptions.idl View 1 2 1 chunk +4 lines, -1 line 0 comments Download
M third_party/WebKit/public/platform/WebMediaRecorderHandler.h View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 30 (17 generated)
mcasas
(branched off http://crrev.com/1566263002 PS#6 which was LGTM'd). esprehn@, peter@: Moved the bitrate calculation to Blink ...
4 years, 11 months ago (2016-01-20 17:38:58 UTC) #13
Peter Beverloo
https://codereview.chromium.org/1610473002/diff/130001/content/renderer/media/video_track_recorder.cc File content/renderer/media/video_track_recorder.cc (right): https://codereview.chromium.org/1610473002/diff/130001/content/renderer/media/video_track_recorder.cc#newcode115 content/renderer/media/video_track_recorder.cc:115: const int32_t bits_per_second_; nit: all other members have documentation ...
4 years, 11 months ago (2016-01-20 18:35:35 UTC) #14
mcasas
peter@ PTAL https://codereview.chromium.org/1610473002/diff/130001/content/renderer/media/video_track_recorder.cc File content/renderer/media/video_track_recorder.cc (right): https://codereview.chromium.org/1610473002/diff/130001/content/renderer/media/video_track_recorder.cc#newcode115 content/renderer/media/video_track_recorder.cc:115: const int32_t bits_per_second_; On 2016/01/20 18:35:35, Peter ...
4 years, 11 months ago (2016-01-20 21:13:22 UTC) #15
miu
lgtm % one thing: https://codereview.chromium.org/1610473002/diff/150001/third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp File third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp (right): https://codereview.chromium.org/1610473002/diff/150001/third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp#newcode55 third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp:55: const unsigned long kInt32MaxValueAsULong = ...
4 years, 11 months ago (2016-01-21 00:51:05 UTC) #16
esprehn
lgtm https://codereview.chromium.org/1610473002/diff/150001/third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp File third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp (right): https://codereview.chromium.org/1610473002/diff/150001/third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp#newcode51 third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp:51: // This method throws NotSupportedError. yay comments, thanks ...
4 years, 11 months ago (2016-01-21 04:00:47 UTC) #17
esprehn
Please fix feedback for unsigned long, and passing the stream before landing.
4 years, 11 months ago (2016-01-21 04:01:06 UTC) #18
Peter Beverloo
lgtm https://codereview.chromium.org/1610473002/diff/130001/third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp File third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp (right): https://codereview.chromium.org/1610473002/diff/130001/third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp#newcode56 third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp:56: On 2016/01/20 21:13:22, mcasas wrote: > On 2016/01/20 ...
4 years, 11 months ago (2016-01-21 11:04:36 UTC) #19
mcasas
https://codereview.chromium.org/1610473002/diff/130001/third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp File third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp (right): https://codereview.chromium.org/1610473002/diff/130001/third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp#newcode56 third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp:56: On 2016/01/21 11:04:36, Peter Beverloo wrote: > On 2016/01/20 ...
4 years, 11 months ago (2016-01-21 18:42:46 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1610473002/170001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1610473002/170001
4 years, 11 months ago (2016-01-21 18:43:38 UTC) #23
commit-bot: I haz the power
Committed patchset #3 (id:170001)
4 years, 11 months ago (2016-01-21 20:31:00 UTC) #25
commit-bot: I haz the power
Patchset 3 (id:??) landed as https://crrev.com/8408d85eedde8c47e73ed6aea331dfa28088c16d Cr-Commit-Position: refs/heads/master@{#370772}
4 years, 11 months ago (2016-01-21 20:32:15 UTC) #27
brucedawson
https://codereview.chromium.org/1610473002/diff/170001/content/renderer/media/audio_track_recorder.cc File content/renderer/media/audio_track_recorder.cc (right): https://codereview.chromium.org/1610473002/diff/170001/content/renderer/media/audio_track_recorder.cc#newcode150 content/renderer/media/audio_track_recorder.cc:150: DCHECK((params.sample_rate() != 48000) || (params.sample_rate() != 24000) || This ...
4 years, 11 months ago (2016-01-26 18:28:47 UTC) #29
mcasas
4 years, 11 months ago (2016-01-26 18:45:01 UTC) #30
Message was sent while issue was closed.
On 2016/01/26 18:28:47, brucedawson wrote:
>
https://codereview.chromium.org/1610473002/diff/170001/content/renderer/media...
> File content/renderer/media/audio_track_recorder.cc (right):
> 
>
https://codereview.chromium.org/1610473002/diff/170001/content/renderer/media...
> content/renderer/media/audio_track_recorder.cc:150:
DCHECK((params.sample_rate()
> != 48000) || (params.sample_rate() != 24000) ||
> This DCHECK is accidentally tautological. There are no values of sample_rate()
> that could cause it to trigger.
> 
> The "!=" operators should all be changed to "==".
> 
> This was found by the VC++ /analyze builder which reported:
> audio_track_recorder.cc(150) : warning C6289: Incorrect operator:  mutual
> exclusion over || is always a non-zero constant.  Did you intend to use &&
> instead?
> 
> Note that its suggested fix is incorrect, but it is correct that there is a
bug.
> 
> Note also that the /analyze builder does *not* automatically report these
> warnings due to the very high false positive rate. I look at the new warnings
a
> few times a week and forward them. So, there is no fyi bot whose output you
> missed.

Thanks! This code is being removed as part of
https://codereview.chromium.org/1579693006/
(under review).

Powered by Google App Engine
This is Rietveld 408576698