diff options
author | Wim Taymans <wim.taymans@collabora.co.uk> | 2011-07-04 10:19:13 +0200 |
---|---|---|
committer | Wim Taymans <wim.taymans@collabora.co.uk> | 2011-07-04 16:01:14 +0200 |
commit | ddce68a5c286a0050334c2b991443ae8363a5961 (patch) | |
tree | 9aa562bf9a5f11b339a0662dee691a4ccc58a29f /sys | |
parent | ebfd6acde102c84f625f9e51d52fb9a4becaa011 (diff) |
video: More video helper library improvements
Make a new GstVideoFormatinfo structure that contains the specific information
related to a format such as the number of planes, components, subsampling,
pixel stride etc. The result is that we are now able to introduce the concept of
components again in the API.
Use tables to specify the formats and its properties.
Use macros to get information about the video format description.
Move code to set strides, offsets and size into one function.
Remove methods that are not handled with the structures.
Add methods to retrieve pointers and strides to the components in the video.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/ximage/ximagepool.c | 12 | ||||
-rw-r--r-- | sys/xvimage/xvimagepool.c | 13 |
2 files changed, 17 insertions, 8 deletions
diff --git a/sys/ximage/ximagepool.c b/sys/ximage/ximagepool.c index 21068ca86..2752831a9 100644 --- a/sys/ximage/ximagepool.c +++ b/sys/ximage/ximagepool.c @@ -508,21 +508,25 @@ ximage_buffer_pool_alloc (GstBufferPool * pool, GstBuffer ** buffer, { GstXImageBufferPool *xpool = GST_XIMAGE_BUFFER_POOL_CAST (pool); GstXImageBufferPoolPrivate *priv = xpool->priv; + GstVideoInfo *info; GstBuffer *ximage; GstMetaXImage *meta; + info = &priv->info; + ximage = gst_buffer_new (); meta = - gst_buffer_add_meta_ximage (ximage, xpool->sink, priv->info.width, - priv->info.height); + gst_buffer_add_meta_ximage (ximage, xpool->sink, + GST_VIDEO_INFO_WIDTH (info), GST_VIDEO_INFO_HEIGHT (info)); if (meta == NULL) { gst_buffer_unref (ximage); goto no_buffer; } if (priv->add_metavideo) { + GST_DEBUG_OBJECT (pool, "adding GstMetaVideo"); /* these are just the defaults for now */ - gst_buffer_add_meta_video (ximage, 0, priv->info.format, priv->info.width, - priv->info.height); + gst_buffer_add_meta_video (ximage, 0, GST_VIDEO_INFO_FORMAT (info), + GST_VIDEO_INFO_WIDTH (info), GST_VIDEO_INFO_HEIGHT (info)); } *buffer = ximage; diff --git a/sys/xvimage/xvimagepool.c b/sys/xvimage/xvimagepool.c index 40f294c95..a95a490de 100644 --- a/sys/xvimage/xvimagepool.c +++ b/sys/xvimage/xvimagepool.c @@ -555,22 +555,27 @@ xvimage_buffer_pool_alloc (GstBufferPool * pool, GstBuffer ** buffer, { GstXvImageBufferPool *xvpool = GST_XVIMAGE_BUFFER_POOL_CAST (pool); GstXvImageBufferPoolPrivate *priv = xvpool->priv; + GstVideoInfo *info; GstBuffer *xvimage; GstMetaXvImage *meta; + info = &priv->info; + xvimage = gst_buffer_new (); meta = - gst_buffer_add_meta_xvimage (xvimage, xvpool->sink, priv->info.width, - priv->info.height, priv->im_format); + gst_buffer_add_meta_xvimage (xvimage, xvpool->sink, + GST_VIDEO_INFO_WIDTH (info), GST_VIDEO_INFO_HEIGHT (info), + priv->im_format); if (meta == NULL) { gst_buffer_unref (xvimage); goto no_buffer; } if (priv->add_metavideo) { + GST_DEBUG_OBJECT (pool, "adding GstMetaVideo"); /* these are just the defaults for now */ - gst_buffer_add_meta_video (xvimage, 0, priv->info.format, priv->info.width, - priv->info.height); + gst_buffer_add_meta_video (xvimage, 0, GST_VIDEO_INFO_FORMAT (info), + GST_VIDEO_INFO_WIDTH (info), GST_VIDEO_INFO_HEIGHT (info)); } *buffer = xvimage; |