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

Issue 11416367: Add Opus decode wrapper to media. (Closed)

Created:
8 years ago by Tom Finegan
Modified:
8 years ago
CC:
chromium-reviews, feature-media-reviews_chromium.org, darin-cc_chromium.org
Visibility:
Public.

Description

Add wrapper class to media for support of Opus audio, and add a command line flag to enable the support. This initial version of the wrapper provides support for decoding Opus audio in WebM container files, and is disabled by default. New flag added: --enable-opus-playback BUG=166094 TEST=Opus audio in WebM containers plays back in <video> elements when --enable-opus-playback is specified on the command line. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=173663

Patch Set 1 #

Total comments: 16

Patch Set 2 : Address comments. #

Patch Set 3 : Move opus support behind a flag, and add canPlayType support. #

Total comments: 50

Patch Set 4 : Rebased to stay synced with 11468018 (libvpx wrapper CL). Sorry for the noise! #

Total comments: 2

Patch Set 5 : Address comments. #

Total comments: 15

Patch Set 6 : Address comments. #

Total comments: 19

Patch Set 7 : Rebased (changed machines) Address most comments. Added TODO for Opus buffering question. #

Total comments: 33

Patch Set 8 : Address most comments and remove media source stuff. #

Total comments: 4

Patch Set 9 : Revert mime_util changes. #

Total comments: 13

Patch Set 10 : Address remaining nits from media reviewers. #

Total comments: 2

Patch Set 11 : Address Dale's comment. #

Patch Set 12 : Make Opus sample size handling more compatible with pending ffmpeg_common changes. #

Total comments: 2

Patch Set 13 : Address comment. #

Patch Set 14 : Rebased. #

Patch Set 15 : Final pre-CQ rebase. #

Patch Set 16 : Rebase on updates to webkit/media/filter_helpers.cc #

Unified diffs Side-by-side diffs Delta from patch set Stats (+629 lines, -26 lines) Patch
M chrome/app/generated_resources.grd View 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/browser/about_flags.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +7 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_process_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1 line, -0 lines 0 comments Download
M media/DEPS View 1 chunk +1 line, -0 lines 0 comments Download
M media/base/audio_decoder_config.h View 1 2 3 4 5 6 7 1 chunk +2 lines, -3 lines 0 comments Download
M media/base/media_switches.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +2 lines, -0 lines 0 comments Download
M media/base/media_switches.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +3 lines, -0 lines 0 comments Download
M media/ffmpeg/ffmpeg_common.cc View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +15 lines, -1 line 0 comments Download
A + media/filters/opus_audio_decoder.h View 1 2 3 4 5 6 7 8 9 5 chunks +17 lines, -22 lines 0 comments Download
A media/filters/opus_audio_decoder.cc View 1 2 3 4 5 6 7 8 9 1 chunk +561 lines, -0 lines 0 comments Download
M media/media.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +3 lines, -0 lines 0 comments Download
M webkit/media/filter_helpers.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +11 lines, -0 lines 0 comments Download

Messages

