Commit Graph

101 Commits

Author SHA1 Message Date
Chris Pearce
1448181589 Bug 778105 - Fix an nsOggReader::GetBuffered() return value type mismatch. r=doublec 2012-08-01 13:24:25 +12:00
Ralph Giles
f63a794f44 Bug 763010 - Expose media element metadata. r=cpearce
Implements a media.mozGetMetadata() method returning a new javascript object whose properties are key value pairs respresenting metadata tags from the media resource. This data is available after readystate enters METADATA_LOADED.

Currently this is only implemented for Ogg Vorbis streams.

Media format metadata is parsed out by the media decoders. In the nsCodecStateMachine::ReadMetadata subclasses we fill in an nsDataHashtable pointer using the format-specifc api.

The hash pointer is passed up to the media element as part of the MetadataLoaded event.

The hash is deleted if the load is aborted. The audio metadata is also reset to zero (as in the constructor), resolving a todo comment.
2012-07-30 20:14:29 -04:00
Ehsan Akhgari
b40b21d633 Merge the nullptr conversion from mozilla-central into mozilla-inbound 2012-07-30 10:28:15 -04:00
Aryeh Gregor
e806eeab4f Bug 777292 part 2 - Change all nsnull to nullptr 2012-07-30 17:20:58 +03:00
Aryeh Gregor
96fc9d649c Bug 777292 - Annotate some incorrect conversions to nsresult; r=ehsan 2012-07-27 17:03:25 +03:00
Aryeh Gregor
e57dd159b2 Bug 626472 part 1 - Define nsnull as nullptr where available; r=ehsan 2012-07-20 14:16:17 +03:00
Ralph Giles
ce957c9c8b Bug 766331 - Don't rescan old data for Ogg timestamps - r=cpearce
nsOggReader::RangeEndTime() relied on CRC values from valid ogg
pages to keep track of already-searched data when looking for a
end timestamp. This caused quadratic behaviour searching in a
section of a file with no valid pages.

Instead, remember where we last looked, and backoff immediately
if we go more than the maximum length of a page into previously
scanned data. This avoids searching data we've eliminated as
containing valid Ogg pages and lets us search backward with O(N)
instead.
2012-06-25 09:38:56 -07:00
Matthew Gregan
d6ea8c2c90 Bug 723860 - Early bail from reader's GetBuffered() if not yet initialized. r=doublec 2012-06-06 17:58:07 +12:00
Timothy B. Terriberry
ac0bc073d7 Bug 752661 - Make ReadMetadata() fail when there are no active Ogg streams, r=kinetik 2012-06-02 06:29:44 -07:00
Andreas Gal
1518859a5b Bug 714408 Part 2 - Media plugin support for libstagefright - r=doublec
--HG--
extra : rebase_source : 308d1aab3cfffbb7ddeb0602a3991565603e6212
2012-06-01 12:54:23 +12:00
Timothy B. Terriberry
8cf0158bfc Bug 751219 - Support header gain in Opus files, r=kinetik 2012-05-31 11:13:17 -07:00
Timothy B. Terriberry
97a1c5f7c1 Bug 759612 - Update granule position accounting for Opus, r=kinetik 2012-05-31 11:13:17 -07:00
Timothy B. Terriberry
fac791cc69 Bug 759399 - Handle preroll correctly during an Opus seek, r=doublec 2012-05-31 11:13:17 -07:00
Timothy B. Terriberry
e4706b6f85 Bug 759490 - Use Opus streams when seeking in Ogg, if present, r=doublec 2012-05-31 11:13:11 -07:00
Ralph Giles
08ed5054b4 Bug 758833 - Track and trim opus preskip samples - r=doublec
We trim the initial few samples out of the opus decoder,
to give the output time to converge, and to correct for
the encoding delay. Encoders store the delay in the preskip
field of the Ogg encapsulation header.

The previous code to do this was a hack based on the granulepos
values and could fail on some inputs. Instead, keep a count
of how many samples we want to trip, and remove packet data
until that value matches the preskip value from the header.

The value is set to the preskip value from the header when
the decoder is initialized. We also need to do this after
seek. To do this we add a specialized nsOggReader::ResetDecode
method which takes a boolean argument, set to true when
we are seeking to the start of the stream. In that case,
the method resets the skip count.

There is still an issue after general seeks. The spec recommends
trimming a full 80 ms (3840 frames) to allow the decoder to fully
settle from the previous state. It's tricky to do this inside
nsOpusState because it doesn't know where it is in the stream.

