Commit Graph

54 Commits

Author SHA1 Message Date
Karl Tomlinson
dc70c3e748 bug 930257 finish BufferSource on processing last non-null block r=padenot
Since changes for bug 1217625, the node and downstream nodes won't be made
inactive until after downstream nodes have done their processing, and so there
is no need to wait for the first silent output block.

This essentially reverts 5c607f3f39d55544838f3111ede9e11a00d3c25e.

--HG--
extra : rebase_source : f449c427b580239f9072cc7c580585f10b69608f
2015-10-23 08:55:57 +13:00
Karl Tomlinson
5db355303c bug 1020370 use int64_t to avoid overflow in subsample calcs r=padenot
ratioDen can be large when playbackRate is low.

Subsample skipping is limited to uint32_t values supported by speex resampler.

--HG--
extra : rebase_source : 26a14f212b5fd3fdd62820f458db3a7cf3673e93
extra : histedit_source : 733829a4b2ba6aab7c651f362dbc47553f9dfc59
2015-10-16 11:56:24 +13:00
Karl Tomlinson
c31207d4a3 bug 1020370 adjust assert to tolerate large skipFracNum r=padenot
--HG--
extra : rebase_source : 35b6077976ccdc4c2b9d9fd4c778c6362fdd1daa
extra : histedit_source : 7adb8e3296924a1c8ffcb4665122c40ee48f42a4
2015-10-16 11:31:45 +13:00
Karl Tomlinson
fef64ad5d0 bug 1215096 correct off-by-one error in playback position of resampled buffers r=padenot
"The behavior of an expression of the form E1 op = E2 is equivalent to E1 = E1
op E2 except that E1 is evaluated only once", which means that the subtraction
of -= was happening before conversion from double to unsigned int.

The "+ 0.5" was subtracted before the truncation toward zero, causing rounding
to nearest minus one, except when nearest was zero.

--HG--
extra : rebase_source : 3b2335da7a244245ea2fcf5c80760dc1645e6dae
2015-10-16 01:40:07 +13:00
Karl Tomlinson
145e364521 bug 1214493 restore fractional start time accidentally rounded in 13e85dc6b41b r=padenot
--HG--
extra : rebase_source : 524269e54597bffcdeafc96940cbe14b8850c6a7
2015-10-15 18:56:56 +13:00
Nathan Froyd
01583602a9 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

--HG--
rename : mfbt/nsRefPtr.h => mfbt/RefPtr.h
2015-10-18 01:24:48 -04:00
Karl Tomlinson
4799b667a3 bug 1210266 use parameter index instead of node callback for sending timeline events r=padenot
--HG--
extra : rebase_source : 27a8ac26a83788c057a225fca47c49af1a021401
2015-10-01 15:48:20 +13:00
Karl Tomlinson
56758d35f3 bug 1205558 remove unused AudioNodeStream* aSource parameter r=padenot
--HG--
extra : rebase_source : 23fb5cfaa0fa3bc117183bb122bbdf032957637b
2015-09-22 17:11:52 +12:00
Karl Tomlinson
24b8c43a95 bug 1205558 use destination stream for audio node engine time r=padenot
--HG--
extra : rebase_source : 19fa80f48fac673c13345002cd8e01d1b7a5ed3d
2015-09-22 16:34:45 +12:00
Karl Tomlinson
884c5a6d1f bug 1209286 remove now unnecessary StreamTimeToDOMTime and DOMTimeToStreamTime r=padenot
--HG--
extra : rebase_source : 7da869260707220259ef804f4b3cc6237a3d5843
2015-09-29 10:46:43 +13:00
Paul Adenot
cb424cc5a1 Bug 1200579 - Stop copying AudioParam timelines. r=karlt
--HG--
extra : rebase_source : 3acc85754acb096843c45d5ad12e8e3f7954ecdc
2015-09-25 15:57:55 +02:00
Karl Tomlinson
7fe490cca6 bug 1207003 add GraphTime parameter to ProcessBlock() and remove GetCurrentPosition() r=padenot
This is immediately useful for making the track unnecessary, but will also be
required when switching to the destination node stream for tracking time (bug
1205558) because using GetCurrentPosition() on the destination node stream
would give different results depending on the stream processing order (when
called during processing of streams not strictly upstream from the destination
node).

