Граф коммитов

313 Коммитов

Автор SHA1 Сообщение Дата
Paul Adenot 6bf737fc9a Bug 1059389 - Unbreak --disable-webrtc. r=jesup
--HG--
extra : rebase_source : 4ef5373b44a889c0641b0e829e3feae2a0116f5e
2014-09-09 18:23:01 +02:00
Paul Adenot 9ea3573709 Bug 1062293 - Ensure the graph stays alive when doing driver switches and audio stream shutdown operations. r=jesup
This basically gets a grip on the graph while doing driver switches operations
on another thread (system thread or audio thread), because those can take time.
Because the graph is refcounted, it'll be freed when the last operation
finishes, which is what we want.

This patch also only allows driver switching when the graph is in state
LIFECYCLE_RUNNING, which is what we want anyway.

--HG--
extra : rebase_source : 76365981ec909796509bd21e616b1ff8602406bd
2014-09-03 15:52:43 +02:00
Paul Adenot 2635504554 Bug 1062293 - Add specialized logging to track the lifetime state change of MediaStreamGraphs r=jesup
As noted in the comment, it is very useful to have this interleaved with the ADB
logcat on Android/b2g, because this way we can correlate gecko state with the
state of the Android HAL.

--HG--
extra : rebase_source : 80df45d0851a06daac3abeab2ea4b5bc7e58a21d
2014-08-31 14:19:48 +02:00
Ehsan Akhgari f76451d2e9 Bug 1060980 - Fix more bad implicit constructors in the media code; r=roc
--HG--
extra : rebase_source : 14da50f7d2e37e04452445dea575ea4d582e8efd
2014-08-31 23:50:23 -04:00
Paul Adenot 9edc44ff65 Bug 1060311 - Force the use of an AudioCallbackDriver when at least an AudioNodeStream is present in the graph. r=jesup
This prevent a bug where the graph would be using a SystemClockDriver even if it
was rendering Web Audio API content.

It went like this:
- An AudioContext was created.
- Some AudioNodeStream (Web Audio API MediaStreams) were created, but their
MediaStreamTrack was not added yet
- During the stream ordering, we would see that we were running an
AudioCallbackDriver (because the MSG was created using an AudioContext, and we
pass in hints regarding the type of MediaStreams that will be added in the
future, to open the audio stream as early as we can, because it can take some
time, the MSG was created directly using an AudioCallbackDriver)
- Also during the stream ordering, we see that none of our MediaStream have an
MediaStreamTrack with an audio track. This triggers a switch to a
SystemClockDriver, because the graph thinks there is no audio.
- During CreateAndDestroyAudioNode, we would not switch to an
AudioCallbackDriver on the first iteration (right after the UpdateStreamOrder
call), because we would be switching, and not during the iteration after,
because we thought we already switched (the first patch makes this more robust).

This basically forces an AudioCallbackDriver if there is an AudioNodeStream,
which prevents unnecessary GraphDriver switches (and save threads creation
destruction, audio stream create and destruction, and all other resources
associated with a GraphDriver).
2014-08-29 20:26:29 +02:00
Paul Adenot 98e21670d3 Bug 1059601 - Make sure we don't try to play audio with a system driver. r=jesup
--HG--
extra : rebase_source : 7142e0d9baf38491637d40d66375d92a0aaa9e9e
2014-08-27 19:13:15 +02:00
Randell Jesup e6fa29bd01 Bug 848954 - Part 32 - Disable MSG sleep. r=padenot
This has a race somewhere, so we disable it for now.

The real fix will come from the Web Audio API Suspend API [0]

