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

Issue 605803004: [cast] Allow audio encoder implementations to specify the frame length. (Closed)

Created:
6 years, 2 months ago by jfroy
Modified:
6 years, 2 months ago
Reviewers:
hclam, miu
CC:
chromium-reviews, hclam+watch_chromium.org, imcheng+watch_chromium.org, hguihot+watch_chromium.org, jasonroberts+watch_google.com, avayvod+watch_chromium.org, pwestin+watch_google.com, feature-media-reviews_chromium.org, miu+watch_chromium.org, hubbe+watch_chromium.org, mikhal+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

[cast] Allow audio encoder implementations to specify the frame length. The previous implementation hardcoded 100 audio frames per second, which yielded 10ms frames. In this context, frame is understood as a grouping of audio samples (across all channels) sent to the receiver in some format (raw PCM or encoded/compressed) with an associated RTP timestamp. The implementation accumulates samples submitted by the sender in a buffer until it has |frame duration| samples, after which it encodes the samples and sends the data. 10ms is conveniently one of the supported Opus frame lengths. It obviously also worka for raw PCM. However, other codecs may have different frame lengths. In particular, AAC uses 1024 or 960 samples frames, regardless of the sampling rate. This patch changes the audio encoder to allow implementations to specify the number of samples per Cast audio frame. Existing implementations specify |sampling_rate / 100|, which yields the same 10ms length regardless of sampling rate. An AAC implementation could specify 1024 or 960 instead. BUG=417861 Committed: https://crrev.com/488b1dc973220b5f529fa95955c14961502c0269 Cr-Commit-Position: refs/heads/master@{#301011}

Patch Set 1 #

Total comments: 10

Patch Set 2 : Derive the max_frame_rate of the audio sender from the encoder and address review feedback. #

Patch Set 3 : Query the frame duration and samples per frame from the encoder in the audio encoder unit tests. #

Total comments: 1

Patch Set 4 : Remove '(or packet)' from comment and rebase. #

Patch Set 5 : Move inline namespace back inside media::cast to better match original file. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+69 lines, -45 lines) Patch
M media/cast/sender/audio_encoder.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M media/cast/sender/audio_encoder.cc View 1 2 3 4 11 chunks +43 lines, -20 lines 0 comments Download
M media/cast/sender/audio_encoder_unittest.cc View 1 2 5 chunks +9 lines, -6 lines 0 comments Download
M media/cast/sender/audio_sender.cc View 1 2 chunks +16 lines, -19 lines 0 comments Download

Messages

Total messages: 11 (2 generated)
jfroy
6 years, 2 months ago (2014-09-25 21:29:41 UTC) #2
miu
Nice. This helps us get rid of the rigid 10ms-per-frame requirement that we're finding may ...
6 years, 2 months ago (2014-09-29 19:13:25 UTC) #3
jfroy
I'll make the necessary changes to the sender code to remove the redundant constant. https://codereview.chromium.org/605803004/diff/1/media/cast/sender/audio_encoder.cc ...
6 years, 2 months ago (2014-10-17 21:22:43 UTC) #4
jfroy
The patch I just submitted addresses your feedback and passes all unit tests. I decided ...
6 years, 2 months ago (2014-10-17 23:05:26 UTC) #5
jfroy
I've just submitted another patch set which modifies the unit tests to query the frame ...
6 years, 2 months ago (2014-10-18 01:56:21 UTC) #6
miu
lgtm % one nit: https://codereview.chromium.org/605803004/diff/40001/media/cast/sender/audio_encoder.cc File media/cast/sender/audio_encoder.cc (right): https://codereview.chromium.org/605803004/diff/40001/media/cast/sender/audio_encoder.cc#newcode166 media/cast/sender/audio_encoder.cc:166: // The duration of one ...
6 years, 2 months ago (2014-10-22 04:22:49 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/605803004/80001
6 years, 2 months ago (2014-10-23 23:52:30 UTC) #9
commit-bot: I haz the power
Committed patchset #5 (id:80001)
6 years, 2 months ago (2014-10-24 01:02:55 UTC) #10
commit-bot: I haz the power
6 years, 2 months ago (2014-10-24 01:03:31 UTC) #11
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/488b1dc973220b5f529fa95955c14961502c0269
Cr-Commit-Position: refs/heads/master@{#301011}

Powered by Google App Engine
This is Rietveld 408576698