Commit Graph

95 Commits

Author SHA1 Message Date
Ralph Giles
585c620ea4 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
1fc0488427 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
2586d036c2 Bug 752661 - Make ReadMetadata() fail when there are no active Ogg streams, r=kinetik 2012-06-02 06:29:44 -07:00
Andreas Gal
3c320eb743 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
be06d81459 Bug 751219 - Support header gain in Opus files, r=kinetik 2012-05-31 11:13:17 -07:00
Timothy B. Terriberry
87b5e2c9ef Bug 759612 - Update granule position accounting for Opus, r=kinetik 2012-05-31 11:13:17 -07:00
Timothy B. Terriberry
c59add4dfa Bug 759399 - Handle preroll correctly during an Opus seek, r=doublec 2012-05-31 11:13:17 -07:00
Timothy B. Terriberry
61396f0581 Bug 759490 - Use Opus streams when seeking in Ogg, if present, r=doublec 2012-05-31 11:13:11 -07:00
Ralph Giles
ab5cec5feb 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
82ff7027aa Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
Benjamin Smedberg
eaa4878487 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
f64d1ecb9a Bug 754643 - Enable FAIL_ON_WARNINGS in content/media; r=cpearce f=roc 2012-05-18 10:29:38 +02:00
Ralph Giles
64ef2c566d 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
8c5b9206cd Bug 739962 - fix -Wunused-but-set-variable warnings in content; r=bent 2012-03-28 09:14:33 -04:00
Robert O'Callahan
872bbcb297 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
3bf55cada3 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
f08642b928 Bug 703379. Rename nsMediaDecoder::GetCurrentStream to GetStream. Make nsMediaStream::URI() const. r=doublec 2011-11-25 15:06:20 +13:00
Robert O'Callahan
84c543bfb3 Backing out part of bug 703379 to fix build failure of nsRawReader 2011-11-24 12:30:03 +13:00
Robert O'Callahan
a01d14ee25 Bug 703379. Rename nsMediaDecoder::GetCurrentStream to GetStream. Make nsMediaStream::URI() const. r=doublec 2011-11-24 12:05:12 +13:00
Matthew Gregan
8f6aeecfc2 Bug 690603 - Remove PR_TRUE/PR_FALSE from media code. r=doublec 2011-09-30 12:34:37 +13:00
Michael Wu
d2b70213ac 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
203738f570 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
6b62274806 Bug 646333 - Make video constants consistently const T. r=cpearce 2011-09-15 07:39:50 +12:00
Matthew Gregan
37751a6419 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
f582e1c46c Bug 462960 - Implement nsIDOMHTMLMediaElement::GetSeekable() + seeking algorithm part 7. r=cpearce 2011-08-09 12:10:48 +02:00
Chris Pearce
f288cf29c0 Bug 675747 - Handle multiple bos pages in a single ogg bitstream. r=doublec 2011-08-05 08:44:24 +12:00
David Volgyes
e446815189 Bug 673154 - Use nsAutoArrayPtr for SoundDataValue allocations to simplify ownership. r=cpearce 2011-07-29 13:54:21 +12:00
Matthew Gregan
15da3a33cb 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
35ef90aeb4 Bug 670726 - Remove ns{Ogg,WebM}Reader::CanDecodeToTarget(), it makes invalid assumptions. r=kinetik 2011-07-14 09:24:35 +12:00
Chris Pearce
c3e3d7574c Bug 592833 - Remove nsBuiltinDecoderReader monitor. r=roc 2011-07-12 15:39:28 +12:00
Chris Pearce
73f0b3659e Bug 592833 - Move seeking to the decode thread. r=roc 2011-07-12 15:39:25 +12:00
Chris Pearce
0a67b5d0ec Bug 592833 - Move metadata decoding to decode thread. r=roc 2011-07-12 15:39:23 +12:00
Chris Pearce
b26b7e038c 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
93b85eed54 Bug 635726 - Ignore Ogg header pages in seek timestamp capture. r=doublec 2011-07-07 09:50:44 +12:00
Chris Pearce
c6b73f16a1 Bug 592833 - Backout due to suspected android crashtest permaorange. r=philor 2011-07-06 19:21:49 +12:00
Chris Pearce
d343bdfd2e Bug 592833 - Remove nsBuiltinDecoderReader monitor. r=roc 2011-07-06 10:03:32 +12:00
Chris Pearce
48387c1643 Bug 592833 - Move seeking to the decode thread. r=roc 2011-07-06 10:03:21 +12:00
Chris Pearce
23e7bf406c Bug 592833 - Move metadata decoding to decode thread. r=roc 2011-07-06 10:03:11 +12:00
Paul ADENOT
041ce477ba 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
92c1b9ecd3 Bug 661456 - Scale WebM video frames to display size. r=kinetik 2011-06-24 10:08:54 +12:00
Chris Pearce
be98f356e2 Bug 655648 - Don't enqueue expired theora frames. r=roc 2011-06-09 08:56:45 +12:00
Chris Pearce
61d1102801 Bug 566779 - Clean up media start and end time calculation. r=doublec 2011-05-09 09:10:28 +12:00
Chris Pearce
0c662cc62d Bug 650994 - Decode ogg packets lazily, timestamp them at demux time. r=doublec 2011-05-08 18:24:09 +12:00
Chris Jones
31aa2c4e77 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
Chris Pearce
68454aca67 Bug 645773 - Typo fix in nsOggReader::GetSeekRanges(). r=roc 2011-04-26 11:32:08 +12:00
Chris Pearce
5d950fcb8f Bug 650157 - Push nsBuiltinDecoderReader::mDataOffset down into nsOggReader. r=doublec 2011-04-15 13:29:54 +12:00
Chris Pearce
73310e4cd6 Bug 641718 - Convert to using microseconds for internal video timestamps. r=kinetik 2011-04-14 10:12:23 +12:00
Chris Pearce
5e2c8c0e56 Bug 641718 - Backout 44d43f095a4f. r=backout 2011-04-01 13:02:20 +13:00
Chris Pearce
051f10c4f3 Bug 644045 - Handle Theora granulepos 'pframe' of 0 when decrementing granulepos. r=derf 2011-04-01 11:10:49 +13:00
Chris Pearce
de44f0f3fe Bug 641718 - Convert to using microseconds for internal video timestamps. r=kinetik 2011-04-01 11:10:49 +13:00