Closed
Bug 785536
Opened 13 years ago
Closed 13 years ago
Add MPAPI GetPref so platform decoders can query about:config prefs
Categories
(Core :: Audio/Video, defect, P3)
Tracking
()
RESOLVED
FIXED
mozilla18
People
(Reporter: cpeterson, Assigned: cpeterson)
References
Details
Attachments
(1 file, 1 obsolete file)
6.67 KB,
patch
|
cajbir
:
review+
lsblakk
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
This patch adds a GetPref() function to PluginHost that allows platform decoders to query about:config prefs.
In particular, I would like to be able to override the OMXCodec::CreationFlags we pass to Stagefright's OMXCodec::Create() to toggle hardware or software decoding. This would be useful for A/B testing hardware and software decoders for performance and bugs. doublec suggested the pref name "media.stagefright.omxcodec.flags".
Can you suggest there a better way for a platform decoder plugin to query a pref than extending MPAPI's PluginHost?
OmxPlugin.cpp is not able to call Preferences::GetUint() directly because Preferences.h has an #error message that it is a MOZILLA_INTERNAL_API only available within libxul.
Attachment #655204 -
Flags: review?(gal)
Assignee | ||
Comment 1•13 years ago
|
||
We could also use this pref to temporarily disable hardware decoding when this code is uplifted from Nightly 17 to Aurora 17 next week.
Assignee | ||
Comment 2•13 years ago
|
||
Comment on attachment 655204 [details] [diff] [review]
add-PluginHost-GetPref.patch
doublec, this patch adds a GetPref() function to PluginHost that allows platform decoders to query about:config prefs. There are more notes above in this bug report.
This change is a little ugly. Can you suggest a cleaner way to expose user-configurable prefs to a media plugin?
You and I had previously discussed passing a plugin-specific configuration struct to CreateDecoder(), but that API change would require changing all media plugins' CreateDecoder() APIs. Plus, the core code has to know which configuration prefs each plugin wants. Adding a GetPref() function to PluginHost only affects media plugins that care to call it.
Attachment #655204 -
Flags: review?(gal) → review?(chris.double)
Comment 3•13 years ago
|
||
Comment on attachment 655204 [details] [diff] [review]
add-PluginHost-GetPref.patch
Unfortunately the Mozilla preferences API can only be used on the main thread and in this patch the call happens in the decoder thread (from nsBuiltinDecoderStateMachine::DecodeMetadata).
I do not know of an easy non-code-intrusive way of calling this on the main thread and passing it through to the plugin unfortunately.
Attachment #655204 -
Flags: review?(chris.double) → review-
Comment 4•13 years ago
|
||
Send a runnable and wait for the result. Should be trivial.
Assignee | ||
Comment 5•13 years ago
|
||
Changes in patch v2:
* Renames GetPref() to GetIntPref(), so getters for other pref types may be added
later.
* GetIntPref() dispatches a synchronous runnable from the decoder thread to the
main thread. This synchronous call only affects the video initialization code
path for media plugins that call GetIntPref(), which is currently just Android.
* Log a warning message if the Stagefright pref is overriding the default decoder
behavior by forcing hardware or software decoder.
Attachment #655204 -
Attachment is obsolete: true
Attachment #656615 -
Flags: review?(chris.double)
Assignee | ||
Comment 6•13 years ago
|
||
(In reply to Chris Peterson (:cpeterson) from comment #5)
> Created attachment 656615 [details] [diff] [review]
> add-PluginHost-GetIntPref-v2.patch
doublec, have you had a chance to review my updated patch for adding a GetIntPref() API to MPAPI?
Updated•13 years ago
|
Attachment #656615 -
Flags: review?(chris.double) → review+
Assignee | ||
Comment 7•13 years ago
|
||
status-firefox16:
--- → wontfix
status-firefox17:
--- → affected
status-firefox18:
--- → fixed
Target Milestone: --- → mozilla18
Comment 8•13 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 9•13 years ago
|
||
Comment on attachment 656615 [details] [diff] [review]
add-PluginHost-GetIntPref-v2.patch
[Approval Request Comment]
Bug caused by (feature/regressing bug #): N/A
User impact if declined: This patch adds an about:config pref to force Android H264 video to use a software decoder or the hardware decoder. This will make debugging and performance testing much easier.
Testing completed (on m-c, etc.): m-c and local testing.
Risk to taking this patch (and alternatives if risky): Low risk because this code path only affects Android H264 video playback.
String or UUID changes made by this patch: N/A
Attachment #656615 -
Flags: approval-mozilla-aurora?
Updated•13 years ago
|
Attachment #656615 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Assignee | ||
Comment 10•13 years ago
|
||
You need to log in
before you can comment on or make changes to this bug.
Description
•