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

51 Коммитов

Автор SHA1 Сообщение Дата
alwu c88ed9264e Bug 1717119 - part2 - only store more video frames than usual for 4k+ video. r=bryce
For lower resolution videos, we should be able to decode them well without storing too many video frames. So let's keep this mechanism for 4k+ video only.

Differential Revision: https://phabricator.services.mozilla.com/D118402
2021-06-23 20:31:13 +00:00
alwu 07724ed21f Bug 1712595 - ensure AudioSink won't discard frames that are not played yet. r=padenot
When we switch to the DecodedStream from AudioSink. AudioSink would store some frames in its own media queue before those audio frames get played. After AudioSink got shutdown, it doesn't push those frames back to the original audio queue.

Therefore, when DecodedStream starts, it try to retrieve audio data from the audio queue, but it doesn't know that there is already a gap between "the audio DecodedStream is going to play" and "the audio that AudioSink had played".

Differential Revision: https://phabricator.services.mozilla.com/D115749
2021-05-28 19:11:18 +00:00
alwu 72477d0384 Bug 1701992 - fix `MediaQueue::GetElementsAfter()`. r=bryce
Current `GetElementsAfter()` is wrong, the result array would still contain the element which end time is earlier or equal to the given time.

Differential Revision: https://phabricator.services.mozilla.com/D107170
2021-04-01 00:37:06 +00:00
Chris Fronk 3b7a1daba2 Bug 1647536 - Support ref counted pointers in nsDeque r=froydnj
Adds a new specialization of nsDeque, nsRefPtrDeque for use with
reference counted pointers.

Differential Revision: https://phabricator.services.mozilla.com/D84766
2020-08-22 15:47:59 +00:00
Mihai Alexandru Michis fb644eda26 Backed out changeset 5838f8b581ed (bug 1647536) for causing failures in browser_active_mediasession_among_tabs.js
CLOSED TREE
2020-08-14 19:42:51 +03:00
Chris Fronk 8770c8a332 Bug 1647536 - Support ref counted pointers in nsDeque r=froydnj
Adds a new specialization of nsDeque, nsRefPtrDeque for use with
reference counted pointers.

Differential Revision: https://phabricator.services.mozilla.com/D84766
2020-08-14 15:19:48 +00:00
Chris Fronk 6f84249b41 Bug 1337953 - Make nsDeque templated on pointer type r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D79629
2020-06-25 02:39:23 +00:00
Butkovits Atila 7916df7f02 Backed out changeset 5614bcd268d1 (bug 1337953) for bustage at FuzzyLayer.cpp. CLOSED TREE 2020-06-23 11:01:37 +03:00
Chris Fronk cea9cef934 Bug 1337953 - Make nsDeque templated on pointer type r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D79629
2020-06-23 00:58:13 +00:00
alwu c6ddd24262 Bug 1545108 - use diagnostic assertion to ensure the sample is valid to be accessed. r=bryce
This patch will do :
- add `MOZ_DIAGNOSTIC_ASSERT` to ensure the sample is valid to be accessed

The advantage  :
- to ensure the sample is still valid when we push it to the queue or pop it out the queue

Differential Revision: https://phabricator.services.mozilla.com/D75871
2020-05-19 15:42:06 +00:00
André Bargull 73a498ec0c Bug 1625138 - Part 38: Replace mozilla::IsSame with std::is_same in dom/. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D68557

--HG--
extra : moz-landing-system : lando
2020-03-28 13:57:21 +00:00
Michael Froman 87e611dd7a Bug 1595657 - Add MediaQueue::Push that takes an already_AddRefed. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D52622

--HG--
extra : moz-landing-system : lando
2019-11-12 10:58:39 +00:00
Bryce Van Dyk 2862090894 Bug 1545108 - Use a diagnostic assert to check for nullptr when pushing into MediaQueue. r=alwu
We're rarely getting nullptrs out of MediaQueues. It's not clear where these are
coming from, as we have many guards against them. Upgrade this assert to a
diagnostic to help us track the source and determine if the value is null before
entering the queue.

