Commit Graph
479 Commits
Author SHA1 Message Date
JW Wang 64c0b513b6 Bug 1235966 - reset mAudioCompleted and mVideoCompleted when switching MediaSink so they are resolved by the new MediaSink. r=kikuo. 2016-01-13 06:13:00 +08:00
JW Wang 851b76e982 Bug 948267. Part 3 - remove MDSM::AdjustAudioThresholds() to ensure we have enough data for AudioStream::DataCallback() to consume in the audio-only case. Also increase the amount of prerolling audio to 1s (which is the size of the circular buffer of AudioStream) to ensure a smooth start of playback. r=kinetik. 2016-01-12 21:48:25 +08:00
JW Wang fb8b7440fd Bug 1237806 - update playback position before entering buffering mode so the currentTime of the media element is more accurate during buffering. r=jya. 2016-01-12 10:25:23 +08:00
JW Wang acaf30a261 Bug 1238347 - stop prerolling when decoding starts if we are waiting for data. r=cpearce. 2016-01-12 08:06:44 +08:00
JW Wang 4c38e52c9c Bug 1238343 - Update MDSM::mIsAudioPrerolling/mIsVideoPrerolling when playback rate changes. r=cpearce. 2016-01-12 08:05:21 +08:00
JW Wang 645a7bdc58 Bug 1237482 - Remove MediaDecoderStateMachine::mStreamSink. r=kikuo. 2016-01-08 15:52:12 +08:00
JW Wang 62a6167dd2 Bug 1237174 - Remove the unnecessary code since mState won't change in the case of DECODER_STATE_COMPLETED. r=bechen. 2016-01-06 18:18:13 +08:00
JW Wang 94832fa5a0 Bug 1234424. Part 2 - remove unused code. r=roc. 2016-01-05 21:15:43 +08:00
JW Wang 227e7abb19 Bug 1234424. Part 1 - share the underlying value of MDSM::mSameOriginMedia with DecodedStream. r=roc. 2016-01-05 21:15:37 +08:00
JW Wang e0fbde9d72 Bug 1233650. Part 4 - remove unused functions from DecodedStream. r=roc. 2015-12-24 10:14:16 +08:00
JW Wang f0e09dea46 Bug 1233650. Part 3 - move creation of OutputStreamManager from DecodedStream to MDSM. r=roc. 2015-12-24 10:14:16 +08:00
JW Wang 2dcb704743 Bug 1233630 - Remove MediaDecoderStateMachine::AudioDecodedUsecs. r=kikuo. 2015-12-24 10:00:47 +08:00
JW Wang b60e2e609e Bug 1231091. Part 1 - Add mVideoCompleted so MDSM can check when audio/video is done rendering. This removes the only caller of DecodedStream::IsFinished(). r=roc. 2015-12-22 08:42:38 +08:00
Jean-Yves Avenard 4a0eef18ed Bug 1229987: P4. Stop pre-rolling when encountering WAITING_FOR_DATA. r=cpearce
This allows to start displaying frames even when we have less than 5 frames.
2015-12-18 19:26:54 +11:00
JW Wang 31d0cbefaf Bug 1231075. Respect the timestamp of video frames and don't pop frames as fast as we can in real-time mode. r=roc. 2015-12-17 10:53:49 +08:00
JW Wang bcb2afb601 Bug 1230882. Part 2 - remove DecodedStream::BeginShutdown() and other unused code. r=roc. 2015-12-14 11:32:19 +08:00
Phil Ringnalda a5418f8a15 Back out 4 changesets (bug 1229987) for ASan e10s timeout in test_playback.html, Mac timeouts in test_BufferingWait_mp4.html, and Win8 failures in test_WaitingToEndedTransition_mp4.html
Backed out changeset 707a87454058 (bug 1229987)
Backed out changeset 37003d495f20 (bug 1229987)
Backed out changeset c8f4e1eaf884 (bug 1229987)
Backed out changeset 42ca05d8546d (bug 1229987)
2015-12-10 23:10:20 -08:00
Jean-Yves Avenard c682154ccc Bug 1230527: P1. Ensure seeked event is fired prior loadeddata. r=jwwang 2015-12-10 14:08:05 -05:00
Jean-Yves Avenard abe15854ff Bug 1229987: P4. Stop pre-rolling when encountering WAITING_FOR_DATA. r=cpearce
This allows to start displaying frames even when we have less than 5 frames.
2015-12-10 12:17:29 -05:00
JW Wang 7fa0fb3d54 Bug 1230004. Part 2 - have MDSM::BeginShutdown return a promise and remove MDSM::mDecoder. r=cpearce. 2015-12-03 15:59:44 +08:00
JW Wang 44efdca870 Bug 1230004. Part 1 - cache data in MDSM so it won't need to ask MediaDecoder. r=cpearce. 2015-12-03 15:59:30 +08:00
JW Wang cb6c7460e1 Bug 1228939 - 1. add mSeekable to MediaInfo. 2. use MediaEventSource to notify the decoder when the media is not seekable. 3. remove unused code. r=jya. 2015-12-02 15:42:32 +08:00
JW Wang ea5b44f5ac Bug 1228923 - Merge some MediaEventSource for MDSM. r=jya. 2015-12-01 09:34:02 +08:00
JW Wang e29a951f12 Bug 1227797 - Use MediaEventSource to publish playback events for MDSM. r=jya. 2015-11-30 13:06:19 +08:00
JW Wang 23e5234319 Bug 1218311 - Port the fix of bug 1193614 to VideoSink. r=cpearce. 2015-11-25 15:15:05 +08:00
JW Wang 98580acba1 Bug 1226569. Part 1 - Use MediaEventSource to publish MetadataLoaded and FirstFrameLoaded events. r=jya. 2015-11-23 10:35:18 +08:00
sajitk 67836f0590 Bug 1201997 - Part 4 - Change size and offset variables to size_t.r=froydn 2015-11-15 14:48:08 +01:00
JW Wang eab89943d5 Bug 1220512 - ensure next frame status is updated before notifying MediaDecoder::PlaybackEnded. See bug 1220512 comment 1 for the detail. r=cpearce. 2015-11-02 21:26:10 +08:00
Nathan Froyd c4013082d6 Bug 1220491 - clarify ownership relationships for creators of AudioData; r=gerald
The way we pass in AudioDataValue arrays into AudioData is non-uniform:
sometimes we have nsAutoArrayPtrs, sometimes we don't, and it's not
immediately obvious from the function signature of the constructor that
we're actually taking ownership of this array.  Let's fix that by using
UniquePtr<AudioDataValue[]> smart pointers to hold the data prior to
creating AudioData values, and for passing in to AudioData's
constructor.  Using standard-er C++ things instead of our homegrown ones
is a good thing.
2015-11-01 17:34:26 -05:00
Jean-Yves Avenard 2d2d243fb4 Bug 1207198: P2. Defer dormant request while ReadMetadata is pending in MDSM. r=sotaro 2015-10-23 23:34:06 +11:00
JW Wang 9fb5a4078f Bug 1216850. Part 3 - backout bug 1214073. r=me. 2015-10-21 14:04:20 +08:00
JW Wang 101e01f229 Bug 1216850. Part 2 - backout bug 1214498. r=me. 2015-10-21 11:45:53 +08:00
JW Wang 97a83e3d05 Bug 1216850. Part 1 - backout bug 1215003. r=me. 2015-10-21 10:59:56 +08:00
Kilik Kuo ae4bb28254 Bug 1194918 - Move av-sync and video frame rendering logic from MDSM to VideoSink. r=jwwang. 2015-10-19 18:08:11 +08:00
Kilik Kuo 154db5b190 Bug 1194918 - Add VideoSink which contains either AudioSinkWrapper or DecodedStreamSink as a default operating MediaSink in MDSM. r=jwwang. 2015-10-19 17:32:16 +08:00
JW Wang 2f6e153526 Bug 1215003. Part 3 - fix AsyncReadMetadata() and its callers. r=gerald. 2015-10-19 10:52:34 +08:00
Jonathan Hao ce74a9c16c Bug 1207964 - Remove workaround from bug 1080461. r=jwwang 2015-10-14 15:25:00 +08:00
Nathan Froyd 4e6d8f6705 Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat
The bulk of this commit was generated with a script, executed at the top
level of a typical source code checkout.  The only non-machine-generated
part was modifying MFBT's moz.build to reflect the new naming.

