summaryrefslogtreecommitdiffstats
path: root/media/base
Commit message (Collapse)AuthorAgeFilesLines
* First patch in making destructors of refcounted objects private.jam@chromium.org2009-11-052-0/+16
| | | | | | | BUG=26749 Review URL: http://codereview.chromium.org/360042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31136 0039d316-1c4b-4281-b951-d872f2087c98
* Reduce test duration for valgrind.fbarchard@chromium.org2009-11-031-1/+1
| | | | | | | | | BUG=26556 TEST=run valgrind on Mac unittests. Should take less than 1 minute for YUV test. Review URL: http://codereview.chromium.org/346036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30805 0039d316-1c4b-4281-b951-d872f2087c98
* Add yasm and ffmpeg into the build tree for linux.ajwong@chromium.org2009-10-301-0/+10
| | | | | | | | | BUG=22307 TEST=builds correctly, and an html5 video runs. Review URL: http://codereview.chromium.org/300013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30571 0039d316-1c4b-4281-b951-d872f2087c98
* -fPIC buildable version of yuv for 64 bit linux.fbarchard@chromium.org2009-10-161-97/+106
| | | | | | | | | BUG=25070 TEST=add -fPIC to gcc. Old code failed to build. New code builds with 64 bit. Review URL: http://codereview.chromium.org/269106 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29329 0039d316-1c4b-4281-b951-d872f2087c98
* Move Alsa device opening into the audio thread, and add in support for ↵ajwong@chromium.org2009-10-162-0/+34
| | | | | | | | | | | | | | | multi-channel audio. Moving the device opening into the audio thread will prevent browser hangs for badly behaving alsa implementations (like pulseaudio) that can hang snd_pcm_open if pulseaudiod is wedged, even if SND_PCM_NONBLOCK is requested. For multi-channel audio, device enumeration has been added to try and find a multi-channel device with a stable channel mapping. According to http://0pointer.de/blog/projects/guide-to-sound-apis.html, default should only be used with mono and stereo stream because the channel ordering is not defined by Alsa. To get a well-defined channel ordering, one must use one of the surround40, surround51, etc., device names. However, these device names do not always allow multiple opens, so a fallback scheme is implemented to use default if necessary. BUG=20945,17703 TEST=listened with built-in soundcard and USB soundcard with various other audio programs running. Review URL: http://codereview.chromium.org/275022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29299 0039d316-1c4b-4281-b951-d872f2087c98
* Report stalled event correctly for <video>hclam@chromium.org2009-10-164-1/+45
| | | | | | | | | | | | | | | | | | | | | BUG=20127 BUG=13568 TEST=Opens a web page, stalled event should be fire only if network is actuall stalled. What this patch does: 1. Report Loading / Idle according to whether we are actively receiving data in the BuffereResourceLoader. This is done by signaling the network events to BufferedDataSource and then to the media playback pipeline. 2. Report byteLoaded() as the last byte position buffered. This will enable an actual ticking progress for the progress event. With this value actually ticking, stalled event is suppressed. Review URL: http://codereview.chromium.org/269002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29235 0039d316-1c4b-4281-b951-d872f2087c98
* Mark YUV conversion functions private_extern on the Mac. These symbols don'tmark@chromium.org2009-10-151-2/+0
| | | | | | | | | | | need to leak beyond the module in which they're used. BUG=24911 TEST=nm C.app/Contents/Versions/*/C F.framework/C F | grep " [A-TV-Z] " should not show _MacConvertYUVToRGB32Row or _MacScaleYUVToRGB32Row. Review URL: http://codereview.chromium.org/269098 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29181 0039d316-1c4b-4281-b951-d872f2087c98
* MMX2 improvements on Linux 64 bit.fbarchard@chromium.org2009-10-153-77/+87
| | | | | | | | | | | MMX2 to avoid EMMS LEA to remove 2 instructions from Scale loop shuffle to remove one instruction sub at top of loop avoids one branch Review URL: http://codereview.chromium.org/269088 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29107 0039d316-1c4b-4281-b951-d872f2087c98
* Reverting 29019.finnur@chromium.org2009-10-143-70/+66
| | | | | | | | | Reverting due to test_shell_tests Linux 64 release failures TBR: fbarchard Review URL: http://codereview.chromium.org/275021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29031 0039d316-1c4b-4281-b951-d872f2087c98
* Use lea to remove 2 instructions from the inner loop of YUV Scale.fbarchard@chromium.org2009-10-143-66/+70
| | | | | | | | | | | Use MMX2 to remove emms. unittest has code to time yuv scale and convert 100 times so it takes about 1 second... useful for catching performance issues. But the code is disabled. BUG=23263 TEST=media_unittest should pass and run much faster: 28% faster than 32 bit version. Review URL: http://codereview.chromium.org/273047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29019 0039d316-1c4b-4281-b951-d872f2087c98
* 64 bit linux yuvfbarchard@chromium.org2009-10-132-40/+120
| | | | | | | | BUG=23263 TEST=media_unittest should pass and run much faster: faster than 32 bit even. Review URL: http://codereview.chromium.org/268029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28802 0039d316-1c4b-4281-b951-d872f2087c98
* use djb2 hash in media/basefbarchard@chromium.org2009-10-121-21/+17
| | | | | | Review URL: http://codereview.chromium.org/266040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28718 0039d316-1c4b-4281-b951-d872f2087c98
* Move more ICU-dependent stuff from base into base/i18n. Some test stuff alsobrettw@chromium.org2009-10-091-1/+1
| | | | | | | | | | | | depended on this, so to make the DEPS work out, I made a new base/test directory where I moved the testing-related files into a new directory base/test. TEST=none BUG=none Review URL: http://codereview.chromium.org/266038 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28569 0039d316-1c4b-4281-b951-d872f2087c98
* DJB2 Hash for applications where high speed hash or checksum values are needed.fbarchard@chromium.org2009-10-093-0/+71
| | | | | | | | | BUG=21126 TEST=djb2_unittest.cc has a quick test. will replace versions in media unittests and media_bench in future. Review URL: http://codereview.chromium.org/193028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28532 0039d316-1c4b-4281-b951-d872f2087c98
* Off by one in YUV scale caused an extra read (mostly harmless)fbarchard@chromium.org2009-09-223-21/+3
| | | | | | | | | BUG=22594 TEST=none Review URL: http://codereview.chromium.org/212043 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26797 0039d316-1c4b-4281-b951-d872f2087c98
* Fixing build bustage caused by r26759hclam@chromium.org2009-09-211-1/+1
| | | | | | | | | | TBR=ajwong StringPrintf should use %u instead of %zd. Review URL: http://codereview.chromium.org/216042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26763 0039d316-1c4b-4281-b951-d872f2087c98
* Clean up the unittest to correct order of expects, and give correct tracing ↵ajwong@chromium.org2009-09-211-18/+28
| | | | | | | | info. Review URL: http://codereview.chromium.org/209054 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26759 0039d316-1c4b-4281-b951-d872f2087c98
* Mac YUV with a single YUV table of 6k instead of 3 tables of 2k.fbarchard@chromium.org2009-09-212-278/+66
| | | | | | | | | BUG=20749 TEST=play mac video... it should be 3 times faster rendering and visibly smoother Review URL: http://codereview.chromium.org/208048 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26740 0039d316-1c4b-4281-b951-d872f2087c98
* Disable FFmpeg logging as it interferes with layout tests.scherkus@chromium.org2009-09-192-0/+9
| | | | | | | | | | | | We could disable logging as soon as FFmpeg is loaded in InitializeMediaLibrary(), but we may want logging enabled for different applications using the media library (i.e., media_bench). BUG=16779 TEST=running chrome, test_shell on theora videos shouldn't print any boring log messages Review URL: http://codereview.chromium.org/212013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26641 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Mac YUV assembly"ajwong@chromium.org2009-09-182-63/+273
| | | | | | | | This reverts commit r26614. Review URL: http://codereview.chromium.org/213034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26621 0039d316-1c4b-4281-b951-d872f2087c98
* Mac YUV assemblyfbarchard@chromium.org2009-09-182-273/+63
| | | | | | | | BUG=20749 TEST=play mac video... it should be 3 times faster rendering and visibly smoother Review URL: http://codereview.chromium.org/208030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26614 0039d316-1c4b-4281-b951-d872f2087c98
* Reverting 26070 from media tests failuremhm@chromium.org2009-09-124-76/+286
| | | | | | | | | | | | | | | | | | 6 failed media_unittests - CreateFrame - Clamp - YV12 - YV16 - YV12 - YV16 TBR=fbarchard BUG=none TEST=none Review URL: http://codereview.chromium.org/202068 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26074 0039d316-1c4b-4281-b951-d872f2087c98
* Mac Assembler and Linux cleanupfbarchard@chromium.org2009-09-124-286/+76
| | | | | | | | | BUG=20749 TEST=play mac video... it should be time times faster rendering and visibly smoother Review URL: http://codereview.chromium.org/180066 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26070 0039d316-1c4b-4281-b951-d872f2087c98
* Added USE_GDK, set when either TOOLKIT_GTK or TOOLKIT_VIEWS is set butbenl@chromium.org2009-09-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | not OS_WIN. Added USE_X11. Set when OS_LINUX or OS_FREEBSD is set. Added USE_BASE_DATA_PACK for base::DataPack usage, set for OS_MACOSX, OS_LINUX or OS_FREEBSD. Added USE_NSS for ... nss (for crypto). Windows and MacOS use platform-specific libraries. All of the above cause slightly odd formulations like: #if defined(OS_WIN) ... #elif defined(USE_BASE_DATA_PACK) ... #endif Possibly should also define USE_DLL_FOR_DATA, etc? Or something? Wrapped various references to struct stat64 and stat64() to use struct stat and stat() for FreeBSD - but a "man stat64" on Linux suggests that we could do the same thing for at least Linux, too, and perhaps eliminate the wrapper? git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25599 0039d316-1c4b-4281-b951-d872f2087c98
* linux: fix yuv_row on ARM (don't use MMX).piman@chromium.org2009-09-041-2/+1
| | | | | | | Review URL: http://codereview.chromium.org/193011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25417 0039d316-1c4b-4281-b951-d872f2087c98
* Apply some sanity checks to the values coming back to us from FFmpeg.cevans@chromium.org2009-09-041-0/+28
| | | | | | | | | | | | Put the limits in a new standalone header file that can be re-used in other place where we have similar limits. BUG=NONE TEST=media_unittests pass Review URL: http://codereview.chromium.org/200011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25416 0039d316-1c4b-4281-b951-d872f2087c98
* mmx for linux yuv convert function.fbarchard@chromium.org2009-09-015-88/+903
| | | | | | | | | BUG=18449,20718 TEST=play a video on linux without scaling and it should go 4 times faster than with scaling. Review URL: http://codereview.chromium.org/174442 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25001 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Fix a ton of compiler warnings."tony@chromium.org2009-08-281-3/+0
| | | | | | | | | | | This reverts commit r24792. TBR=estade Review URL: http://codereview.chromium.org/179028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24796 0039d316-1c4b-4281-b951-d872f2087c98
* Fix a ton of compiler warnings.estade@chromium.org2009-08-281-0/+3
| | | | | | | | | | | | | | | Most of these are classes with virtual methods lacking virtual destructors or NULL used in non-pointer context. BUG=none TEST=app_unittests && base_unittests --gtest_filter=-ConditionVariableTest.LargeFastTaskTest patch by Jacob Mandelson <jlmjlm [at] gmail> http://codereview.chromium.org/171028/show git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24792 0039d316-1c4b-4281-b951-d872f2087c98
* Fix memory leask in media yuv_convert unit tests. Replace pointers init'd by ↵jshin@chromium.org2009-08-281-22/+22
| | | | | | | | | | | plain new[] with scoped_array. BUG=20497 (http://crbug.com/20497) TEST=Valgrind does not report memory leaks any more in media/base/yuv_convert_unittest.cc Review URL: http://codereview.chromium.org/182010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24735 0039d316-1c4b-4281-b951-d872f2087c98
* Correct network state and ready state reporting.ajwong@chromium.org2009-08-215-0/+26
| | | | | | | | | | | | | For network state, make it return "loading" for everything that's not a file source since our cache does not yet reliably support caching the full media w/o need for a network. For ready state, correctly handle seeks to drop from HaveEnoughData down to HaveMetaData until the seek completes. Also implement the seeking() function. BUG=18975 TEST=none Review URL: http://codereview.chromium.org/165432 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24036 0039d316-1c4b-4281-b951-d872f2087c98
* Timing code for measuring DLL load performance.fbarchard@chromium.org2009-08-211-1/+29
| | | | | | | | | BUG=18466 TEST=reduce DLL sizes with -O2 and other options, and test performance with this code. Review URL: http://codereview.chromium.org/165039 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24017 0039d316-1c4b-4281-b951-d872f2087c98
* Fix Issue 160529 in a nice way with unittest.fbarchard@chromium.org2009-08-212-1/+4
| | | | | | | | | | | | Original CL171023 by Song YeWen. BUG=16020 TEST=test with all media types and ensure there are no memory leaks are functional differences from previous version. Review URL: http://codereview.chromium.org/174027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24016 0039d316-1c4b-4281-b951-d872f2087c98
* Reverting r24002 due to test_shell_tests rednessajwong@chromium.org2009-08-215-26/+0
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24004 0039d316-1c4b-4281-b951-d872f2087c98
* Correct network state and ready state reporting.ajwong@chromium.org2009-08-215-0/+26
| | | | | | | | | | | | | For network state, make it return "loading" for everything that's not a file source since our cache does not yet reliably support caching the full media w/o need for a network. For ready state, correctly handle seeks to drop from HaveEnoughData down to HaveMetaData until the seek completes. Also implement the seeking() function. BUG=18975 TEST=none Review URL: http://codereview.chromium.org/165432 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24002 0039d316-1c4b-4281-b951-d872f2087c98
* Suppress slider thumb jumping around during seekinghclam@chromium.org2009-08-215-7/+66
| | | | | | | | | | | | | BUG=19396 TEST=Open a video, seek to any position, the thumb should stops a bit and then goes forward from there. Preventing the slider thumb from jumping around after seek by freezing the clock until we get a valid time update from the audio renderer. Review URL: http://codereview.chromium.org/173072 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23937 0039d316-1c4b-4281-b951-d872f2087c98
* A quick fix for YUV overflow on Mac concern.fbarchard@chromium.org2009-08-183-32/+88
| | | | | | | | | BUG=18672 TEST=run videos in debug mode and watch for DCHECK. Review URL: http://codereview.chromium.org/170019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23599 0039d316-1c4b-4281-b951-d872f2087c98
* Framework to display disabled mute button when audio fails.kylep@chromium.org2009-08-141-0/+5
| | | | | | | | BUG=18970 TEST=play a video with no audio hardware, verify that UI changes Review URL: http://codereview.chromium.org/169010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23491 0039d316-1c4b-4281-b951-d872f2087c98
* Implemented end-of-stream callback for media::PipelineImpl.scherkus@chromium.org2009-08-1210-6/+215
| | | | | | | | | | | | | | | A new method HasEnded() was added to renderer interfaces. Renderers return true when they have both received and rendered an end-of-stream buffer. For audio this translates to sending the very last buffer to the hardware. For video this translates to displaying a black frame after the very last frame has been displayed. Renderers can notify the pipeline that the value of HasEnded() has changed to true via FilterHost::NotifyEnded(). Instead of tracking which renderers have called NotifyEnded(), the pipeline uses the notification to poll every renderer. The ended callback will only be executed once every renderer returns true for HasEnded(). This has a nice benefit of being able to ignore extra NotifyEnded() calls if we already determine the pipeline has ended. With the changes to WebMediaPlayerImpl, we should now properly support both the ended event and looping. BUG=16768,17970,18433,18846 TEST=media_unittests, media layout tests, ended event, timeupdate should stop firing, looping should work, seeking after video ends Review URL: http://codereview.chromium.org/164403 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23255 0039d316-1c4b-4281-b951-d872f2087c98
* Free demuxed audio packets if audio device failshclam@chromium.org2009-08-067-0/+94
| | | | | | | | | | | | | | | | BUG=17481 TEST=media_unittests Introduced a mesage broadcasting mechanism to notify filters of events from another filter. In particular this is used to notify all filters that the audio device has failed and special actions should be taken to handle it. In this case, demuxer should disable the audio stream and should free the demuxed audio packets instead of caching them. This will fix the memory leak that happens if audio device fails during playback. Review URL: http://codereview.chromium.org/159845 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22630 0039d316-1c4b-4281-b951-d872f2087c98
* Replace the guts of AudioRendererBase with calls to scaling algorithm.kylep@chromium.org2009-08-014-34/+73
| | | | | | | | BUG=16011 TEST=audio_renderer_base_unittest.cc and buffer_queue_unittest.cc Review URL: http://codereview.chromium.org/155695 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22237 0039d316-1c4b-4281-b951-d872f2087c98
* Missing buffered attribute for <video>/<audio>hclam@google.com2009-07-303-2/+64
| | | | | | | | | | | | | | | | | | | | | | | | | BUG=16056 TEST=LayoutTests/media/video-buffered.html The current implementation of the buffered attribute for <video> and <audio> is broken. There are several problems around this attribute: 1. We don't have any caching on disk, so we only keep a recent range of bytes close to current playback position. 2. WebKit reports buffered as one range (0, max_time_buffered). But we only cache a short partial range which doesn't start with 0. The correct implementation is a list of ranges buffered. But this has to go into WebKit first. 3. We don't have an accurate mapping between byte offset < - > timestamp. So the current implementation is to lie about what we have buffered. We always say we have buffered everything before the current download position. And we only report one range. The calculation of time is also based on scaling the duration with current buffered bytes. Review URL: http://codereview.chromium.org/160300 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22087 0039d316-1c4b-4281-b951-d872f2087c98
* Pipeline will execute a callback whenever an run-time error has happened.kylep@chromium.org2009-07-303-1/+24
| | | | | | | | BUG=16738 TEST=pipeline_impl_unittest.cc Review URL: http://codereview.chromium.org/160298 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22075 0039d316-1c4b-4281-b951-d872f2087c98
* BufferedDataSource to support server without range request supporthclam@chromium.org2009-07-297-3/+30
| | | | | | | | | | | | | | | This patch will enable BufferedDataSource to support servers with no range request support. It will start a probe request of 1 byte size besides the regular request. If the server does not support range request, we will turn on the is_streamed flag of FFmpeg and will not do any seeking. BUG=17628 TEST=test_shell_tests --gtest_filter=BufferedDataSource.* Review URL: http://codereview.chromium.org/160076 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21999 0039d316-1c4b-4281-b951-d872f2087c98
* Nice and easy fix for the media clock interpolating past the duration.scherkus@chromium.org2009-07-293-8/+20
| | | | | | | | | | | I considered adding duration to Clock itself, but that felt like it would pollute Clock's simple purposes of keeping track of time. Furthermore, by keeping duration checking in PipelineImpl we can handle future scenarios such as streaming media where clock really should run forever. BUG=16508 TEST=currentTime should never exceed duration Review URL: http://codereview.chromium.org/159573 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21937 0039d316-1c4b-4281-b951-d872f2087c98
* Cancel a task if stopped/errored so we don't hit an over-protective DCHECK.scherkus@chromium.org2009-07-281-0/+5
| | | | | | | | | TEST=media bear tests should start passing again BUG=none Review URL: http://codereview.chromium.org/160295 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21907 0039d316-1c4b-4281-b951-d872f2087c98
* Assorted fixes for 64-bit.deanm@chromium.org2009-07-281-1/+2
| | | | | | | Review URL: http://codereview.chromium.org/160288 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21891 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Pipeline will execute a callback whenever an run-time error has ↵scherkus@chromium.org2009-07-283-25/+1
| | | | | | | | | | happened." TBR=kylep Review URL: http://codereview.chromium.org/160287 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21885 0039d316-1c4b-4281-b951-d872f2087c98
* Implemented a proper clock for audio/video synchronization.scherkus@chromium.org2009-07-286-10/+409
| | | | | | | | | | | More or less a change to pull out time management from PipelineImpl into a new class ClockImpl. Biggest difference is ClockImpl will use the system clock + linear interpolation to provide a more "precise" representation of the current playback position. BUG=16508 TEST=a/v sync should remain the same, currentTime should report more precise values Review URL: http://codereview.chromium.org/159517 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21882 0039d316-1c4b-4281-b951-d872f2087c98
* Pipeline will execute a callback whenever an run-time error has happened.kylep@chromium.org2009-07-283-1/+25
| | | | | | | | BUG=16738 TEST=pipeline_impl_unittest.cc Review URL: http://codereview.chromium.org/159373 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21877 0039d316-1c4b-4281-b951-d872f2087c98