Differential Revision: https://phabricator.services.mozilla.com/D28866

--HG--
extra : moz-landing-system : lando
2019-04-25 17:08:27 +00:00
Jean-Yves Avenard 3cf8c6d0df Bug 1524890 - P7. No longer access AudioData::mFrames directly. r=bryce
This will allow to remove mFrames member and calculate from the size of the content, which will dynamically change depending on a cropping filter.

Differential Revision: https://phabricator.services.mozilla.com/D20165

--HG--
extra : moz-landing-system : lando
2019-02-22 09:18:47 +00:00
Ehsan Akhgari e5e885ae31 Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre
# ignore-this-changeset

--HG--
extra : amend_source : 7221c8d15a765df71171099468e7c7faa648f37c
extra : histedit_source : a0cce6015636202bff09e35a13f72e03257a7695
2019-01-18 10:16:18 +01:00
alwu cf4634f07a Bug 1505972 - request audio data when entering 'loopingDecoding' state if decoding has ended r=jya
When entering 'loopingDecoding' state, we should ensure we would continue to decoding even if
the audio decoding has finished before.

Differential Revision: https://phabricator.services.mozilla.com/D12589

--HG--
extra : moz-landing-system : lando
2018-11-22 13:27:21 +00:00
Sylvestre Ledru 804b8b8883 Bug 1204606 - Reformat of dom/media r=jya
# skip-blame

Differential Revision: https://phabricator.services.mozilla.com/D12251

--HG--
extra : moz-landing-system : lando
2018-11-19 13:25:37 +00:00
alwu fa0d371ff0 Bug 1498440 - part5 : rename PopEvent() to PopFrontEvent(). r=jya
We only have a interest in the data which is popped out from the front side of the queue.

Differential Revision: https://phabricator.services.mozilla.com/D9190

--HG--
extra : moz-landing-system : lando
2018-11-05 22:05:58 +00:00
alwu 055cfe1842 Bug 1498440 - part4 : discard redudant looping data when cancel looping. r=jya
When we cancel seamless looping, we should discard audio data whose time are later than the last
audio frame's time in the audio track.

Differential Revision: https://phabricator.services.mozilla.com/D9189

--HG--
extra : moz-landing-system : lando
2018-11-05 22:04:45 +00:00
Chris Peterson 37efe4d0e6 Bug 1428535 - Add missing override specifiers to overridden virtual functions. r=froydnj
MozReview-Commit-ID: DCPTnyBooIe

--HG--
extra : rebase_source : cfec2d96faeb11656d86d760a34e0a04cacddb13
extra : intermediate-source : 6176724d63788b0fe8caa3f91607c2d93dbaa7ec
extra : source : eebbb0600447f9b64aae3bcd47b4be66c02a51ea
2017-11-05 19:37:28 -08:00
Gerald Squelart 7dbe315e25 Bug 1398999 - nsDequeFunctor::operator() doesn't need to return anything - r=froydnj
Its return value is never used, and most implementations return nullptr anyway.

MozReview-Commit-ID: 8rxC053mmE8

--HG--
extra : rebase_source : 61a0b8b1373396182efd27d3c01b96e5e5541364
2017-02-09 14:06:36 +11:00
Nathan Froyd 12b117c200 Bug 1347963 - part 6 - make MediaQueue use RecursiveMutex; r=gerald
Making MediaQueue slightly faster with RecursiveMutex is a good thing.
2017-07-04 13:47:15 -04:00
JW Wang 302d82c85a Bug 1356530 - Change the type of MediaData::mTime to TimeUnit since int64_t is ambiguous. r=kaku
MozReview-Commit-ID: 4bVeqIuWO2O

--HG--
extra : rebase_source : d504ac15a6dc59ad42f3ab80faf23f629d74315f
extra : intermediate-source : 6e52995b6c8146451d98dffc62f6907755dc856e
extra : source : 82d2649cdafb5a6389f6858c23578811933580c9
2017-04-14 17:13:36 +08:00
JW Wang 3c0e7bddc7 Bug 1356502. P1 - let MediaDatra::GetEndTime() return a TimeUnit instead of ambiguous int64_t. r=gerald
MozReview-Commit-ID: DBQELBs32Ad

--HG--
extra : rebase_source : a7c9f7affbdfa12aaf94a6d0505cf4f54f4408cc
extra : intermediate-source : e1fcccdb12bb86c23520b5c2e0d76aef355597a5
extra : source : ddb8a8382c74e18dd52cdfbc7e8eee54cf46f05d
2017-04-14 14:14:08 +08:00
JW Wang a7f369e934 Bug 1350811 - Replace use of int64_t for microseconds by TimeUnit in DecodedStream. r=kaku
MozReview-Commit-ID: JjBfTmqkru8

--HG--
extra : rebase_source : f03d35b4697304255f24e66dbdf93a1c8815fd59
2017-03-27 11:09:49 +08:00
JW Wang 4eb1252534 Bug 1326330. Part 2 - add assertions and checks. r=JamesCheng
1. ensure the 'finish' event is notified only once.
2. assert pushing items to a finished queue.

MozReview-Commit-ID: 9lYWPANVz0m

--HG--
extra : rebase_source : c05b0c77fdee324798579e0e2ebec6ce6303cbf6
extra : intermediate-source : 80be35003c76fc9cc74f206576394b46317b7880
extra : source : 14f5d5c064fddbbcf5728fb4d19e9c0a4e45fac7
2016-12-23 19:19:04 +08:00
JW Wang 3985fd7208 Bug 1326330. Part 1 - remove unused functions. r=JamesCheng
MozReview-Commit-ID: 66XDaghbKUy

--HG--
extra : rebase_source : a25d3413d6f076366373b92fd51ff850bb1dd79e
extra : intermediate-source : a9f7a68b4bff23ec0a059f5cc2a7fca92c1501bd
extra : source : d2dbc97390bc85fba1bd0a53d780f6122cc96ac7
2016-12-23 19:17:11 +08:00
Chris Pearce 3940f4a605 Bug 1258870 - Don't push late video frames to the compositor, drop them. r=jwwang
We can get out of A/V sync if the decode is struggling to keep up. This is
because of the loop in VideoSink::UpdateRenderedVideoFrames(). If this function
runs while there's only one frame in the video queue, we won't drop that one
frame if it's late. If we're struggling to keep up, it's increasingly likely
that we'll end up running this function with only one frame in the video queue.
That results in us entering VideoSink::RenderVideoFrames() with only 1 late
frame, which the compositor dutifully draws. Resulting in a late frame being
drawn, and thus broken A/V sync.

This change makes VideoSink::UpdateRenderedVideoFrames() drop all late
frames, even the last one in the video queue. We now keep A/V sync when the
decode is struggling to keep up. However, if I do this, we end up dropping
(and reporting that we drop) a lot more frames, and thus rendering a lot fewer.
But since we when we drop the frames we report them as dropped, a well written
MSE player can detect that we've failing miserably to keep up, and and lower
their bitrate.




MozReview-Commit-ID: ybkq48mKk2

--HG--
extra : rebase_source : f03c186059a365a45de698b2a30e632daae47fb8
2016-08-15 13:35:52 +12:00
Jean-Yves Avenard b9ddae6e51 Bug 1264199: P0. Fix nsDequeue/MediaQueue methods constness. r=jwwang
MozReview-Commit-ID: BiOedq3IHt

--HG--
extra : rebase_source : 87175a92efdcfea864256482ced7eeee61301690
2016-04-25 12:13:55 +10:00
JW Wang 0c694cb31b Bug 1246051 - have MediaQueue<T>::Peek/PeekFront return a RefPtr<> to avoid dangling pointers per comment 0. r=gerald.
MozReview-Commit-ID: JhPVlqMWsTu
2016-04-25 14:36:07 +08:00
JW Wang d9e2bd240b Bug 1265974 - Don't fire push events in MediaQueue::PushFront(). r=jya.
MozReview-Commit-ID: FEqDlD854vM
2016-04-21 10:18:20 +08:00
JW Wang d203a1d897 Bug 1265969 - Don't fire pop events in MediaQueue::Reset(). r=jya.
MozReview-Commit-ID: 6J0VsVvIeg
2016-04-19 23:04:02 +08:00
JW Wang 22151cf459 Bug 1218311 - Port the fix of bug 1193614 to VideoSink. r=cpearce. 2015-11-25 15:15:05 +08:00
sajitk 8eb3a68c9e Bug 1201997 - Part 4 - Change size and offset variables to size_t.r=froydn 2015-11-15 14:48:08 +01: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
JW Wang c13d97710a Bug 1188257 - Use MediaEventSource for MediaQueue to do the job. r=cpearce. 2015-08-06 10:14:15 +08:00
JW Wang 71a3144556 Bug 1184874. Part 2 - add the ability to know which item is popped from the MediaQueue. r=cpearce. 2015-07-23 14:12:28 +08:00
JW Wang 292f369434 Bug 1184874. Part 1 - fix indentation. r=cpearce. 2015-07-23 14:12:00 +08:00
Bobby Holley 04eaf4c167 Bug 1184634 - Move various includes into the mozilla namespace. r=gerald
I did my a quick best-effort pass to fix up the most egregious ordering
problems. I left some big pre-existing messes alone.
2015-07-16 22:23:18 -07:00
Bobby Holley 997543e6ba Bug 1184634 - Rename MediaTaskQueue to TaskQueue. r=gerald 2015-07-16 22:23:06 -07:00
Robert O'Callahan a552e48824 Bug 1143575. Add MediaQueue::GetFirstElements. r=cpearce
--HG--
extra : commitid : 88ugHjLdj3M
extra : rebase_source : 571e0c835c47892ed0da5f61ba121d4e7fa45d9a
2015-03-30 21:30:03 +13:00
Robert O'Callahan 27ae3dd82a Bug 1143575. Remove unused MediaQueue::Empty. r=cpearce
--HG--
extra : commitid : BJKjy3e2BkR
extra : rebase_source : ae976f42593570b864708a6d3964799f39ad2ed7
2015-03-30 20:06:58 +13:00
Bobby Holley 1590c33115 Bug 1154805 - Remove MaybeTailDispatch. r=jww
This is now the default behavior.
2015-04-16 09:28:56 -07:00
Bobby Holley 72ad334118 Bug 1151656 - Use TailDispatch for the MDSM's task queue. r=mattwoodrow 2015-04-08 21:33:21 -07:00
Bobby Holley 53ad5b2a9c Bug 1135424 - Switch the MDSM to a task queue. r=mattwoodrow 2015-03-16 14:38:44 -07:00
Phil Ringnalda 345a4eca93 Back out 3 changesets (bug 1135424) on suspicion of causing frequent hangs in test_playback.html on mochitest-e10s
CLOSED TREE

Backed out changeset 584d91ffdf88 (bug 1135424)
Backed out changeset d86806ea63f4 (bug 1135424)
Backed out changeset e52401d30a67 (bug 1135424)
2015-03-12 23:05:11 -07:00
Bobby Holley 0563f41ef7 Bug 1135424 - Switch the MDSM to a task queue. r=mattwoodrow 2015-03-12 17:54:35 -07:00
Bobby Holley 8ecafb0e29 Bug 1135785 - Hoist some work onto the state machine thread and tighten down our assertions. r=cpearce 2015-03-01 19:33:53 -08:00
Jonathan Hao 754ee54a0c Bug 1114434 - Fix logic in MediaQueue::Duration(). r=jwwang 2014-12-24 18:10:24 +08:00
Bobby Holley 4d9c1393da Bug 1100776 - Reference-count MediaData. r=cpearce 2014-11-19 13:01:10 -08:00