CLOSED TREE makes big refactorings like this a piece of cake.

 # The main substitution.
find . -name '*.cpp' -o -name '*.cc' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \
    xargs perl -p -i -e '
 s/nsRefPtr\.h/RefPtr\.h/g; # handle includes
 s/nsRefPtr ?</RefPtr</g;   # handle declarations and variables
'

 # Handle a special friend declaration in gfx/layers/AtomicRefCountedWithFinalize.h.
perl -p -i -e 's/::nsRefPtr;/::RefPtr;/' gfx/layers/AtomicRefCountedWithFinalize.h

 # Handle nsRefPtr.h itself, a couple places that define constructors
 # from nsRefPtr, and code generators specially.  We do this here, rather
 # than indiscriminantly s/nsRefPtr/RefPtr/, because that would rename
 # things like nsRefPtrHashtable.
perl -p -i -e 's/nsRefPtr/RefPtr/g' \
     mfbt/nsRefPtr.h \
     xpcom/glue/nsCOMPtr.h \
     xpcom/base/OwningNonNull.h \
     ipc/ipdl/ipdl/lower.py \
     ipc/ipdl/ipdl/builtin.py \
     dom/bindings/Codegen.py \
     python/lldbutils/lldbutils/utils.py

 # In our indiscriminate substitution above, we renamed
 # nsRefPtrGetterAddRefs, the class behind getter_AddRefs.  Fix that up.