--HG--
extra : rebase_source : 7a3432b2e6a20fa3f42be05776c178dfda64d166
2015-09-18 17:05:25 +12:00
Karl Tomlinson
aa9fd09fa4 bug 1207003 remove unused aStream parameter r=padenot
--HG--
extra : rebase_source : b3c453cc2c13ca1a22bdc5946a8aa1c07639cbaa
2015-09-18 14:58:26 +12:00
Karl Tomlinson
5dc1c2c5d6 bug 1207003 fetch stream position once instead of three times r=padenot
--HG--
extra : rebase_source : b76cf41cf5eedae7f1b131703e14303e4f642560
2015-09-18 14:27:03 +12:00
Karl Tomlinson
644913284f bug 1206362 be careful about double -> int conversion r=padenot
--HG--
extra : rebase_source : 66fd40ddd3794ac225c581bbae56445d92362e12
2015-09-21 15:44:10 +12:00
Karl Tomlinson
026a99369a bug 1205540 account for active inputs and skip processing when streams are inactive r=padenot
--HG--
extra : rebase_source : 20eca7c13b9757fc9c79ee414a7b4c2c8da26be2
2015-09-18 00:03:00 +12:00
Karl Tomlinson
2a0fb73346 bug 1205540 mark BufferSource finished only when producing silent output block r=padenot
This allows simpler processing of the finished state to mark the node as an
inactive input of any downstream nodes.  Otherwise the input could not be
considered inactive until after downstream nodes have finished processing,
but ProcessInput() may not be called again on finished streams.

AudioBufferSourceNode now behaves the same as OscillatorNode and similarly
to nodes that release a playing ref.

--HG--
extra : rebase_source : 1268ca8f561fee2a43ba17f5fe3abc804486a50c
2015-09-18 00:00:17 +12:00
Karl Tomlinson
57f288f403 bug 1205540 provide querying whether engines need to continue processing even without input r=padenot
--HG--
extra : rebase_source : 08dfd9685c49b93a9ca113434f62d92de26f58e7
2015-09-09 08:54:03 +12:00
Carsten "Tomcat" Book
1ae732f5ba Backed out 5 changesets (bug 1205540) for Assertion Failurs in m2-e10s tests on a CLOSED TREE
Backed out changeset e89d8182d588 (bug 1205540)
Backed out changeset abace4cdec06 (bug 1205540)
Backed out changeset b3f6e1db7233 (bug 1205540)
Backed out changeset 0d122cb34921 (bug 1205540)
Backed out changeset 4de5f87180fb (bug 1205540)
2015-09-18 16:36:33 +02:00
Karl Tomlinson
abcc44d6d5 bug 1205540 account for active inputs and skip processing when streams are inactive r=padenot
--HG--
extra : rebase_source : ad55142a54728e7ed2dab8edefbe87547e09d85a
2015-09-18 00:03:00 +12:00
Karl Tomlinson
985811fe37 bug 1205540 mark BufferSource finished only when producing silent output block r=padenot
This allows simpler processing of the finished state to mark the node as an
inactive input of any downstream nodes.  Otherwise the input could not be
considered inactive until after downstream nodes have finished processing,
but ProcessInput() may not be called again on finished streams.

AudioBufferSourceNode now behaves the same as OscillatorNode and similarly
to nodes that release a playing ref.

--HG--
extra : rebase_source : 0b3c7123f916fce36f852785c1e0b2a7c7013600
2015-09-18 00:00:17 +12:00
Karl Tomlinson
ee25bfb081 bug 1205540 provide querying whether engines need to continue processing even without input r=padenot
--HG--
extra : rebase_source : 76545deae4cdc929f1b3ce4d10065f99f21a2ec3
2015-09-09 08:54:03 +12:00
Robert O'Callahan
a320393b12 Bug 1189506. Pass AudioContext to AudioNodeStream::Create. r=karlt
--HG--
extra : commitid : 2WtlMxxGnj1
extra : rebase_source : 31d3c936c139df1348249df1f34e5206d38647db
2015-09-09 01:22:16 +12:00
Karl Tomlinson
46752d8354 bug 1201855 send ended event even when the buffer has no channel data r=padenot
The ThreadSharedFloatArrayBufferList may be null even when there is a buffer
if one of its arrays has been neutered.

