Getting at a GstGLMemory object from a buffer? - thanks to Matthew Waters

Lasse Laursen lasse at lasselaursen.com
Fri Sep 26 23:32:26 PDT 2014


Hey everyone,

I'm working on a prototype video timeline interface, and I'm trying to 
simplify how I'm using gStreamer. I've had a lot of really useful 
feedback and help, and on this particular matter Matthew has been 
especially helpful previously. The entire gStreamer team seems like a 
lovely bunch of people. So hugs all around!

Anyway - back to my problem. I'm using the cinder framework and want to 
have gStreamers processed data end up on an OpenGL texture for me to 
use. My currently working code does this in a fairly ugly manner. It 
uses the following caps and pipeline:

std::string CAPS = "video/x-raw,format=RGB,pixel-aspect-ratio=1/1";
pipelineLaunchString = "uridecodebin uri=" + mPathToVideoFile +    " ! 
videoconvert ! appsink name=sink caps=\"" + CAPS + "\"";

and then waits for frames (samples) to arrive via the appsink callback 
function, promptly copying and uploading the gStreamer data on to the 
GPU for cinder to use. I basically have one OpenGL texture I'm 
constantly supplying the data gStreamer delivers, to.

Matthew suggested that by simply throwing in a 'glcolorscale' element, 
the data would automatically get to the GPU by way of gStreamer (instead 
of having me upload it). Great! So now my pipeline and caps looks as 
follows:

std::string CAPS = 
"video/x-raw(memory:GLMemory),format=RGBA,pixel-aspect-ratio=1/1";
pipelineLaunchString = "uridecodebin uri=" + mPathToVideoFile +    " ! 
videoconvert ! glcolorscale ! appsink name=sink caps=\"" + CAPS + "\"";

But here's where adventures end and my questions begin... I'm wondering 
about the following:

1. Is defining 'video/x-raw(memory:GLMemory)' considered correct? Is 
this how I should have the GL data flow to the appsink?

2. I've looked at the cluttershare example which seems to use a 
fakesink. Given that the data is now flowing over the GPU and the end 
result I want in my hands is a texture ID leading me to the video data 
(rather than the actual data), is it more proper to use a fakesink than 
an appsink?

3. And finally, I don't know much of clutter - in fact, I know nothing 
at all, and the sample code is hard for me to figure out. I am pretty 
clueless as how to actually get ahold of the GstGLMemory object - could 
anyone give me a few hints or point me in the right direction?

Much obliged!
Lasse

-- 
Lasse Farnung Laursen
Researcher at the University of Tokyo
www.lasselaursen.com <http://www.lasselaursen.com>
FB: lasse.laursen <https://www.facebook.com/lasse.laursen>
Twitter: @PMP_J <https://twitter.com/PMP_J>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20140927/95b880c8/attachment.html>


More information about the gstreamer-devel mailing list