find . -name '*.cpp' -o -name '*.h' -o -name '*.idl' | \
    xargs perl -p -i -e 's/nsRefPtrGetterAddRefs/RefPtrGetterAddRefs/g'

if [ -d .git ]; then
    git mv mfbt/nsRefPtr.h mfbt/RefPtr.h
else
    hg mv mfbt/nsRefPtr.h mfbt/RefPtr.h
fi
2015-10-18 01:24:48 -04:00
Nathan Froyd bf7f6dda03 Bug 1207245 - part 3 - switch all uses of mozilla::RefPtr<T> to nsRefPtr<T>; r=ehsan
This commit was generated using the following script, executed at the
top level of a typical source code checkout.

 # Don't modify select files in mfbt/ because it's not worth trying to
 # tease out the dependencies currently.
 #
 # Don't modify anything in media/gmp-clearkey/0.1/ because those files
 # use their own RefPtr, defined in their own RefCounted.h.
find . -name '*.cpp' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \
    grep -v 'mfbt/RefPtr.h' | \
    grep -v 'mfbt/nsRefPtr.h' | \
    grep -v 'mfbt/RefCounted.h' | \
    grep -v 'media/gmp-clearkey/0.1/' | \
    xargs perl -p -i -e '
 s/mozilla::RefPtr/nsRefPtr/g; # handle declarations in headers
 s/\bRefPtr</nsRefPtr</g; # handle local variables in functions
 s#mozilla/RefPtr.h#mozilla/nsRefPtr.h#; # handle #includes
 s#mfbt/RefPtr.h#mfbt/nsRefPtr.h#;       # handle strange #includes
'

 # |using mozilla::RefPtr;| is OK; |using nsRefPtr;| is invalid syntax.
find . -name '*.cpp' -o -name '*.mm' | xargs sed -i -e '/using nsRefPtr/d'

 # RefPtr.h used |byRef| for dealing with COM-style outparams.
 # nsRefPtr.h uses |getter_AddRefs|.
 # Fixup that mismatch.
find . -name '*.cpp' -o -name '*.h'| \
    xargs perl -p -i -e 's/byRef/getter_AddRefs/g'
2015-10-18 00:40:10 -04:00
Dan Glastonbury 1c36d235d5 Bug 1193614 - Schedule State Machine when VideoQueue() is low. r=cpearce
If UpdateRenderedVideoFrames() can't find a frame in VideoQueue() that
is `in the future`, ie. has a time stamp that is greater than clock
time, the thread is scheduled in 40ms.

The logic in UpdateRenderedVideoFrames() always leaves the current frame
sent to the compositor at the head of the queue. It's time stamp is
always less than clock time.

Because there's always one, old frame in the queue, the logic in
OnVideoDecoded() needs to reschedule the state machine when queue size
is two, after adding the new frame.
2015-10-15 07:29:03 +10:00
JW Wang 533dab4862 Bug 1214498 - MediaDecoderReader::DisableHardwareAcceleration should figure out which thread to dispatch the job. r=gerald. 2015-10-14 14:25:01 +08:00
JW Wang 48c6ff4892 Bug 1214073 - MediaDecoderReader::ReleaseMediaResources will do dispatch if necessary. r=gerald. 2015-10-14 11:52:26 +08:00
JW Wang 582b648a0d Bug 1214065 - Remove unused arguments from MediaDecoder::Load() and its friends. r=kinetik. 2015-10-14 11:46:27 +08:00
Kilik Kuo a2580e42be Bug 1213897 - Extract DelayedScheduler out of MDSM to a common class. r=jwwang 2015-10-13 15:39:01 +08:00
JW Wang 17c6b91845 Bug 1212723. Part 2 - remove unused argument aCloneDonor from MediaDecoderReader::Init(). r=jya. 2015-10-13 15:28:57 +08:00
JW Wang f787446b04 Bug 1212701. Part 2 - remove MediaDecoderStateMachine::OnDecodeTaskQueue() which is unused. r=jya. 2015-10-12 12:05:52 +08:00
JW Wang 5fb6ba91b6 Bug 1212220 - cache pref values so they are safe to access off the main thread. r=roc. 2015-10-11 20:11:04 +08:00
Kilik Kuo c068370869 Bug 1211364 - Check frame validity earlier when decoded frames arrive in MDSM. r=jwwang
Rebase to currnet truck
2015-10-07 14:52:05 +08:00
JW Wang 3c0a0246a0 Bug 1211787 - Improve the accuracy of MediaDecoderStateMachine::GetDecodedAudioDuration(). r=roc. 2015-10-07 12:09:34 +08:00
JW Wang 2999762c86 Bug 1208934 - Remove usage of decoder monitor from MDSM. r=kinetik. 2015-10-06 10:26:33 +08:00