Closed
Bug 1271491
Opened 9 years ago
Closed 9 years ago
PDMFactory shouldn't require initialisation in the main thread
Categories
(Core :: Audio/Video: Playback, defect)
Core
Audio/Video: Playback
Tracking
()
RESOLVED
FIXED
mozilla49
Tracking | Status | |
---|---|---|
firefox49 | --- | fixed |
People
(Reporter: jya, Assigned: jya)
References
(Depends on 1 open bug)
Details
Attachments
(7 files, 2 obsolete files)
58 bytes,
text/x-review-board-request
|
cpearce
:
review+
|
Details |
58 bytes,
text/x-review-board-request
|
mattwoodrow
:
review+
|
Details |
58 bytes,
text/x-review-board-request
|
cpearce
:
review+
|
Details |
58 bytes,
text/x-review-board-request
|
cpearce
:
review+
|
Details |
58 bytes,
text/x-review-board-request
|
cpearce
:
review+
|
Details |
58 bytes,
text/x-review-board-request
|
cpearce
:
review+
|
Details |
58 bytes,
text/x-review-board-request
|
ayang
:
review+
|
Details |
Right now, everything using the PDMFactory must ensure that the PDMFactory::Init() function has been called at least once and on the main thread.
One of the core reason it was required was the reliance on the reading of Preferences ; which can only be done on the main thread.
With the move to using MediaPrefs, this is no longer a restriction.
Apparently, there is no problem to load the external frameworks on secondary thread.
so the PDMFactory should move to a new access type, using a singleton that would be initialized upon the first use with no need to rely that PDMFactory::Init has been called.
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → jyavenard
Assignee | ||
Comment 1•9 years ago
|
||
Instead rely on MediaPrefs.
Review commit: https://reviewboard.mozilla.org/r/52171/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/52171/
Attachment #8751699 -
Flags: review?(cpearce)
Attachment #8751700 -
Flags: review?(cpearce)
Attachment #8751701 -
Flags: review?(matt.woodrow)
Attachment #8751702 -
Flags: review?(cpearce)
Attachment #8751703 -
Flags: review?(cpearce)
Attachment #8751704 -
Flags: review?(cpearce)
Attachment #8751705 -
Flags: review?(cpearce)
Attachment #8751706 -
Flags: review?(cpearce)
Attachment #8751707 -
Flags: review?(ayang)
Assignee | ||
Comment 2•9 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/52173/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/52173/
Assignee | ||
Comment 3•9 years ago
|
||
This is a very rough and lame attempt at making some parts of gfx thread-safe, however some parts rely on Preferences::AddBoolCache which isn't thread-safe.
Must still be called once gfx has been initialized.
Review commit: https://reviewboard.mozilla.org/r/52175/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/52175/
Assignee | ||
Comment 4•9 years ago
|
||
This code was unused as Link() / Unlink() are only ever called once in the life time of the gecko.
Review commit: https://reviewboard.mozilla.org/r/52177/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/52177/
Assignee | ||
Comment 5•9 years ago
|
||
FFMpegRuntimeLinker/FFVPXRuntimeLinker::Init() aren't thread safe, but they can be called on any threads.
Review commit: https://reviewboard.mozilla.org/r/52179/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/52179/
Assignee | ||
Comment 6•9 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/52181/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/52181/
Assignee | ||
Comment 7•9 years ago
|
||
Currently, the test launch a synchronous dispatch to the main thread. It may be acceptable to simply use an asynchronous check instead, using the cached result instead.
Review commit: https://reviewboard.mozilla.org/r/52183/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/52183/
Assignee | ||
Comment 8•9 years ago
|
||
PDMFactory will automatically load and initialize the required frameworks upon first use.
Also fix constness of some methods.
Review commit: https://reviewboard.mozilla.org/r/52185/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/52185/
Assignee | ||
Comment 9•9 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/52187/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/52187/
Comment 10•9 years ago
|
||
Comment on attachment 8751701 [details]
MozReview Request: Bug 1271491: P2. Allow initialization of WMFPlatformDecoderModule from any threads. r?mattwoodrow
https://reviewboard.mozilla.org/r/52175/#review49079
Attachment #8751701 -
Flags: review?(matt.woodrow) → review+
Comment 11•9 years ago
|
||
Comment on attachment 8751699 [details]
MozReview Request: Bug 1271491: [WMF] P1. Don't use main thread only preferences methods. r?cpearce
https://reviewboard.mozilla.org/r/52171/#review49211
Attachment #8751699 -
Flags: review?(cpearce) → review+
Comment 12•9 years ago
|
||
Comment on attachment 8751700 [details]
MozReview Request: Bug 1271491: [WMF] P2. Allow creation of DXVA manager on any thread. r?cpearce
https://reviewboard.mozilla.org/r/52173/#review49213
Attachment #8751700 -
Flags: review?(cpearce) → review+
Comment 13•9 years ago
|
||
Is this blocking on the crash guard being made threadsafe?
That working is important to protect our users, I don't think it's ok to just break it.
Comment 14•9 years ago
|
||
Comment on attachment 8751702 [details]
MozReview Request: Bug 1271491: P3. Remove refcounting the number of time apple's linkers are called. r?cpearce
https://reviewboard.mozilla.org/r/52177/#review49229
I assume we're just letting the OS handle unlinking at shutdown.
Attachment #8751702 -
Flags: review?(cpearce) → review+
Comment 15•9 years ago
|
||
Comment on attachment 8751703 [details]
MozReview Request: Bug 1271491: [ffmpeg] P4. Remove requirements to call Init on the main thread. r?cpearce
https://reviewboard.mozilla.org/r/52179/#review49231
Attachment #8751703 -
Flags: review?(cpearce) → review+
Assignee | ||
Comment 16•9 years ago
|
||
(In reply to Matt Woodrow (:mattwoodrow) from comment #13)
> Is this blocking on the crash guard being made threadsafe?
>
> That working is important to protect our users, I don't think it's ok to
> just break it.
No, that's what P7 does; it fixes what you describe. It checks that the CrashGuard is set. I've made it use a sync dispatch for now (because other places in the DXVA always allocate the dxva on the main thread already).
I've made it easy to change that to a normal dispatch, in which case the value of the crash guard may be slightly out of data: but I don't think it matters.
Assignee | ||
Comment 17•9 years ago
|
||
(In reply to Chris Pearce (:cpearce) from comment #14)
> Comment on attachment 8751702 [details]
> MozReview Request: Bug 1271491: P4. Remove refcounting the number of time
> apple's linkers are called. r?cpearce
>
> https://reviewboard.mozilla.org/r/52177/#review49229
>
> I assume we're just letting the OS handle unlinking at shutdown.
We are... In fact, there are many places in our code linking libraries that never unlink them... When main() exits, it's all unloaded.
Comment 18•9 years ago
|
||
Comment on attachment 8751704 [details]
MozReview Request: Bug 1271491: [GMP] P5. Allow GMPDecoderModule::Init() to be called off the main thread. r?cpearce
https://reviewboard.mozilla.org/r/52181/#review49265
::: dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp:188
(Diff revision 1)
> {
> - MOZ_ASSERT(NS_IsMainThread());
> -
> + if (!NS_IsMainThread()) {
> + nsCOMPtr<nsIThread> mainThread = do_GetMainThread();
> + nsCOMPtr<nsIRunnable> runnable =
> + NS_NewRunnableFunction([]() { Init(); });
> + SyncRunnable::DispatchToThread(mainThread, runnable);
Sync dispatch. boo sux! But I understand why you need it. We'll need a better way to get the GMP codecs list updated.
Attachment #8751704 -
Flags: review?(cpearce) → review+
Comment 19•9 years ago
|
||
Comment on attachment 8751705 [details]
MozReview Request: Bug 1271491: [WMF] P7. Check that D3D didn't crash earlier. r?cpearce
https://reviewboard.mozilla.org/r/52183/#review49277
Attachment #8751705 -
Flags: review?(cpearce) → review+
Comment 20•9 years ago
|
||
Comment on attachment 8751706 [details]
MozReview Request: Bug 1271491: P6. Remove the need to call PDMFactory::Init(). r?cpearce
https://reviewboard.mozilla.org/r/52185/#review49279
::: dom/media/Benchmark.cpp:137
(Diff revision 1)
> void
> Benchmark::Init()
> {
> MOZ_ASSERT(NS_IsMainThread());
>
> - PDMFactory::Init();
> + MediaPrefs::GetSingleton();
It seems that the only place that calls Benchmark::Init() is in gtest/TestMediaDataDecoder.cpp#26, so you may as well delete Benchmark::Init() and just call MediaPrefs::GetSingleton() at gtest/TestMediaDataDecoder.cpp#26.
Attachment #8751706 -
Flags: review?(cpearce) → review+
Assignee | ||
Comment 21•9 years ago
|
||
Comment on attachment 8751699 [details]
MozReview Request: Bug 1271491: [WMF] P1. Don't use main thread only preferences methods. r?cpearce
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/52171/diff/1-2/
Attachment #8751701 -
Attachment description: MozReview Request: Bug 1271491: P3. Allow initialization of WMFPlatformDecoderModule from any threads. r?mattwoodrow → MozReview Request: Bug 1271491: P2. Allow initialization of WMFPlatformDecoderModule from any threads. r?mattwoodrow
Attachment #8751702 -
Attachment description: MozReview Request: Bug 1271491: P4. Remove refcounting the number of time apple's linkers are called. r?cpearce → MozReview Request: Bug 1271491: P3. Remove refcounting the number of time apple's linkers are called. r?cpearce
Attachment #8751703 -
Attachment description: MozReview Request: Bug 1271491: [ffmpeg] P5. Remove requirements to call Init on the main thread. r?cpearce → MozReview Request: Bug 1271491: [ffmpeg] P4. Remove requirements to call Init on the main thread. r?cpearce
Attachment #8751704 -
Attachment description: MozReview Request: Bug 1271491: [GMP] P6. Allow GMPDecoderModule::Init() to be called off the main thread. r?cpearce → MozReview Request: Bug 1271491: [GMP] P5. Allow GMPDecoderModule::Init() to be called off the main thread. r?cpearce
Attachment #8751706 -
Attachment description: MozReview Request: Bug 1271491: P8. Remove the need to call PDMFactory::Init(). r?cpearce → MozReview Request: Bug 1271491: P6. Remove the need to call PDMFactory::Init(). r?cpearce
Attachment #8751707 -
Attachment description: MozReview Request: Bug 1271491: P9. Remove unused members. r?alfredo → MozReview Request: Bug 1271491: P7. Remove unused members. r?alfredo
Assignee | ||
Comment 22•9 years ago
|
||
Comment on attachment 8751701 [details]
MozReview Request: Bug 1271491: P2. Allow initialization of WMFPlatformDecoderModule from any threads. r?mattwoodrow
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/52175/diff/1-2/
Assignee | ||
Comment 23•9 years ago
|
||
Comment on attachment 8751702 [details]
MozReview Request: Bug 1271491: P3. Remove refcounting the number of time apple's linkers are called. r?cpearce
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/52177/diff/1-2/
Assignee | ||
Comment 24•9 years ago
|
||
Comment on attachment 8751703 [details]
MozReview Request: Bug 1271491: [ffmpeg] P4. Remove requirements to call Init on the main thread. r?cpearce
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/52179/diff/1-2/
Assignee | ||
Comment 25•9 years ago
|
||
Comment on attachment 8751704 [details]
MozReview Request: Bug 1271491: [GMP] P5. Allow GMPDecoderModule::Init() to be called off the main thread. r?cpearce
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/52181/diff/1-2/
Assignee | ||
Comment 26•9 years ago
|
||
Comment on attachment 8751706 [details]
MozReview Request: Bug 1271491: P6. Remove the need to call PDMFactory::Init(). r?cpearce
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/52185/diff/1-2/
Assignee | ||
Comment 27•9 years ago
|
||
Comment on attachment 8751707 [details]
MozReview Request: Bug 1271491: P7. Remove unused members. r?alfredo
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/52187/diff/1-2/
Assignee | ||
Updated•9 years ago
|
Attachment #8751700 -
Attachment is obsolete: true
Assignee | ||
Updated•9 years ago
|
Attachment #8751705 -
Attachment is obsolete: true
Assignee | ||
Comment 28•9 years ago
|
||
https://reviewboard.mozilla.org/r/52185/#review49279
> It seems that the only place that calls Benchmark::Init() is in gtest/TestMediaDataDecoder.cpp#26, so you may as well delete Benchmark::Init() and just call MediaPrefs::GetSingleton() at gtest/TestMediaDataDecoder.cpp#26.
having an Init function makes it simple to not have to modify the gtest or any users of that code (like the fuzz team which are using the benchmark as a way to test the decoders)
Comment 29•9 years ago
|
||
Comment on attachment 8751707 [details]
MozReview Request: Bug 1271491: P7. Remove unused members. r?alfredo
https://reviewboard.mozilla.org/r/52187/#review49355
Attachment #8751707 -
Flags: review?(ayang) → review+
Comment 30•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/57272b83ae53
https://hg.mozilla.org/integration/mozilla-inbound/rev/eda1e9a01c4e
https://hg.mozilla.org/integration/mozilla-inbound/rev/d645ebd74e86
https://hg.mozilla.org/integration/mozilla-inbound/rev/076253655f65
https://hg.mozilla.org/integration/mozilla-inbound/rev/30e33b58645e
https://hg.mozilla.org/integration/mozilla-inbound/rev/91217b1ad736
https://hg.mozilla.org/integration/mozilla-inbound/rev/65a790075868
Comment 31•9 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/57272b83ae53
https://hg.mozilla.org/mozilla-central/rev/eda1e9a01c4e
https://hg.mozilla.org/mozilla-central/rev/d645ebd74e86
https://hg.mozilla.org/mozilla-central/rev/076253655f65
https://hg.mozilla.org/mozilla-central/rev/30e33b58645e
https://hg.mozilla.org/mozilla-central/rev/91217b1ad736
https://hg.mozilla.org/mozilla-central/rev/65a790075868
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox49:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla49
You need to log in
before you can comment on or make changes to this bug.
Description
•