Summary: | [GStreamer] HRTFDatabaseLoader conflicts with AudioFileReader | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Philippe Normand <pnormand> | ||||||||||||
Component: | WebKitGTK | Assignee: | Nobody <webkit-unassigned> | ||||||||||||
Status: | RESOLVED FIXED | ||||||||||||||
Severity: | Normal | CC: | crogers, dynastpsh, eric.carlson, feature-media-reviews, gustavo, menard, mrobinson, pnormand, rakuco, s.choi, sh919.park, slomo, webkit.review.bot, xan.lopez | ||||||||||||
Priority: | P2 | ||||||||||||||
Version: | 528+ (Nightly build) | ||||||||||||||
Hardware: | Unspecified | ||||||||||||||
OS: | Unspecified | ||||||||||||||
Bug Depends on: | 67187 | ||||||||||||||
Bug Blocks: | |||||||||||||||
Attachments: |
|
Description
Philippe Normand
2012-02-08 02:45:34 PST
Yes, gst_init() should be called from the main thread before any other GStreamer function and ideally before anything else. Same for gobject_init() and gtk_init() btw, I hope these are not called from different threads? :) (In reply to comment #1) > Yes, gst_init() should be called from the main thread before any other GStreamer function and ideally before anything else. Same for gobject_init() and gtk_init() btw, I hope these are not called from different threads? :) We're safe on the gobject/gtk side I think :) I started already looking at make the HRTF DatabaseLoader run in the main loop, some good results already! (In reply to comment #2) > We're safe on the gobject/gtk side I think :) > I started already looking at make the HRTF DatabaseLoader run in the main loop, some good results already! Why not just run gst_init() in the main loop and keep the HRTF DatabaseLoader in it's own thread? I believe it's best to keep expensive operations out of the main thread. Created attachment 130157 [details]
Patch
Comment on attachment 130157 [details]
Patch
Maybe it'd be better to move this to a more global location? Is there some function that initializes the WebAudio backend as a whole?
(In reply to comment #5) > (From update of attachment 130157 [details]) > Maybe it'd be better to move this to a more global location? Is there some function that initializes the WebAudio backend as a whole? I haven't found such function yet. I'll keep looking! The reason why I moved this in FFTFrame::initialize is because it's called by AudioContext::constructCommon() which is called in the AudioContext ctors. Created attachment 131290 [details]
Patch
Chris, it's indeed a bit odd to use FFTFrame::initialize() to initialize various backend-specific bits. Would it be Ok to add a more general function for this? Any suggestion welcome! :) Chris, can you please provide some insight on this matter? :) (In reply to comment #10) > Chris, it's indeed a bit odd to use FFTFrame::initialize() to initialize various backend-specific bits. Would it be Ok to add a more general function for this? Any suggestion welcome! :) Hi Philippe, I think it's ok to create your GTK-specific initialize function which will call gst_init_check() instead of putting it in FFTFrame::initialize() (where it doesn't really belong). Then in AudioContext::contructCommon() you could conditionally compile in the call to this function. (In reply to comment #12) > (In reply to comment #10) > > Chris, it's indeed a bit odd to use FFTFrame::initialize() to initialize various backend-specific bits. Would it be Ok to add a more general function for this? Any suggestion welcome! :) > > Hi Philippe, I think it's ok to create your GTK-specific initialize function which will call gst_init_check() instead of putting it in FFTFrame::initialize() (where it doesn't really belong). > > Then in AudioContext::contructCommon() you could conditionally compile in the call to this function. Thanks Chris! I'm preparing a patch adding a new GStreamerUtilities.cpp/h which for now only contains the init function, but later we could add more functions if needed. Created attachment 135598 [details]
Patch
Comment on attachment 135598 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=135598&action=review Looks good, though I've pointed out a few small nits below. > Source/WebCore/Modules/webaudio/AudioContext.cpp:186 > + WebCore::initializeGStreamer(); You are already in the WebCore namespace here, right? > Source/WebCore/platform/graphics/gstreamer/GStreamerUtilities.cpp:22 > + > +#include "GStreamerUtilities.h" Extra newline here. > Source/WebCore/platform/graphics/gstreamer/GStreamerUtilities.cpp:27 > +#include <wtf/gobject/GOwnPtr.h> > + > +#if USE(GSTREAMER) > +#include <gst/gst.h> I think I'd prefer the includes to all be on one side of the guard. > Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:196 > + GRefPtr<GstElementFactory> factory = gst_element_factory_find(gPlaybinName); > + if (factory) I think you could actually do: GRefPtr<GstElementFactory> factory = gst_element_factory_find(gPlaybinName); return factory; > Source/autotools/symbols.filter:138 > +_ZN7WebCore19initializeGStreamerEv; Why is this necessary? It should only be required if yo uare using this function outside of libwebkitgtk, I think. Comment on attachment 135598 [details] Patch Attachment 135598 [details] did not pass qt-wk2-ews (qt): Output: http://queues.webkit.org/results/12323816 Comment on attachment 135598 [details] Patch Attachment 135598 [details] did not pass qt-ews (qt): Output: http://queues.webkit.org/results/12327010 (In reply to comment #15) > (From update of attachment 135598 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=135598&action=review > > Source/autotools/symbols.filter:138 > > +_ZN7WebCore19initializeGStreamerEv; > > Why is this necessary? It should only be required if yo uare using this function outside of libwebkitgtk, I think. Hum I had a runtime failure when running the tests about that missing symbol. I'll double check and upload a new patch which hopefully should build on Qt and EFL too. Comment on attachment 135598 [details] Patch Attachment 135598 [details] did not pass gtk-ews (gtk): Output: http://queues.webkit.org/results/12319950 Comment on attachment 135598 [details] Patch Attachment 135598 [details] did not pass efl-ews (efl): Output: http://queues.webkit.org/results/12321929 Created attachment 135615 [details]
Patch
Comment on attachment 135615 [details] Patch Attachment 135615 [details] did not pass gtk-ews (gtk): Output: http://queues.webkit.org/results/12325905 Created attachment 136460 [details]
Patch
Same patch but just to make sure GTK EWS builds it.
Comment on attachment 136460 [details] Patch Attachment 136460 [details] did not pass gtk-ews (gtk): Output: http://queues.webkit.org/results/12384233 (In reply to comment #24) > (From update of attachment 136460 [details]) > Attachment 136460 [details] did not pass gtk-ews (gtk): > Output: http://queues.webkit.org/results/12384233 A clean build is needed. Comment on attachment 136460 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=136460&action=review Looks good, but take a look at my comment below before landing. > Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:179 > +bool doGstInit() Is this used outside the file now? It's no longer static. Now that you have initializeGStreamer, perhaps it makese sense to rename this method to differeniate it from initializeGStreamer. How about initializeGStreamerAndRegisterWebKitWebSrc? Comment on attachment 136460 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=136460&action=review >> Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:179 >> +bool doGstInit() > > Is this used outside the file now? It's no longer static. Now that you have initializeGStreamer, perhaps it makese sense to rename this method to differeniate it from initializeGStreamer. How about initializeGStreamerAndRegisterWebKitWebSrc? I agree about renaming but I saw some branches of this code doing additional elements registration. So maybe we should have a less specific name, like initializeGStreamerAndAndRegisterWebKitElements ? long names ftw :( Committed r114269: <http://trac.webkit.org/changeset/114269> |