Gstreamer-1.0 - get data from GstSample in GstAppSink
Sérgio Agostinho
sergio.r.agostinho at gmail.com
Sun Feb 14 13:28:16 UTC 2016
Hey,
A sample has a buffer
https://developer.gnome.org/gstreamer/stable/gstreamer-GstSample.html#gst-sample-get-buffer
A buffer has memory, which you map to get access to the raw data.
https://developer.gnome.org/gstreamer/stable/gstreamer-GstBuffer.html#gst-buffer-map
The MapInfo structure then should has the pointer to the data you can use
https://developer.gnome.org/gstreamer/stable/gstreamer-GstMemory.html#GstMapInfo
Cheers
2016-02-14 12:36 GMT+01:00 Christoph Kuhr <christoph.kuhr at web.de>:
> Hi *,
>
> I posted on stack overflow before, but I realized, this might be the
> better channel for this question.
>
> I am trying to get data from a GstSample to process it in my app sink. But
> I cannot find a way to extract the data from a sample. I have set the
> callball function "new-sample":
>
> static void GStPipeline::new_sample (GstAppSink *sink, CustomData *data) {
> GstSample* sample;
>
> sample = gst_app_sink_pull_sample(data->app_sink);
>
> if (sample) {
> data->sampleBuffer[data->num_samples] = sample;
>
> data->num_samples++;
>
> gst_sample_unref(sample);
> }
>
> gst_sample_unref(sample);}
>
>
> Am I missing some basic concept? Is it true, that since gstreamer-1.0 I
> have to provide a callback "new-sample" instead of "pull-buffer" ? For my
> understanding, a buffer contains the samples?
>
> BR,
> Ck
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20160214/0c4994f6/attachment.html>
More information about the gstreamer-devel
mailing list