Commit Graph

184 Commits

Author SHA1 Message Date
Chris Pearce
35eb41eb07 Bug 910897 - Use MP3FrameParser in DirectShow in order to calculate the duration. r=padenot 2013-09-10 12:45:33 +12:00
Chris Pearce
ddd2cfddd7 Bug 910966 - Use MP3FrameParser in DirectShow's SourceFilter, to more accurately determine the offset of the first MP3 frame. This enables us to only pass the MP3 data into DirectShow, which can't handle large ID3v2 tags. r=padenot 2013-09-09 09:47:54 +12:00
Chris Pearce
82fc0dde57 Bug 910996 - Move MP3FrameParser out of B2G specific code, so it can be used on other platforms. r=padenot
--HG--
rename : content/media/omx/MP3FrameParser.cpp => content/media/MP3FrameParser.cpp
rename : content/media/omx/MP3FrameParser.h => content/media/MP3FrameParser.h
2013-09-09 09:47:29 +12:00
Ehsan Akhgari
143454cc1a Bug 912702 - Minimize the #includes in content/media; r=roc 2013-09-05 16:25:17 -04:00
Ehsan Akhgari
92ad73ef93 Backed out changeset 2f15518f566e (bug 912702) because of B2G JB Emulator build bustage
--HG--
extra : rebase_source : 6c01ad3bc2f91b0e7e3edab84aedbfe064310a8b
2013-09-05 13:29:38 -04:00
Ehsan Akhgari
be1e68caf3 Bug 912702 - Minimize the #includes in content/media; r=roc 2013-09-04 17:58:14 -04:00
Mike Hommey
f1cf3b4238 Bug 912293 - Remove now redundant boilerplate from Makefile.in. r=gps 2013-09-05 09:01:46 +09:00
Brian O'Keefe
4f68eb9b02 Bug 875934 - Move LIBRARY_NAME to moz.build, batch 3; r=mshal 2013-08-15 09:02:09 -04:00
Ms2ger
2d7391b50d Bug 883284 - Part b: Move LIBXUL_LIBRARY into moz.build (a-c); r=joey 2013-08-22 08:55:59 +02:00
Thomas Zimmermann
a0bcc67e59 Bug 831224: Use multi-threaded I/O for reading and processing MP3 frames, r=padenot
Reading large MP3 files from a slow medium, such as an SD card, takes
several seconds. This is too long for interactive applications like the
music app.

With this patch, the OmxDecoder reads large MP3 file in smaller chunks
and hands over each chunk individually to the MP3 parser. Reading the
file is done in the I/O thread, which is allowed to block, parsing is
done on the main thread.

The current chunk size is 8 MiB, which is small enough to not cause any
delay.
2013-05-06 20:07:29 +02:00
Thomas Zimmermann
79d1b1351b Bug 831224: Parse MP3 frame headers in OmxDecoder, r=padenot
On FirefoxOS, the Android libraries estimate the duration of MP3 streams
by examining the first MP3 frame header. This only works for streams with
constant bit rate. For streams with variable bit rate, a too short or too
long duration is computed.

This patch adds support for parsing MP3 frame headers. The decoder handles
file streams by reading them at once at the beginning and parsing them
immediately. Network streams are updated when a new fragment arrives.
2013-01-24 13:38:32 +01:00
Thomas Zimmermann
156ef9939c Bug 831224: Added MP3 frame parser, r=padenot
MP3 streams consist of small frames, with each frame containing the
audio data of a few hundred milliseconds. The actual duration of the
encoded audio can among frames.

Each frame consists of a 4-byte frame header, some optional extra
information, and the audio data. The MP3 frame parser walks over the
content of an MP3 stream, computes the duration of each frame from
the frame header, and sums them up to the streams complete duration.

