chromium/src/media.git
4 hours agoMake content_shell link in the GN build. master
brettw@chromium.org [Mon, 28 Jul 2014 19:47:04 +0000 (19:47 +0000)]
Make content_shell link in the GN build.

It doesn't run yet. This disables WebRTC since that's not done yet.

Libvpx isn't done either. This patch exports the disable flag for this from media to dependent targets like the GYP build does. It adds one extra check for this flag in Pepper. I assume everybody that compiles without libvpx also disables plugins so this has never come up before.

Disable some warnings in Mesa.

The resulting binary does not yet run.

R=jamesr@chromium.org

Review URL: https://codereview.chromium.org/419913003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@285962 0039d316-1c4b-4281-b951-d872f2087c98

21 hours agoRevert 285479 "Make DataSource::Stop() synchronous."
inferno@chromium.org [Mon, 28 Jul 2014 02:50:44 +0000 (02:50 +0000)]
Revert 285479 "Make DataSource::Stop() synchronous."

Causing UAFs on ClusterFuzz

BUG=397656

> Make DataSource::Stop() synchronous.
>
> In a lot of filters in media code, Stop() has been folded into the dtor.
> This model doesn't apply directly to DataSource because DataSource::Stop()
> is called by the FFmpegDemuxer, but the DataSource is owned by
> WebMediaPlayerImpl.
>
> TBR=gbillock@chromium.org
> BUG=349211
> TEST=All existing tests pass.
>
> Review URL: https://codereview.chromium.org/413243002

TBR=xhwang@chromium.org

Review URL: https://codereview.chromium.org/421843004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@285858 0039d316-1c4b-4281-b951-d872f2087c98

37 hours agoclang/win: Fix a few warnings.
thakis@chromium.org [Sun, 27 Jul 2014 11:30:45 +0000 (11:30 +0000)]
clang/win: Fix a few warnings.

__THROW is not some magical thing, don't pretend it is. Don't add it to
extern "C" functions. Replace it with "throw ()" on the functions where it's
correct since it was defined to nothing on windows (the only place where this
file is used).

Fix an inconsequential enum constant mix-up in media (both enum constants
evaluated to the same value, and the enums had the same size, so it shouldn't
make a difference in practice, but the old code was comparing enum variables
with enum constants from a different enum).

BUG=82385
TBR=dalecurtis

Review URL: https://codereview.chromium.org/419323002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@285838 0039d316-1c4b-4281-b951-d872f2087c98

2 days agoFix two uninitialized variables in media.
wfh@chromium.org [Sat, 26 Jul 2014 01:33:23 +0000 (01:33 +0000)]
Fix two uninitialized variables in media.

BUG=397762
TEST=compile with no errors
R=dalecurtis@chromium.org

Review URL: https://codereview.chromium.org/413393006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@285741 0039d316-1c4b-4281-b951-d872f2087c98

3 days agoUpdate browser tests to support upcoming EME parameter type changes.
jrummell@chromium.org [Fri, 25 Jul 2014 20:50:14 +0000 (20:50 +0000)]
Update browser tests to support upcoming EME parameter type changes.

The EME spec is now using ArrayBuffer/ArrayBufferView instead of
Uint8Array as the type for data buffers. Calls from JavaScript
aren't affected as Uint8Array is an ArrayBufferView. However,
"message" events now pass back an ArrayBuffer and the tests expect
Uint8Array. This converts the returned message to a Uint8Array
to keep the code working.

This change works with and without the upcoming changes. If
Uint8Array is passed back, then the result is that another copy of
the view is made.

BUG=358271
TEST=encrypted media browser_tests pass

Review URL: https://codereview.chromium.org/405733003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@285672 0039d316-1c4b-4281-b951-d872f2087c98

3 days agoUpdate VP9 444 tests
johannkoenig@chromium.org [Fri, 25 Jul 2014 17:26:05 +0000 (17:26 +0000)]
Update VP9 444 tests

Files re-encoded with the updated bitstream:
$ ffmpeg -i blackwhite.png -pix_fmt yuv444p blackwhite.y4m
$ vpxenc --codec=vp9 --profile=1 --experimental-bitstream -o
blackwhite_yuv444p.webm blackwhite.y4m
$ ffmpeg -i bear-1280x720.mp4 -vf crop=960:720:0:160,scale=320:240
-pix_fmt yuv444p bear-320x240-P444.y4m
$ vpxenc --codec=vp9 --profile=1 --experimental-bitstream -o
bear-320x240-P444.webm bear-320x240-P444.y4m

BUG=392309
R=scherkus@chromium.org

Review URL: https://codereview.chromium.org/396543003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@285613 0039d316-1c4b-4281-b951-d872f2087c98

3 days agoFix force-qtkit flag on dev channel
vrk@chromium.org [Fri, 25 Jul 2014 05:34:03 +0000 (05:34 +0000)]
Fix force-qtkit flag on dev channel

This changes the logic in the AVFoundation support check to always respect
the force-qtkit flag.

Note: This CL was only tested on OS X 10.9, and should be verified on 10.6.

BUG=396767,396764

Review URL: https://codereview.chromium.org/411983002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@285486 0039d316-1c4b-4281-b951-d872f2087c98

3 days agoMake DataSource::Stop() synchronous.
xhwang@chromium.org [Fri, 25 Jul 2014 04:36:51 +0000 (04:36 +0000)]
Make DataSource::Stop() synchronous.

In a lot of filters in media code, Stop() has been folded into the dtor.
This model doesn't apply directly to DataSource because DataSource::Stop()
is called by the FFmpegDemuxer, but the DataSource is owned by
WebMediaPlayerImpl.

TBR=gbillock@chromium.org
BUG=349211
TEST=All existing tests pass.

Review URL: https://codereview.chromium.org/413243002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@285479 0039d316-1c4b-4281-b951-d872f2087c98

3 days agoFix various uninitialized member variables in media code.
xhwang@chromium.org [Fri, 25 Jul 2014 00:35:43 +0000 (00:35 +0000)]
Fix various uninitialized member variables in media code.

Review URL: https://codereview.chromium.org/415273002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@285438 0039d316-1c4b-4281-b951-d872f2087c98

4 days agoGN foreach should mark the list identifier as used.
brettw@chromium.org [Thu, 24 Jul 2014 21:01:50 +0000 (21:01 +0000)]
GN foreach should mark the list identifier as used.

Previously an identifier used as the list in a feoreach statement would not count as "using" the identifier, which would give unused variable errors. Added a unit test.

Checks for unused identifiers in component(). Previously these were not checked. This checking turned up a misspelling in the cc build. Added a unit test.

Fixes for the ozone media build (turned up when testing).

R=dpranke@chromium.org

Review URL: https://codereview.chromium.org/420443003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@285367 0039d316-1c4b-4281-b951-d872f2087c98

4 days agoVideoCaptureFormat: add method to print out pixel format as string
lionel.g.landwerlin@intel.com [Thu, 24 Jul 2014 12:46:40 +0000 (12:46 +0000)]
VideoCaptureFormat: add method to print out pixel format as string

BUG=none

TEST=run desktopCapture example (verbose level 3) to see the pixel format

Review URL: https://codereview.chromium.org/416553002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@285215 0039d316-1c4b-4281-b951-d872f2087c98

4 days agoFold TextRenderer::Stop() into the dtor.
xhwang@chromium.org [Thu, 24 Jul 2014 12:44:17 +0000 (12:44 +0000)]
Fold TextRenderer::Stop() into the dtor.

BUG=349211
TEST=All existing tests pass.

Review URL: https://codereview.chromium.org/416713002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@285213 0039d316-1c4b-4281-b951-d872f2087c98

4 days agomedia: Remove upper limit on number of frames in vpx decoder
vigneshv@chromium.org [Thu, 24 Jul 2014 11:07:31 +0000 (11:07 +0000)]
media: Remove upper limit on number of frames in vpx decoder

In some extreme cases, we seem to be hitting the number of frames limit
on vpx video decoder. In those cases, there's a delay before chromium
releases the video frame. ffmpeg video decoder does not have any upper
limits on the number of video frames. So removing the limit on vpx video
decoder as well.

BUG=395431
TEST=media_unittests

Review URL: https://codereview.chromium.org/414523002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@285184 0039d316-1c4b-4281-b951-d872f2087c98

5 days agoAndroid VideoCapture: catch exception on Android.Camera.SetParameters.
mcasas@chromium.org [Wed, 23 Jul 2014 22:03:52 +0000 (22:03 +0000)]
Android VideoCapture: catch exception on Android.Camera.SetParameters.