Also add some debug output to track the decode behaviour.
2012-05-31 16:03:14 +12:00
Gervase Markham
ca171eec44 Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
Benjamin Smedberg
4f91700da9 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
Ms2ger
3d92167c95 Bug 754643 - Enable FAIL_ON_WARNINGS in content/media; r=cpearce f=roc 2012-05-18 10:29:38 +02:00
Ralph Giles
3adcc0b005 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
Nathan Froyd
3816c12d35 Bug 739962 - fix -Wunused-but-set-variable warnings in content; r=bent 2012-03-28 09:14:33 -04:00
Robert O'Callahan
4840bbe976 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
1e90444bb6 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
4f2e71dc44 Bug 703379. Rename nsMediaDecoder::GetCurrentStream to GetStream. Make nsMediaStream::URI() const. r=doublec 2011-11-25 15:06:20 +13:00
Robert O'Callahan
1a60edba9a Backing out part of bug 703379 to fix build failure of nsRawReader 2011-11-24 12:30:03 +13:00
Robert O'Callahan
fc5886fa9f Bug 703379. Rename nsMediaDecoder::GetCurrentStream to GetStream. Make nsMediaStream::URI() const. r=doublec 2011-11-24 12:05:12 +13:00
Matthew Gregan
b91f76289a Bug 690603 - Remove PR_TRUE/PR_FALSE from media code. r=doublec 2011-09-30 12:34:37 +13:00
Michael Wu
d8e503c38b Bug 675553 - Switch from PRBool to bool on a CLOSED TREE , r=bsmedberg,khuey,bz,cjones
--HG--
rename : tools/trace-malloc/bloatblame.c => tools/trace-malloc/bloatblame.cpp
2011-09-28 23:19:26 -07:00
Matthew Gregan
bd4295528f Bug 689432 - Disambiguate use of "samples" by introducing "frames" in a number of places. r=doublec 2011-09-27 16:31:18 +13:00
Martin Richard
398b044837 Bug 646333 - Make video constants consistently const T. r=cpearce 2011-09-15 07:39:50 +12:00
Matthew Gregan
1eaa941a74 Bug 679269 - Rename SoundData{,Value} to AudioData{,Value} and fix inconsistent use of "sound" vs "audio". r=doublec 2011-08-16 17:19:51 +12:00
Paul ADENOT
36cf6a91a7 Bug 462960 - Implement nsIDOMHTMLMediaElement::GetSeekable() + seeking algorithm part 7. r=cpearce 2011-08-09 12:10:48 +02:00
Chris Pearce
e9746ae18e Bug 675747 - Handle multiple bos pages in a single ogg bitstream. r=doublec 2011-08-05 08:44:24 +12:00
David Volgyes
2b21de9549 Bug 673154 - Use nsAutoArrayPtr for SoundDataValue allocations to simplify ownership. r=cpearce 2011-07-29 13:54:21 +12:00
Matthew Gregan
5ed522c02f Bug 645773 - Reorder a sensitive computation to avoid signed vs unsigned issues. Return a null range from SelectSeekRange when stream length is unknown. r=cpearce 2011-04-01 17:18:43 +13:00
Chris Pearce
f2608ac6df Bug 670726 - Remove ns{Ogg,WebM}Reader::CanDecodeToTarget(), it makes invalid assumptions. r=kinetik 2011-07-14 09:24:35 +12:00
Chris Pearce
fabed158ed Bug 592833 - Remove nsBuiltinDecoderReader monitor. r=roc 2011-07-12 15:39:28 +12:00
Chris Pearce
1e2942a0a5 Bug 592833 - Move seeking to the decode thread. r=roc 2011-07-12 15:39:25 +12:00
Chris Pearce
b6b4964da4 Bug 592833 - Move metadata decoding to decode thread. r=roc 2011-07-12 15:39:23 +12:00
Chris Pearce
740b9b2109 Bug 635726 - Escape backoff in Ogg seek when we back off back to start of seek target range. r=doublec 2011-07-07 09:51:26 +12:00
Chris Pearce
fb29383b24 Bug 635726 - Ignore Ogg header pages in seek timestamp capture. r=doublec 2011-07-07 09:50:44 +12:00
Chris Pearce
a24dd67388 Bug 592833 - Backout due to suspected android crashtest permaorange. r=philor 2011-07-06 19:21:49 +12:00
Chris Pearce
0811c3e838 Bug 592833 - Remove nsBuiltinDecoderReader monitor. r=roc 2011-07-06 10:03:32 +12:00
Chris Pearce
7da896cb74 Bug 592833 - Move seeking to the decode thread. r=roc 2011-07-06 10:03:21 +12:00
Chris Pearce
863da21429 Bug 592833 - Move metadata decoding to decode thread. r=roc 2011-07-06 10:03:11 +12:00
Paul ADENOT
913b92aa91 Bug 667929 - OGG media buffered member is not correct when the stream is infinite; r=cpearce 2011-06-30 14:25:27 +02:00
Chris Pearce
b364e365c4 Bug 661456 - Scale WebM video frames to display size. r=kinetik 2011-06-24 10:08:54 +12:00
Chris Pearce
0ce10721e9 Bug 655648 - Don't enqueue expired theora frames. r=roc 2011-06-09 08:56:45 +12:00
Chris Pearce
c47b80f93b Bug 566779 - Clean up media start and end time calculation. r=doublec 2011-05-09 09:10:28 +12:00
Chris Pearce
ccae22ade2 Bug 650994 - Decode ogg packets lazily, timestamp them at demux time. r=doublec 2011-05-08 18:24:09 +12:00
Chris Jones
ed22df8f64 Bug 556214, parts 1 and 1.1: Rename Monitor to ReentrantMonitor and fix existing Monitor users. r=roc
--HG--
rename : xpcom/glue/Monitor.h => xpcom/glue/ReentrantMonitor.h
2011-04-29 14:21:57 -05:00