Commit Graph

952 Commits

Author SHA1 Message Date
Benoit Jacob
43d4449b09 Bug 732875 - 8/8 - move CheckedInt to MFBT, enable unit tests in mfbt/tests - r=jwalden
--HG--
rename : xpcom/ds/CheckedInt.h => mfbt/CheckedInt.h
2012-05-14 15:50:20 -04:00
Daniel Holbert
2f25cd6b55 Bug 664918 followup: Add missing */ terminator on emacs modeline in header comment for new files nsDOMMediaStream.cpp and MediaStreamGraph.cpp. (no review, comment-only) DONTBUILD 2012-05-11 10:35:36 -07:00
Christopher De Cairos
c484bd36db Bug 726904: Make nsVideoFrame::GetVideoIntrinsicSize return the video size before the poster size. r=cpearce 2012-05-11 20:32:15 +12:00
Robert O'Callahan
3988ef793a Bug 750258. Small cleanup to make it more obvious why mCurrentTime is initialized to 1. r=jesup 2012-05-10 15:30:34 +12:00
Robert O'Callahan
5ab08b47bd Bug 750769. Dump currentTime/paused/ended/readyState on every event. r=cpearce 2012-05-10 15:30:34 +12:00
Robert O'Callahan
a9c6f17444 Bug 752784. Don't mess with tracks we haven't initialized yet. r=cpearce 2012-05-10 15:30:34 +12:00
Randell Jesup
ebb8d15057 Bug 752784: protect against media not having a track of the required type r=roc 2012-05-09 01:53:49 -04:00
Randell Jesup
729c0d0f7e Bug 752087: Use correct method to check is a jsval is an object r=roc 2012-05-07 18:54:29 -04:00
Daniel Holbert
d0c4544c6e Bug 664918 followup: Add missing */ terminator on emacs modeline in header comment for new file StreamBuffer.cpp. (no review, comment-only) DONTBUILD 2012-05-07 11:22:44 -07:00
Chris Pearce
c59be7944b Bug 752141 - Release media decoder monitor when finishing audio stream. r=kinetik 2012-05-07 17:12:52 +12:00
Robert O'Callahan
1324bd3eab Bug 750258. Fix bustage. 2012-05-07 15:57:52 +12:00
Robert O'Callahan
f1d92066fc Bug 750258. Set intial audio capture state correctly on mDecoderStateMachine. r=cpearce
For media resources whose streams are captured before the load has started, we shouldn't even start
an audio thread. This saves a lot of resources and ensures we don't see races between the audio thread
and the code that copies packets from the audio queue to the MediaStreams.
2012-05-07 15:45:06 +12:00
Robert O'Callahan
5aa5e1864b Bug 750258. Advance mBlockingDecisionsMadeUntilTime to include time lost when the media graph control thread was stopped and all streams had underruns. r=jesup
The first part just handles the case where nsAudioStream failed to allocate a stream. It won't be playing
anything, so instead of trying to get the audio position, just fall back to the media graph current time.
Otherwise GetPositionInFrames returns -1 and things go badly from there.
The second part simplifies the calculation of the next mCurrentTime to just make it based on real time.
We had some code to not let it advance past the end of a stream's buffer, but the next part will make that
unnecessary.
The third part is the real fix. When the new current time has advanced past mBlockingDecisionsMadeUntilTime,
that means the control loop didn't run in time to replenish the audio output buffers and keep up with its
other duties. Effectively all streams have been blocked between mBlockingDecisionsMadeUntilTime and
the new current time. Account for that by adding the difference as extra blocked time for every stream.
We only need to ensure that the stream is marked blocked from mBlockingDecisionsMadeUntilTime indefinitely
far into the future, and then update mBlockingDecisionsMadeUntilTime to the new current time, because the
code takes into account that only blocking decisions up to mBlockingDecisionsMadeUntilTime are valid.
2012-05-07 15:44:41 +12:00
Matthew Gregan
d74fbf6059 Bug 747793 - Use a ring buffer for audio buffered by nsBufferedAudioStream. Remove generic sample copy out with volume adjustment and replace with the lightly optimized version from nsNativeAudioStream. Add a fast path for the unity volume case. Bump cubeb's refill thread priority on Win32. r=cpearce 2012-05-03 16:48:54 +12:00
Ralph Giles
e558af769f Bug 752234 - Guard nsOpusState::Time against inactive streams. r=cpearce
Fix a crash loading opus files when the media.opus.enabled pref is
false. The buffering code still tries to call our Time() method,
but without having read the headers we cannot perform the
conversion.

This commit adds a guard on mActive like the other ::Time
methods use.
2012-05-05 09:55:29 -07:00
Robert O'Callahan
c69e2bcfd2 Bug 750769. Add logging code to dump events for diagnosis. r=cpearce 2012-05-04 17:05:42 +12:00
Doug Sherk
c287a8aa3f Bug 751539: fix test to avoid timeout r=cpearce 2012-05-03 14:12:36 -07:00
Ralph Giles
c7464ef85a Bug 674225 - Add basic mochitests for Opus. r=cpearce
Add a short Ogg Opus file to the content/media/test
directory and add it to the gSeekTests, gSmallTests,
and gPlayTests in manifest.js. This file is crafted
to end on a packet boundary, so trimming to duration
is not verified.
Set the media.opus.enabled pref to true in manifest.js
so the various tests using the opus file succeed.

Add a stanza to can_play_type_ogg.js to test the
behaviour of canPlayType with an opus-specific
media type for both values of the pref.

Add support for the .opus filename extension to
the mochitest http server.
2012-05-01 17:29:42 -07:00
Ralph Giles
daed6b4964 Bug 674225 - Add Opus support to nsOggReader. r=cpearce
Parse and decode Opus streams embedded in the Ogg
container. Based on the draft specification from
https://wiki.xiph.org/OggOpus
Support is conditional on the runtime preference
setting media.opus.enabled, which is false by
default until we're confident the spec is stable
and useful.

This patch doesn't support the gain header or
multichannel files.

The LEUint*() functions from the skeleton parser
are used to read the multi-byte header fields.
This requires moving them to earlier in the file.