See [1].

[1] http://developer.android.com/reference/android/hardware/Camera.html#setParameters(android.hardware.Camera.Parameters)

BUG=b/16370110

Review URL: https://codereview.chromium.org/400933002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@285050 0039d316-1c4b-4281-b951-d872f2087c98

5 days agomedia/win: Make TypeEnumerator FINAL.
thakis@chromium.org [Wed, 23 Jul 2014 17:46:30 +0000 (17:46 +0000)]
media/win: Make TypeEnumerator FINAL.

Fixes this warning:

In file included from ..\..\media/video/capture/win/pin_base_win.h:15:
..\..\base/memory/ref_counted.h(131,7) :  warning(clang): delete called on 'const media::TypeEnumerator' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
      delete static_cast<const T*>(this);
      ^
..\..\media\video\capture\win\pin_base_win.cc(40,39) :  note(clang): in instantiation of member function 'base::RefCounted<media::TypeEnumerator>::Release' requested here
    base::RefCounted<TypeEnumerator>::Release();
                                      ^
1 warning generated.

BUG=82385
NOTRY=true

Review URL: https://codereview.chromium.org/410833002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@284982 0039d316-1c4b-4281-b951-d872f2087c98

5 days agoGN: Add //ui/base/ime, fix up printing on mac
jamesr@chromium.org [Wed, 23 Jul 2014 17:45:47 +0000 (17:45 +0000)]
GN: Add //ui/base/ime, fix up printing on mac

This adds the //ui/base/ime target to the GN build, which is used
everywhere except for ios. In the gyp build this isn't a real target,
it's a set of properties that are included into the ui_base target which
is the best you can do in GYP since you can't link a static library into
a component without dropping some symbols. In GN, we can define this as
a source_set with its own dependencies and settings.

This also fixes up some miscellaneous mac issues.

R=brettw@chromium.org,ben@chromium.org

Review URL: https://codereview.chromium.org/389083002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@284981 0039d316-1c4b-4281-b951-d872f2087c98

5 days agoVideoRenderer: Fires all pending callbacks in dtor.
xhwang@chromium.org [Wed, 23 Jul 2014 09:52:20 +0000 (09:52 +0000)]
VideoRenderer: Fires all pending callbacks in dtor.

This make VideoRenderer consistent with the rest of the media pipeline.

BUG=349211
TEST=All existing tests pass.

Review URL: https://codereview.chromium.org/414583002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@284898 0039d316-1c4b-4281-b951-d872f2087c98

5 days agoDon't check reserved bits when parsing AVCDecoderConfigurationRecords.
sandersd@chromium.org [Wed, 23 Jul 2014 06:45:48 +0000 (06:45 +0000)]
Don't check reserved bits when parsing AVCDecoderConfigurationRecords.

This allows some videos with incorrectly set reserved bits to play.

BUG=393304

Review URL: https://codereview.chromium.org/412693002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@284869 0039d316-1c4b-4281-b951-d872f2087c98

5 days agoFold VideoRenderer::Stop() into the dtor.
xhwang@chromium.org [Wed, 23 Jul 2014 01:49:15 +0000 (01:49 +0000)]
Fold VideoRenderer::Stop() into the dtor.

BUG=349211
TEST=All existing tests pass.

Review URL: https://codereview.chromium.org/409813003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@284830 0039d316-1c4b-4281-b951-d872f2087c98

6 days agoHave media content and chrome browser tests load data from media/test/data
shadi@chromium.org [Tue, 22 Jul 2014 23:33:07 +0000 (23:33 +0000)]
Have media content and chrome browser tests load data from media/test/data

Update remaining encrypted media browser tests to use new player app.

This is similar to r282795 + fix to GN builds. The fix is in
media/BUILD.gn file.

BUG=379314

Review URL: https://codereview.chromium.org/408993002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@284803 0039d316-1c4b-4281-b951-d872f2087c98

6 days agoRemove muted_ and playback_rate_ from media::AudioRendererAlgorithm.
scherkus@chromium.org [Tue, 22 Jul 2014 23:27:40 +0000 (23:27 +0000)]
Remove muted_ and playback_rate_ from media::AudioRendererAlgorithm.

We don't need to hold onto the state as playback rate is only used when
calling FillBuffer().

BUG=370634

Review URL: https://codereview.chromium.org/411683002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@284802 0039d316-1c4b-4281-b951-d872f2087c98

6 days agoCleanup test_support target names.
tfarina@chromium.org [Tue, 22 Jul 2014 23:26:48 +0000 (23:26 +0000)]
Cleanup test_support target names.

In GN it is redundat to include the parent directory name, as in
ui/gfx:gfx_test_support. Instead we can write it as ui/gfx:test_support
which is shorter and nicer to read.

Targets found with the following command line:
$ for f in $(g ls-files | grep BUILD); do grep _test_support $f; echo
$f; done

BUG=None
TEST=None
R=brettw@chromium.org
TBR=darin@chromium.org

Review URL: https://codereview.chromium.org/409493002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@284800 0039d316-1c4b-4281-b951-d872f2087c98

6 days agoCast: Remove an incorrect assert
hclam@chromium.org [Tue, 22 Jul 2014 18:37:04 +0000 (18:37 +0000)]
Cast: Remove an incorrect assert

I'm seeing asserts coming from PacedSender. The assert is not correct
and should be removed.

NOTRY=true
TBR=miu
BUG=none

Review URL: https://codereview.chromium.org/409943004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@284739 0039d316-1c4b-4281-b951-d872f2087c98

6 days agoFold AudioRenderer::Stop() into the dtor.
xhwang@chromium.org [Tue, 22 Jul 2014 18:26:59 +0000 (18:26 +0000)]
Fold AudioRenderer::Stop() into the dtor.

BUG=349211
TEST=Existing tests pass.

Review URL: https://codereview.chromium.org/407583002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@284734 0039d316-1c4b-4281-b951-d872f2087c98

6 days agoGN Windows build fixes
brettw@chromium.org [Tue, 22 Jul 2014 16:35:26 +0000 (16:35 +0000)]
GN Windows build fixes

Reland of https://codereview.chromium.org/404603002/ but without the problematic extensions.gypi changes.

R=agl@chromium.org, dalecurtis@chromium.org

Review URL: https://codereview.chromium.org/400233002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@284703 0039d316-1c4b-4281-b951-d872f2087c98

6 days agoRevert of Clean up. Experimental user avatars removed. (https://codereview.chromium...
johnme@chromium.org [Tue, 22 Jul 2014 14:44:22 +0000 (14:44 +0000)]
Revert of Clean up. Experimental user avatars removed. (https://codereview.chromium.org/395133002/)

Reason for revert:
This broke build:
http://build.chromium.org/p/chromium.webkit/builders/Linux%20ChromiumOS%20Tests%20%28dbg%29%282%29/builds/419

With error:
/mnt/data/b/build/slave/Linux_ChromiumOS_Tests__dbg__2_/build/src/out/Debug/app_shell_browsertests: symbol lookup error: /mnt/data/b/build/slave/Linux_ChromiumOS_Tests__dbg__2_/build/src/out/Debug/lib/libmedia.so: undefined symbol: Ebml_Serialize

Original issue's description:
> Clean up. Experimental user avatars removed.
>
> BUG=387738
>
> Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=284666

TBR=scherkus@chromium.org,nkostylev@chromium.org,merkulova@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=387738

Review URL: https://codereview.chromium.org/411523005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@284676 0039d316-1c4b-4281-b951-d872f2087c98

6 days agoClean up. Experimental user avatars removed.
merkulova@chromium.org [Tue, 22 Jul 2014 12:05:07 +0000 (12:05 +0000)]
Clean up. Experimental user avatars removed.

BUG=387738

Review URL: https://codereview.chromium.org/395133002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@284666 0039d316-1c4b-4281-b951-d872f2087c98

6 days agoAndroid media: VideoFrame should not store so many sync points.
dongseong.hwang@intel.com [Tue, 22 Jul 2014 10:31:57 +0000 (10:31 +0000)]
Android media: VideoFrame should not store so many sync points.

VideoFrame based on StreamTexture is reused on many frames. However, clients (e.g.
compositor, WebGL) inserts a sync point every frame. So VideoFrame on Android
can keep several mega byte sync points unnecessarily.

This CL makes VideoFrame keep only one sync point. When a client set new sync point
to VideoFrame and VideoFrame already keeps the sync point of another client, VideoFrame
waits the previous sync point before inserting a new sync point. A client must provide
a VideoFrame::SyncPointProvider so that VideoFrame can insert or wait a sync point.

BUG=350925

Review URL: https://codereview.chromium.org/312803002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@284658 0039d316-1c4b-4281-b951-d872f2087c98

6 days agoMake media::AudioRenderer return a media::TimeSource.
scherkus@chromium.org [Tue, 22 Jul 2014 02:30:06 +0000 (02:30 +0000)]
Make media::AudioRenderer return a media::TimeSource.

Mostly mechanical change to finish migrating time-related
methods from AudioRenderer to TimeSource.

BUG=370634

Review URL: https://codereview.chromium.org/403723006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@284598 0039d316-1c4b-4281-b951-d872f2087c98

7 days agoSupport basic authentication for html5 media
qinmin@chromium.org [Mon, 21 Jul 2014 23:12:17 +0000 (23:12 +0000)]
Support basic authentication for html5 media

This change passes the basic auth information to android mediaplayer to solve the issue that media with basic auth is not able to play.
Previously MediaInfoLoader and MediaResourceGetter could be ran at the same time.
However, MediaResourceGetter could miss the credential info if we do that.
As a result, we should wait until MediaInfoLoader finishes before creating the browser side MediaPlayer.

BUG=319885

Review URL: https://codereview.chromium.org/405663002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@284535 0039d316-1c4b-4281-b951-d872f2087c98

7 days agoImprove media::AudioRendererImplTest correctness via helper types.
scherkus@chromium.org [Mon, 21 Jul 2014 22:56:08 +0000 (22:56 +0000)]
Improve media::AudioRendererImplTest correctness via helper types.

While writing some new tests I ran into some hard to track down failures
that were a result of:
  1) Using AudioBufferConverter due to different input/output rates
  2) Using "int" for all input/output frame counts

