Commit Graph

38 Commits

Author SHA1 Message Date
Robert O'Callahan
cd82f78cfb Bug 784829. Initialize mIsConsumed at the start of every pass to determine what's consumed. r=jesup
Also, might as well set mIsConsumed on every stream.
2012-08-29 23:20:45 +12:00
Robert O'Callahan
ef29d2ea89 Bug 779715. Part 8: Make it safe to call MediaInputPort::Destroy after streams at both ends of the port have been destroyed. r=jesup
We had problems because we'd call Destroy on a port after calling Destroy on
its streams. This patch makes the port's Destroy ControlMessage not use a stream,
instead we get the stream from the port directly. It also makes us update the
graph's mPortCount only when the port is finally destroyed; this fixes a potential
bug where the current graph could shut down when all streams are removed, before
all ports have been completely destroyed.

--HG--
extra : rebase_source : 3245fa64b79fb8a75c17190f1a4a2af6d42a5012
2012-08-24 00:46:20 +12:00
Ehsan Akhgari
8c296bbcd4 Bug 579517 - Part 1: Automated conversion of NSPR numeric types to stdint types in Gecko; r=bsmedberg
This patch was generated by a script.  Here's the source of the script for
future reference:

function convert() {
echo "Converting $1 to $2..."
find . ! -wholename "*nsprpub*" \
       ! -wholename "*security/nss*" \
       ! -wholename "*/.hg*" \
       ! -wholename "obj-ff-dbg*" \
       ! -name nsXPCOMCID.h \
       ! -name prtypes.h \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.c" \
         -o -iname "*.cc" \
         -o -iname "*.idl" \
         -o -iname "*.ipdl" \
         -o -iname "*.ipdlh" \
         -o -iname "*.mm" \) | \
    xargs -n 1 sed -i -e "s/\b$1\b/$2/g"
}

convert PRInt8 int8_t
convert PRUint8 uint8_t
convert PRInt16 int16_t
convert PRUint16 uint16_t
convert PRInt32 int32_t
convert PRUint32 uint32_t
convert PRInt64 int64_t
convert PRUint64 uint64_t

convert PRIntn int
convert PRUintn unsigned

convert PRSize size_t

convert PROffset32 int32_t
convert PROffset64 int64_t

convert PRPtrdiff ptrdiff_t

convert PRFloat64 double
2012-08-22 11:56:38 -04:00
Paul Adenot
f0ee1ac2d2 Bug 775319 - Determine the sample format at compile time for all media code. r=kinetik 2012-08-16 18:10:36 -07:00
David Zbarsky
b27894f902 Bug 784004 - Don't include Layers.h everywhere Part 3 r=nical 2012-08-21 00:06:46 -04:00
Robert O'Callahan
15411af0fe Bug 779715. Part 4: Play all tracks of a media stream with multiple tracks. r=jesup
Until now we've identified the "first active track" of a stream and played only that. Instead,
it makes more sense to play all the tracks.
For video, we pick the last track that has a video frame for the current time, and display that.

--HG--
extra : rebase_source : 00ce3eb363df06c292232aa507e861639d10cff2
2012-08-01 00:17:22 +12:00
Robert O'Callahan
750d28ceb3 Bug 779715. Part 3: Add an API to get notifications of changes to the main-thread-visible state of a MediaStream. r=jesup
--HG--
extra : rebase_source : 24b7204d219612760b9d159fff5219c1960df51a
2012-08-20 16:20:44 +12:00
Robert O'Callahan
5bc78e2fbe Bug 779715. Part 2: Create TrackUnionStream. r=jesup
--HG--
extra : rebase_source : 29038fa1b93dcade3d762537bf510dc0901a9738
2012-08-01 00:17:21 +12:00
Robert O'Callahan
d3b9aab0ce Bug 779715. Part 1: Add basic support for ProcessedMediaStreams. r=jesup
The main thing this patch does is to add ProcessedMediaStream objects and
MediaInputPorts connecting streams. ProcessedMediaStreams are an abstract
class that doesn't constrain what processing is actually performed, except
that for now we assume a stream's processing depends only on its inputs
window of data between mCurrentTime and mStateComputedTime.
This patch reorganizes the way the blocking status of each stream is computed.
The streams are partitioned into groups so that every stream which can affect
the blocking status of another stream is in the same group as that other stream.
We also add a pass to order the streams by dependency so we can process the streams
in order of dependency; this pass also identifies the streams that form part of a
cycle.