The MP3 frame parser does not decode the actual audio data.
2013-05-03 09:44:02 +02:00
Thomas Zimmermann
d184108c32 Bug 831224: Remove trailing whitespaces, r=padenot 2013-01-24 13:38:32 +01:00
Ed Morley
356d0996fb Backed out changeset 303ba353d785 (bug 831224) for turning bug 897108 permaorange 2013-08-08 10:00:26 -07:00
Ed Morley
77d8517be3 Backed out changeset 3cfe2793f157 (bug 831224) 2013-08-08 09:59:52 -07:00
Ed Morley
7b2317d99c Backed out changeset e334b3139e2a (bug 831224) 2013-08-08 09:59:45 -07:00
Ed Morley
34a074e7fd Backed out changeset 909cddbd5af9 (bug 831224) 2013-08-08 09:59:42 -07:00
Thomas Zimmermann
38af5b43c8 Bug 831224: Use multi-threaded I/O for reading and processing MP3 frames, r=padenot
Reading large MP3 files from a slow medium, such as an SD card, takes
several seconds. This is too long for interactive applications like the
music app.

With this patch, the OmxDecoder reads large MP3 file in smaller chunks
and hands over each chunk individually to the MP3 parser. Reading the
file is done in the I/O thread, which is allowed to block, parsing is
done on the main thread.

The current chunk size is 8 MiB, which is small enough to not cause any
delay.

--HG--
extra : rebase_source : 4effb86db481c405a97760cd98f4218dde42104d
2013-05-06 20:07:29 +02:00
Thomas Zimmermann
5fa26f0ddd Bug 831224: Parse MP3 frame headers in OmxDecoder, r=padenot
On FirefoxOS, the Android libraries estimate the duration of MP3 streams
by examining the first MP3 frame header. This only works for streams with
constant bit rate. For streams with variable bit rate, a too short or too
long duration is computed.

This patch adds support for parsing MP3 frame headers. The decoder handles
file streams by reading them at once at the beginning and parsing them
immediately. Network streams are updated when a new fragment arrives.

--HG--
extra : rebase_source : bffb9447a5fdba4145e83f5aeb3c2accfb7872d6
2013-01-24 13:38:32 +01:00
Thomas Zimmermann
9f51b66cc3 Bug 831224: Added MP3 frame parser, r=padenot
MP3 streams consist of small frames, with each frame containing the
audio data of a few hundred milliseconds. The actual duration of the
encoded audio can among frames.

Each frame consists of a 4-byte frame header, some optional extra
information, and the audio data. The MP3 frame parser walks over the
content of an MP3 stream, computes the duration of each frame from
the frame header, and sums them up to the streams complete duration.

The MP3 frame parser does not decode the actual audio data.