SAMPLE_RATE is used instead of BUFFEREND to detect whether start() and buffer
have been received because buffers can have zero length when acquiring the
contents returns "zero-length channel data buffers", although this zero-length
is not yet implemented.

LOOP and BUFFEREND are reset when the buffer is set to null to end playback.

--HG--
extra : rebase_source : f247ca61e045ff548180da5c8c6e521e944620be
2015-09-05 00:15:52 +12:00
Karl Tomlinson
f0c5e3a312 bug 1201855 use unsigned integers for buffer positions so that negative buffer positions are impossible r=padenot
I think the limits on sample rates already ensure that mBufferPosition will
not overflow, but this makes sure that there are no out of bounds reads.

The node checks the parameters are > 0 before sending to the engine.

--HG--
extra : rebase_source : 3547c7a6ed8bd1e30a34c8c402a1c339ecb89ac2
2015-08-25 13:01:15 +12:00
Karl Tomlinson
129da4defa bug 1201855 keep track of buffer position even when there are no channels r=padenot
--HG--
extra : rebase_source : 38eb547011207d8f21970402204cac5613adb07b
2015-09-05 00:50:35 +12:00
Karl Tomlinson
153f9a5413 bug 1201855 rearrange CopyFromBuffer to separate code using numFrames r=padenot
--HG--
extra : rebase_source : ad70b02ae650410c6f7b86230ddfac3cda5d0aa9
2015-09-04 23:06:50 +12:00
Karl Tomlinson
2fba565b9f bug 1201854 handle stop time precisely even when resampling r=padenot
--HG--
extra : rebase_source : f2a8c0b28ff614e85d184e3f7c1bb8b0622caea9
2015-09-04 22:05:49 +12:00
Karl Tomlinson
e74d20e2da bug 1197028 use AudioBlock for web audio processing to reuse buffers shared downstream r=padenot
--HG--
extra : rebase_source : d2e403ae64a314177cba4d596ea235eb351ad3bc
2015-09-03 19:01:50 +12:00
Karl Tomlinson
46ff786925 bug 1197043 use flags to distinguish between external streams and events r=padenot
MediaStreamAudioDestinationNode does not need any main thread events because
mDOMStream provides GetCurrentTime to consumers.

MediaRecoder also does not use main thread current time.

--HG--
extra : rebase_source : e022dc12e8a0e67c70d4a617449e28e76288b57e
2015-08-13 16:13:34 +12:00
Karl Tomlinson
330a9459ea bug 1197043 move AudioNodeStream creation to stream class r=padenot
--HG--
extra : rebase_source : 2e399f5d59b057a0cca6a423481ac86f6fa2c507
2015-08-12 11:26:24 +12:00
Karl Tomlinson
639872f1ff bug 1186779 use ChannelFloatsForWrite() instead of const_cast r=padenot
--HG--
extra : rebase_source : 324b2fbf4addbac848b7a74b048d67ba7c461b0c
2015-07-22 17:59:21 +12:00
Birunthan Mohanathas
a8939590de Bug 1182996 - Fix and add missing namespace comments. rs=ehsan
The bulk of this commit was generated by running:

  run-clang-tidy.py \
    -checks='-*,llvm-namespace-comment' \
    -header-filter=^/.../mozilla-central/.* \
    -fix
2015-07-13 08:25:42 -07:00
Karl Tomlinson
32603f9d43 bug 1179662 call DisconnectFromGraph once only during unlink r=padenot
--HG--
extra : rebase_source : 4e8fd171367f46cfc3e5e64f4d7e08ceff2e84d3
2015-07-02 18:11:31 +12:00
Karl Tomlinson
ee5781b91a bug 1179662 call UnregisterAudioBufferSourceNode only once r=padenot
Because these nodes are only registered on PannerNodes if they have a
stream, they need only be unregistered once after the stream is destroyed.

Previously unregistration happened on finish, unlink, and destructor.