For example, DeliverRemainingAudio() would actually over-deliver since
it didn't take the ratio of input/output rates into account.

To help make things better, use the type system to differentiate between
input and output frame counts. In addition, use simpler input/output
rates to make it easier to calculate expected time and frame values.

BUG=370634

Review URL: https://codereview.chromium.org/403003004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@284529 0039d316-1c4b-4281-b951-d872f2087c98

7 days agoCast: Avoid hitting a DCHECK caused by race condition
hclam@chromium.org [Mon, 21 Jul 2014 22:37:54 +0000 (22:37 +0000)]
Cast: Avoid hitting a DCHECK caused by race condition

RTCP sender report has a race condition when then current time is
submitted asynchronously (from another process). This caused the value
for DLRR to be negative.

This code is going to be removed it is fine to just suppress this
condition.

BUG=393042
NOTRY=true

Review URL: https://codereview.chromium.org/410433002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@284521 0039d316-1c4b-4281-b951-d872f2087c98

7 days agoRevert 284489 "Have media content and chrome browser tests load ..."
sky@chromium.org [Mon, 21 Jul 2014 20:18:15 +0000 (20:18 +0000)]
Revert 284489 "Have media content and chrome browser tests load ..."

This broke the linux gn bot:

http://build.chromium.org/p/chromium.linux/builders/Linux%20GN%20%28dbg%29/builds/9676/steps/compile/logs/stdio

[824/4367 | 164.256] CXX
obj/media/video/capture/media_unittests.fake_video_capture_device_unittest.o
FAILED: ../../third_party/llvm-build/Release+Asserts/bin/clang++
-Wl,--fatal-warnings -m64 -fPIC -Wl,-z,noexecstack -Wl,-z,now
-Wl,-z,relro -B../../third_party/binutils/Linux_x64/Release/bin
-Wl,--icf=none -pthread -Wl,-rpath=\\\$ORIGIN/lib/
-Wl,-rpath-link=lib/ -o ffmpeg_unittests -Wl,--start-group
@ffmpeg_unittests.rsp  -Wl,--end-group  -ldl -lasound -lX11
-lXcomposite -lXcursor -lXdamage -lXext -lXfixes -lXi -lXrender -lXss
-lXtst -lgmodule-2.0 -lgobject-2.0 -lgthread-2.0 -lrt -lglib-2.0
-lnss3 -lnssutil3 -lsmime3 -lplds4 -lplc4 -lnspr4 -lfontconfig
-lfreetype -lpangocairo-1.0 -lpango-1.0 -lcairo
obj/media/base/media_test_support.test_data_util.o:../../media/base/test_data_util.cc:function
media::StartMediaHttpTestServer():error: undefined reference to
'net::BaseTestServer::kLocalhost'
obj/media/base/media_test_support.test_data_util.o:../../media/base/test_data_util.cc:function
media::StartMediaHttpTestServer():error: undefined reference to
'net::LocalTestServer::LocalTestServer(net::BaseTestServer::Type,
std::string const&, base::FilePath const&)'
obj/media/base/media_test_support.test_data_util.o:../../media/base/test_data_util.cc:function
media::StartMediaHttpTestServer():error: undefined reference to
'net::LocalTestServer::Start()'
clang:error: linker command failed with exit code 1 (use -v to see
invocation)
...

> Have media content and chrome browser tests load data from media/test/data
>
> Update remaining encrypted media browser tests to use new player app.
>
> (This is identical to r282795 which got reverted, i.e. revert of revert).
>
> The fix was submitted separately in r283757
>
> BUG=379314
>
> Review URL: https://codereview.chromium.org/398823004

TBR=shadi@chromium.org

Review URL: https://codereview.chromium.org/405803007

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@284495 0039d316-1c4b-4281-b951-d872f2087c98

7 days agoHave media content and chrome browser tests load data from media/test/data
shadi@chromium.org [Mon, 21 Jul 2014 19:57:02 +0000 (19:57 +0000)]
Have media content and chrome browser tests load data from media/test/data

Update remaining encrypted media browser tests to use new player app.

(This is identical to r282795 which got reverted, i.e. revert of revert).

The fix was submitted separately in r283757

BUG=379314

Review URL: https://codereview.chromium.org/398823004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@284489 0039d316-1c4b-4281-b951-d872f2087c98

7 days agoSwitch the input code to use AudioBlockFifo.
xians@chromium.org [Mon, 21 Jul 2014 19:36:51 +0000 (19:36 +0000)]
Switch the input code to use AudioBlockFifo.

It saves two memcpy and quite some intermedia AudioBus code.

Also, this CL corrects a mistake in https://codereview.chromium.org/389623002/ by using FromInterleavedPartial() instead of FromInterleaved().

BUG=393199
TEST=bots and webrtc loopback test: https://apprtc.appspot.com

Review URL: https://codereview.chromium.org/396263004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@284477 0039d316-1c4b-4281-b951-d872f2087c98

