Changeset 151673 in webkit
- Timestamp:
- Jun 18, 2013 1:09:55 AM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r151668 r151673 1 2013-06-18 Víctor Manuel Jáquez Leal <vjaquez@igalia.com> 2 3 [GStreamer] [texmap] upload a video buffer into the video texture 4 https://bugs.webkit.org/show_bug.cgi?id=116042 5 6 Reviewed by Philippe Normand. 7 8 This patch prepares more quickly the texture when the video frame is 9 already in the GPU memory. 10 11 It is done using a new buffer's metadata available in GStreamer 1.2, 12 and its purpose is to upload buffers into a OpenGL texture. 13 14 If the decoder provides buffers with this metadata, the buffer will be 15 uploaded into the texture used for the video display and it will be 16 rendered, avoiding a expensive mem copies. This is particularly useful 17 for Full HD videos, where all the processing and display will be done 18 in the GPU. 19 20 No new tests, covered by existing tests. 21 22 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: 23 (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase): 24 (WebCore::MediaPlayerPrivateGStreamerBase::updateTexture): 25 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h: 26 * platform/graphics/gstreamer/VideoSinkGStreamer.cpp: 27 (webkitVideoSinkProposeAllocation): 28 1 29 2013-06-17 Peter Gal <galpeter@inf.u-szeged.hu> 2 30 -
trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp
r151203 r151673 52 52 #endif 53 53 54 #if GST_CHECK_VERSION(1, 1, 0) && USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER_GL) 55 #include "TextureMapperGL.h" 56 #endif 57 54 58 GST_DEBUG_CATEGORY(webkit_media_player_debug); 55 59 #define GST_CAT_DEFAULT webkit_media_player_debug … … 340 344 m_texture->reset(size); 341 345 346 #if GST_CHECK_VERSION(1, 1, 0) 347 GstVideoGLTextureUploadMeta* meta; 348 if ((meta = gst_buffer_get_video_gl_texture_upload_meta(buffer))) { 349 if (meta->n_textures == 1) { // BRGx & BGRA formats use only one texture. 350 const BitmapTextureGL* textureGL = static_cast<const BitmapTextureGL*>(m_texture.get()); 351 guint ids[4] = { textureGL->id(), 0, 0, 0 }; 352 353 if (gst_video_gl_texture_upload_meta_upload(meta, ids)) { 354 client()->setPlatformLayerNeedsDisplay(); 355 return; 356 } 357 } 358 } 359 #endif 360 342 361 #ifdef GST_API_VERSION_1 343 362 GstMapInfo srcInfo; … … 348 367 #endif 349 368 350 // @TODO: support cropping351 369 m_texture->updateContents(srcData, WebCore::IntRect(WebCore::IntPoint(0, 0), size), WebCore::IntPoint(0, 0), size.width() * 4, BitmapTexture::UpdateCannotModifyOriginalImageData); 352 370 -
trunk/Source/WebCore/platform/graphics/gstreamer/VideoSinkGStreamer.cpp
r149250 r151673 42 42 43 43 // CAIRO_FORMAT_RGB24 used to render the video buffers is little/big endian dependant. 44 #ifdef GST_API_VERSION_1 44 45 #if G_BYTE_ORDER == G_LITTLE_ENDIAN 45 #ifndef GST_API_VERSION_1 46 #define GST_CAPS_FORMAT "{ BGRx, BGRA }" 47 #else 48 #define GST_CAPS_FORMAT "{ xRGB, ARGB }" 49 #endif 50 #if GST_CHECK_VERSION(1, 1, 0) 51 #define GST_FEATURED_CAPS GST_VIDEO_CAPS_MAKE_WITH_FEATURES(GST_CAPS_FEATURE_META_GST_VIDEO_GL_TEXTURE_UPLOAD_META, GST_CAPS_FORMAT) 52 #else 53 #define GST_FEATURED_CAPS 54 #endif 55 #endif // GST_API_VERSION_1 56 57 #ifdef GST_API_VERSION_1 58 #define WEBKIT_VIDEO_SINK_PAD_CAPS GST_FEATURED_CAPS ";" GST_VIDEO_CAPS_MAKE(GST_CAPS_FORMAT) 59 #else 60 #if G_BYTE_ORDER == G_LITTLE_ENDIAN 46 61 #define WEBKIT_VIDEO_SINK_PAD_CAPS GST_VIDEO_CAPS_BGRx ";" GST_VIDEO_CAPS_BGRA 47 62 #else 48 #define WEBKIT_VIDEO_SINK_PAD_CAPS GST_VIDEO_CAPS_MAKE("{ BGRx, BGRA }")49 #endif50 #else51 #ifndef GST_API_VERSION_152 63 #define WEBKIT_VIDEO_SINK_PAD_CAPS GST_VIDEO_CAPS_xRGB ";" GST_VIDEO_CAPS_ARGB 53 #else 54 #define WEBKIT_VIDEO_SINK_PAD_CAPS GST_VIDEO_CAPS_MAKE("{ xRGB, ARGB }") 55 #endif 56 #endif 64 #endif 65 #endif // GST_API_VERSION_1 66 57 67 static GstStaticPadTemplate s_sinkTemplate = GST_STATIC_PAD_TEMPLATE("sink", GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS(WEBKIT_VIDEO_SINK_PAD_CAPS)); 58 68 … … 352 362 gst_query_add_allocation_meta(query, GST_VIDEO_META_API_TYPE, 0); 353 363 gst_query_add_allocation_meta(query, GST_VIDEO_CROP_META_API_TYPE, 0); 364 #if GST_CHECK_VERSION(1, 1, 0) 365 gst_query_add_allocation_meta(query, GST_VIDEO_GL_TEXTURE_UPLOAD_META_API_TYPE, 0); 366 #endif 354 367 return TRUE; 355 368 }
Note: See TracChangeset
for help on using the changeset viewer.