Total messages: 36 (0 generated)
Tom Finegan
First pass/works on my machine. Note: There's a hack in ffmpeg_common to get around (I ...
8 years ago (2012-12-12 09:28:33 UTC) #1
xhwang
+dalecurtis as he is more familiar with audio decoders than me. first round of comments. ...
8 years ago (2012-12-12 22:16:09 UTC) #2
Tom Finegan
Addressed the first round of comments, and: - added command line flag - added canPlayType ...
8 years ago (2012-12-13 06:18:14 UTC) #3
xhwang
more comments https://codereview.chromium.org/11416367/diff/7001/chrome/browser/about_flags.cc File chrome/browser/about_flags.cc (right): https://codereview.chromium.org/11416367/diff/7001/chrome/browser/about_flags.cc#newcode639 chrome/browser/about_flags.cc:639: "enable-vp9-opus-playback", does it make sense to have ...
8 years ago (2012-12-13 08:33:13 UTC) #4
fgalligan1
https://codereview.chromium.org/11416367/diff/7001/chrome/browser/about_flags.cc File chrome/browser/about_flags.cc (right): https://codereview.chromium.org/11416367/diff/7001/chrome/browser/about_flags.cc#newcode639 chrome/browser/about_flags.cc:639: "enable-vp9-opus-playback", On 2012/12/13 08:33:13, xhwang wrote: > does it ...
8 years ago (2012-12-13 22:30:14 UTC) #5
Tom Finegan
I think I got everything... apologies in advance if I missed a comment or two. ...
8 years ago (2012-12-13 23:20:00 UTC) #6
xhwang
Thanks for the update. A few more comments. https://codereview.chromium.org/11416367/diff/7001/chrome/browser/about_flags.cc File chrome/browser/about_flags.cc (right): https://codereview.chromium.org/11416367/diff/7001/chrome/browser/about_flags.cc#newcode639 chrome/browser/about_flags.cc:639: "enable-vp9-opus-playback", ...
8 years ago (2012-12-14 01:19:20 UTC) #7
fgalligan1
https://codereview.chromium.org/11416367/diff/6008/media/filters/opus_audio_decoder.cc File media/filters/opus_audio_decoder.cc (right): https://codereview.chromium.org/11416367/diff/6008/media/filters/opus_audio_decoder.cc#newcode51 media/filters/opus_audio_decoder.cc:51: static const int kBytesPerChannel = kRequiredSampleSize / 8; On ...
8 years ago (2012-12-14 02:39:27 UTC) #8
Tom Finegan
PTAL, thanks! https://codereview.chromium.org/11416367/diff/6008/media/filters/opus_audio_decoder.cc File media/filters/opus_audio_decoder.cc (right): https://codereview.chromium.org/11416367/diff/6008/media/filters/opus_audio_decoder.cc#newcode51 media/filters/opus_audio_decoder.cc:51: static const int kBytesPerChannel = kRequiredSampleSize / ...
8 years ago (2012-12-14 03:09:21 UTC) #9
xhwang
mostly looking good. I don't quite like RunReadCBOrReadFromDemuxerStream() but I am not sure what the ...
8 years ago (2012-12-14 08:41:48 UTC) #10
Tom Finegan
PTAL, thanks! https://codereview.chromium.org/11416367/diff/7003/media/filters/opus_audio_decoder.cc File media/filters/opus_audio_decoder.cc (right): https://codereview.chromium.org/11416367/diff/7003/media/filters/opus_audio_decoder.cc#newcode160 media/filters/opus_audio_decoder.cc:160: uint8 stream_map[kMaxVorbisChannels]; On 2012/12/14 08:41:48, xhwang wrote: ...
8 years ago (2012-12-14 20:21:34 UTC) #11
scherkus (not reviewing)
looking pretty good! mostly some code organization / high level comments https://codereview.chromium.org/11416367/diff/18002/media/base/audio_decoder_config.h File media/base/audio_decoder_config.h (right): ...
8 years ago (2012-12-14 21:13:34 UTC) #12
Tom Finegan
Most comments addressed with the following exceptions" - backed out the trampoline related comments and ...
8 years ago (2012-12-14 23:19:52 UTC) #13
Tom Finegan
Hopefully the media stuff is now ready, PTAL. Now to find reviewers for the stuff ...
8 years ago (2012-12-14 23:31:56 UTC) #14
xhwang
lgtm to me You'll also need scherkus's review. Be sure to add unit tests soon! ...
8 years ago (2012-12-14 23:35:26 UTC) #15
Tom Finegan
+cpu cpu, Please do an OWNERS review of generated_resources.grd. I've added strings for support of ...
8 years ago (2012-12-14 23:36:05 UTC) #16
scherkus (not reviewing)
few more nits https://codereview.chromium.org/11416367/diff/6014/media/base/media_switches.cc File media/base/media_switches.cc (right): https://codereview.chromium.org/11416367/diff/6014/media/base/media_switches.cc#newcode64 media/base/media_switches.cc:64: // Ensable VP9 and Opus playback ...
8 years ago (2012-12-14 23:39:28 UTC) #17
Tom Finegan
Nits addressed. https://codereview.chromium.org/11416367/diff/7003/media/filters/opus_audio_decoder.cc File media/filters/opus_audio_decoder.cc (right): https://codereview.chromium.org/11416367/diff/7003/media/filters/opus_audio_decoder.cc#newcode160 media/filters/opus_audio_decoder.cc:160: uint8 stream_map[kMaxVorbisChannels]; On 2012/12/14 23:35:27, xhwang wrote: ...
8 years ago (2012-12-14 23:58:39 UTC) #18
scherkus (not reviewing)
lgtm
8 years ago (2012-12-15 00:00:47 UTC) #19
Tom Finegan
Ben: Please do OWNERS reviews of: - chrome/browser/about_flags.cc - content/browser/renderer_host/render_process_host_impl.cc These are very small changes ...
8 years ago (2012-12-15 00:06:46 UTC) #20
Tom Finegan
cpu, Please do an OWNERS review of generated_resources.grd. I've added strings for support of a ...
8 years ago (2012-12-15 00:07:29 UTC) #21
DaleCurtis
I haven't looked through the decoder, but can you add at least a quick PipelineIntegration ...
8 years ago (2012-12-15 00:13:47 UTC) #22
Tom Finegan
Dale, PTAL: > I haven't looked through the decoder, but can you add at least ...
8 years ago (2012-12-15 00:33:38 UTC) #23
Tom Finegan
Per offline discussion with Dale I tweaked the way sample size is handled in ffmpeg_common ...
8 years ago (2012-12-15 00:59:02 UTC) #24
DaleCurtis
As discussed offline test is okay for next week. https://codereview.chromium.org/11416367/diff/19008/media/ffmpeg/ffmpeg_common.cc File media/ffmpeg/ffmpeg_common.cc (right): https://codereview.chromium.org/11416367/diff/19008/media/ffmpeg/ffmpeg_common.cc#newcode233 media/ffmpeg/ffmpeg_common.cc:233: ...
8 years ago (2012-12-15 01:13:22 UTC) #25
Tom Finegan
https://codereview.chromium.org/11416367/diff/19008/media/ffmpeg/ffmpeg_common.cc File media/ffmpeg/ffmpeg_common.cc (right): https://codereview.chromium.org/11416367/diff/19008/media/ffmpeg/ffmpeg_common.cc#newcode233 media/ffmpeg/ffmpeg_common.cc:233: AVSampleFormat sample_format = codec_context->sample_fmt; On 2012/12/15 01:13:22, DaleCurtis wrote: ...
8 years ago (2012-12-15 01:24:33 UTC) #26
DaleCurtis
lgtm
8 years ago (2012-12-15 01:27:41 UTC) #27
Tom Finegan
+brettw for OWNERS review of command line flag changes. PTAL Thanks!
8 years ago (2012-12-17 21:16:47 UTC) #28
brettw
owners lgtm rubberstamp
8 years ago (2012-12-17 21:25:28 UTC) #29
Tom Finegan
Made the description more informative.
8 years ago (2012-12-17 21:28:15 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/tomfinegan@chromium.org/11416367/36002
8 years ago (2012-12-17 21:58:21 UTC) #31
commit-bot: I haz the power
Retried try job too often on win_rel for step(s) browser_tests
8 years ago (2012-12-18 00:21:57 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/tomfinegan@chromium.org/11416367/11050
8 years ago (2012-12-18 00:22:07 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/tomfinegan@chromium.org/11416367/11050
8 years ago (2012-12-18 00:58:12 UTC) #34
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/tomfinegan@chromium.org/11416367/11050
8 years ago (2012-12-18 01:49:44 UTC) #35
commit-bot: I haz the power
8 years ago (2012-12-18 06:55:16 UTC) #36
Failed to apply patch for webkit/media/filter_helpers.cc:
While running patch -p1 --forward --force --no-backup-if-mismatch;
  patching file webkit/media/filter_helpers.cc
  Hunk #1 succeeded at 5 with fuzz 2.
  Hunk #2 FAILED at 30.
  1 out of 2 hunks FAILED -- saving rejects to file
webkit/media/filter_helpers.cc.rej

Patch:       webkit/media/filter_helpers.cc
Index: webkit/media/filter_helpers.cc
diff --git a/webkit/media/filter_helpers.cc b/webkit/media/filter_helpers.cc
index
362810c10ff0559c82be9307a1c36d5b7d4dd5b8..b52adc07358eecea5c9765d3ff49b2513d1b2f71
100644
--- a/webkit/media/filter_helpers.cc
+++ b/webkit/media/filter_helpers.cc
@@ -5,12 +5,15 @@
 #include "webkit/media/filter_helpers.h"
 
 #include "base/bind.h"
+#include "base/command_line.h"
 #include "media/base/filter_collection.h"
+#include "media/base/media_switches.h"
 #include "media/filters/chunk_demuxer.h"
 #include "media/filters/dummy_demuxer.h"
 #include "media/filters/ffmpeg_audio_decoder.h"
 #include "media/filters/ffmpeg_demuxer.h"
 #include "media/filters/ffmpeg_video_decoder.h"
+#include "media/filters/opus_audio_decoder.h"
 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h"
 #include "webkit/media/crypto/proxy_decryptor.h"
 #include "webkit/media/media_stream_client.h"
@@ -27,10 +30,18 @@ static void AddDefaultDecodersToCollection(
     const scoped_refptr<base::MessageLoopProxy>& message_loop,
     media::FilterCollection* filter_collection,
     ProxyDecryptor* proxy_decryptor) {
+
   scoped_refptr<media::FFmpegAudioDecoder> ffmpeg_audio_decoder =
       new media::FFmpegAudioDecoder(message_loop);
   filter_collection->GetAudioDecoders()->push_back(ffmpeg_audio_decoder);
 
+  const CommandLine* cmd_line = CommandLine::ForCurrentProcess();
+  if (cmd_line->HasSwitch(switches::kEnableOpusPlayback)) {
+    scoped_refptr<media::OpusAudioDecoder> opus_audio_decoder =
+        new media::OpusAudioDecoder(message_loop);
+    filter_collection->GetAudioDecoders()->push_back(opus_audio_decoder);
+  }
+
   scoped_refptr<media::FFmpegVideoDecoder> ffmpeg_video_decoder =
       new media::FFmpegVideoDecoder(message_loop, proxy_decryptor);
   filter_collection->GetVideoDecoders()->push_back(ffmpeg_video_decoder);

Powered by Google App Engine
This is Rietveld 408576698