After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 703344 - Add support for GstVideoMeta and GstVideoCropMeta
Add support for GstVideoMeta and GstVideoCropMeta
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-gl
git master
Other Linux
: Normal enhancement
: 1.2.0
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-06-30 12:24 UTC by Sebastian Dröge (slomo)
Modified: 2014-04-30 11:14 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
upload: add support for arbitrary strides (21.07 KB, patch)
2014-01-31 10:54 UTC, Matthew Waters (ystreet00)
committed Details | Review
glmem: use GstVideoInfo for format configuration (10.98 KB, patch)
2014-01-31 16:16 UTC, Matthew Waters (ystreet00)
committed Details | Review

Description Sebastian Dröge (slomo) 2013-06-30 12:24:20 UTC
Most importantly support for arbitrary strides and cropping would need to be added.

Separate to that support for different color matrices and gamma transfer functions could be implemented but those are less important.
Comment 1 Matthew Waters (ystreet00) 2014-01-31 10:54:27 UTC
Created attachment 267714 [details] [review]
upload: add support for arbitrary strides
Comment 2 Sebastian Dröge (slomo) 2014-01-31 13:33:10 UTC
Review of attachment 267714 [details] [review]:

In general this looks good... but you don't use GstVideoMeta or GstVideoFrame anywhere, only GstVideoInfo. So for each buffer you'll have to look at the videometa to get the current buffer's strides and offsets, and then use them in the shaders.

And to get the videometa you will need to add it in the GL buffer pool and other elements into the reply of the allocation query.
Comment 3 Sebastian Dröge (slomo) 2014-01-31 13:34:07 UTC
Also take a look at the code in eglglessink for this.
Comment 4 Matthew Waters (ystreet00) 2014-01-31 15:21:11 UTC
(In reply to comment #2)
> Review of attachment 267714 [details] [review]:
> 
> In general this looks good... but you don't use GstVideoMeta or GstVideoFrame
> anywhere, only GstVideoInfo. So for each buffer you'll have to look at the
> videometa to get the current buffer's strides and offsets, and then use them in
> the shaders.

There are three upload paths in GstGLUpload
1. GstGLMemory - needs to be updated for strides.
2. GstVideoGLTextureUploadMeta - not relevant
3. System Memory - depending on which function you call depends on if you get proper stride support.  Two paths are available for this:
3a. gst_gl_upload_perform_with_buffer() - wraps (3b.) with GstVideoFrame map/unmap which will update upload->in_info with stride and offsets.
3b. gst_gl_upload_perform_with_data() - At the moment, does not touch upload->in_info so you get whatever is set.

All the elements use gst_gl_upload_perform_with_buffer() anyway.

> And to get the videometa you will need to add it in the GL buffer pool and
> other elements into the reply of the allocation query.

Already there.
Comment 5 Sebastian Dröge (slomo) 2014-01-31 15:41:34 UTC
Oh right, sorry for the memory leaks in my brain :) Will take another look at the patch and then merge it, unless you get your account until then already.
Comment 6 Matthew Waters (ystreet00) 2014-01-31 16:16:19 UTC
Created attachment 267739 [details] [review]
glmem: use GstVideoInfo for format configuration
Comment 7 Sebastian Dröge (slomo) 2014-02-04 11:59:17 UTC
commit 259e6f80ed63d307b0bf60fc405151d567363812
Author: Matthew Waters <ystreet00@gmail.com>
Date:   Sat Feb 1 03:14:48 2014 +1100

    glmem: use GstVideoInfo for format configuration
    
    Allows use of strides

commit 9a4c65faa997ef63f4896da3525c1f2bc37d81a7
Author: Matthew Waters <ystreet00@gmail.com>
Date:   Fri Jan 31 06:53:54 2014 +1100

    upload: support for arbitrary strides
    
    Using GL_UNPACK_ALIGNMENT for GLES2 and GL_UNPACK_ROW_LENGTH for everything else
Comment 8 Sebastian Dröge (slomo) 2014-02-04 12:04:47 UTC
Matthew, I noticed that "make check" fails to compile right now. Can you fix that (in another bug)?