7 days agoRevert of Revert of Cast: Log playout delay from receiver (https://codereview.chromiu...
hclam@chromium.org [Mon, 21 Jul 2014 18:14:17 +0000 (18:14 +0000)]
Revert of Revert of Cast: Log playout delay from receiver (https://codereview.chromium.org/401273002/)

Reason for revert:
This revert wouldn't solve the flakiness. The fix for flakiness is in CQ now. Reverting this.

Original issue's description:
> Revert of Cast: Log playout delay from receiver (https://codereview.chromium.org/401213002/)
>
> Reason for revert:
> This patch seems to break CastStreamingApiTestWithPixelOutput.EndToEnd.
>
> http://build.chromium.org/p/chromium.linux/builders/Linux%20Tests%20%28dbg%29%281%29/builds/32598/steps/browser_tests/logs/EndToEnd
>
> Original issue's description:
> > Cast: Log playout delay from receiver
> >
> > The last refactoring in RTCP handling dropped the playout delay from
> > receiver. This change adds it back.
> >
> > TBR=miu
> > BUG=393042
> >
> > Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=284395
>
> TBR=miu@chromium.org,hclam@chromium.org
> NOTREECHECKS=true
> NOTRY=true
> BUG=393042
>
> Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=284411

TBR=miu@chromium.org,dgozman@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=393042

Review URL: https://codereview.chromium.org/410443002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@284462 0039d316-1c4b-4281-b951-d872f2087c98

7 days agoRevert of Cast: Log playout delay from receiver (https://codereview.chromium.org...
dgozman@chromium.org [Mon, 21 Jul 2014 11:31:28 +0000 (11:31 +0000)]
Revert of Cast: Log playout delay from receiver (https://codereview.chromium.org/401213002/)

Reason for revert:
This patch seems to break CastStreamingApiTestWithPixelOutput.EndToEnd.

http://build.chromium.org/p/chromium.linux/builders/Linux%20Tests%20%28dbg%29%281%29/builds/32598/steps/browser_tests/logs/EndToEnd

Original issue's description:
> Cast: Log playout delay from receiver
>
> The last refactoring in RTCP handling dropped the playout delay from
> receiver. This change adds it back.
>
> TBR=miu
> BUG=393042
>
> Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=284395

TBR=miu@chromium.org,hclam@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=393042

Review URL: https://codereview.chromium.org/401273002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@284411 0039d316-1c4b-4281-b951-d872f2087c98

7 days agoCast: Log playout delay from receiver
hclam@chromium.org [Mon, 21 Jul 2014 07:10:20 +0000 (07:10 +0000)]
Cast: Log playout delay from receiver

The last refactoring in RTCP handling dropped the playout delay from
receiver. This change adds it back.

TBR=miu
BUG=393042

Review URL: https://codereview.chromium.org/401213002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@284395 0039d316-1c4b-4281-b951-d872f2087c98

8 days agoCast: Refactor RTCP handling
hclam@chromium.org [Sun, 20 Jul 2014 07:13:24 +0000 (07:13 +0000)]
Cast: Refactor RTCP handling

OBJECTIVES

This change is to refactor RTCP handling in media/cast such that RTCP
message parsing is done in CastTransportSender.

This side effect of this refactoring is much cleaner code: RTCP handling
code are grouped under one module. VideoSender and AudioSender do not
handle packets directly.

This also affect the architectutre in Chrome that RTCP message parsing
is now done in the browser process. A parsed RTCP message is passed to
the renderer instead of raw packets.

REATIONALE

RTCP is used as a feedback mechanism in Cast Streaming. It used to be
parsed and handled by VideoSender and AudioSender in the render process.
This was very ineffective because packetization and sending is done in
the browser process. This created inefficiencies in packet
retransmission. It also made improvement to the transport protocol /
algorithm much more difficult. A side effect is very messy code.

DETAILS

Rtcp - This class is responsibile for maintaining a bi-directional RTCP
session. It is now owned by CastTransportSender.

CastTransportSender - It now performs packetization and also parsing of
incoming RTCP packets. RTCP packets are small UDP packets for signaling
only. Eventually retransmission can also be moved to this class. It will
handle all packet level send transport.

AudioSender / VideoSender - They don't handle packet directly any more.
Which means render process doesn't see raw packets.

FrameSender - Base class for AudioSender and VideoSender to share code
for RTCP message handling. Eventually AudioSender and VideoSender will
merge here but it is not the point of this change.

RtcpBuilder - Removed and merged with RtcpSender.

Net deleted 400 lines of code and simulation shows the same results.

BUG=393042

Review URL: https://codereview.chromium.org/387933005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@284363 0039d316-1c4b-4281-b951-d872f2087c98

9 days agoFactorize media/audio into new GN.
dalecurtis@chromium.org [Sat, 19 Jul 2014 04:59:52 +0000 (04:59 +0000)]
Factorize media/audio into new GN.

Breaks out one of the most complex media/ targets into its
own BUILD.gn file for improved readibility and targetting.

BUG=none
TEST=media_unittests

Review URL: https://codereview.chromium.org/396793003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@284314 0039d316-1c4b-4281-b951-d872f2087c98

10 days agoDrop time from media::{Audio,Video}Renderer::StartPlayingFrom().
scherkus@chromium.org [Fri, 18 Jul 2014 18:02:29 +0000 (18:02 +0000)]
Drop time from media::{Audio,Video}Renderer::StartPlayingFrom().

In preparation for migrating to TimeSource, StartPlayingFrom() is
renamed to StartPlaying() with renderers expected to fetch the current
time instead of being provided the time.

AudioRenderer::SetMediaTime() is temporarily added until we can migrate
the interface to being based on TimeSource.

BUG=370634
R=xhwang@chromium.org

Review URL: https://codereview.chromium.org/400853002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@284155 0039d316-1c4b-4281-b951-d872f2087c98

10 days agoIntroduce media::TimeSource.
scherkus@chromium.org [Fri, 18 Jul 2014 16:36:30 +0000 (16:36 +0000)]
Introduce media::TimeSource.

TimeSource represents the canonical source of time and will eventually
replace the time-updating callback from AudioRenderer and VideoRenderer.

A wall-clock based implementation is also provided for media pipelines
that do not contain any audio.

BUG=370634

Review URL: https://codereview.chromium.org/379343005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@284122 0039d316-1c4b-4281-b951-d872f2087c98

10 days agoFold DecoderSelector::Abort() into the dtor.
xhwang@chromium.org [Fri, 18 Jul 2014 07:25:27 +0000 (07:25 +0000)]
Fold DecoderSelector::Abort() into the dtor.

BUG=349211
TEST=Existing tests pass.

Review URL: https://codereview.chromium.org/398163004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@284028 0039d316-1c4b-4281-b951-d872f2087c98

10 days agoTweak expectations for VideoRendererImplTest.StartPlayingFrom_LowDelay.
scherkus@chromium.org [Fri, 18 Jul 2014 03:40:19 +0000 (03:40 +0000)]
Tweak expectations for VideoRendererImplTest.StartPlayingFrom_LowDelay.

Until we get rid of the internal thread, the buffering events will fire
non-deterministically. For example, under valgrind it's possible for
them to never fire.

BUG=144683

Review URL: https://codereview.chromium.org/403573004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@283998 0039d316-1c4b-4281-b951-d872f2087c98

10 days agoAdded UMA logging for Video Rotation metadata.
suderman@chromium.org [Fri, 18 Jul 2014 01:26:47 +0000 (01:26 +0000)]
Added UMA logging for Video Rotation metadata.

BUG=47554

Review URL: https://codereview.chromium.org/394373002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@283962 0039d316-1c4b-4281-b951-d872f2087c98

11 days agoAdd the ability for presentation timestamps to be specified in test strings.
acolwell@chromium.org [Fri, 18 Jul 2014 00:17:29 +0000 (00:17 +0000)]
Add the ability for presentation timestamps to be specified in test strings.

All SourceBufferStream string based unit tests assume that decode and
presentation timestamps are the same. This change extends the string
syntax so that buffers can be created where the presentation and
decode timestamps are different. This will make it easier to write
tests that verify proper behavior when B-frames are used.

Review URL: https://codereview.chromium.org/395303002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@283944 0039d316-1c4b-4281-b951-d872f2087c98

11 days agoCast: Implement priority packets in PacedSender
hclam@chromium.org [Thu, 17 Jul 2014 22:46:15 +0000 (22:46 +0000)]
Cast: Implement priority packets in PacedSender

This change implements a high priority packet list in PacedSender. In
practice the order of packet priority is:
1. RTCP
2. Audio
3. Video

The reason for doing this such that audio packets can interleave between
video packets even if the audio packets has a greater value of
timestamp. This characteristic of interleaving packets will facilitate
better bandwidth estimation by looking at audio send and ACK pairs.

cast_simulator shows no ill effect but a slight improvement:
Before
Audio frame count received: 17978
Video frame count received: 5169

After
Audio frame count received: 17989
Video frame count received: 5174

BUG=394191

Review URL: https://codereview.chromium.org/399743002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@283911 0039d316-1c4b-4281-b951-d872f2087c98

11 days agoFix most GN clang errors.
brettw@chromium.org [Thu, 17 Jul 2014 21:53:09 +0000 (21:53 +0000)]
Fix most GN clang errors.

Finally enabling Clang requires openssl and hunspell rolls. This should
fix everything else.

R=dalecurtis@chromium.org

Review URL: https://codereview.chromium.org/402683003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@283894 0039d316-1c4b-4281-b951-d872f2087c98

11 days agoFold DecryptingDemuxerStream::Stop() into the dtor.
xhwang@chromium.org [Thu, 17 Jul 2014 21:38:51 +0000 (21:38 +0000)]
Fold DecryptingDemuxerStream::Stop() into the dtor.

BUG=349211
TEST=Existing tests pass.

Review URL: https://codereview.chromium.org/397953007

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@283886 0039d316-1c4b-4281-b951-d872f2087c98

11 days agoUse audio thread for the fake input audio stream.
xians@chromium.org [Thu, 17 Jul 2014 18:30:24 +0000 (18:30 +0000)]
Use audio thread for the fake input audio stream.

Previously the fake input stream is creating a new thread to pump the callbacks, this is unnecessary and FakeAudioInputStream::Stop() might take time to stop the thread. I suspect that this is one of the potential causes for the timeout in WebRtc content browser tests on Android bots.

This patch changes the code to use AudioManager audio thread instead, hopefully this can reduce the flakiness on Android tests.
Also it changes |beep_lock| from a global lock to a lock used only by BeepContext privately.

BUG=387895
TEST=bots

Review URL: https://codereview.chromium.org/399623008

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@283822 0039d316-1c4b-4281-b951-d872f2087c98

11 days agoUpdate SourceBufferStream and its unit tests to always expect valid durations.
acolwell@chromium.org [Thu, 17 Jul 2014 11:24:54 +0000 (11:24 +0000)]
Update SourceBufferStream and its unit tests to always expect valid durations.

This change fixes the SourceBufferStream unit tests so that they always
provide valid durations for buffers that it passes to SourceBufferStream.
I've also added code to SoureBufferStream to verify that it always gets
buffers with valid durations.

Minor tweaks to test expectations were needed to compensate for the
SourceBufferStream behaving differently when it got actual durations instead
of using the durations it made up. In most cases I just used the duration
the SourceBufferStream was ultimately using. In a few cases the duration
the SourceBufferStream was generating didn't make any sense so I simply
changed the expectations to match the new behavior.

This is an attempt to reland https://codereview.chromium.org/379693002/ with
appropriate crash fixes.

Review URL: https://codereview.chromium.org/393403002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@283754 0039d316-1c4b-4281-b951-d872f2087c98

11 days agoAVFoundation video capture: blacklisting micro fix
mcasas@chromium.org [Thu, 17 Jul 2014 10:16:49 +0000 (10:16 +0000)]
AVFoundation video capture: blacklisting micro fix

Where it reads = it should read |= so it keep the blacklisting mark.

TBR=tommi@chromium.org

BUG=347371

Review URL: https://codereview.chromium.org/398093002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@283736 0039d316-1c4b-4281-b951-d872f2087c98

11 days agoFold DecoderStream::Stop() into the dtor.
xhwang@chromium.org [Thu, 17 Jul 2014 08:32:52 +0000 (08:32 +0000)]
Fold DecoderStream::Stop() into the dtor.

BUG=349211
TEST=Existing tests pass.

Review URL: https://codereview.chromium.org/393313004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@283713 0039d316-1c4b-4281-b951-d872f2087c98

11 days agoRemoved extra video_rotation_ from FFmpeg Demuxer
suderman@chromium.org [Thu, 17 Jul 2014 06:09:09 +0000 (06:09 +0000)]
Removed extra video_rotation_ from FFmpeg Demuxer

BUG=47554

Review URL: https://codereview.chromium.org/394703004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@283653 0039d316-1c4b-4281-b951-d872f2087c98

11 days agoCdmAdapter: Allow parallel SendPlatformChallenge() calls.
xhwang@chromium.org [Thu, 17 Jul 2014 06:07:18 +0000 (06:07 +0000)]
CdmAdapter: Allow parallel SendPlatformChallenge() calls.

Previously CdmAdapter only allows one outstanding SendPlatformChallenge() call.
However, CDM actually needs to make parallel SendPlatformChallenge() calls. This
CL fixes CdmAdapter to allow this.

BUG=393722
TEST=Tested on ChromeOS build on Linux with hack in
PepperPlatformVerificationMessageFilter to return faked challenge platform reply.

Review URL: https://codereview.chromium.org/393713003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@283651 0039d316-1c4b-4281-b951-d872f2087c98

12 days agoFold {Audio|Video}Decoder::Stop() into the dtor.
xhwang@chromium.org [Wed, 16 Jul 2014 23:36:41 +0000 (23:36 +0000)]
Fold {Audio|Video}Decoder::Stop() into the dtor.

The Stop() process is already synchronous. This CL folds the Stop() call into
the dtor which simplifies a lot of code.

TBR=bbudge@chromium.org
BUG=349211
TEST=Current unittests pass.

Review URL: https://codereview.chromium.org/395703002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@283578 0039d316-1c4b-4281-b951-d872f2087c98

12 days agoAdd a block based Audio FIFO.
xians@chromium.org [Wed, 16 Jul 2014 21:38:18 +0000 (21:38 +0000)]
Add a block based Audio FIFO.

This new AudioBlockFifo() is made for the input code to avoid copying audio data during Push() and Consume().

Contrast to the existing AudioFifo, which requires a AudioBus* as input param for its Push() and Consume() methods to copy the data from/to the FIFO, this new AudioBlockFifo keeps blocks of AudioBus, it accepts interleaved data as input for its Push() method, and its Consume() method return an AudioBus for consumption. So the copy operations in this AudioBlockFifo() is 1 versus 3 in AudioFifo().

NOTRY=true
BUG=393199
TEST=media_unittests --gtest_filter="*AudioBlockFifo*"

Review URL: https://codereview.chromium.org/389623002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@283518 0039d316-1c4b-4281-b951-d872f2087c98

12 days agoAdd playback underflow logic to media::VideoRendererImpl.
scherkus@chromium.org [Wed, 16 Jul 2014 21:05:21 +0000 (21:05 +0000)]
Add playback underflow logic to media::VideoRendererImpl.

BUG=144683

Review URL: https://codereview.chromium.org/391023002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@283501 0039d316-1c4b-4281-b951-d872f2087c98

12 days agoEnable media in default GN build -- Part Deux!
dalecurtis@google.com [Wed, 16 Jul 2014 20:14:06 +0000 (20:14 +0000)]
Enable media in default GN build -- Part Deux!

Previous submission was missing enough of the android portion to prevent
passing of compilation.  This patch combines ajwong@'s previous work with
enough fixes to the Android build to get it working.

BUG=none
TEST=passes GN, compiles.
R=brettw@chromium.org

Review URL: https://codereview.chromium.org/390893003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@283477 0039d316-1c4b-4281-b951-d872f2087c98

12 days agoRemove media::AudioRendererImpl::now_cb_ and clean up tests (round 2).
scherkus@chromium.org [Wed, 16 Jul 2014 18:29:06 +0000 (18:29 +0000)]
Remove media::AudioRendererImpl::now_cb_ and clean up tests (round 2).

It's no longer needed as of r282376.

BUG=370634

Review URL: https://codereview.chromium.org/395943002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@283443 0039d316-1c4b-4281-b951-d872f2087c98

12 days agoFix 'except' and 'prefer' spelling.
tnagel@chromium.org [Wed, 16 Jul 2014 17:53:20 +0000 (17:53 +0000)]
Fix 'except' and 'prefer' spelling.

TBR=marja, stevenjb, yosin
BUG=none

Review URL: https://codereview.chromium.org/382153006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@283419 0039d316-1c4b-4281-b951-d872f2087c98

12 days agoRevert of Update SourceBufferStream and its unit tests to always expect valid duratio...
falken@chromium.org [Wed, 16 Jul 2014 08:59:24 +0000 (08:59 +0000)]
Revert of Update SourceBufferStream and its unit tests to always expect valid durations. (https://codereview.chromium.org/379693002/)

Reason for revert:
This seems to have broken several layout tests:

event-attributes.html
media-controller-time-clamp.html
video-currentTime-delay.html
video-currentTime-set.html
video-duration-known-after-eos.html
video-loop.html
video-playbackrate.html
video-played-collapse.html
video-seek-past-end-paused.html
video-seek-past-end-playing.html
video-seek-to-duration-with-playbackrate-zero.html

See for example this build:
http://build.chromium.org/p/chromium.webkit/builders/WebKit%20Mac10.6%20(dbg)/builds/16392

Original issue's description:
> Update SourceBufferStream and its unit tests to always expect valid durations.
>
> This change fixes the SourceBufferStream unit tests so that they always
> provide valid durations for buffers that it passes to SourceBufferStream.
> I've also added code to SoureBufferStream to verify that it always gets
> buffers with valid durations.
>
> Minor tweaks to test expectations were needed to compensate for the
> SourceBufferStream behaving differently when it got actual durations instead
> of using the durations it made up. In most cases I just used the duration
> the SourceBufferStream was ultimately using. In a few cases the duration
> the SourceBufferStream was generating didn't make any sense so I simply
> changed the expectations to match the new behavior.
>
> Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=283365

TBR=wolenetz@chromium.org,dalecurtis@chromium.org,acolwell@chromium.org
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/392193003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@283390 0039d316-1c4b-4281-b951-d872f2087c98

12 days agoUpdate SourceBufferStream and its unit tests to always expect valid durations.
acolwell@chromium.org [Wed, 16 Jul 2014 05:47:42 +0000 (05:47 +0000)]
Update SourceBufferStream and its unit tests to always expect valid durations.

This change fixes the SourceBufferStream unit tests so that they always
provide valid durations for buffers that it passes to SourceBufferStream.
I've also added code to SoureBufferStream to verify that it always gets
buffers with valid durations.

Minor tweaks to test expectations were needed to compensate for the
SourceBufferStream behaving differently when it got actual durations instead
of using the durations it made up. In most cases I just used the duration
the SourceBufferStream was ultimately using. In a few cases the duration
the SourceBufferStream was generating didn't make any sense so I simply
changed the expectations to match the new behavior.

Review URL: https://codereview.chromium.org/379693002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@283365 0039d316-1c4b-4281-b951-d872f2087c98

12 days agoUpdate media::AudioClock API to take time since writing into account.
scherkus@chromium.org [Wed, 16 Jul 2014 05:17:12 +0000 (05:17 +0000)]
Update media::AudioClock API to take time since writing into account.

AudioRendererImpl will continue to function as it does today since it
always calls CurrentMediaTimestamp() inside the audio callback, hence
the time since writing is always zero.

When TimeDeltaInterpolator gets replaced by AudioRendererImpl as the
master clock inside Pipeline, we'll need a method for determining the
current media timestamp at any point in time to provide good video
synchronization that isn't affected by what the audio callback buffer
size is.

BUG=370634

Review URL: https://codereview.chromium.org/389613005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@283353 0039d316-1c4b-4281-b951-d872f2087c98

12 days agoUse SkSrc_Mode in SkCanvasVideoRenderer, to prevent transparent video frames from...
rileya@chromium.org [Wed, 16 Jul 2014 04:44:56 +0000 (04:44 +0000)]
Use SkSrc_Mode in SkCanvasVideoRenderer, to prevent transparent video frames from blending with reused image buffer contents.

BUG=392733
TEST=SkCanvasVideoRendererTest.TransparentFrame

Review URL: https://codereview.chromium.org/388363002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@283338 0039d316-1c4b-4281-b951-d872f2087c98

12 days agoCdmAdapter: Value initialize PP_Decrypted*Info.
xhwang@chromium.org [Wed, 16 Jul 2014 04:38:33 +0000 (04:38 +0000)]
CdmAdapter: Value initialize PP_Decrypted*Info.

Previously there care cases where those structs are only partially initialized.

TBR=ddorwin@chromium.org
BUG=393938

Review URL: https://codereview.chromium.org/390613004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@283335 0039d316-1c4b-4281-b951-d872f2087c98

13 days agoAdd wolenetz@chromium.org to media OWNERs files.
acolwell@chromium.org [Tue, 15 Jul 2014 10:35:38 +0000 (10:35 +0000)]
Add wolenetz@chromium.org to media OWNERs files.

R=scherkus@chromium.org

Review URL: https://codereview.chromium.org/388333006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@283178 0039d316-1c4b-4281-b951-d872f2087c98

13 days agoCast: Reshuffle files under media/cast
hclam@chromium.org [Tue, 15 Jul 2014 01:04:25 +0000 (01:04 +0000)]
Cast: Reshuffle files under media/cast

This is a large refactoring to move files around where it makes sense.

media/cast/transport/rtp_sender => media/cast/net/rtp
media/cast/transport/rtp_sender/packet_storage => media/cast/net/rtp
media/cast/transport/rtp_sender/packetizer => media/cast/net/rtp
media/cast/transport/transport => media/cast/net
media/cast/base => media/cast/common
media/cast/transport/utility => media/cast/common
media/cast/video_sender => media/cast/sender
media/cast/video_sender/codecs/vp8 => media/cast/sender
media/cast/audio_sender => media/cast/sender
media/cast/congestion_control => media/cast/sender
media/cast/transport => media/cast/net
media/cast/framer => media/cast/net/rtp
media/cast/rtp_receiver => media/cast/net/rtp
media/cast/rtcp => media/cast/net/rtcp
Remove "transport" namespace

BUG=393042

Review URL: https://codereview.chromium.org/388663003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@283120 0039d316-1c4b-4281-b951-d872f2087c98

2 weeks agoMake DecryptingDemuxerStream::Stop() synchronous.
xhwang@chromium.org [Tue, 15 Jul 2014 00:19:08 +0000 (00:19 +0000)]
Make DecryptingDemuxerStream::Stop() synchronous.

BUG=349211
TEST=Current tests pass.

Review URL: https://codereview.chromium.org/389413003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@283101 0039d316-1c4b-4281-b951-d872f2087c98

2 weeks agoRemove media::VideoRenderer::SetPlaybackRate() (round 2).
scherkus@chromium.org [Mon, 14 Jul 2014 23:14:45 +0000 (23:14 +0000)]
Remove media::VideoRenderer::SetPlaybackRate() (round 2).

Video renderers don't need the information as they are already making
audio/video synchronization decisions based on a media timeline that
already incorporates the current playback rate via the time callback.

In particular, VideoRendererImpl only used playback rate to estimate
a better duration to sleep until the current frame was ready ...
except that in most cases we'd sleep for kIdleTimeDelta and wait
until the media timeline had progressed past the current frame's
timestamp. In other words, there's absolutely no reason to even try
to estimate the sleep duration based on the playback rate.

BUG=370634

Review URL: https://codereview.chromium.org/394443003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@283072 0039d316-1c4b-4281-b951-d872f2087c98

2 weeks agoMpeg2 TS - simplify the buffer emission logic.
damienv@chromium.org [Mon, 14 Jul 2014 19:33:45 +0000 (19:33 +0000)]
Mpeg2 TS - simplify the buffer emission logic.

Two goals:
- Previously, |new_config_cb| was invoked twice even when there was no change of audio/video configuration. Now, if there is no mid-stream configuration change, |new_config_cb| is invoked only once.
- Segment start time is now computed correctly for badly muxed streams: previously, the upper layer did not receive the buffers with the smallest timestamps first.

BUG=None

Review URL: https://codereview.chromium.org/369683002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@283000 0039d316-1c4b-4281-b951-d872f2087c98

2 weeks agoAlways use 48kHz for OPUS decoding.
dalecurtis@chromium.org [Mon, 14 Jul 2014 18:48:31 +0000 (18:48 +0000)]
Always use 48kHz for OPUS decoding.

Per the specification OPUS should always use 48kHz for decoding.

BUG=392827
TEST=new unittests

Review URL: https://codereview.chromium.org/390543002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@282989 0039d316-1c4b-4281-b951-d872f2087c98

2 weeks agoRevert of Remove media::VideoRenderer::SetPlaybackRate(). (https://codereview.chromiu...
falken@chromium.org [Mon, 14 Jul 2014 02:48:56 +0000 (02:48 +0000)]
Revert of Remove media::VideoRenderer::SetPlaybackRate(). (https://codereview.chromium.org/384943002/)

Reason for revert:
Sorry to revert this change. It made the following layout tests flakily fail:
media/track/track-cue-rendering-horizontal.html
media/track/track-cue-rendering-vertical.html

Reverting locally healed the tests.

The image diffs show what appears to be a timestamp change (something like 0:18 to 0:19):
https://storage.googleapis.com/chromium-layout-test-archives/WebKit_Linux__dbg_/20779/layout-test-results/results.html

Original issue's description:
> Remove media::VideoRenderer::SetPlaybackRate().
>
> Video renderers don't need the information as they are already making
> audio/video synchronization decisions based on a media timeline that
> already incorporates the current playback rate via the time callback.
>
> In particular, VideoRendererImpl only used playback rate to estimate
> a better duration to sleep until the current frame was ready ...
> except that in most cases we'd sleep for kIdleTimeDelta and wait
> until the media timeline had progressed past the current frame's
> timestamp. In other words, there's absolutely no reason to even try
> to estimate the sleep duration based on the playback rate.
>
> BUG=370634
>
> Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=282797

TBR=xhwang@chromium.org,scherkus@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=370634

Review URL: https://codereview.chromium.org/390733002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@282891 0039d316-1c4b-4281-b951-d872f2087c98

2 weeks agoRevert 282795 "Have media content and chrome browser tests load ..."
shadi@google.com [Sat, 12 Jul 2014 07:36:30 +0000 (07:36 +0000)]
Revert 282795 "Have media content and chrome browser tests load ..."

It broke browser tests. Probably need to update isolate files to fix it...

> Have media content and chrome browser tests load data from media/test/data
>
> With media files copied over to media/test/data, this CL makes media related content browser tests and chrome browser tests load test data from one location.
>
> The location is common with media unit tests data forder;  managed in one place in media/base/test_data_util.h
>
> BUG=379314
>
> Review URL: https://codereview.chromium.org/357413002

TBR=shadi@chromium.org

Review URL: https://codereview.chromium.org/383063009

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@282812 0039d316-1c4b-4281-b951-d872f2087c98

2 weeks agoSome cleanup in PipelineTest.
xhwang@chromium.org [Sat, 12 Jul 2014 04:50:09 +0000 (04:50 +0000)]
Some cleanup in PipelineTest.

Do not call Pipeline::On{Audio|Video}RendererEnded() because it's pipeline's
implementation detail and will go away. Instead, let the mock renderers call the
ended_cb.

Also rename several helper functions to reflect what they really do.

BUG=392259
TEST=All current tests pass.

Review URL: https://codereview.chromium.org/388763003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@282798 0039d316-1c4b-4281-b951-d872f2087c98

2 weeks agoRemove media::VideoRenderer::SetPlaybackRate().
scherkus@chromium.org [Sat, 12 Jul 2014 04:49:31 +0000 (04:49 +0000)]
Remove media::VideoRenderer::SetPlaybackRate().

Video renderers don't need the information as they are already making
audio/video synchronization decisions based on a media timeline that
already incorporates the current playback rate via the time callback.

In particular, VideoRendererImpl only used playback rate to estimate
a better duration to sleep until the current frame was ready ...
except that in most cases we'd sleep for kIdleTimeDelta and wait
until the media timeline had progressed past the current frame's
timestamp. In other words, there's absolutely no reason to even try
to estimate the sleep duration based on the playback rate.

BUG=370634

Review URL: https://codereview.chromium.org/384943002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@282797 0039d316-1c4b-4281-b951-d872f2087c98

2 weeks agoHave media content and chrome browser tests load data from media/test/data
shadi@chromium.org [Sat, 12 Jul 2014 04:47:40 +0000 (04:47 +0000)]
Have media content and chrome browser tests load data from media/test/data

With media files copied over to media/test/data, this CL makes media related content browser tests and chrome browser tests load test data from one location.

The location is common with media unit tests data forder;  managed in one place in media/base/test_data_util.h

BUG=379314

Review URL: https://codereview.chromium.org/357413002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@282795 0039d316-1c4b-4281-b951-d872f2087c98

2 weeks agoRevert 282780 because it broke the android-gn build.
sadrul@chromium.org [Sat, 12 Jul 2014 04:39:37 +0000 (04:39 +0000)]
Revert 282780 because it broke the android-gn build.

> Enable media in default GN build.
>
> Roll ffmpeg to pick up build fix. f620cda6 -> 04bb33e9
>
> All hail GN. oRZ
>
> BUG=none
> TBR=brettw
>
> Review URL: https://codereview.chromium.org/381903003

TBR=dalecurtis@chromium.org

Review URL: https://codereview.chromium.org/387103004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@282792 0039d316-1c4b-4281-b951-d872f2087c98

2 weeks agoEnable media in default GN build.
dalecurtis@chromium.org [Sat, 12 Jul 2014 02:23:57 +0000 (02:23 +0000)]
Enable media in default GN build.

Roll ffmpeg to pick up build fix. f620cda6 -> 04bb33e9

All hail GN. oRZ

BUG=none
TBR=brettw

Review URL: https://codereview.chromium.org/381903003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@282780 0039d316-1c4b-4281-b951-d872f2087c98

2 weeks agoZero initialize the first allocation of a VideoFrame.
dalecurtis@chromium.org [Sat, 12 Jul 2014 01:53:28 +0000 (01:53 +0000)]
Zero initialize the first allocation of a VideoFrame.

Replicates FFmpeg's behavior for frame allocation.  They do not zero
the frame on subsequent pool reuse, so I have not done so either.

BUG=390941,390944,390945
TEST=new unittest.

Review URL: https://codereview.chromium.org/383893002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@282775 0039d316-1c4b-4281-b951-d872f2087c98

2 weeks agoAdd test data for BUG=392827
dalecurtis@google.com [Sat, 12 Jul 2014 01:09:35 +0000 (01:09 +0000)]
Add test data for BUG=392827

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@282765 0039d316-1c4b-4281-b951-d872f2087c98

2 weeks agoZero initialize OPUS stream mapping data.
dalecurtis@chromium.org [Fri, 11 Jul 2014 23:28:43 +0000 (23:28 +0000)]
Zero initialize OPUS stream mapping data.

On parse failure, FFmpeg does not always error out, so ensure the OPUS
initializer we construct is completely initialized.

BUG=389280
TEST=none

Review URL: https://codereview.chromium.org/382123002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@282731 0039d316-1c4b-4281-b951-d872f2087c98

2 weeks agoSkip to enter the fullscreen automatically when hole-punching is enabled.
ycheo@chromium.org [Fri, 11 Jul 2014 08:21:15 +0000 (08:21 +0000)]
Skip to enter the fullscreen automatically when hole-punching is enabled.

BUG=391724

Review URL: https://codereview.chromium.org/378543002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@282588 0039d316-1c4b-4281-b951-d872f2087c98

2 weeks agoMpeg2TS - estimate duration for video frames.
damienv@chromium.org [Fri, 11 Jul 2014 08:05:07 +0000 (08:05 +0000)]
Mpeg2TS - estimate duration for video frames.

The updated frame processor assumes each frame is assigned
a positive duration.
Update the Mpeg2 TS stream parser to provide estimated duration
for video frames.

BUG=None

Review URL: https://codereview.chromium.org/364823008

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@282585 0039d316-1c4b-4281-b951-d872f2087c98

2 weeks agoEncrypted Media: Fix PpbBuffer::Destroy().
xhwang@chromium.org [Fri, 11 Jul 2014 04:47:21 +0000 (04:47 +0000)]
Encrypted Media: Fix PpbBuffer::Destroy().

This CL makes the ownership of the pp::Buffer_Dev clear:

1) If the PpbBuffer owns the pp::Buffer_Dev, it always calls
allocator_->Release() during the destructor so that the buffer is returned to
the allocator_ and can be reused.

2) If TakeBufferDev() is called. PpbBuffer doesn't own the pp::Buffer_Dev any
more. The caller of TakeBufferDev() needs to make sure allocator->Release() is
called sometime later to return the buffer to allocator_.

BUG=392497
TEST=Tested with random stream switch video.

Review URL: https://codereview.chromium.org/374353004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@282544 0039d316-1c4b-4281-b951-d872f2087c98

2 weeks agoAdd a ref counted audio bus.
rkc@chromium.org [Fri, 11 Jul 2014 02:53:18 +0000 (02:53 +0000)]
Add a ref counted audio bus.
For some applications where we need to keep multiple copies of the audio bus around (particularly in STL containers), a scoped_ptr to an audio bus isn't enough. For those rare situations, we're adding a RefCounted version of the AudioBus.

R=dalecurtis@chromium.org
BUG=None.

Review URL: https://codereview.chromium.org/388563005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@282510 0039d316-1c4b-4281-b951-d872f2087c98

2 weeks agoCast: Update simulator tool with more inputs.
imcheng@chromium.org [Fri, 11 Jul 2014 01:43:28 +0000 (01:43 +0000)]
Cast: Update simulator tool with more inputs.

Inputs:
- directory to libffmpegsumo.so.
- network simulation parameters given as a proto.

BUG=none

Review URL: https://codereview.chromium.org/362123005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@282496 0039d316-1c4b-4281-b951-d872f2087c98

2 weeks agoAllow AudioRendererMixerInputs to be restarted after stopped.
dalecurtis@chromium.org [Fri, 11 Jul 2014 00:36:55 +0000 (00:36 +0000)]
Allow AudioRendererMixerInputs to be restarted after stopped.

We probably shouldn't allow this, but it's currently relied upon by the
WebAudio code and cleaning it up is a big deal: http://crbug.com/151051.

The AudioRendererSink interface does not specify that after Stop() the
sink can no longer be used.  All other sinks allow restart, so this is
just keeping with the pace.

In http://crrev.com/280502 I conflated the one-stop-only mechanics of
AudioRenderer:Stop() with those of AudioRendererSink::Stop().  This
patch reverts that mistake while keeping the fixes for the original
issue.

BUG=389204,390977
TEST=new unittest.

Review URL: https://codereview.chromium.org/381823003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@282481 0039d316-1c4b-4281-b951-d872f2087c98

2 weeks agoConverts most logic in media.gyp to BUILD.gn files.
ajwong@chromium.org [Thu, 10 Jul 2014 22:54:41 +0000 (22:54 +0000)]
Converts most logic in media.gyp to BUILD.gn files.

Most everything but android and cdm code has been converted. Next step is to break these up into smaller BUILD.gn files per subdirectory.

All hail GN. orz

BUG=none
R=brettw@chromium.org, dalecurtis@chromium.org

Review URL: https://codereview.chromium.org/268713006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@282448 0039d316-1c4b-4281-b951-d872f2087c98

2 weeks agoRevert 282424 "Remove media::AudioRendererImpl::now_cb_ and clea..."
scherkus@chromium.org [Thu, 10 Jul 2014 21:44:38 +0000 (21:44 +0000)]
Revert 282424 "Remove media::AudioRendererImpl::now_cb_ and clea..."

MSVC evaluates functions in a different order, causing test failures.

> Remove media::AudioRendererImpl::now_cb_ and clean up tests.
>
> It's no longer needed as of r282376.
>
> BUG=370634
> R=rileya@chromium.org
>
> Review URL: https://codereview.chromium.org/380893002

TBR=scherkus@chromium.org

Review URL: https://codereview.chromium.org/380303004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@282436 0039d316-1c4b-4281-b951-d872f2087c98

2 weeks agoRemove media::AudioRendererImpl::now_cb_ and clean up tests.
scherkus@chromium.org [Thu, 10 Jul 2014 20:47:54 +0000 (20:47 +0000)]
Remove media::AudioRendererImpl::now_cb_ and clean up tests.

It's no longer needed as of r282376.

BUG=370634
R=rileya@chromium.org

Review URL: https://codereview.chromium.org/380893002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@282424 0039d316-1c4b-4281-b951-d872f2087c98

2 weeks agoUse AudioClock to determine when audio playback has ended.
scherkus@chromium.org [Thu, 10 Jul 2014 17:54:46 +0000 (17:54 +0000)]
Use AudioClock to determine when audio playback has ended.

The old mechanism of estimating the wall clock time isn't as accurate as
the frame-level information tracked inside AudioClock. For example,
AudioClock properly handles situations where the playback rate changes
over time.

BUG=370634

Review URL: https://codereview.chromium.org/382633005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@282376 0039d316-1c4b-4281-b951-d872f2087c98

2 weeks agoProvide gtest printers for ui/gfx geometry types
jamesr@chromium.org [Thu, 10 Jul 2014 07:41:43 +0000 (07:41 +0000)]
Provide gtest printers for ui/gfx geometry types

This provides PrintTo(..) functions for the geometric types in ui/gfx/
so that failing gtest assertions pretty-print the values instead of
dumping the bytes of the objects. This way gtest assertions on these
types can be written in the form:

  EXPECT_EQ(a, b);

instead of
  EXPECT_EQ(a.ToString(), b.ToString());

which is currently used (inconsistently) to provide more readable
failure messages.

This is a bit tricky since gtest uses streams and somewhat complicated
template expansion magic to pretty print values and we don't want to
link the stream-based code into production code paths. This declares the
PrintTo() functions in the headers defining each of the geometry types,
using the <iosfwd> header to keep stream bloat to a minimum, and defines
the formatters in gfx_test_support. This way every test that
instantiates these printers has to declare a dependency on
gfx_test_support or it fails to link, but a test does not have to
#include any particular header to see the correct printer declaration
and thus expand the template correctly.

If we were to declare the PrintTo() functions in a test only header such
a gfx_util.h then the pretty printers would work reliably only if
*every* target in a translation unit that instantiated the comparison
saw this declaration. If some unit tests in a target #included the
header and some did not then it would be intederminate whether the
template instantiation linked in to the test binary was the pretty
printed one or the hex dump one (and in practice this appears to be
inconsistent across clang and gcc for whatever reason).

Review URL: https://codereview.chromium.org/368903003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@282270 0039d316-1c4b-4281-b951-d872f2087c98

2 weeks agoUpdate to Pipeline Metadata and Decoder stream
suderman@chromium.org [Thu, 10 Jul 2014 03:24:16 +0000 (03:24 +0000)]
Update to Pipeline Metadata and Decoder stream
to track the set of video rotation metadata. This
will later be used to correctly orient rotated videos.

BUG=47554

Review URL: https://codereview.chromium.org/363813002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@282236 0039d316-1c4b-4281-b951-d872f2087c98

2 weeks agoRename media::Clock to media::TimeDeltaInterpolator and update API.
scherkus@chromium.org [Thu, 10 Jul 2014 00:10:10 +0000 (00:10 +0000)]
Rename media::Clock to media::TimeDeltaInterpolator and update API.

Mostly cosmetic API changes. The guts of TimeDeltaInterpolator were
spruced up a bit.

BUG=370634

Review URL: https://codereview.chromium.org/376013003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@282186 0039d316-1c4b-4281-b951-d872f2087c98

2 weeks agoMSE: Optimize frame processor appends to streams
wolenetz@chromium.org [Wed, 9 Jul 2014 23:10:35 +0000 (23:10 +0000)]
MSE: Optimize frame processor appends to streams

This change collects contiguous processed frames for each track buffer
and appends them to track buffers' streams as groups of frames rather
than inefficiently appending each frame one at a time. One at a time
appends are still possible in the worst case, since collected processed
frames are appended at the end of ProcessFrames() and also prior to any
NotifyNewMediaSegmentStarting().

R=acolwell@chromium.org, damienv1@chromium.org
BUG=371197
TEST=no media_unittest, MSE layout test, or YT conformance unit test regression locally on Linux

Review URL: https://codereview.chromium.org/381443002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@282165 0039d316-1c4b-4281-b951-d872f2087c98

2 weeks agoAdd rotated MP4 test movie content.
scherkus@chromium.org [Wed, 9 Jul 2014 22:23:49 +0000 (22:23 +0000)]
Add rotated MP4 test movie content.

BUG=47554
TBR=suderman

Review URL: https://codereview.chromium.org/382683003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@282145 0039d316-1c4b-4281-b951-d872f2087c98

2 weeks agoAndroid VideoCapture: Use max frame rate instead of min for CaptureFormat enumeration.
mcasas@chromium.org [Wed, 9 Jul 2014 20:44:30 +0000 (20:44 +0000)]
Android VideoCapture: Use max frame rate instead of min for CaptureFormat enumeration.

BUG=390884

Review URL: https://codereview.chromium.org/379813003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@282115 0039d316-1c4b-4281-b951-d872f2087c98

2 weeks agoMac VideoCapture: return empty GetModel() for non-USB non-built-in cameras.
mcasas@chromium.org [Wed, 9 Jul 2014 16:34:13 +0000 (16:34 +0000)]
Mac VideoCapture: return empty GetModel() for non-USB non-built-in cameras.

This CL adds support for storage of the camera connection
information in the devices' names enumeration and subsequently
in the VideoCaptureDevice::Name structure.

-[AVCaptureDevice transportType] indicates the connection type
to the camera: USB, Built-in, PCI, etc. Note that this info is only
available for AVFoundation API and not for QTKit.

Chromium style check forces to move complex constructors
and destructors from video_capture_device.h to .cc.

TEST: Verify that the FaceTime Built-in HD (USB) used in
MBA >=2013 does not show incorrect modelID and vendorID
in the camera name -- those fields should be empty since
they only exist for USB or built-in cameras..

BUG=336651

Review URL: https://codereview.chromium.org/366593003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@282063 0039d316-1c4b-4281-b951-d872f2087c98

2 weeks agoInvoke the seek callback during abort if needed.
damienv@chromium.org [Wed, 9 Jul 2014 05:52:35 +0000 (05:52 +0000)]
Invoke the seek callback during abort if needed.

BUG=392281
TEST=ChunkDemuxerTest.SeekCompleteDuringAbort

Review URL: https://codereview.chromium.org/374203003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src/media@281965 0039d316-1c4b-4281-b951-d872f2087c98