mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
ogg: Update new code for 0.11 buffer API
This commit is contained in:
parent
c8792778f8
commit
dce40847a8
1 changed files with 19 additions and 6 deletions
|
@ -2049,11 +2049,14 @@ gboolean
|
||||||
gst_ogg_stream_setup_map_from_caps_headers (GstOggStream * pad,
|
gst_ogg_stream_setup_map_from_caps_headers (GstOggStream * pad,
|
||||||
const GstCaps * caps)
|
const GstCaps * caps)
|
||||||
{
|
{
|
||||||
|
GstBuffer *buf;
|
||||||
const GstStructure *structure;
|
const GstStructure *structure;
|
||||||
const GstBuffer *buf;
|
|
||||||
const GValue *streamheader;
|
const GValue *streamheader;
|
||||||
const GValue *first_element;
|
const GValue *first_element;
|
||||||
ogg_packet packet;
|
ogg_packet packet;
|
||||||
|
guint8 *data;
|
||||||
|
gsize size;
|
||||||
|
gboolean ret;
|
||||||
|
|
||||||
GST_INFO ("Checking streamheader on caps %" GST_PTR_FORMAT, caps);
|
GST_INFO ("Checking streamheader on caps %" GST_PTR_FORMAT, caps);
|
||||||
|
|
||||||
|
@ -2086,16 +2089,26 @@ gst_ogg_stream_setup_map_from_caps_headers (GstOggStream * pad,
|
||||||
}
|
}
|
||||||
|
|
||||||
buf = gst_value_get_buffer (first_element);
|
buf = gst_value_get_buffer (first_element);
|
||||||
if (buf == NULL || GST_BUFFER_SIZE (buf) == 0) {
|
if (buf == NULL) {
|
||||||
|
GST_ERROR ("no first streamheader buffer");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
data = gst_buffer_map (buf, &size, 0, GST_MAP_READ);
|
||||||
|
if (data == NULL || size == 0) {
|
||||||
GST_ERROR ("invalid first streamheader buffer");
|
GST_ERROR ("invalid first streamheader buffer");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_MEMDUMP ("streamheader", GST_BUFFER_DATA (buf), GST_BUFFER_SIZE (buf));
|
GST_MEMDUMP ("streamheader", data, size);
|
||||||
|
|
||||||
packet.packet = GST_BUFFER_DATA (buf);
|
packet.packet = data;
|
||||||
packet.bytes = GST_BUFFER_SIZE (buf);
|
packet.bytes = size;
|
||||||
|
|
||||||
GST_INFO ("Found headers on caps, using those to determine type");
|
GST_INFO ("Found headers on caps, using those to determine type");
|
||||||
return gst_ogg_stream_setup_map (pad, &packet);
|
ret = gst_ogg_stream_setup_map (pad, &packet);
|
||||||
|
|
||||||
|
gst_buffer_unmap (buf, data, size);
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue