Commit Graph

919 Commits

Author SHA1 Message Date
Ralph Giles
a580b38664 Bug 757600 - Update the Opus version field parser. r=cpearce
On 2012 May 10, the Ogg encapsulation spec for Opus at
https://wiki.xiph.org/OggOpus bumped the version number
from zero to one. The one-byte field is also now notionally
split into major and minor subfields, with incompatible
changes signalled by the major field.

We update nsOpusState::DecodeHeader to parse the version
field separately from the stream identification and reject
any stream where the high four bits of the version field
is non-zero.

The opus-tools repo was updated 2012 May 22 to set with
version = 1. This commit enables playback of those files.
2012-05-22 20:21:46 -04:00
Robert O'Callahan
21d304129c Bug 750769. Prevent mCurrentFrameTime from advancing during DecodeSeek. r=cpearce 2012-05-22 21:56:02 +12:00
Gervase Markham
87620f5676 Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
Benjamin Smedberg
2187798a40 Bug 734847 part 2 - treewide changes resulting from the default-infallibility of hashtables; either remove useless result checks, or use the fallible version of APIs, depending on context, r=jlebar
--HG--
extra : rebase_source : 844b008c5167e6ca39a7ba9eeec8b30672938704
2012-05-18 13:30:49 -04:00
Paul Adenot
744ee4cb46 Bug 756372 - Change |seeking| to prevent seeking in WebM livestream. r=kinetik 2012-05-18 13:35:43 -04:00
Ms2ger
b1ec8ac12a Bug 754643 - Disable FAIL_ON_WARNINGS in content/media because new warnings were introduced. 2012-05-18 10:57:20 +02:00
Ms2ger
1c8f2530d8 Bug 754643 - Enable FAIL_ON_WARNINGS in content/media; r=cpearce f=roc 2012-05-18 10:29:38 +02:00
Landry Breuil
a32c7aa9fb Bug 732875 - use stdint.h types instead of PRtypes, fixes build on OpenBSD - r=Ms2ger 2012-05-17 10:07:26 -04:00
Dão Gottwald
406b28dc20 Backed out changeset ee527adf9d44 2012-05-17 16:47:36 +02:00
Landry Breuil
e28f6d0967 Bug 732875 - use stdint.h types instead of PRtypes, fixes build on OpenBSD - r=Ms2ger 2012-05-17 10:07:26 -04:00
Benoit Jacob
6598b33e08 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
Paul Adenot
d76fe09441 Bug 599217 - WebM buffered: should use duration for end time of last buffered range. r=kinetik 2010-09-24 13:57:30 +12:00
Paul Adenot
f814bb5630 Bug 449363 - Support media attribute of <source> elements. r=cpearce,bz 2012-05-15 08:56:51 -04:00
Robert O'Callahan
41e12c9ddd Bug 750769. Add more logging. r=cpearce 2012-05-15 17:57:29 +12:00
Robert O'Callahan
73b8d69382 Bug 750769. Clarify that mNextState can only be PLAY_STATE_PAUSED or PLAY_STATE_PLAYING. r=cpearce 2012-05-15 17:57:23 +12:00
Robert O'Callahan
3e35dded86 Bug 750769. Clarify thread-safety guarantees around mPlayState and mNextState. r=cpearce 2012-05-15 17:57:17 +12:00
Ed Morley
d38b916352 Backout 345ae68f15f4, b3b40121ac8d, 0d18b7a246d7, 9dbb6064ab58, dee9d7fa8eb6, 63eec6bfa948, 323c6be7cfe8 & f4aac7523a48 (bug 732875) for compilation failures 2012-05-14 21:05:24 +01:00
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