[0]: https://github.com/WebAudio/web-audio-api/issues/317
2014-08-26 17:12:41 +02:00
Randell Jesup 61652f721c Bug 848954 - Part 29 - Make the MSG in stable state event ref counted. r=padenot 2014-08-26 17:04:39 +02:00
Randell Jesup fadcfae452 Bug 848954 - Part 29 - Make sure to clear the right boolean flag when dispatching a stable state event. r=padenot 2014-08-25 14:13:14 +02:00
Paul Adenot 2d2000e11a Bug 848954 - Part 28 - Properly stop the driver when shutting down the graph. r=jesup
(this was originaly present, probably caused by a bad rebase)
2014-08-26 17:04:38 +02:00
Paul Adenot f408b70e40 Bug 848954 - Part 24 - Clean up the clock getter, because the right thing is now done by the GraphDriver. r=roc 2014-08-26 17:02:31 +02:00
Paul Adenot e2c00fc640 Bug 848954 - Part 23 - Refcount the AudioOutputObserver. r=jesup 2014-08-26 17:02:31 +02:00
Paul Adenot a3533d7c93 Bug 848954 - Part 20 - Remove the now useless DriverHolder class. r=roc 2014-08-26 17:02:28 +02:00
Paul Adenot 86c51354d2 Bug 848954 - Part 18 - Start the thread after having processed the messages to make sure there are messages in the queue when processing starts. r=roc 2014-08-26 17:02:09 +02:00
Paul Adenot 2dc4962f29 Bug 848954 - Part 16 - Make AudioCallbackDriver respect the AudioChannelType. r=roc 2014-08-26 17:02:08 +02:00
Paul Adenot 4dffa09424 Bug 848954 - Part 15 - Allow an AudioCallbackDriver to sleep to save power. r=roc 2014-08-26 17:02:08 +02:00
Paul Adenot a61c50b315 Bug 848954 - Part 14 - Run all blocking cubeb operations off-main-thread. r=roc 2014-08-26 17:02:07 +02:00
Paul Adenot d73a6771b0 Bug 848954 - Part 13 - Add an RAII class to ensure another thread is not in the audio callback when shutting down. r=roc 2014-08-26 17:01:35 +02:00
Paul Adenot 94dff88eb5 Bug 848954 - Part 11 - When deciding to block a MediaStream due to a speculative data underrun, don't block if we have exactly the right number of frames buffered. r=roc 2014-08-26 17:01:35 +02:00
Paul Adenot d410cae05a Bug 848954 - Part 10 - Add a MediaStreamGraph driver based on an audio callback. r=roc 2014-08-26 17:01:33 +02:00
Paul Adenot 64e239b778 Bug 848954 - Part 9 - Allow to pass in hints when getting a reference to a MediaStreamGraph to get the right driver started as soon as possible. r=roc
This is useful because some platform have rather slow audio stream
initialization time, especially the first time an audio stream is created for
the process.

We put in telemetry probes to measure that:
First stream opened for the process:
http://telemetry.mozilla.org/#filter=nightly%2F33%2FAUDIOSTREAM_FIRST_OPEN_MS&aggregates=multiselect-all!Submissions!Mean!5th%20percentile!25th%20percentile!median!75th%20percentile!95th%20percentile&evoOver=Builds&locked=true&sanitize=true&renderhistogram=Graph