--HG--
extra : rebase_source : c45c931a264e73f295642a934500bbeaa6448774
2012-08-01 00:17:21 +12:00
Chris Double
bb6001e68d Backed out changeset dcb9299974a0 due to audio issues on android and b2g
--HG--
extra : rebase_source : 7e2b937487c3df9a40406eadf250e6596b89664f
2012-08-10 17:30:01 +12:00
Robert O'Callahan
17835a1702 Bug 779721. Part 6: Add a flag to track whether the main thread has called Destroy on a stream, and check that flag when sending a message to it. r=jesup 2012-08-09 23:30:09 +12:00
Robert O'Callahan
7037667a9f Bug 779721. Part 4: Fix lock ordering inversion when running control messages during a forced shutdown. r=jesup 2012-08-01 00:17:22 +12:00
Robert O'Callahan
c069a47ae8 Bug 779721. Part 3: Don't clean up streams on the MediaGraph thread during a forced shutdown. r=jesup
This is actually a better fix for bug 774597. We can rely on main thread code to call
Destroy on all the MediaStreams normally. These Destroy calls can be handled even when the
MediaGraph thread has been shut down, since MediaStreamGraphImpl::AppendMessage will
call RunDuringShutdown on the Destroy messages.
2012-08-09 23:29:47 +12:00
Robert O'Callahan
c9fbc641f1 Bug 779721. Part 2: Don't block a stream just because it has no consumers. r=jesup
There is actually no reason to do this.
2012-08-01 00:17:21 +12:00
Robert O'Callahan
78f550e377 Bug 779721. Part 1: Simplify MediaStreamGraph's invariants around when messages are processed. r=jesup
Rename mBlockingDecisionsMadeUntilTime to mStateComputedTime. The invariant is that
all graph state is known up to mStateComputedTime but not beyond it (except for some
stream contents that may be buffered beyond it).
Get rid of mMessageAffectedTime and all the code around computing "affected times" and "action times".
Instead, all messages take effect at mStateComputedTime.
Get rid of the two-phase execution of messages. Everything can just happen in a single Run() method.
2012-08-01 00:17:21 +12:00
Paul Adenot
eb3129b6c8 Bug 775319 - Determine the sample format at compile time for all media code. r=kinetik
--HG--
extra : rebase_source : 4e8a2a4544895c9234ccd3992e1cafe82b8cf365
2012-08-07 16:01:02 -07:00
Aryeh Gregor
57c0ad57fb Bug 777292 part 2 - Change all nsnull to nullptr 2012-07-30 17:20:58 +03:00
Robert O'Callahan
b88beb8a39 Bug 771135. Add MediaStreamListener::NotifyPull to give SourceMediaStream generators an easy way to implement pulling data from some source. r=jesup 2012-07-20 12:36:03 -07:00
Robert O'Callahan
98cf4c17fa Bug 774597. Avoid accessing MediaStreamGraphImpl members after the graph object may have been cleaned up by the main thread. r=jesup
--HG--
extra : rebase_source : 5f6c34855ad5df629c25d4b11f008b03cf2266ae
2012-07-18 01:02:06 -04:00
Robert O'Callahan
99b99a420e Bug 752796. More logging. r=jesup 2012-06-22 22:51:04 +12:00
Mounir Lamouri
1f70fdd32a Back out bug 766007, bug 703241 and bug 752796 due to perma-orange (419f0d1b848b to 8661c74deeb5). 2012-06-22 11:13:32 +02:00
Robert O'Callahan
53fe336e33 Bug 752796. Add a bit more logging. r=jesup 2012-06-22 17:07:41 +12:00
Ehsan Akhgari
aef7f91aa1 Bug 758992 - Make the classes which use the XPCOM nsISupports implementation macros final, to avoid the warning about deleting using a pointer to a base class with virtual functions and no virtual dtor (content parts); r=bzbarsky
--HG--
extra : rebase_source : e25a064995914ca4f7b1db16b5725eb440d3e531
2012-06-18 22:30:09 -04:00
Robert O'Callahan
15a11a1162 Bug 759908. Create MediaStreamListener::NotifyConsumptionChanged. r=jesup
--HG--
extra : rebase_source : f9479b836ec92170782eb01ea8b97004b057ceb7
2012-06-01 18:26:17 +12:00
Robert O'Callahan
6e8c450277 Bug 758583. Must acquire SourceMediaStream lock before MediaStreamGraph lock. r=jesup 2012-05-29 21:10:45 +12:00
Robert O'Callahan
4e46ae0fef Bug 752796. Ensure that stream-finished notifications aren't accidentally dropped. r=jesup 2012-05-28 23:58:34 +12:00
Robert O'Callahan
01443e737c Bug 750258. Ensure that MediaStreamListener::NotifyBlockingChanged is always called for a new listener, and similar for NotifyFinished called on an already-finished stream. Rely on this to set readyState correctly for media elements consuming a stream. r=jesup,cpearce 2012-05-24 22:37:14 +12:00
Robert O'Callahan
c75f94b390 Bug 753852. Don't try to notify the graph to perform its next iteration if this stream has been removed from the graph. r=jesup 2012-05-23 18:01:15 +12: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
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
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
Robert O'Callahan
1324bd3eab Bug 750258. Fix bustage. 2012-05-07 15:57:52 +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
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
6959d6762a Bug 664918. Part 9: Tentative support for MediaStreamListener::NotifyQueuedTrackChanges. r=jesup 2012-04-30 15:12:50 +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
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