--HG--
extra : rebase_source : 7dab08fe4b5648e2a04495d6f570727684247f51
2015-07-02 18:14:54 +12:00
Karl Tomlinson
7f8f4121f7 bug 1179662 specify AudioNode::mStream as AudioNodeStream r=padenot
--HG--
extra : rebase_source : 30cbe8f0b513063acf0e1c62078474f8f147a0ae
2015-07-02 17:36:07 +12:00
Karl Tomlinson
2c46294a5d bug 1179662 uninline DestroyMediaStream overrides so that mStream type need not be complete r=padenot
--HG--
extra : rebase_source : 2f9676a2e1c4ce13adfdf109e7e8c9827fb26502
2015-07-02 16:44:31 +12:00
Paul Adenot
724c74bc92 Bug 1175510 - Update the AudioBufferSourceNode <=> PannerNode mapping when destroying AudioNodeStream. r=karlt
--HG--
extra : rebase_source : d02b6c241ca5371b8c53bfea54bf80954ab1725c
2015-07-02 05:43:52 +02:00
Karl Tomlinson
70a1be5d33 Bug 974089 - Destroy WebAudio MediaStream when a source finishes. r=padenot
--HG--
extra : rebase_source : 1a6c80ebaf11cf52194774088399040fea4605cd
2015-06-10 13:31:29 +02:00
Ryan VanderMeulen
20eb4e1566 Backed out 3 changesets (bug 974089) for causing OSX/Windows test_bug867104.html permafail.
Backed out changeset 1dcfd15bb387 (bug 974089)
Backed out changeset 8c6a7d5efe3a (bug 974089)
Backed out changeset e511c79f2211 (bug 974089)

CLOSED TREE
2015-06-11 15:10:06 -04:00
Paul Adenot
015314f5a6 Bug 974089 - Destroy the streams from the main thread. 2015-06-11 18:46:44 +02:00
Karl Tomlinson
6ad70ef68e Bug 974089 - Destroy WebAudio MediaStream when a source finishes. r=padenot 2015-06-10 13:31:29 +02:00
Baptiste Emmanuel
92defa0014 Bug 1140450 - Lower speex_resampler quality for Web Audio API. r=padenot 2015-05-21 10:12:23 +02:00
Andrea Marchesini
aed237ffe3 Bug 1161946 - MainThreadMediaStreamListener should be notified just when the stream is finished - patch 1, r=padenot 2015-05-11 15:07:24 +01:00
Andrea Marchesini
c1020e6762 Bug 1159290 - "Add final/override to WebAudio classes". r=padenot
--HG--
extra : rebase_source : 85f0d2997fdfefed17456d086c98c6f28d68fa26
2015-04-28 08:42:00 +02:00
Paul Adenot
bc7866deae Bug 1134034 - Add a chrome-only parentId and name on AudioParam for devtools. r=ehsan 2015-04-14 17:03:52 +02:00
Paul Adenot
e86047f94a Bug 1153783 - Implement the detune AudioParam for the AudioBufferSourceNode. r=ehsan 2015-04-14 17:03:50 +02:00
Ehsan Akhgari
883849ee32 Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj
This patch was automatically generated using the following script:

function convert() {
echo "Converting $1 to $2..."
find . \
       ! -wholename "*/.git*" \
       ! -wholename "obj-ff-dbg*" \
         -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 MOZ_OVERRIDE override
convert MOZ_FINAL final
2015-03-21 12:28:04 -04:00
Boris Zbarsky
dc24477d79 Bug 1117172 part 3. Change the wrappercached WrapObject methods to allow passing in aGivenProto. r=peterv
The only manual changes here are to BindingUtils.h, BindingUtils.cpp,
Codegen.py, Element.cpp, IDBFileRequest.cpp, IDBObjectStore.cpp,
dom/workers/Navigator.cpp, WorkerPrivate.cpp, DeviceStorageRequestChild.cpp,
Notification.cpp, nsGlobalWindow.cpp, MessagePort.cpp, nsJSEnvironment.cpp,
Sandbox.cpp, XPCConvert.cpp, ExportHelpers.cpp, and DataStoreService.cpp.  The
rest of this diff was generated by running the following commands:

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g'

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g'

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObject\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(Binding(?:_workers)?::Wrap\((?:aCx|cx|aContext|aCtx|js), [^,)]+)\)/\1, aGivenProto)/g'
2015-03-19 10:13:33 -04:00
Chris Peterson
9e23388ca8 Bug 1118076 - Remove MOZ_THIS_IN_INITIALIZER_LIST. r=Waldo 2015-01-06 21:39:46 -08:00