summaryrefslogtreecommitdiffstats
path: root/media
Commit message (Collapse)AuthorAgeFilesLines
* Convert ConnectToApplication to take a params classben2015-11-202-11/+2
| | | | | | | | | R=sky@chromium.org BUG=none Review URL: https://codereview.chromium.org/1455833005 Cr-Commit-Position: refs/heads/master@{#360954}
* Reland: media::FFmpegVideoDecoder: remove ctor param |task_runner| and use a ↵mcasas2015-11-206-18/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ThreadChecker instead. Relanding http://crrev.com/1456993004 after sorting out a bot that failed to compile. Original CL description ------------------------------------------------ This CL removed the |task_runner| passed on construction to FFmpegVideoDecoder since: "... is used in just one location for PostTask()ing. The class itself is otherwise mostly single threaded (except perhaps construction), and passing a |task_runner| as ctor argument is confusingly indicating the opposite. A |thread_checker_| basically tells that a(ll) methods are run in a given thread, whichever this is." (from discussion in http://crrev.com/1438233003, which has sadly been reverted for unrelated issues, and is going to be relanded as http://crrev.com/1447343004). Removal of this |task_runner| is also necessary for using these two classes from WebRtc, see the linekd bug. BUG=554737 TEST=This is a tiny change, all unittest and content_browsertests should cover it. TBR=dalecurtis@chromium.org, bbudge@chromium.org(for video_decoder_shim.cc) Review URL: https://codereview.chromium.org/1464573003 Cr-Commit-Position: refs/heads/master@{#360953}
* Run gn --format over all .gn filesagrieve2015-11-206-7/+7
| | | | | | | | | | | | | | | | The recent formatter alphebetizing change is causing a lot of noise in code reviews. Figured it'd be worth a clean-up CL. Exact command I ran: find . -name "*.gn*" -exec gn format --in-place "{}" \; TBR=ddorwin@chromium.org BUG=554928 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1464873002 Cr-Commit-Position: refs/heads/master@{#360891}
* Remove three buffer mode implementation.xjz2015-11-2023-404/+11
| | | | | | | | BUG=557453 Review URL: https://codereview.chromium.org/1455843003 Cr-Commit-Position: refs/heads/master@{#360849}
* Reland: Media: Use libyuv::I420Copy instead of Copy{Y,U,V,A}Plane() in unittestsmcasas2015-11-207-100/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | Relanding http://crrev.com/1449293002 that got reverted to give way to the revert of http://crrev.com/1438233003. Otherwise this patch is innocent until otherwise proven :) Original CL description ---------------------------------------- Media: Use libyuv::I420Copy instead of Copy{Y,U,V,A}Plane() in unittests Because the former are as fast as the latter (mempcy) and usually faster. This CL is the last in its row, and removes the last uses of the said Copy functions, which only affects unit tests, and which are then removed. Incidentally it also removes MakeOpaqueAPlane() since it's unused. BUG=554196 TEST= all media_unittests passing, but in particular: ./out/Debug/media_unittests --gtest_filter='Pipeline**.*' and ./out/Debug/media_unittests --gtest_filter='Sk*Video*.*' TBR=dalecurtis@chromium.org Review URL: https://codereview.chromium.org/1459873003 Cr-Commit-Position: refs/heads/master@{#360838}
* Remove the custom base64url implementation in //media/cdm/peter2015-11-201-77/+52
| | | | | | | | | | | Semantics of the implementation are maintained by using the OMIT_PADDING policy when encoding, and the DISALLOW_PADDING policy when decoding. BUG=536745 Review URL: https://codereview.chromium.org/1459143003 Cr-Commit-Position: refs/heads/master@{#360820}
* Update EME browser tests to use EmbeddedTestServerjrummell2015-11-201-5/+9
| | | | | | | | | BUG=557930 TEST=affected tests pass Review URL: https://codereview.chromium.org/1456283002 Cr-Commit-Position: refs/heads/master@{#360776}
* ScopedPtrMap -> std::map from apps, ash, media, uilimasdf2015-11-202-10/+10
| | | | | | | | | | | | | | C++ 11 enables containers that contain move-only type, scoped_ptr. So, Use std::map<key, scoped_ptr<Foo>> instead of ScopedPtrMap. Also use std::move() instead of scoped_ptr::Pass(). TBR=avi@chromium.org BUG=554291, 557422 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1458553006 Cr-Commit-Position: refs/heads/master@{#360745}
* Avoid resampling for basic playback on Android.dalecurtis2015-11-191-1/+12
| | | | | | | | | | | | | | | | | | | Just like ChromeOS the hardware can handle the resampling for us without any issues, so don't spend CPU cycles on it. For resampling of MSE content we'll still resample for low sample rates (<44.1kHz) to ensure sample rate adaptations don't get locked into the low sample rate. Res mA New mA Delta 480p30 293 281 -4.10% 720p30 307 293 -4.56% 1080p60 442 431 -2.49% BUG=none TEST=2.5-4.5% power delta (mA) Review URL: https://codereview.chromium.org/1452063002 Cr-Commit-Position: refs/heads/master@{#360679}
* media: Add Clear Key key system support in MojoCdmFactory.xhwang2015-11-191-0/+21
| | | | | | | | | | | | Clear Key key system is supported with AesDecryptor doing decryption in the render process. BUG=521731 TEST=Tested Clear Key test page with L3_video.mp4.mpd and org.w3.clearkey. Review URL: https://codereview.chromium.org/1458993003 Cr-Commit-Position: refs/heads/master@{#360677}
* Reland of: media::VpxVideoDecoder cleanupmcasas2015-11-194-242/+231
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Relanding http://crrev.com/1438233003, which got reverted due to screwing with the MemoryPool lifetime, causing a use-after-free. This CL lands the original CL, keeping MemoryPool as ref-counted and adding some comments on it. Original CL description ----------------------------------------------- Couple of deep-cut cleanups: - Inner class MemoryPool is ref-counted thread safe when it doesn't need to, removed it, using WeakPtr for the only Bind use case, which anyway already had a BindToCurrentLoop(). - moved MemoryPool's registration & dereg with MemoryDumpManager to its ctor/dtor. - reshuffled a few method to follow declaration order (sorry that it makes review harder!). - removed VpxVideoDecoder's |task_runner_|, which is used mostly for thread checking (with a note in Reset()). - merged Decode() and DecodeBuffer() following a TODO suggestion. This makes |decode_cb_| superfluous, removed. - added vpx error stringification (useful!). - clarified in DCHECK()s the supported pixel formats vs codec and other assumptions that were not so evident to me. - using libyuv::I420 copy ISO Copy{Y,U,V}Plane(). Also, MakeOpaqueAPlane() > libyuv::SetPlane() and CopyAPlane() -> libyuv::CopyPlane(). - changed some if-if to early returns. Note that VP9 could have supported Alpha channel if looking at the code in ConfigureDecoder(), but not if we looked at CopyVpxImageTo(). Made this evident. BUG=554196, 554737 TEST=Tried bags of tests including this functionality, in particular ./out/Debug/media_unittests --gtest_filter="PipelineIntegrationTest.*_VP*" and anything relating to playing a WebM file from Chrome (big buck bunny). Review URL: https://codereview.chromium.org/1447343004 Cr-Commit-Position: refs/heads/master@{#360665}
* Revert of media::FFmpegVideoDecoder: remove ctor param |task_runner| and use ↵mcasas2015-11-195-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a ThreadChecker instead. (patchset #1 id:20001 of https://codereview.chromium.org/1456993004/ ) Reason for revert: Broke compilation in a Mac bot (https://chromegw.corp.google.com/i/official.desktop.continuous/builders/mac%20trunk/builds/20908) (I wonder why the CQ passed) http://crbug.com/558587 Original issue's description: > media::FFmpegVideoDecoder: remove ctor param |task_runner| and use a ThreadChecker instead. > > This CL removed the |task_runner| passed on construction to > FFmpegVideoDecoder since: "... is used in just one location > for PostTask()ing. The class itself is otherwise mostly single > threaded (except perhaps construction), and passing a > |task_runner| as ctor argument is confusingly indicating the > opposite. A |thread_checker_| basically tells that a(ll) methods > are run in a given thread, whichever this is." > (from discussion in http://crrev.com/1438233003, which has > sadly been reverted for unrelated issues, and is going to be > relanded as http://crrev.com/1447343004). > > Removal of this |task_runner| is also necessary for using these > two classes from WebRtc, see the linekd bug. > > BUG=554737 > > TEST=This is a tiny change, all unittest and content_browsertests should cover it. > > Committed: https://crrev.com/97e43b3e9b64da825f925a047b8d91e75260fd82 > Cr-Commit-Position: refs/heads/master@{#360628} TBR=dalecurtis@chromium.org,chcunningham@chromium.org,bbudge@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=554737 Review URL: https://codereview.chromium.org/1459163003 Cr-Commit-Position: refs/heads/master@{#360649}
* Try to remove <algorithm> header from scoped_ptr.h, again.dcheng2015-11-191-0/+2
| | | | | | | | | | | | | | | | Hopefully this is really the last one... unfortunately, several waterfall configurations lack trybot coverage, and practical experience has shown that it's possible for new regressions to be introduced in the time taken to build the different configs on the waterfall. BUG=none R=danakj TBR=jrummell Review URL: https://codereview.chromium.org/1462843002 Cr-Commit-Position: refs/heads/master@{#360632}
* media::FFmpegVideoDecoder: remove ctor param |task_runner| and use a ↵mcasas2015-11-195-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | ThreadChecker instead. This CL removed the |task_runner| passed on construction to FFmpegVideoDecoder since: "... is used in just one location for PostTask()ing. The class itself is otherwise mostly single threaded (except perhaps construction), and passing a |task_runner| as ctor argument is confusingly indicating the opposite. A |thread_checker_| basically tells that a(ll) methods are run in a given thread, whichever this is." (from discussion in http://crrev.com/1438233003, which has sadly been reverted for unrelated issues, and is going to be relanded as http://crrev.com/1447343004). Removal of this |task_runner| is also necessary for using these two classes from WebRtc, see the linekd bug. BUG=554737 TEST=This is a tiny change, all unittest and content_browsertests should cover it. Review URL: https://codereview.chromium.org/1456993004 Cr-Commit-Position: refs/heads/master@{#360628}
* Use std::default_delete as the default deleter for scoped_ptr.dcheng2015-11-1911-39/+34
| | | | | | | | | | | The aim is to make scoped_ptr and std::unique_ptr functionally identical so scoped_ptr can simply be a typedef. BUG=554298 Review URL: https://codereview.chromium.org/1445003002 Cr-Commit-Position: refs/heads/master@{#360539}
* Multibuffer reader implementationhubbe2015-11-196-5/+916
| | | | | | | | | | | | | | | | | | | | | Provides a simpler, byte-oriented api for getting data out of a multibuffer. This CL also has the unit tests for the multibuffer itself. (Since those tests uses the MultiBufferReader class.) Depends on: https://codereview.chromium.org/1165903002 Media cache design doc: https://docs.google.com/document/d/15q6LTG0iDUe30QcoMtj4XNmKCa_7W_Q2uUIPFsJhS1E/edit BUG=514719, 557589 Committed: https://crrev.com/f8b2532f9f9b4a35f396602bb80dfc34ee102fe4 Cr-Commit-Position: refs/heads/master@{#360244} Review URL: https://codereview.chromium.org/1420883004 Cr-Commit-Position: refs/heads/master@{#360451}
* Fix UMA metrics for MediaSourcePlayer.timav2015-11-182-6/+21
| | | | | | | | | | This should be part of CL https://codereview.chromium.org/1367403003. BUG=407577, 557513 Review URL: https://codereview.chromium.org/1458783002 Cr-Commit-Position: refs/heads/master@{#360428}
* Always create OPUS decoder buffer with kSampleFormatF32zhengxiong2015-11-181-8/+5
| | | | | | | | | | The libopus call used always returns interleaved fp samples, which can cause issues if the provided audio config contains a sample_format other than interleaved fp. BUG= Review URL: https://codereview.chromium.org/1452913003 Cr-Commit-Position: refs/heads/master@{#360408}
* media: Support SetCdm() on GpuVideoDecoder.xhwang2015-11-182-2/+58
| | | | | | | | | BUG=545099 TEST=Manually tested on Android with a hack in the GPU process. Review URL: https://codereview.chromium.org/1450173002 Cr-Commit-Position: refs/heads/master@{#360403}
* media: Add static MojoCdmService::GetCdm().xhwang2015-11-182-0/+68
| | | | | | | | | | | This provides a way to statically lookup all CDMs created by MojoCdmService by their CDM IDs. BUG=545099 Review URL: https://codereview.chromium.org/1448303002 Cr-Commit-Position: refs/heads/master@{#360402}
* MediaCodecPlayer: prevent requesting data in wrong statestimav2015-11-181-0/+13
| | | | | | | | | | | | | | | | | | | | | MediaCodecPlayer expects the demuxer response for each demuxer data request. Currently it might happen that no response would come after a data request, which might result in the player lockup. This situation might happen if the data request callback arrives late at the Media thread, e.g. after the player started the Seek sequence. In this case the data request could come after the demuxer seek request which violates the demuxer contract. This CL checks the decoder state before calling the data request from demuxer. BUG=557334 Review URL: https://codereview.chromium.org/1455853002 Cr-Commit-Position: refs/heads/master@{#360392}
* Avoid frame copy in RTCVideoEncoder for VideoFrame::STORAGE_SHMEMemircan2015-11-181-0/+3
| | | | | | | | | | | | | | | | | | | | | | Detailed DOC on: https://goo.gl/jzT23g - https://docs.google.com/a/chromium.org/document/d/1_WdmdMxKNzlARLS7z2Z4_RyMalbHWjrG8SITWLuWjdI/edit?usp=sharing Currently, RTCVideoEncoder is responsible for doing a deep video frame copy when converting webrtc::VideoFrame to Chrome’s media::VideoFrame for HW encode. This stage provides a shared_memory_handle to VideoFrame to share with GPU process for HW encode. However, this copy may be unnecessary: If we are still holding onto the buffers that are provided by Chrome, we have the shared_memory_handle information in media::VideoFrame. We can set media::VideoFrame to be native_handle() in the WebRTCAdapter and keep this information. TBR=dalecurtis@chromium.org on media/base/video_frame.cc TEST= Ran AppRTC loopback on guado. CPU utilization difference is also given on the DOC above. Review URL: https://codereview.chromium.org/1432773004 Cr-Commit-Position: refs/heads/master@{#360390}
* Reland "Fix video frame overlay codepath for Chromecast"halliwell2015-11-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We stayed on m43 until recently and had no tests to verify that our video frames were correctly generating overlay quads in the compositor. This is a collection of fixes required to get them working again. Some explanation of specific points: 1. Pass-through GLImage case. We use a native pixmap to plumb the overlay frames through to the compositor, but handle actual overlay rendering externally (via our hw-accelerated media playback path). Previously, we relied on a GLImage subclass specifically for this case, which got lost in other refactoring: see https://codereview.chromium.org/1258713002 The new approach here is to: * Support the pass-through case directly in GLImageEGL case, i.e. allow |egl_image_| == EGL_NO_IMAGE_KHR. * GLImageEGL::BindTexImage must return false for this case, and so ScheduleOverlayCHROMIUM should now treat this as a no-op instead of a GL error. 2. XRGB video frames We have always used this type for our dummy video frame, because the compositor is picky about which formats can be allowed for overlays. Support for it was removed here: https://codereview.chromium.org/1150863008/ and we simply restore it here. 3. Adding ClientPixmap/ClientPixmapFactory for Cast ozone This CL: https://codereview.chromium.org/1128113011 means we need these implementing in Cast ozone platform. Some additional tests will be coming soon (they're dependent on other CLs so excluded here) to hopefully reduce such breakage in future :) BUG=internal b/25230251 TBR=alexst@chromium.org,xhwang@chromium.org This reverts commit 5a711190d60ae638c66cffd6247cb36ee0810283. Review URL: https://codereview.chromium.org/1455653002 Cr-Commit-Position: refs/heads/master@{#360385}
* Revert of Multibuffer reader implementation (patchset #5 id:80001 of ↵msramek2015-11-186-912/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1420883004/ ) Reason for revert: This CL probably broke media_blink_unittests: MultiBufferTest.RandomTest and MultiBufferTest.RandomTest_RangeSupported. Original issue's description: > Multibuffer reader implementation > > Provides a simpler, byte-oriented api for getting data out of a multibuffer. > This CL also has the unit tests for the multibuffer itself. (Since those tests > uses the MultiBufferReader class.) > > Depends on: > https://codereview.chromium.org/1165903002 > > Media cache design doc: > https://docs.google.com/document/d/15q6LTG0iDUe30QcoMtj4XNmKCa_7W_Q2uUIPFsJhS1E/edit > > BUG=514719 > > Committed: https://crrev.com/f8b2532f9f9b4a35f396602bb80dfc34ee102fe4 > Cr-Commit-Position: refs/heads/master@{#360244} TBR=dalecurtis@chromium.org,hubbe@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=514719,557589 Review URL: https://codereview.chromium.org/1456903002 Cr-Commit-Position: refs/heads/master@{#360312}
* include what you use: errno.h and string.h in media/mostynb2015-11-183-0/+3
| | | | | | | | | | | Add missing errno.h includes for errno and string.h includes for strerror. TBR=qinmin Review URL: https://codereview.chromium.org/1429383002 Cr-Commit-Position: refs/heads/master@{#360276}
* Cast Streaming: Enable non-blocking IO by default for Windows.miu2015-11-182-13/+18
| | | | | | | | BUG=556910 Review URL: https://codereview.chromium.org/1458753002 Cr-Commit-Position: refs/heads/master@{#360268}
* Revert of media::VpxVideoDecoder cleanup (patchset #4 id:260001 of ↵mcasas2015-11-184-234/+248
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1438233003/ ) Reason for revert: Suspected culprit of http://crbug.com/557070 Original issue's description: > media::VpxVideoDecoder cleanup > > Couple of deep-cut cleanups: > > - Inner class MemoryPool is ref-counted thread safe when it > doesn't need to, removed it, using WeakPtr for the only Bind > use case, which anyway already had a BindToCurrentLoop(). > - moved MemoryPool's registration & dereg with > MemoryDumpManager to its ctor/dtor. > > - reshuffled a few method to follow declaration order (sorry > that it makes review harder!). > - removed VpxVideoDecoder's |task_runner_|, which is used > mostly for thread checking (with a note in Reset()). > - merged Decode() and DecodeBuffer() following a TODO > suggestion. This makes |decode_cb_| superfluous, removed. > - added vpx error stringification (useful!). > - clarified in DCHECK()s the supported pixel formats vs codec > and other assumptions that were not so evident to me. > - using libyuv::I420 copy ISO Copy{Y,U,V}Plane(). Also, > MakeOpaqueAPlane() > libyuv::SetPlane() and > CopyAPlane() -> libyuv::CopyPlane(). > - changed some if-if to early returns. > > Note that VP9 could have supported Alpha channel if > looking at the code in ConfigureDecoder(), but not if > we looked at CopyVpxImageTo(). Made this evident. > > BUG=554196, 554737 > TEST=Tried bags of tests including this > functionality, in particular > ./out/Debug/media_unittests --gtest_filter="PipelineIntegrationTest.*_VP*" > and anything relating to playing a WebM file > from Chrome (big buck bunny). > > TBR=bbudge@chromium.org for the tiny change in > pepper shim, since is just removing the task runner > which is anyway used without having to cache it. > > Committed: https://crrev.com/6b87207188863b43df5a4a089bcfc2b227d0be73 > Cr-Commit-Position: refs/heads/master@{#359880} TBR=chcunningham@chromium.org,dalecurtis@chromium.org,dcastagna@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=554196, 554737 Review URL: https://codereview.chromium.org/1456753003 Cr-Commit-Position: refs/heads/master@{#360263}
* Revert of Media: Use libyuv::I420Copy instead of Copy{Y,U,V,A}Plane() in ↵mcasas2015-11-187-13/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | unittests (patchset #1 id:40001 of https://codereview.chromium.org/1449293002/ ) Reason for revert: Unrelated http://crbug.com/557070 forced revert of http://crrev.com/1438233003/ which forces revert of this fella here. Original issue's description: > Media: Use libyuv::I420Copy instead of Copy{Y,U,V,A}Plane() in unittests > > Because the former are as fast as the latter (mempcy) and > usually faster. This CL is the last in its row, and removes > the last uses of the said Copy functions, which only affects > unit tests, and which are then removed. Incidentally it also > removes MakeOpaqueAPlane() since it's unused. > > BUG=554196 > TEST= all media_unittests passing, but in particular: > ./out/Debug/media_unittests --gtest_filter='Pipeline**.*' > and > ./out/Debug/media_unittests --gtest_filter='Sk*Video*.*' > > Committed: https://crrev.com/3255e7da75ec61125ddbb21f7fba0acf97a45bb7 > Cr-Commit-Position: refs/heads/master@{#360135} TBR=dalecurtis@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=554196 Review URL: https://codereview.chromium.org/1456853002 Cr-Commit-Position: refs/heads/master@{#360255}
* Multibuffer reader implementationhubbe2015-11-186-5/+912
| | | | | | | | | | | | | | | | | | Provides a simpler, byte-oriented api for getting data out of a multibuffer. This CL also has the unit tests for the multibuffer itself. (Since those tests uses the MultiBufferReader class.) Depends on: https://codereview.chromium.org/1165903002 Media cache design doc: https://docs.google.com/document/d/15q6LTG0iDUe30QcoMtj4XNmKCa_7W_Q2uUIPFsJhS1E/edit BUG=514719 Review URL: https://codereview.chromium.org/1420883004 Cr-Commit-Position: refs/heads/master@{#360244}
* Reland "Add unit tests for CdmAdapter"jrummell2015-11-175-14/+396
| | | | | | | | | BUG=510088,555798,556346 TEST=new unittests pass Review URL: https://codereview.chromium.org/1447183004 Cr-Commit-Position: refs/heads/master@{#360206}
* Revert of Enable Beamforming by default on buddy (patchset #3 id:40001 of ↵aluebs2015-11-171-7/+2
| | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1431513009/ ) Reason for revert: This was done as a result of a misunderstanding and is not the desired behavior. Original issue's description: > Enable Beamforming by default on buddy > > Committed: https://crrev.com/4b259c90d8d87f54ab7f3fdf9834fb6ed7586280 > Cr-Commit-Position: refs/heads/master@{#358478} BUG=557252 TBR=tommi@chromium.org,aluebs@webrtc.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/1453823002 Cr-Commit-Position: refs/heads/master@{#360167}
* Remove async=false when loading scripts for EME testsjrummell2015-11-171-1/+1
| | | | | | | | | | | | | async is a boolean attribute, so any specification of it makes it true. Since we want the scripts to execute in order, it shouldn't be mentioned at all. BUG=555744 TEST=affected tests pass Review URL: https://codereview.chromium.org/1454803002 Cr-Commit-Position: refs/heads/master@{#360161}
* media: Post task in MediaDrmBridge::OnSessionExpirationUpdate().xhwang2015-11-171-3/+6
| | | | | | | | | | This was missed in https://codereview.chromium.org/1414923004/ BUG=546108 Review URL: https://codereview.chromium.org/1455723002 Cr-Commit-Position: refs/heads/master@{#360152}
* Make video/mp2t a strict media mime typeservolk2015-11-172-1/+69
| | | | | | | | | | | This CL adds support for old-style avc1 codec ids in mp2t container and makes video/mp2t a strict media mime type. BUG=527627 Review URL: https://codereview.chromium.org/1313513008 Cr-Commit-Position: refs/heads/master@{#360138}
* Media: Use libyuv::I420Copy instead of Copy{Y,U,V,A}Plane() in unittestsmcasas2015-11-177-95/+13
| | | | | | | | | | | | | | | | | | Because the former are as fast as the latter (mempcy) and usually faster. This CL is the last in its row, and removes the last uses of the said Copy functions, which only affects unit tests, and which are then removed. Incidentally it also removes MakeOpaqueAPlane() since it's unused. BUG=554196 TEST= all media_unittests passing, but in particular: ./out/Debug/media_unittests --gtest_filter='Pipeline**.*' and ./out/Debug/media_unittests --gtest_filter='Sk*Video*.*' Review URL: https://codereview.chromium.org/1449293002 Cr-Commit-Position: refs/heads/master@{#360135}
* Revert "Fix video frame overlay codepath for Chromecast"halliwell2015-11-171-2/+2
| | | | | | | | | | | | | | Reverting because this broke ChromeOS codesearch bot. Will reland with fix included. This reverts commit b07a46453b53b801c6127600b5814a1ed47f7b36. TBR=sievers@chromium.org,alexst@chromium.org,xhwang@chromium.org BUG= Review URL: https://codereview.chromium.org/1448393002 Cr-Commit-Position: refs/heads/master@{#360093}
* Prior to libva-intel-driver 1.6.1 we were emitting a scaling operation evenlionel.g.landwerlin2015-11-172-4/+14
| | | | | | | | | | | | | | | | | | | | | | | though we didn't need scaling in most cases. We had 2 different hashes : 75d2f70272df8687dbda32e2eddd0a00 (Ivybridge) 27ddce017b884f8bbfa159ad180a71d2 (Haswell) Then libva-intel-driver 1.6.1 introduced a fast path for yuv->rgb conversion when no scaling is required. 8bbc743c7ac92c2442d09e8b3fb9f4f5 (Ivybridge & Haswell) Now we're switching away from the hardcoded JPEG yuv->rgb conversion matrix to use a configurable one instead and we default to the ITU-R BT.601 matrix. We leave the old hashes in for a transition period. BUG=462179 TEST=video_decode_accelerator_unittest Review URL: https://codereview.chromium.org/1416973018 Cr-Commit-Position: refs/heads/master@{#360059}
* Remove dead code paths around PIXEL_STORAGE_TEXTURE in capture pipeline.miu2015-11-175-26/+40
| | | | | | | | | | | | | | | | Removes code to capture a result as a GPU texture (i.e., tab/desktop capture without read-back into main memory). This code has no activation path and is being removed to make future refactoring/clean-up efforts go more smoothly. This change also has a few minor clean-ups/comment changes in downstream code, based on revealations during the code removal process. BUG=552570 Review URL: https://codereview.chromium.org/1439533004 Cr-Commit-Position: refs/heads/master@{#360021}
* Fix video frame overlay codepath for Chromecasthalliwell2015-11-171-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We stayed on m43 until recently and had no tests to verify that our video frames were correctly generating overlay quads in the compositor. This is a collection of fixes required to get them working again. Some explanation of specific points: 1. Pass-through GLImage case. We use a native pixmap to plumb the overlay frames through to the compositor, but handle actual overlay rendering externally (via our hw-accelerated media playback path). Previously, we relied on a GLImage subclass specifically for this case, which got lost in other refactoring: see https://codereview.chromium.org/1258713002 The new approach here is to: * Support the pass-through case directly in GLImageEGL case, i.e. allow |egl_image_| == EGL_NO_IMAGE_KHR. * GLImageEGL::BindTexImage must return false for this case, and so ScheduleOverlayCHROMIUM should now treat this as a no-op instead of a GL error. 2. XRGB video frames We have always used this type for our dummy video frame, because the compositor is picky about which formats can be allowed for overlays. Support for it was removed here: https://codereview.chromium.org/1150863008/ and we simply restore it here. 3. Adding ClientPixmap/ClientPixmapFactory for Cast ozone This CL: https://codereview.chromium.org/1128113011 means we need these implementing in Cast ozone platform. Some additional tests will be coming soon (they're dependent on other CLs so excluded here) to hopefully reduce such breakage in future :) BUG=internal b/25230251 Review URL: https://codereview.chromium.org/1414113010 Cr-Commit-Position: refs/heads/master@{#359989}
* Move MediaDrmBridge provision communication to native side.timav2015-11-1610-124/+219
| | | | | | | | | | | | | | | | MediaDrmBridge currently uses Android's URLConnection and AsyncTask to communicate with provisioning server. URLConnection bypasses Chrome HTTP stack , AsyncTask requires the UI thread. This CL moves the communication to C++ side and uses a helper class ProvisionFetcher that encapsulate the provisioning. The MediaDrmBridge takes this ProvisionFetcher as a paremeter. BUG=546092 Review URL: https://codereview.chromium.org/1427183002 Cr-Commit-Position: refs/heads/master@{#359923}
* media::VpxVideoDecoder cleanupmcasas2015-11-164-248/+234
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Couple of deep-cut cleanups: - Inner class MemoryPool is ref-counted thread safe when it doesn't need to, removed it, using WeakPtr for the only Bind use case, which anyway already had a BindToCurrentLoop(). - moved MemoryPool's registration & dereg with MemoryDumpManager to its ctor/dtor. - reshuffled a few method to follow declaration order (sorry that it makes review harder!). - removed VpxVideoDecoder's |task_runner_|, which is used mostly for thread checking (with a note in Reset()). - merged Decode() and DecodeBuffer() following a TODO suggestion. This makes |decode_cb_| superfluous, removed. - added vpx error stringification (useful!). - clarified in DCHECK()s the supported pixel formats vs codec and other assumptions that were not so evident to me. - using libyuv::I420 copy ISO Copy{Y,U,V}Plane(). Also, MakeOpaqueAPlane() > libyuv::SetPlane() and CopyAPlane() -> libyuv::CopyPlane(). - changed some if-if to early returns. Note that VP9 could have supported Alpha channel if looking at the code in ConfigureDecoder(), but not if we looked at CopyVpxImageTo(). Made this evident. BUG=554196, 554737 TEST=Tried bags of tests including this functionality, in particular ./out/Debug/media_unittests --gtest_filter="PipelineIntegrationTest.*_VP*" and anything relating to playing a WebM file from Chrome (big buck bunny). TBR=bbudge@chromium.org for the tiny change in pepper shim, since is just removing the task runner which is anyway used without having to cache it. Review URL: https://codereview.chromium.org/1438233003 Cr-Commit-Position: refs/heads/master@{#359880}
* fix build when ffmpeg, libvpx and libwebm are disabledj.isorce2015-11-163-0/+20
| | | | | | | | | | | | | | | | | | | | | | | Tested with all combinaisons of GYP_DEFINES="media_use_ffmpeg=i media_use_libvpx=j media_use_libwebm=k" with i,j,k in {0, 1}^3 Same with GN: media_use_ffmpeg = i media_use_libvpx = j media_use_libwebm = k with i,j,k in {false, true}^3 If disabled it shows a black rectangle on video tag as expected. If only ffmpeg is disabled, it succeeds to play webm video encoded with vpx. BUG= R=reillyg@chromium.org, jochen@chromium.org, xhwang@chromium.org, raymes@chromium.org TEST=GYP_DEFINES="media_use_ffmpeg=0 media_use_libvpx=0 media_use_libwebm=0" Review URL: https://codereview.chromium.org/1415793003 Cr-Commit-Position: refs/heads/master@{#359855}
* Revert of Add unit tests for CdmAdapter (patchset #6 id:100001 of ↵zhaoqin2015-11-165-396/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1428753010/ ) Reason for revert: valgrind reports leaks with no-debug-symbol callstack BUG=556346 TBR=jrummell@chromium.org Original issue's description: > Add unit tests for CdmAdapter > > BUG=510088 > TEST=new unittests pass > > Committed: https://crrev.com/30996193fe3e69fe9ccd52471900bf5685c54956 > Cr-Commit-Position: refs/heads/master@{#359582} TBR=xhwang@chromium.org,jrummell@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=510088 Review URL: https://codereview.chromium.org/1447943002 Cr-Commit-Position: refs/heads/master@{#359798}
* media: Pass SetCdmReadyCB in {Audio|Video}Decoder::Initialize().xhwang2015-11-1536-129/+179
| | | | | | | | | | | | | | | | | | | | (This reverts commit 0c1df0a37a815953d1af3d4eaf145af969210d5d with fix.) This enables all audio/video decoders the ability to get access to the CDM associated with the media element. This is useful for certain decoders to handle encrypted streams. For Decrypting{Audio|Video}Decoder and DecryptingDemuxerStream, the SetCdmReadyCB is simply moved from constructor to Initialize() call. In the future this could also help move Decrypting{Audio|Video}Decoder creation out of DecoderSelector so that it is treated the same as all other decoders. TBR=bbudge@chromium.org,jrummell@chromium.org,dalecurtis@chromium.org BUG=545099 Review URL: https://codereview.chromium.org/1447533006 Cr-Commit-Position: refs/heads/master@{#359754}
* Revert of media: Pass SetCdmReadyCB in {Audio|Video}Decoder::Initialize(). ↵loyso2015-11-1435-176/+128
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (patchset #2 id:20001 of https://codereview.chromium.org/1442933002/ ) Reason for revert: Mac build doesn't compile. ../../media/cast/sender/h264_vt_encoder_unittest.cc:140:43: error: too few arguments to function call, expected 5, have 4 base::Unretained(this))); ^ ../../media/filters/ffmpeg_video_decoder.h:42:3: note: 'Initialize' declared here void Initialize(const VideoDecoderConfig& config, ^ 1 error generated. Original issue's description: > media: Pass SetCdmReadyCB in {Audio|Video}Decoder::Initialize(). > > This enables all audio/video decoders the ability to get access to the CDM > associated with the media element. This is useful for certain decoders to handle > encrypted streams. > > For Decrypting{Audio|Video}Decoder and DecryptingDemuxerStream, the SetCdmReadyCB > is simply moved from constructor to Initialize() call. In the future this could > also help move Decrypting{Audio|Video}Decoder creation out of DecoderSelector so > that it is treated the same as all other decoders. > > TBR=bbudge@chromium.org > BUG=545099 > > Committed: https://crrev.com/406d0255ae170720d2bc68cd7783855f16f3be17 > Cr-Commit-Position: refs/heads/master@{#359702} TBR=jrummell@chromium.org,dalecurtis@chromium.org,ddorwin@chromium.org,bbudge@chromium.org,xhwang@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=545099 Review URL: https://codereview.chromium.org/1446713003 Cr-Commit-Position: refs/heads/master@{#359731}
* media: Pass SetCdmReadyCB in {Audio|Video}Decoder::Initialize().xhwang2015-11-1435-128/+176
| | | | | | | | | | | | | | | | | | This enables all audio/video decoders the ability to get access to the CDM associated with the media element. This is useful for certain decoders to handle encrypted streams. For Decrypting{Audio|Video}Decoder and DecryptingDemuxerStream, the SetCdmReadyCB is simply moved from constructor to Initialize() call. In the future this could also help move Decrypting{Audio|Video}Decoder creation out of DecoderSelector so that it is treated the same as all other decoders. TBR=bbudge@chromium.org BUG=545099 Review URL: https://codereview.chromium.org/1442933002 Cr-Commit-Position: refs/heads/master@{#359702}
* media: Support SetCdm() on VideoDecodeAccelerator interface.xhwang2015-11-132-2/+28
| | | | | | | | | | | This is needed to support encrypted stream handling in VideoDecodeAccelerator (VDA) implmentations on certain platforms (e.g. Android). BUG=545099 Review URL: https://codereview.chromium.org/1438063002 Cr-Commit-Position: refs/heads/master@{#359696}
* Multi reader/writer cache/bufferhubbe2015-11-134-0/+805
| | | | | | | | | | | | | | | | | | | | | MultiBuffer is meant to be integrated into buffered_resource_loader to provide more efficient cacheing. Unit tests are in a separate CL: https://codereview.chromium.org/1420883004 Depends on: https://codereview.chromium.org/1427433012/ https://codereview.chromium.org/1422523007/ Media cache design doc: https://docs.google.com/document/d/15q6LTG0iDUe30QcoMtj4XNmKCa_7W_Q2uUIPFsJhS1E/edit BUG=514719 Review URL: https://codereview.chromium.org/1165903002 Cr-Commit-Position: refs/heads/master@{#359627}
* WebRTC render smoothness test shows on mac platform the timestamps on the ↵qiangchen2015-11-136-5/+63
| | | | | | | | | | | | | video frames are quite irregular. The reason is that we read the system clock time, when the frame is available to chromium, but the system clock may not be high definition. In this CL, we changed the behavior to reading timestamp from the capture driver. BUG=549744 TEST=all unit test and browser test passing, apprtc working as before. Review URL: https://codereview.chromium.org/1421583007 Cr-Commit-Position: refs/heads/master@{#359620}
* Add unit tests for CdmAdapterjrummell2015-11-135-14/+396
| | | | | | | | | BUG=510088 TEST=new unittests pass Review URL: https://codereview.chromium.org/1428753010 Cr-Commit-Position: refs/heads/master@{#359582}