How is data arranged in MapInfo.data?
Christoph Kuhr
christoph.kuhr at web.de
Mon Feb 22 12:43:19 UTC 2016
Hi *,
In my app sink, I want to copy the data provided by new-sample callback
to a non-gstreamer buffer.
The format of the audio data is S16LE.
How is the audio data arranged in GstMapInfo.data?
I tried the following, but it does not to work:
sample = gst_app_sink_pull_sample( sink );
if( sample ){
buffer = gst_sample_get_buffer( sample );
gst_buffer_map( buffer, &mem, GST_MAP_READ );
for (guint i = 0; i < mem.size; i+=2){
guint8 lo = mem.data[i];
guint8 hi = mem.data[i+1];
int16 hilo = (hi << 8) | lo;
castData->sampleBuffer->buffer[
castData->sampleBuffer->cnt++ ] = hilo;
}
gst_buffer_unmap( buffer, &mem );
Can anyone give me a hint, where I can find documentation for this?
BR,
Ck
More information about the gstreamer-devel
mailing list