Changeset 206866 in webkit
- Timestamp:
- Oct 6, 2016 9:38:48 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r206864 r206866 1 2016-10-05 Philippe Normand <pnormand@igalia.com> 2 3 [GStreamer][OWR] GL rendering support 4 https://bugs.webkit.org/show_bug.cgi?id=162972 5 6 Reviewed by Žan Doberšek. 7 8 When GStreamer-GL is enabled the GL context needs to be properly passed 9 to the GStreamer pipeline running within the OpenWebRTC video renderer. 10 This is now supported using a new OpenWebRTC API that allows the 11 renderer to request the context from the application using a callback 12 registered within the renderer. 13 14 The player's GL context/display set-up was refactored to a new 15 method, requestGLContext, which is used as callback for the 16 OpenWebRTC request_context handler. 17 18 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: 19 (WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage): 20 (WebCore::MediaPlayerPrivateGStreamerBase::requestGLContext): 21 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h: 22 (WebCore::MediaPlayerPrivateGStreamerBase::gstGLContext): 23 (WebCore::MediaPlayerPrivateGStreamerBase::gstGLDisplay): 24 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp: 25 (WebCore::MediaPlayerPrivateGStreamerOwr::createVideoSink): 26 1 27 2016-10-06 Antoine Quint <graouts@apple.com> 2 28 -
trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp
r206863 r206866 228 228 gst_message_parse_context_type(message, &contextType); 229 229 230 if (!ensureGstGLContext()) 230 GRefPtr<GstContext> elementContext = adoptGRef(requestGLContext(contextType, this)); 231 if (!elementContext) 231 232 return false; 232 233 233 if (!g_strcmp0(contextType, GST_GL_DISPLAY_CONTEXT_TYPE)) { 234 GRefPtr<GstContext> displayContext = adoptGRef(gst_context_new(GST_GL_DISPLAY_CONTEXT_TYPE, TRUE)); 235 gst_context_set_gl_display(displayContext.get(), m_glDisplay.get()); 236 gst_element_set_context(GST_ELEMENT(message->src), displayContext.get()); 237 return true; 238 } 239 240 if (!g_strcmp0(contextType, "gst.gl.app_context")) { 241 GRefPtr<GstContext> appContext = adoptGRef(gst_context_new("gst.gl.app_context", TRUE)); 242 GstStructure* structure = gst_context_writable_structure(appContext.get()); 243 gst_structure_set(structure, "context", GST_GL_TYPE_CONTEXT, m_glContext.get(), nullptr); 244 gst_element_set_context(GST_ELEMENT(message->src), appContext.get()); 245 return true; 246 } 234 gst_element_set_context(GST_ELEMENT(message->src), elementContext.get()); 235 return true; 247 236 #else 248 237 UNUSED_PARAM(message); … … 253 242 254 243 #if USE(GSTREAMER_GL) 244 GstContext* MediaPlayerPrivateGStreamerBase::requestGLContext(const gchar* contextType, MediaPlayerPrivateGStreamerBase* player) 245 { 246 if (!player->ensureGstGLContext()) 247 return nullptr; 248 249 if (!g_strcmp0(contextType, GST_GL_DISPLAY_CONTEXT_TYPE)) { 250 GstContext* displayContext = gst_context_new(GST_GL_DISPLAY_CONTEXT_TYPE, TRUE); 251 gst_context_set_gl_display(displayContext, player->gstGLDisplay()); 252 return displayContext; 253 } 254 255 if (!g_strcmp0(contextType, "gst.gl.app_context")) { 256 GstContext* appContext = gst_context_new("gst.gl.app_context", TRUE); 257 GstStructure* structure = gst_context_writable_structure(appContext); 258 gst_structure_set(structure, "context", GST_GL_TYPE_CONTEXT, player->gstGLContext(), nullptr); 259 return appContext; 260 } 261 262 return nullptr; 263 } 264 255 265 bool MediaPlayerPrivateGStreamerBase::ensureGstGLContext() 256 266 { -
trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h
r206863 r206866 71 71 #if USE(GSTREAMER_GL) 72 72 bool ensureGstGLContext(); 73 static GstContext* requestGLContext(const gchar* contextType, MediaPlayerPrivateGStreamerBase*); 73 74 #endif 74 75 … … 134 135 GstElement* createGLAppSink(); 135 136 GstElement* createVideoSinkGL(); 137 GstGLContext* gstGLContext() const { return m_glContext.get(); } 138 GstGLDisplay* gstGLDisplay() const { return m_glDisplay.get(); } 136 139 #if USE(CAIRO) && ENABLE(ACCELERATED_2D_CANVAS) 137 140 GLContext* prepareContextForCairoPaint(GstVideoInfo&, IntSize&, IntSize&); -
trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp
r206204 r206866 356 356 gst_element_add_pad(sink, gst_ghost_pad_new("sink", pad.get())); 357 357 #endif 358 358 359 m_videoRenderer = adoptGRef(owr_gst_video_renderer_new(sink)); 359 360 #if USE(GSTREAMER_GL) 361 owr_video_renderer_set_request_context_callback(OWR_VIDEO_RENDERER(m_videoRenderer.get()), (OwrVideoRendererRequestContextCallback) MediaPlayerPrivateGStreamerBase::requestGLContext, this, nullptr); 362 #endif 360 363 return sink; 361 364 } -
trunk/Tools/ChangeLog
r206851 r206866 1 2016-10-05 Philippe Normand <pnormand@igalia.com> 2 3 [GStreamer][OWR] GL rendering support 4 https://bugs.webkit.org/show_bug.cgi?id=162972 5 6 Reviewed by Žan Doberšek. 7 8 When GStreamer-GL is enabled the GL context needs to be properly passed 9 to the GStreamer pipeline running within the OpenWebRTC video renderer. 10 This is now supported using a new OpenWebRTC API that allows the 11 renderer to request the context from the application using a callback 12 registered within the renderer. 13 14 * gtk/jhbuild.modules: Bump to latest OpenWebRTC for the new 15 owr_video_renderer_set_request_context_callback API added 16 recently. 17 1 18 2016-10-05 Youenn Fablet <youenn@apple.com> 2 19 -
trunk/Tools/gtk/jhbuild.modules
r205451 r206866 515 515 <dep package="libnice"/> 516 516 </dependencies> 517 <branch repo="github.com" module="EricssonResearch/openwebrtc.git" checkoutdir="openwebrtc" tag=" c997bff14a9389582bc107e2aea7ce77fb700ed9"/>517 <branch repo="github.com" module="EricssonResearch/openwebrtc.git" checkoutdir="openwebrtc" tag="0b28b080d61af3adb1f779e693fc029f9c1ad499"/> 518 518 </autotools> 519 519
Note: See TracChangeset
for help on using the changeset viewer.