Changeset 114269 in webkit
- Timestamp:
- Apr 16, 2012 10:14:12 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r114268 r114269 1 2012-04-11 Philippe Normand <pnormand@igalia.com> 2 3 [GStreamer] HRTFDatabaseLoader conflicts with AudioFileReader 4 https://bugs.webkit.org/show_bug.cgi?id=78095 5 6 Reviewed by Martin Robinson. 7 8 Moved the GStreamer initialization logic to a new 9 GStreamerUtilities module, used by the MediaPlayer and the 10 AudioContext. I also removed the static variables as 11 gst_init_check already handles cases where it's called multiple 12 times. 13 14 * GNUmakefile.list.am: 15 * Modules/webaudio/AudioContext.cpp: 16 (WebCore::AudioContext::constructCommon): 17 * platform/audio/gstreamer/AudioDestinationGStreamer.cpp: 18 (WebCore::AudioDestinationGStreamer::AudioDestinationGStreamer): 19 * platform/audio/gstreamer/AudioFileReaderGStreamer.cpp: 20 (WebCore::AudioFileReader::createBus): 21 * platform/graphics/gstreamer/GRefPtrGStreamer.cpp: 22 (WTF::adoptGRef): 23 (WTF): 24 (WTF::GstElementFactory): 25 * platform/graphics/gstreamer/GRefPtrGStreamer.h: 26 (WTF): 27 * platform/graphics/gstreamer/GStreamerUtilities.cpp: Added. 28 (WebCore): 29 (WebCore::initializeGStreamer): 30 * platform/graphics/gstreamer/GStreamerUtilities.h: Added. 31 (WebCore): 32 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: 33 (WebCore::doGstInit): 34 1 35 2012-04-16 ChangSeok Oh <shivamidow@gmail.com> 2 36 -
trunk/Source/WebCore/GNUmakefile.list.am
r114220 r114269 4638 4638 Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp \ 4639 4639 Source/WebCore/platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h \ 4640 Source/WebCore/platform/graphics/gstreamer/GRefPtrGStreamer.cpp \4641 Source/WebCore/platform/graphics/gstreamer/GRefPtrGStreamer.h \4642 4640 Source/WebCore/platform/graphics/gstreamer/GStreamerGWorld.cpp \ 4643 4641 Source/WebCore/platform/graphics/gstreamer/GStreamerGWorld.h \ 4644 Source/WebCore/platform/graphics/gstreamer/GStreamerVersioning.cpp \4645 Source/WebCore/platform/graphics/gstreamer/GStreamerVersioning.h \4646 4642 Source/WebCore/platform/graphics/gstreamer/ImageGStreamerCairo.cpp \ 4647 4643 Source/WebCore/platform/graphics/gstreamer/ImageGStreamer.h \ … … 5674 5670 endif 5675 5671 5672 if USE_GSTREAMER 5673 webcore_sources += \ 5674 Source/WebCore/platform/graphics/gstreamer/GRefPtrGStreamer.cpp \ 5675 Source/WebCore/platform/graphics/gstreamer/GRefPtrGStreamer.h \ 5676 Source/WebCore/platform/graphics/gstreamer/GStreamerUtilities.cpp \ 5677 Source/WebCore/platform/graphics/gstreamer/GStreamerUtilities.h \ 5678 Source/WebCore/platform/graphics/gstreamer/GStreamerVersioning.cpp \ 5679 Source/WebCore/platform/graphics/gstreamer/GStreamerVersioning.h 5680 endif 5676 5681 5677 5682 # ---- -
trunk/Source/WebCore/Modules/webaudio/AudioContext.cpp
r114193 r114269 69 69 #endif 70 70 71 #if USE(GSTREAMER) 72 #include "GStreamerUtilities.h" 73 #endif 74 71 75 #include <wtf/ArrayBuffer.h> 72 76 #include <wtf/Atomics.h> … … 179 183 void AudioContext::constructCommon() 180 184 { 185 #if USE(GSTREAMER) 186 initializeGStreamer(); 187 #endif 188 181 189 FFTFrame::initialize(); 182 190 -
trunk/Source/WebCore/PlatformEfl.cmake
r114113 r114269 189 189 platform/graphics/gstreamer/GRefPtrGStreamer.cpp 190 190 platform/graphics/gstreamer/GStreamerGWorld.cpp 191 platform/graphics/gstreamer/GStreamerUtilities.cpp 191 192 platform/graphics/gstreamer/GStreamerVersioning.cpp 192 193 platform/graphics/gstreamer/ImageGStreamerCairo.cpp -
trunk/Source/WebCore/Target.pri
r114220 r114269 3269 3269 platform/graphics/gstreamer/GRefPtrGStreamer.h \ 3270 3270 platform/graphics/gstreamer/GStreamerGWorld.h \ 3271 platform/graphics/gstreamer/GStreamerUtilities.h \ 3271 3272 platform/graphics/gstreamer/GStreamerVersioning.h \ 3272 3273 platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h \ … … 3279 3280 platform/graphics/gstreamer/GRefPtrGStreamer.cpp \ 3280 3281 platform/graphics/gstreamer/GStreamerGWorld.cpp \ 3282 platform/graphics/gstreamer/GStreamerUtilities.cpp \ 3281 3283 platform/graphics/gstreamer/GStreamerVersioning.cpp \ 3282 3284 platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp \ -
trunk/Source/WebCore/platform/audio/gstreamer/AudioDestinationGStreamer.cpp
r111354 r114269 58 58 , m_isPlaying(false) 59 59 { 60 static bool gstInitialized = false;61 if (!gstInitialized)62 gstInitialized = gst_init_check(0, 0, 0);63 ASSERT_WITH_MESSAGE(gstInitialized, "GStreamer initialization failed");64 65 60 m_pipeline = gst_pipeline_new("play"); 66 61 -
trunk/Source/WebCore/platform/audio/gstreamer/AudioFileReaderGStreamer.cpp
r112646 r114269 325 325 m_sampleRate = sampleRate; 326 326 327 static bool gstInitialized = false;328 if (!gstInitialized)329 gstInitialized = gst_init_check(0, 0, 0);330 331 if (!gstInitialized)332 return nullptr;333 334 327 m_frontLeftBuffers = gst_buffer_list_new(); 335 328 m_frontLeftBuffersIterator = gst_buffer_list_iterate(m_frontLeftBuffers); -
trunk/Source/WebCore/platform/graphics/gstreamer/GRefPtrGStreamer.cpp
r111119 r114269 141 141 } 142 142 143 template <> GRefPtr<GstElementFactory> adoptGRef(GstElementFactory* ptr) 144 { 145 ASSERT(!GST_OBJECT_IS_FLOATING(GST_OBJECT(ptr))); 146 return GRefPtr<GstElementFactory>(ptr, GRefPtrAdopt); 147 } 148 149 template <> GstElementFactory* refGPtr<GstElementFactory>(GstElementFactory* ptr) 150 { 151 if (ptr) 152 webkitGstObjectRefSink(GST_OBJECT(ptr)); 153 154 return ptr; 155 } 156 157 template <> void derefGPtr<GstElementFactory>(GstElementFactory* ptr) 158 { 159 if (ptr) 160 gst_object_unref(ptr); 161 } 162 143 163 } 144 164 #endif // USE(GSTREAMER) -
trunk/Source/WebCore/platform/graphics/gstreamer/GRefPtrGStreamer.h
r111354 r114269 30 30 typedef struct _GstTask GstTask; 31 31 typedef struct _GstBus GstBus; 32 typedef struct _GstElementFactory GstElementFactory; 32 33 33 34 namespace WTF { … … 56 57 template<> void derefGPtr<GstBus>(GstBus* ptr); 57 58 59 template<> GRefPtr<GstElementFactory> adoptGRef(GstElementFactory* ptr); 60 template<> GstElementFactory* refGPtr<GstElementFactory>(GstElementFactory* ptr); 61 template<> void derefGPtr<GstElementFactory>(GstElementFactory* ptr); 62 58 63 } 59 64 -
trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
r113849 r114269 32 32 #include "FrameView.h" 33 33 #include "GStreamerGWorld.h" 34 #include "GStreamerUtilities.h" 34 35 #include "GStreamerVersioning.h" 35 36 #include "GraphicsContext.h" … … 176 177 } 177 178 178 static bool gstInitialized = false; 179 180 static bool doGstInit() 181 { 182 // FIXME: We should pass the arguments from the command line 183 if (!gstInitialized) { 184 GOwnPtr<GError> error; 185 gstInitialized = gst_init_check(0, 0, &error.outPtr()); 186 if (!gstInitialized) 187 LOG_VERBOSE(Media, "Could not initialize GStreamer: %s", 188 error ? error->message : "unknown error occurred"); 189 else 190 gst_element_register(0, "webkitwebsrc", GST_RANK_PRIMARY + 100, 191 WEBKIT_TYPE_WEB_SRC); 192 } 193 return gstInitialized; 179 bool initializeGStreamerAndRegisterWebKitElements() 180 { 181 if (!initializeGStreamer()) 182 return false; 183 184 GRefPtr<GstElementFactory> srcFactory = gst_element_factory_find("webkitwebsrc"); 185 if (!srcFactory) 186 return gst_element_register(0, "webkitwebsrc", GST_RANK_PRIMARY + 100, WEBKIT_TYPE_WEB_SRC); 187 188 return true; 194 189 } 195 190 196 191 bool MediaPlayerPrivateGStreamer::isAvailable() 197 192 { 198 if (! doGstInit())193 if (!initializeGStreamerAndRegisterWebKitElements()) 199 194 return false; 200 195 201 GstElementFactory* factory = gst_element_factory_find(gPlaybinName); 202 if (factory) { 203 gst_object_unref(GST_OBJECT(factory)); 204 return true; 205 } 206 return false; 196 GRefPtr<GstElementFactory> factory = gst_element_factory_find(gPlaybinName); 197 return factory; 207 198 } 208 199 … … 245 236 , m_webkitAudioSink(0) 246 237 { 247 if ( doGstInit())238 if (initializeGStreamerAndRegisterWebKitElements()) 248 239 createGSTPlayBin(); 249 240 } … … 1505 1496 { 1506 1497 1507 doGstInit();1498 initializeGStreamerAndRegisterWebKitElements(); 1508 1499 1509 1500 DEFINE_STATIC_LOCAL(HashSet<String>, cache, ());
Note: See TracChangeset
for help on using the changeset viewer.