I'm trying to get the image from a webcam with GStreamer and load it to an OpenGL texture.

I'm using the gstreamer haskell library. I managed to simply display the webcam output in a window with v4l2src as a source and xvimagesink as a sink. Now I'd like to load this in an OpenGL texture. I saw you can do this in C with the appsink GStreamer plugin that allows you to extract samples from the pipeline by calling gst_app_sink_pull_sample () .

I think I managed to load the app plugin and the appsink feature but I don't know what is the equivalent of gst_app_sink_pull_sample () in Haskell.

This is how I load the app plugin and the appsink feature:

import qualified Media.Streaming.GStreamer as GS main = do GS.init appPlugin <- GS.pluginLoadByName "app" appsinkFeature <- GS.registryLookupFeature GS.defaultRegistry "appsink"

Should I create an Element like this:

appSink <- GS.elementFactoryMake "appsink" (Just "app-sink")

But what do I do with it after to sample the pipeline?