--HG--
extra : rebase_source : 1b101d8f9bf73e62672933d0f5d20253d7b25491
2013-05-03 09:44:02 +02:00
Thomas Zimmermann
1573d86782 Bug 831224: Remove trailing whitespaces, r=padenot
--HG--
extra : rebase_source : e04ddb59ab953550d988924670c96b73bf7909f2
2013-01-24 13:38:32 +01:00
Peter Chang
416da61282 Bug 894262 - Merge GonkIOSurfaceImage to GrallocImage, r=nical, kanru 2013-07-25 10:13:35 +08:00
Sotaro Ikeda
78260530d7 Bug 896374 - Fix infinite loop in MediaResourceManagerService::cancelClientLocked(). r=doublec 2013-07-24 08:55:30 -04:00
Sotaro Ikeda
9c866b9030 Bug 891445 - Fix incorrect pointer comparison. r=doublec 2013-07-12 17:27:17 -04:00
Trevor Saunders
82e5558b37 bug 887483 - remove a bunch of useless assignments to FORCE_STATIC_LIB implied by LIBXUL_LIBRARY=1 r=mshal 2013-07-11 11:06:34 -04:00
Sotaro Ikeda
8ce3936dc4 Bug 889238 - Add error handling to OMXCodecProxy. r=doublec 2013-07-07 16:33:57 -04:00
Marco Chen
4d4f788735 Bug 872462 - OmxDecoder::Pause/Start didn't follow AOSP's definition. r=doublec 2013-07-01 12:02:03 +08:00
Sotaro Ikeda
e6911a901b Bug 884654 - Fix deadlock come from OmxDecoder::statusChanged(). r=doublec 2013-06-26 09:36:22 -04:00
Sotaro Ikeda
f910a1819c Bug 883744 - add pointer null check r=doublec 2013-06-22 08:58:12 -04:00
Sotaro Ikeda
cb24852555 Bug 884440 - Remove item correctly from vector. r=doublec 2013-06-19 13:40:31 -04:00
Robert O'Callahan
25cffcb402 Bug 880601. Emulate a form of keyframe skipping by allowing MediaOmxReader::DecodeVideoFrame to decode more than one video frame if video decoding is falling behind. r=cpearce
If we don't support this in any way, then we get into trouble when there is
plenty of compressed data buffered but for some reason video decoding falls
behind (maybe there was a short period where the video data wasn't available).
Audio playback continues normally, but MediaOmxReader keeps making one call
to ReadAudio and one to ReadVideo, and if each call to ReadAudio decodes at
least as much as the calls to ReadVideo, video decoding can never catch up
to the current audio playback position. So video never plays. And when the
video decoding point gets far enough away from the audio decoding point,
horrible things start to happen, such as video and audio reading completely
different parts of the media cache and interfering with the caching mechanism
(which assumes audio and video reads are close together).

This patch approximates keyframe skipping, and is basically just a way for
MediaOmxReader::DecodeVideoFrame to decode more than one frame at a time
if we need video decoding to catch up.

To prevent pathological situations, we cap both the maximum number of frames
decoded per DecodeVideoFrame and the amount of time we spend in the method
(excluding the time for the last frame).

--HG--
extra : rebase_source : cba95c537fe97df5b696581be8233b6e9cffb70b
2013-06-15 23:51:56 +12:00
Sotaro Ikeda
fb0816d02d Bug 871485 - Share hw codec between applications/tasks. r=mwu, r=doublec, r=roc 2013-06-10 08:22:05 -04:00
Robert O'Callahan
54857756c2 Bug 877461. Part 3: Retry libstagefright audio/video decoding if it fails due to a timeout. r=sotaro
--HG--
extra : rebase_source : 2ccd8afaca1e4055eb0105f25754176b0ff37034
2013-06-06 11:43:43 +12:00
Robert O'Callahan
30c4640f2a Bug 877461. Part 2: Initialize VideoFrame members to 0. r=doublec
--HG--
extra : rebase_source : d447561e74bc760c2ccbcba925e54579e3a15088
2013-06-06 10:48:25 +12:00
Vladimir Vukicevic
903320a647 b=843599; use gralloc buffers for WebGL streaming on B2G; r=nical,jgilbert,jrmuizel 2013-05-27 10:12:13 -04:00
Sotaro Ikeda
1591798e76 Bug 874325 - Add lock to MediaStreamSource::readAt(). r=doublec 2013-06-03 10:41:54 -04:00
Mike Shal
994cfe0b6b Bug 864774 - Part 2: Move CPPSRCS to moz.build as CPP_SOURCES; r=joey CLOSED TREE
From 9e0ba7f425143f545eb6c4b26a9a96b5ade4d8e9 Mon Sep 17 00:00:00 2001
2013-04-23 17:54:15 -04:00
Sotaro Ikeda
ea6d1dc9d5 Bug 871753 Part1 - fix deadlock during youtube video playback. r=doublec 2013-05-16 17:24:13 -07:00
Sotaro Ikeda
db7c471a36 Bug 868806 - Handle OMXCodec's error. r=doublec 2013-05-15 21:35:34 -04:00
Patrick Wang
2ba1b673b5 Bug 871463 - allow to fallback to software codec in emulator. r=doublec 2013-05-13 17:38:49 +08:00
Sotaro Ikeda
b794e3ebea Bug 863441 - Increment GetAmpleVideoFrames() to 3. r=doublec 2013-05-07 10:53:42 -04:00
Sotaro Ikeda
aeeac1a8b1 Bug 864180 - Move audio software decoder to app's process. r=doublec 2013-05-06 08:43:18 -04:00
Ed Morley
cabb89f9ab Merge mozilla-central and birch 2013-05-03 13:35:02 +01:00
Chris Pearce
ea957dfa74 Bug 862182. r=roc,doublec 2013-05-03 10:59:18 +12:00
Michael Wu
932f230512 Bug 868065 - Move GraphicBuffer.h include out of ImageContainer.h, r=vlad 2013-05-02 12:56:09 -04:00
Chris Pearce
a183f15892 Bug 862182 - Revert bug 862183 due to frequent orange in 459439 crashtest. CLOSED TREE. r=philor 2013-05-01 13:33:33 +12:00
Chris Pearce
252138b2cf Bug 862182 - Hold references to MediaResource in nsRefPtrs (content/media/omx), and fix some omx compiler warnings. r=doublec 2013-05-01 11:23:46 +12:00
Ryan VanderMeulen
a9cb7d2c88 Merge m-c to inbound. 2013-04-16 16:04:20 -04:00
Mike Shal
77cdb6567d Bug 846634 - Part 2: Move EXPORTS to moz.build; r=joey 2013-04-16 15:24:43 -04:00
Diego Wilson
4b30b46d1f Bug 860760 - Pause OMX media sources when playback is paused. r=sotaro, r=cdouble
OMXCodec needs to now when the stream is paused. Otherwise it will
prevent the device from lowering its power state when idle.
2013-04-10 17:58:25 -07:00
Sotaro Ikeda
533f569684 Bug 837051 - Store less buffers for video playback at MediaOmxReader. r=doublec 2013-04-08 14:35:30 -04:00
Diego Wilson
788b16a9ac Bug 847779 - Abort playback if OMX audio init fails. r=doublec, r=cpearce 2013-04-04 15:33:45 -07:00
Kyle Machulis
5aa83c3e11 Bug 855465 - Add emacs python mode comments to moz.build files; r=gps 2013-04-01 11:36:59 -07:00
Kyle Machulis
c79ccc0693 Backout for changeset 03452b187c14 (Bug 855465) due to bustage on a CLOSED TREE; r=qdot 2013-03-29 15:12:58 -07:00
Kyle Machulis
a59d40f143 Bug 855465 - Add emacs python mode comments to moz.build files; r=gps
--HG--
extra : rebase_source : 004a756492323e1a049586e85b3be5037159df20
2013-03-29 13:56:18 -07:00
Sotaro Ikeda
9174c6b903 Bug 850566 - Part 3: Set video size to SurfaceDescriptorGralloc. r=doublec 2013-03-28 09:59:48 -04:00
Mike Shal
9680b82df6 Bug 844654 - Part 2: Move MODULE to moz.build; rs=gps 2013-03-19 11:47:00 -07:00
Sotaro Ikeda
269dd694f1 Bug 803471 - Part 5b - Change OmxDecode to use GonkNativeWindowClient. r=cdouble 2013-03-08 14:43:33 -05:00
Sotaro Ikeda
1f005c4979 Bug 803471 - Part 2 - Use OmxClient in OmxDecoder. r=cdouble 2013-03-08 14:43:32 -05:00
Andrea Marchesini
b57856b7a9 Bug 841014 - Rename nsTimeRanges.h to TimeRanges.h. r=Ms2ger
--HG--
rename : content/html/content/src/nsTimeRanges.cpp => content/html/content/src/TimeRanges.cpp
rename : content/html/content/src/nsTimeRanges.h => content/html/content/src/TimeRanges.h
2013-03-02 14:14:44 -05:00
Gregory Szorc
aa0fed2e03 Bug 784841 - Part 18g: Convert /content; r=glandium 2013-02-25 12:47:19 -08:00
Sotaro Ikeda
06b641ac00 Bug 840154 - Do not release MediaBuffer during OMXCodec is seeking. r=cdouble 2013-02-15 21:27:18 -05:00
Ehsan Akhgari
1090ae9f96 Bug 792263 - Implement decodeAudioData; r=bzbarsky,cpearce,padenot 2013-02-01 17:13:23 -05:00
Chris Jones
a46b8b76a0 Bug 834150: Just Say No to the fallback SW decoder. r=doublec a=blocking-b2g 2013-01-30 15:06:28 -08:00
Chris Double
07758d927e Bug 825485 - AAC files don't play on B2G - r=cjones 2013-01-07 12:55:50 +00:00
Chris Jones
a3794cb9e4 Bug 824230: Handle UNKNOWN_ERROR in OmxDecoder. r=doublec 2012-12-24 15:43:10 -08:00
Chris Jones
d3257c3260 Bug 819609: Don't try to send too-large videos to hardware video decoders. r=doublec a=blocking-basecamp 2012-12-10 23:48:58 -08:00
Paul Adenot
8890b245de Bug 816949 - Remove IsSeekableInBufferedRange() methods as they are not needed anymore. r=cpearce 2012-12-07 14:30:03 +01:00
Paul Adenot
c1c81fcc33 Bug 815194 - Remove more ns prefixes on content/media classes + whitespace fixes. r=cpearce 2012-11-28 20:40:07 +01:00
Edwin Flores
d28bc51cd3 Bug 812756 - Set AmpleVideoFrames to the minimum to win a race when shutting down OMX.qcom.video.decoder.mpeg4 decoder r=doublec 2012-11-28 15:34:53 +13:00
Edwin Flores
ed0385c3e4 Bug 812756 - Remove seeking hack from OMX decoder r=cpearce 2012-11-27 17:08:40 +13:00
Ehsan Akhgari
136a70ea49 Bug 814757 - Export all decoder reader headers; r=cpearce 2012-11-23 14:52:39 -05:00
Thinker K.F. Li
d9bd1c6a6e Bug 805711 - check EOS against audio source for OmxDecoder. r=doublec 2012-11-24 20:25:02 +13:00
Thinker K.F. Li
0e74036a49 Bug 810734 - Check EOF to avoid infinite looping when parsing MP4. r=doublec 2012-11-21 22:45:42 -05:00
Ehsan Akhgari
d5bdac2156 Bug 812032 - Refactor the media reader classes to not access MediaDecoder directly; r=cpearce 2012-11-19 10:11:21 -05:00
Chris Pearce
9abb830db0 Bug 811381 - Remove ns prefix from media code. r=roc
--HG--
rename : content/media/nsAudioAvailableEventManager.cpp => content/media/AudioAvailableEventManager.cpp
rename : content/media/nsAudioAvailableEventManager.h => content/media/AudioAvailableEventManager.h
rename : content/media/nsAudioStream.cpp => content/media/AudioStream.cpp
rename : content/media/nsAudioStream.h => content/media/AudioStream.h
rename : content/media/nsMediaCache.cpp => content/media/MediaCache.cpp
rename : content/media/nsMediaCache.h => content/media/MediaCache.h
rename : content/media/nsBuiltinDecoder.cpp => content/media/MediaDecoder.cpp
rename : content/media/nsBuiltinDecoder.h => content/media/MediaDecoder.h
rename : content/media/nsBuiltinDecoderReader.cpp => content/media/MediaDecoderReader.cpp
rename : content/media/nsBuiltinDecoderReader.h => content/media/MediaDecoderReader.h
rename : content/media/nsBuiltinDecoderStateMachine.cpp => content/media/MediaDecoderStateMachine.cpp
rename : content/media/nsBuiltinDecoderStateMachine.h => content/media/MediaDecoderStateMachine.h
rename : content/media/dash/nsDASHDecoder.cpp => content/media/dash/DASHDecoder.cpp
rename : content/media/dash/nsDASHDecoder.h => content/media/dash/DASHDecoder.h
rename : content/media/dash/nsDASHReader.cpp => content/media/dash/DASHReader.cpp
rename : content/media/dash/nsDASHReader.h => content/media/dash/DASHReader.h
rename : content/media/dash/nsDASHRepDecoder.cpp => content/media/dash/DASHRepDecoder.cpp
rename : content/media/dash/nsDASHRepDecoder.h => content/media/dash/DASHRepDecoder.h
rename : content/media/gstreamer/nsGStreamerDecoder.cpp => content/media/gstreamer/GStreamerDecoder.cpp
rename : content/media/gstreamer/nsGStreamerDecoder.h => content/media/gstreamer/GStreamerDecoder.h
rename : content/media/gstreamer/nsGStreamerReader.cpp => content/media/gstreamer/GStreamerReader.cpp
rename : content/media/gstreamer/nsGStreamerReader.h => content/media/gstreamer/GStreamerReader.h
rename : content/media/ogg/nsOggCodecState.cpp => content/media/ogg/OggCodecState.cpp
rename : content/media/ogg/nsOggCodecState.h => content/media/ogg/OggCodecState.h
rename : content/media/ogg/nsOggDecoder.cpp => content/media/ogg/OggDecoder.cpp
rename : content/media/ogg/nsOggDecoder.h => content/media/ogg/OggDecoder.h
rename : content/media/ogg/nsOggReader.cpp => content/media/ogg/OggReader.cpp
rename : content/media/ogg/nsOggReader.h => content/media/ogg/OggReader.h
rename : content/media/omx/nsMediaOmxDecoder.cpp => content/media/omx/MediaOmxDecoder.cpp
rename : content/media/omx/nsMediaOmxDecoder.h => content/media/omx/MediaOmxDecoder.h
rename : content/media/omx/nsMediaOmxReader.cpp => content/media/omx/MediaOmxReader.cpp
rename : content/media/omx/nsMediaOmxReader.h => content/media/omx/MediaOmxReader.h
rename : content/media/plugins/nsMediaPluginDecoder.cpp => content/media/plugins/MediaPluginDecoder.cpp
rename : content/media/plugins/nsMediaPluginDecoder.h => content/media/plugins/MediaPluginDecoder.h
rename : content/media/plugins/nsMediaPluginHost.cpp => content/media/plugins/MediaPluginHost.cpp
rename : content/media/plugins/nsMediaPluginHost.h => content/media/plugins/MediaPluginHost.h
rename : content/media/plugins/nsMediaPluginReader.cpp => content/media/plugins/MediaPluginReader.cpp
rename : content/media/plugins/nsMediaPluginReader.h => content/media/plugins/MediaPluginReader.h
rename : content/media/raw/nsRawDecoder.cpp => content/media/raw/RawDecoder.cpp
rename : content/media/raw/nsRawDecoder.h => content/media/raw/RawDecoder.h
rename : content/media/raw/nsRawReader.cpp => content/media/raw/RawReader.cpp
rename : content/media/raw/nsRawReader.h => content/media/raw/RawReader.h
rename : content/media/raw/nsRawStructs.h => content/media/raw/RawStructs.h
rename : content/media/wave/nsWaveDecoder.cpp => content/media/wave/WaveDecoder.cpp
rename : content/media/wave/nsWaveDecoder.h => content/media/wave/WaveDecoder.h
rename : content/media/wave/nsWaveReader.cpp => content/media/wave/WaveReader.cpp
rename : content/media/wave/nsWaveReader.h => content/media/wave/WaveReader.h
rename : content/media/webm/nsWebMBufferedParser.cpp => content/media/webm/WebMBufferedParser.cpp
rename : content/media/webm/nsWebMBufferedParser.h => content/media/webm/WebMBufferedParser.h
rename : content/media/webm/nsWebMDecoder.cpp => content/media/webm/WebMDecoder.cpp
rename : content/media/webm/nsWebMDecoder.h => content/media/webm/WebMDecoder.h
rename : content/media/webm/nsWebMReader.cpp => content/media/webm/WebMReader.cpp
rename : content/media/webm/nsWebMReader.h => content/media/webm/WebMReader.h
2012-11-14 11:46:40 -08:00
Chris Pearce
42d7fd21b1 Bug 811381 - Move media code into mozilla namespace. r=roc 2012-11-14 11:45:33 -08:00
Chris Pearce
f9e8b1f20a Bug 811381 - Flatten nsMediaDecoder and nsBuiltinDecoder into a single class. r=roc 2012-11-14 11:45:13 -08:00
Ehsan Akhgari
0704216980 Bug 810177 - Part 2: Break MetadataTags out of nsHTMLMediaElements; r=cpearce
This patch simply moves the MetadataTags typedef to nsMediaDecoder.h to
reduce the dependencies on nsHTMLMediaElements.h.  The rest of the
changes are made to make this compile.
2012-11-08 19:40:08 -05:00
Chris Pearce
dc33e1da54 Bug 799344 - Flatten nsBultinDecoderStateMachine and nsDecoderStateMachine into a single class. r=roc 2012-11-07 11:33:02 +13:00
Ryan VanderMeulen
4f33e32827 Backout 3f0e69962962, 84a1afc5b15e, c62f225d0dbb, 24870ebc9665, and dd7663e68657 (bug 799344) for mochitest-1 orange. 2012-11-06 19:36:49 -05:00
Chris Pearce
22fe237724 Bug 799344 - Flatten nsBultinDecoderStateMachine and nsDecoderStateMachine into a single class. r=roc 2012-11-07 11:33:02 +13:00
Chris Double
c11aeb6b46 Bug 791912 - Fix crash when using libstagefright during video playback shutdown on B2G - r=cpearce 2012-09-27 16:33:43 +12:00
Edwin Flores
78ee3c2d6c Bug 759506 - Add support for zero-copy OMX hardware decoding to B2G r=doublec 2012-09-27 16:33:43 +12:00