Subsequent streams:
http://telemetry.mozilla.org/#filter=nightly%2F33%2FAUDIOSTREAM_LATER_OPEN_MS&aggregates=multiselect-all!Submissions!Mean!5th%20percentile!25th%20percentile!median!75th%20percentile!95th%20percentile&evoOver=Builds&locked=true&sanitize=true&renderhistogram=Graph
2014-08-25 15:27:25 +02:00
Paul Adenot 5856b1e3a4 Bug 848954 - Part 7 - Get rid of the stack allocated message queue. r=roc
In the next patches, when the AudioDriver will be implemented, the audio backend
thread (that we don't control), will return from the stack frame where the
nsTArray that allows the MSG thread to exchange message queues in a efficient
manner with the main thread. We put it in the MediaStreamGraph to avoid adding
an allocation/deallocation per iteration on the MSG thread.

In addition, the graph will be able to run on different threads during its
lifetime, so we can't guarantee a stable stack frame to allocate things on
anymore.

The array are renamed with meaningful names, explaining the double-buffering
pattern: the back queue is filled by the main thread, and is swapped with the
front queue that is processed by the MSG thread.

Arrays accesses are synchronized using the driver's monitor.
2014-08-25 15:26:21 +02:00
Paul Adenot bf1afe6d99 Bug 848954 - Part 6 - Put cubeb-related static functions in their own file. r=kinetik 2014-08-25 15:26:09 +02:00
Paul Adenot 735258f143 Bug 848954 - Part 5 - Mix down all audio and only output a single stream. r=roc 2014-08-25 15:25:49 +02:00
Paul Adenot 7e987d0735 Bug 848954 - Part 4 - Factor behavior for drivers that manage their thread. r=roc 2014-04-25 18:04:53 +02:00
Paul Adenot f6e2e2b753 Bug 848954 - Part 3 - Separate interval time calculation and actual processing, and give an audio-callback compatible interface to the Process function. r=roc 2014-04-25 18:04:23 +02:00
Paul Adenot abc95a4adc Bug 848954 - Part 2 - Put the thread management in the driver. r=roc 2014-04-25 18:03:04 +02:00
Paul Adenot f4c5b13dbd Bug 848954 - Part 1 - Factor out clocks and scheduling of MSG iterations. r=roc 2014-04-25 16:09:30 +02:00
Paul Adenot 6010fdc4cd Bug 989921 - Allow the MediaStreamGraph mixer to send data back to multiple consumers. r=jesup 2014-08-25 14:13:08 +02:00
Randell Jesup 3592b4fbba Bug 1054166: Mirror Add/RemoveListener in Add/RemoveDirectListener r=roc 2014-08-17 02:09:21 -04:00
Paul Adenot 2ae10d87c4 Bug 1046930 - Fix loop index when sending the status of the microphone to the AudioStream. r=jesup 2014-08-01 15:29:19 +02:00
Karl Tomlinson 890c626840 b=1033122 be consistent about speex_resampler symbol visibility r=khuey
When "speex/speex_resampler.h" was included, another exported header (in
dist/include) would find the speex/speex_resampler.h in dist/include before
dist/system_wrappers.  Visibility of undefined symbols depended on the order
of includes.

This patch changes includes to <speex/speex_resampler.h> so that
WRAP_SYSTEM_INCLUDES works as expected but removes the wrapper when not using
GKMEDIAS_SHARED_LIBRARY.

--HG--
extra : rebase_source : 93ca1dbdd6b489647624326e78539f44c60d0b34
2014-07-02 14:21:34 +12:00
Paul Adenot 0146ada851 Bug 1027713 - Part 5 - Trigger the panning logic on stream creation. r=jesup
UpdateStreamOrder is not called often because it's expensive (it's called only
when the graph topology changed), and it's earlier in the MSG loop than the
audio stream creation, so we need to tell the newly created AudioStream that a
microphone is active on creation as well.

The panning logic is also now triggered on stream start, because it is async.
2014-07-29 18:45:05 +02:00
Paul Adenot b2c10649c1 Bug 1027713 - Part 4 - Pan audio to the right when we are using gUM and outputing sound using MacBookPro speakers. r=jesup 2014-07-29 18:45:03 +02:00
Karl Tomlinson 44362049aa b=1022945 only AppendToTrack before SourceMediaStreams are destroyed r=roc
--HG--
extra : rebase_source : 016877261fb7a10b6d99abd17a8ca26b222d38c4
2014-07-25 09:23:59 +12:00
Karl Tomlinson 2b3a4e189d b=1022945 null MediaInputPort::mGraph when removing port from graph r=roc
This shouldn't be necessary, if clients do the right things, but provides some
safety, in case they don't.

--HG--
extra : rebase_source : e64d663c27f03eff35f538c205cd66d42420d9e4
2014-07-25 09:18:38 +12:00
Karl Tomlinson ea108f4a53 b=1022945 null MediaStream::mGraph before removing stream from graph r=roc
and use mGraph to test whether SourceMediaStreams are destroyed.

--HG--
extra : rebase_source : 03df9e7ab14ecd627dfeb333b79713a7b619f215
2014-07-25 09:09:22 +12:00
Karl Tomlinson 10289f7b9e b=1022945 remove SetStreamOrderDirty call from ProcessedMediaStream::DestroyImpl r=roc
The stream order is only important if there are connections, in which case
MediaInputPort::Disconnect() calls SetStreamOrderDirty().

MediaStreamGraphImpl::RemoveStream() also calls SetStreamOrderDirty(), which
ensures that mFirstCycleBreaker is updated when necessary.