Mappings for the .opus filename extension are also
added to facilitate testing with local files.
2012-05-01 17:29:34 -07:00
Paul ADENOT
7404d0fe40 Bug 462960 - Add tests for the played member. r=cpearce 2012-04-30 20:29:29 -04:00
Robert O'Callahan
075f297518 Bug 750163. MediaStreamGraphImpl::UpdateBufferSufficiencyState should skip tracks whose creation is pending --- there is no Track object for them yet. r=jesup 2012-04-30 17:23:00 +12:00
Robert O'Callahan
1e013d242c Bug 664918. Part 12: Finish SourceMediaStreams when the media decoder is destroyed, to avoid late low-audio/low-video notifications and issues when multiple decoders write to the same stream. r=cpearce,rjesup 2012-04-30 15:13:42 +12:00
Robert O'Callahan
04b6d68bcd Bug 664918. Part 11: Refactor code around mDecoder->Shutdown() to make following fix easier. r=cpearce 2012-04-30 15:13:09 +12:00
Robert O'Callahan
8198eb7fe3 Bug 664918. Part 10: Add test_streams_element_capture.html to test capturing a media element into a stream and playing that stream through another media element.
The test also tests that capturing MediaStream video into a canvas works.
2012-04-30 15:13:01 +12:00
Robert O'Callahan
6959d6762a Bug 664918. Part 9: Tentative support for MediaStreamListener::NotifyQueuedTrackChanges. r=jesup 2012-04-30 15:12:50 +12:00
Robert O'Callahan
54a29c01d8 Bug 664918. Part 8: Add mozCaptureStream()/mozCaptureStreamUntilEnded() APIs to HTML media elements, returning a MediaStream representing the contents of the media element. r=cpearce,jesup
This is currently not fully functional. The MediaStream always ends when the underlying resource ends. You can't use these APIs on a media element
whose src is a MediaStream. Seeking or pausing the resource will cause problems. The media element does not play back in sync with the MediaStream.
2012-04-30 15:12:42 +12:00
Robert O'Callahan
e96832b226 Bug 664918. Part 5: Create SourceMediaStream, a MediaStream with an API allowing data to be injected into it by some source. r=jesup 2012-04-30 15:11:40 +12:00
Robert O'Callahan
1f5dd9a4af Bug 664918. Part 4: Create nsDOMMediaStream, a DOM object wrapping an underlying MediaStream. r=smaug,jesup 2012-04-30 15:11:34 +12:00
Robert O'Callahan
3e8e91443c Bug 664918. Part 3: Create MediaStream and MediaGraphManager for internal management of real-time media processing. r=jesup 2012-04-30 15:11:26 +12:00
Robert O'Callahan
d76ff3d562 Bug 664918. Part 2: Create MediaSegment, AudioSegment and VideoSegment classes to manage intervals of media data. r=jesup
Also introduces a SharedBuffer class, representing a blob of binary data with threadsafe refcounting.
2012-04-30 15:11:19 +12:00
Robert O'Callahan
9802d67ea6 Bug 664918. Part 1: Create TimeVarying<T> class to represent values that change over time. r=jesup 2012-04-30 15:11:08 +12:00
Robert O'Callahan
1fe7590d18 Bug 664918. Part 0: Refactor nsMediaCache's handling of principals into a helper method in nsContentUtils. r=bzbarsky 2012-04-30 15:11:00 +12:00
Paul ADENOT
70eca6f58d Bug 480376 - Implement mozHasAudio to indicate when there's no audio track available. r=cpearce 2012-04-28 11:01:10 -04:00
Masatoshi Kimura
f17f15dabb Bug 745498 - Add testcases for DOM4 exception types. r=sicking 2012-04-26 09:42:26 -07:00
Nicholas Nethercote
c33177f72e Bug 744311 (part 1) - Preliminary whitespace and code order changes. r=jlebar.
--HG--
extra : rebase_source : f700733d8aa1aed1ae1f9206b4ee9063f9a03341
2012-04-09 22:52:33 -07:00
Ehsan Akhgari
731cf9d3bd Merge mozilla-central into birch 2012-04-19 10:03:36 -04:00
Ehsan Akhgari
962d717229 Bug 722981 - Flush the media cache when the last private browsing window is closed; r=roc 2012-04-16 23:16:47 -04:00
Alessandro Decina
1c7e653fdb Bug 422540 - GStreamer backend for audio/video decoding. r=cdouble, a=npotb 2012-04-18 18:33:13 -04:00
Daniel Holbert
6e5356dd30 Bug 745272: Replace comparison of unsigned value >=0 with a useful comparison. r=humph r=cpearce 2012-04-16 14:29:14 -07:00
Matthew Gregan
b622e34f64 Bug 742154 - Work around media crashtest shutdown hang in cubeb_winmm. r=cpearce 2012-04-16 15:00:40 +12:00
Matthew Gregan
cfefa73214 Bug 723793 - Lazily initialize libcubeb on first use. r=roc 2012-04-16 15:00:12 +12:00
Abhishek Bhatnagar
a1f068120f Bug 620164 - Remove CheckedInt and Muloverflow from nsTheoraState::MaxKeyframeOffset. r=cpearce 2012-04-11 07:44:28 -04:00
Veeraya Pupatwibul
26e9a6a204 Bug 741333 - Remove PRBool/PR_TRUE/PR_FALSE that crept in r=Ms2ger 2012-04-04 11:15:10 +02:00
Chris Pearce
ca47762f8f Bug 741052 - Null check nsMediaCache::mFileCache in nsMediaCache destructor. r=roc 2012-04-02 10:34:11 +12:00
Christopher De Cairos
b9bebb8f08 Bug 736400 - Make each decoder Clone() method check if its mimetype is enabled. r=cpearce 2012-03-30 20:52:07 -04:00
Chris Pearce
235c0ed1b6 Bug 736342 - Defer media cache writes and block moves to a non-main thread. r=roc 2012-03-28 13:04:26 +13:00
Chris Pearce
c92e96b48f Bug 736342 - Add AsyncBlockWriter, which defers file writes to another thread. r=roc 2012-03-28 13:04:20 +13:00
Nathan Froyd
f951079eae Bug 739962 - fix -Wunused-but-set-variable warnings in content; r=bent 2012-03-28 09:14:33 -04:00
Chris Pearce
5d037cdaf0 Bug 726400 - Backed out changeset 4ad6c040729f. r=backout. 2012-03-26 14:41:14 +13:00
Christopher De Cairos
49bf77143e Bug 736400 - Make each decoder Clone() method check if its mimetype is enabled r=cpearce 2012-03-26 14:21:53 +13:00
Phil Ringnalda
f0b85848e1 Back out c4a4b0171b99 (bug 736400) for Android build bustage 2012-03-25 15:35:37 -07:00
Christopher De Cairos
b9927ed2b5 Bug 736400 - Make each decoder Clone() method check if its mimetype is enabled r=cpearce 2012-03-26 10:48:40 +13:00
Robert O'Callahan
437f35ed2a Bug 712836. Make MediaResources which have ended abnormally ineligible for cloning. r=cpearce 2012-03-20 20:55:40 +13:00
Robert O'Callahan
f7ecbe0c64 Bug 646331. Fix duration of big.wav. r=cpearce 2012-03-19 12:36:06 +13:00
Matthew Gregan
400456d7dd Bug 734784 - Clean up some include lists in content/media. r=cpearce 2012-03-12 15:19:31 +13:00
Adam Dane
3297d979d7 Bug 612246 - Store the media cache in the profile directory for single process Gecko and the system temp directory for multi-process. r=cpearce 2012-03-05 14:40:56 -06:00
Matthew Gregan
5690270a32 Bug 693021 - Back out the incorrect removal of bug 673698's fixed. 2012-03-05 19:19:45 +13:00
Matthew Gregan
23eae0d564 Bug 693021 - Bail from AdvanceFrame early if no longer playing. r=cpearce 2012-03-05 15:27:49 +13:00
Justin Lebar
62dbeeb1ab Bug 731789 - Rename mfbt/StdInt.h to mfbt/StandardInteger.h, so stdint types work from cpp files inside mfbt. r=waldo 2012-02-29 22:56:43 -05:00
Matthew Gregan
50c2fae2eb Bug 730425 - Make range check assertion in stream read fatal, and add the same check to similar code in the cached stream read. r=roc 2012-03-01 12:52:02 +13:00
Matthew Gregan
19bc4b9146 Bug 730425 - Performa an additional range check in stream read. r=roc 2012-02-28 17:38:46 +13:00
Matthew Gregan
9b3f74d365 Bug 634564 - Re-enable test_closing_connections. 2012-02-27 12:51:52 +13:00
Matthew Gregan
b4bd6bbd9d Bug 634564 - Don't reset load-in-background flag when moving completed media load into the foreground. r=cpearce 2012-02-24 14:07:35 +13:00
Masatoshi Kimura
d99288b6cc Bug 720208 - Implement DOM4 DOMException types and codes. r=smaug,ms2ger 2012-02-23 01:34:14 +01:00
Ching Wei Tseng
9bb78b0653 Bug 601535 - content/media should use CheckedInt.h. r=doublec 2012-02-22 13:28:06 +01:00
Ms2ger
79981b5cf9 Bug 726416 - Fix some content/ build warnings; r=mounir 2012-02-21 10:34:01 +01:00
David Seifried
f3faca678f Bug 680321 - Media preload state should reset in resource selection algorithm. r=cpearce 2012-02-20 10:02:08 +13:00
Bill McCloskey
6b3aa0565d Bug 641025 - Incremental GC (r=igor,smaug,roc,cdleary,gregor) 2012-02-17 14:35:20 -08:00
Robert O'Callahan
dea0c5b319 Bug 727694. Set up new mDecoderStateMachine with any preset initial volume. r=cpearce 2012-02-16 17:17:36 +13:00
Robert O'Callahan
ad4c67538b Bug 726889. Rename nsMediaStream/nsMediaChannelStream/nsMediaFileStream to mozilla::MediaResource/ChannelMediaResource/FileMediaResource. Also rename nsByteRange to mozilla::MediaByteRange and nsChannelStatistics to mozilla::MediaChannelStatistics. Rename GetStream to GetResource and various other mentions of 'stream' to 'resource'. r=cpearce
--HG--
rename : content/media/nsMediaStream.cpp => content/media/MediaResource.cpp
rename : content/media/nsMediaStream.h => content/media/MediaResource.h
2012-02-15 17:35:01 +13:00
Robert O'Callahan
8b57a3e190 Bug 708116. Factor out logic for updating the current frame of a video element into a helper object. r=doublec 2012-02-15 17:35:01 +13:00
Robert O'Callahan
30f3e3e857 Bug 726891. Move rate/channels/format up to nsAudioStream and add inline getters. r=kinetik 2012-02-14 17:39:33 +13:00
Chris Pearce
a8858bf744 Bug 673698 - Don't update video playback position during seek. r=roc 2012-02-14 21:48:16 +13:00
Phil Ringnalda
4ef4e9a277 Back out 7f81109133b5 (bug 725221), 135721f3720b (bug 726891), aef4ead175b4 (bug 726894) for orange 2012-02-13 22:31:22 -08:00
Robert O'Callahan
7e49a0a41c Bug 726891. Move rate/channels/format up to nsAudioStream and add inline getters. r=kinetik 2012-02-14 17:39:33 +13:00
Joe Olivas
6453e0bff8 Bug 725152 - Only use force_stereo_mode pref if it's explicitly set. r=kinetik 2012-02-14 15:35:26 +13:00
Zack Weinberg
3e37aa2a65 Bug 682141 band-aid: add another todo missed the first time. r=cpearce 2012-02-05 20:32:43 -08:00
Matthew Gregan
bf2bef38cb Bug 723781 - Disable libcubeb for now.
--HG--
extra : rebase_source : 23c5d8448d65e2b18a10e61e079f44f261cdb71a
2012-02-03 21:31:43 +13:00
Phil Ringnalda
fd99423d49 Back out 60fc46d5b1ca (bug 723793) for Windows crashtest assertions
--HG--
extra : rebase_source : 6ca69e6016ed2c1699315b7a1f7d632903857a33
2012-02-02 23:33:08 -08:00
Matthew Gregan
c7f2939f94 Bug 723793 - Lazily initialize libcubeb on first use. r=roc 2012-02-03 16:01:40 +13:00
Matthew Gregan
1e41289b57 Bug 677138 - Integrate libcubeb into a buffered nsAudioStream API. r=cpearce 2012-01-13 10:20:36 +13:00
Ed Morley
14dbcc2bc2 Backout 0e6b1dfaa99c (bug 720208) for M1 orange 2012-02-01 12:58:07 +00:00
Masatoshi Kimura
7d692e41fd Bug 720208 - Implement DOM4 DOMException types and codes. r=ms2ger,smaug 2012-02-01 11:36:42 +01:00
Chris DeCairos
87c0079e11 Bug 715323 - Make offset paramater in NotifyDataArrived PRInt64 r=cpearce 2012-02-01 11:05:51 +13:00
Chris Pearce
c7b6d7ccdc Bug 715469 - Make video full-screen button use background image, so it doesn't fire a load event. r=gavin 2012-01-30 20:04:44 +13:00
Jon Buckley
a1ada7a67d Bug 682299 - Implement CORS support for the <video> tag. r=roc 2012-01-25 17:31:30 -05:00
Christopher De Cairos
57cbddb595 Bug 686137 - Make nsMediaDecoder::RequestFrameBufferLength virtual. r=kinetik 2012-01-25 13:38:23 +13:00
Christopher De Cairos
3fd6013dea Bug 686137 - Add test for setting mozFrameBufferLength. r=kinetik 2012-01-25 13:38:22 +13:00
Chris Pearce
8f31983afb Bug 717026 - Change test to not play() media to avoid audio thread destruction bottleneck. r=roc 2012-01-20 07:31:03 +13:00
Chris Pearce
eb006e51ef Bug 713381 - Queue media decode thread creation when limit reached. r=roc 2012-01-20 07:30:29 +13:00
Chris Pearce
399643a27c Bug 713381 - Add null check on decoder state machine, increase media thread limit. r=roc 2012-01-20 07:29:12 +13:00
Chris Pearce
92dea45444 Bug 717026 - Ensure libsydneyaudio windows block size is an even multiple of channels*frame_size. r=kinetik 2012-01-19 14:11:51 +13:00
Chris Pearce
feca30f47a Bug Bug 713381 - backout 38271572005b,d5ebbc25b4b8,6435f51dd10d. r=backout 2012-01-19 11:56:54 +13:00
Chris Pearce
c7db97f406 Bug 713381 - Queue media decode thread creation when limit reached. r=roc 2012-01-19 09:15:57 +13:00
Chris Pearce
f8ec2fc9d5 Bug 713381 - Add null check on decoder state machine. r=roc 2012-01-19 09:15:47 +13:00
Ms2ger
10ae9ad9d2 Merge m-c to m-i. 2012-01-11 12:15:35 +01:00
Ms2ger
f721014338 Bug 699731 - Remove PR_INT64_MAX / PR_UINT64_MAX from non-nsprpub source; r=ted 2012-01-11 09:23:07 +01:00
Chris Pearce
451d64779a Bug 712738 - Cap seeking outside of buffered data in live streams to end of buffered data. r=kinetik 2012-01-06 19:40:51 +13:00
Chris Pearce
176bb0c176 Bug 716417 - Don't add media elements to the element table twice if when we hit decode thread limit. r=roc 2012-01-11 11:58:43 +13:00
Kyle Huey
dca538b319 Bug 714445: nsWebMReader should not read preferences off the main thread. r=roc 2012-01-01 12:10:49 -05:00