--HG--
extra : rebase_source : b437f0d078a481725579456d91acc32353e1221a
2014-07-25 08:36:07 +12:00
Karl Tomlinson 5b0046119f b=1041466 don't remove one too many streams from the SCC stack r=roc
Also reduce the number of ProcessedMediaStream* static_casts and use a new
variable name |removed| to emphasize what is happening.

--HG--
extra : rebase_source : 50b6c5e2d97a2e4ffbf9db993e1327de8c1d7b36
2014-07-24 21:58:01 +12:00
Wes Kocher 04a9c3cb26 Backed out 8 changesets (bug 1023947, bug 1027713) for frequent Cppunit test failures
Backed out changeset 03edb1ab3182 (bug 1027713)
Backed out changeset ad05dc816fa0 (bug 1023947)
Backed out changeset a56aad94c7c9 (bug 1023947)
Backed out changeset 63af4528bd9c (bug 1023947)
Backed out changeset b6bb38846333 (bug 1027713)
Backed out changeset c0045bb1849e (bug 1027713)
Backed out changeset 274b2b25d167 (bug 1027713)
Backed out changeset e0bba6f4966f (bug 1027713)
2014-07-24 13:57:03 -07:00
Paul Adenot d826143a22 Bug 1027713 - Part 5 - Trigger the panning logic on stream creation. r=jesup
UpdateStreamOrder is not called often because it's expensive (it's called only
when the graph topology changed), and it's earlier in the MSG loop than the
audio stream creation, so we need to tell the newly created AudioStream that a
microphone is active on creation as well.

The panning logic is also now triggered on stream start, because it is async.
2014-07-24 17:05:24 +02:00
Paul Adenot 8c440dbba5 Bug 1027713 - Part 4 - Pan audio to the right when we are using gUM and outputing sound using MacBookPro speakers. r=jesup
--HG--
extra : rebase_source : d77a3e6d17b237dc46301a34ed36b6d3e8e0aeda
2014-07-24 17:05:23 +02:00
Karl Tomlinson 09a7376680 b=932400 change stream ordering to get feedback DelayNode output before supplying input r=roc
Previously downstream nodes from DelayNodes in cycles sometimes received stale
output from the previous MSG iteration.

Also, if two cycles share a common path, they will now *both* be treated as
cycles, either by muting or by enforcing minimum delay.  Previously, marking
one cycle first could prevent detection of other cycles in the same SCC.

--HG--
extra : rebase_source : 82892c538c5ce514165b5f975474df15b99e3d2b
2014-07-17 12:55:55 +12:00
Karl Tomlinson 7db34c314d b=932400 remove refcount manipulation of streams when reordering for processing r=roc
--HG--
extra : rebase_source : f99f4220b53a28a32e9a294b67f4db6218113d73
2014-07-07 11:52:25 +12:00
Randell Jesup 77ee2e1b15 Bug 1035819: patch 1 - Add notification of DirectListeners and generalize Notification of events r=roc 2014-07-14 01:47:56 -04:00
Eric Rahm 9724ad20af Bug 1036679 - MediaStreamGraph shutdown can hang if happening in conjunction with a memory report. r=roc 2014-07-09 17:22:37 -07:00
Karl Tomlinson 05746f1c8d b=1020411 correct control message order with RunAfterPendingUpdates() at shutdown r=roc
--HG--
extra : transplant_source : %AE%05%92%2C%60%9FL%D0%13O%EE%7D%09ZV%87%06%E9%B6%D8
2014-07-02 18:04:54 +12:00
Karl Tomlinson 0edb1283ff b=1027963 count ticks remaining in PlayAudio() better when blocking changes r=padenot
The previous code could result in an infinite loop.

--HG--
extra : transplant_source : %DB%20%2C%A3%26%A1%B0%00E%0B%85v%DC%1F0%F1%81Tm%9B
2014-07-01 18:21:57 +12:00
Paul Adenot 1a6848ddaa Bug 1028458 - Don't try to use a resampler when resampling segments to graph rate if we haven't instanciated one yet. r=karlt
--HG--
extra : rebase_source : 3b7696b3e89c1be0e338893578d81088f7182a3b
2014-06-26 14:01:01 +02:00
Benoit Jacob 60fe48da28 Bug 1028588 - Fix dangerous public destructors in content/media/ - r=cpearce,smaug 2014-06-24 12:36:43 -04:00