Commit f8866813 authored by Mark Nauwelaerts's avatar Mark Nauwelaerts

isomp4: port to 0.11

parent 65bb271a
......@@ -6,6 +6,7 @@ libgstisomp4_la_LIBADD = \
$(GST_PLUGINS_BASE_LIBS) \
-lgstriff-@GST_MAJORMINOR@ \
-lgstaudio-@GST_MAJORMINOR@ \
-lgstvideo-@GST_MAJORMINOR@ \
-lgstrtp-@GST_MAJORMINOR@ \
-lgsttag-@GST_MAJORMINOR@ \
-lgstpbutils-@GST_MAJORMINOR@ \
......
......@@ -206,9 +206,10 @@ static AtomData *
atom_data_new_from_gst_buffer (guint32 fourcc, const GstBuffer * buf)
{
AtomData *data = atom_data_new (fourcc);
gsize size = gst_buffer_get_size ((GstBuffer *) buf);
atom_data_alloc_mem (data, GST_BUFFER_SIZE (buf));
g_memmove (data->data, GST_BUFFER_DATA (buf), GST_BUFFER_SIZE (buf));
atom_data_alloc_mem (data, size);
gst_buffer_extract ((GstBuffer *) buf, 0, data->data, size);
return data;
}
......@@ -2825,6 +2826,19 @@ atom_moov_add_uint_tag (AtomMOOV * moov, guint32 fourcc, guint32 flags,
}
}
static GstBuffer *
_gst_buffer_new_wrapped (gpointer mem, gsize size, GFreeFunc free_func)
{
GstBuffer *buf;
buf = gst_buffer_new ();
gst_buffer_take_memory (buf, -1,
gst_memory_new_wrapped (free_func ? 0 : GST_MEMORY_FLAG_READONLY,
mem, free_func, size, 0, size));
return buf;
}
void
atom_moov_add_blob_tag (AtomMOOV * moov, guint8 * data, guint size)
{
......@@ -2843,10 +2857,7 @@ atom_moov_add_blob_tag (AtomMOOV * moov, guint8 * data, guint size)
if (len > size)
return;
buf = gst_buffer_new ();
GST_BUFFER_SIZE (buf) = len - 8;
GST_BUFFER_DATA (buf) = data + 8;
buf = _gst_buffer_new_wrapped (data + 8, len - 8, NULL);
data_atom = atom_data_new_from_gst_buffer (fourcc, buf);
gst_buffer_unref (buf);
......@@ -2864,12 +2875,12 @@ atom_moov_add_3gp_tag (AtomMOOV * moov, guint32 fourcc, guint8 * data,
guint8 *bdata;
/* need full atom */
buf = gst_buffer_new_and_alloc (size + 4);
bdata = GST_BUFFER_DATA (buf);
bdata = g_malloc (size + 4);
/* full atom: version and flags */
GST_WRITE_UINT32_BE (bdata, 0);
memcpy (bdata + 4, data, size);
buf = _gst_buffer_new_wrapped (bdata, size + 4, g_free);
data_atom = atom_data_new_from_gst_buffer (fourcc, buf);
gst_buffer_unref (buf);
......@@ -3188,13 +3199,12 @@ build_pasp_extension (AtomTRAK * trak, gint par_width, gint par_height)
GstBuffer *buf;
guint8 *data;
buf = gst_buffer_new_and_alloc (8);
data = GST_BUFFER_DATA (buf);
data = g_malloc (8);
/* ihdr = image header box */
GST_WRITE_UINT32_BE (data, par_width);
GST_WRITE_UINT32_BE (data + 4, par_height);
buf = _gst_buffer_new_wrapped (data, 8, g_free);
atom_data = atom_data_new_from_gst_buffer (FOURCC_pasp, buf);
gst_buffer_unref (buf);
......@@ -3942,13 +3952,13 @@ build_esds_extension (AtomTRAK * trak, guint8 object_type, guint8 stream_type,
/* optional DecoderSpecificInfo */
if (codec_data) {
DecoderSpecificInfoDescriptor *desc;
gsize size;
esds->es.dec_conf_desc.dec_specific_info = desc =
desc_dec_specific_info_new ();
desc_dec_specific_info_alloc_data (desc, GST_BUFFER_SIZE (codec_data));
memcpy (desc->data, GST_BUFFER_DATA (codec_data),
GST_BUFFER_SIZE (codec_data));
size = gst_buffer_get_size ((GstBuffer *) codec_data);
desc_dec_specific_info_alloc_data (desc, size);
gst_buffer_extract ((GstBuffer *) codec_data, 0, desc->data, size);
}
return build_atom_info_wrapper ((Atom *) esds, atom_esds_copy_data,
......@@ -3961,16 +3971,17 @@ build_btrt_extension (guint32 buffer_size_db, guint32 avg_bitrate,
{
AtomData *atom_data;
GstBuffer *buf;
guint8 *data;
if (buffer_size_db == 0 && avg_bitrate == 0 && max_bitrate == 0)
return 0;
buf = gst_buffer_new_and_alloc (12);
GST_WRITE_UINT32_BE (GST_BUFFER_DATA (buf), buffer_size_db);
GST_WRITE_UINT32_BE (GST_BUFFER_DATA (buf) + 4, max_bitrate);
GST_WRITE_UINT32_BE (GST_BUFFER_DATA (buf) + 8, avg_bitrate);
data = g_malloc (12);
GST_WRITE_UINT32_BE (data, buffer_size_db);
GST_WRITE_UINT32_BE (data + 4, max_bitrate);
GST_WRITE_UINT32_BE (data + 8, avg_bitrate);
buf = _gst_buffer_new_wrapped (data, 12, g_free);
atom_data =
atom_data_new_from_gst_buffer (GST_MAKE_FOURCC ('b', 't', 'r', 't'), buf);
gst_buffer_unref (buf);
......@@ -4022,6 +4033,7 @@ build_mov_aac_extension (AtomTRAK * trak, const GstBuffer * codec_data,
{
AtomInfo *esds, *mp4a;
GstBuffer *buf;
guint32 tmp = 0;
/* Add ESDS atom to WAVE */
esds = build_esds_extension (trak, ESDS_OBJECT_TYPE_MPEG4_P3,
......@@ -4029,8 +4041,7 @@ build_mov_aac_extension (AtomTRAK * trak, const GstBuffer * codec_data,
/* Add MP4A atom to the WAVE:
* not really in spec, but makes offset based players happy */
buf = gst_buffer_new_and_alloc (4);
*((guint32 *) GST_BUFFER_DATA (buf)) = 0;
buf = _gst_buffer_new_wrapped (&tmp, 4, NULL);
mp4a = build_codec_data_extension (FOURCC_mp4a, buf);
gst_buffer_unref (buf);
......@@ -4052,14 +4063,13 @@ build_fiel_extension (gint fields)
{
AtomData *atom_data;
GstBuffer *buf;
guint8 f = fields;
if (fields == 1) {
return NULL;
}
buf = gst_buffer_new_and_alloc (1);
GST_BUFFER_DATA (buf)[0] = (guint8) fields;
buf = _gst_buffer_new_wrapped (&f, 1, NULL);
atom_data =
atom_data_new_from_gst_buffer (GST_MAKE_FOURCC ('f', 'i', 'e', 'l'), buf);
gst_buffer_unref (buf);
......@@ -4129,9 +4139,8 @@ build_jp2h_extension (AtomTRAK * trak, gint width, gint height, guint32 fourcc,
cdef_size = 8 + 2 + cdef_array_size * 6;
}
buf = gst_buffer_new_and_alloc (idhr_size + colr_size + cmap_size +
cdef_size);
gst_byte_writer_init_with_buffer (&writer, buf, FALSE);
gst_byte_writer_init_with_size (&writer,
idhr_size + colr_size + cmap_size + cdef_size, TRUE);
/* ihdr = image header box */
gst_byte_writer_put_uint32_be (&writer, 22);
......@@ -4215,6 +4224,7 @@ build_jp2h_extension (AtomTRAK * trak, gint width, gint height, guint32 fourcc,
}
g_assert (gst_byte_writer_get_remaining (&writer) == 0);
buf = gst_byte_writer_reset_and_get_buffer (&writer);
atom_data = atom_data_new_from_gst_buffer (FOURCC_jp2h, buf);
gst_buffer_unref (buf);
......@@ -4245,10 +4255,6 @@ build_amr_extension (void)
GstBuffer *buf;
AtomInfo *res;
buf = gst_buffer_new ();
GST_BUFFER_DATA (buf) = ext;
GST_BUFFER_SIZE (buf) = sizeof (ext);
/* vendor */
GST_WRITE_UINT32_LE (ext, 0);
/* decoder version */
......@@ -4260,6 +4266,7 @@ build_amr_extension (void)
/* frames per sample */
GST_WRITE_UINT8 (ext + 8, 1);
buf = _gst_buffer_new_wrapped (ext, sizeof (ext), NULL);
res = build_codec_data_extension (GST_MAKE_FOURCC ('d', 'a', 'm', 'r'), buf);
gst_buffer_unref (buf);
return res;
......@@ -4272,10 +4279,6 @@ build_h263_extension (void)
GstBuffer *buf;
AtomInfo *res;
buf = gst_buffer_new ();
GST_BUFFER_DATA (buf) = ext;
GST_BUFFER_SIZE (buf) = sizeof (ext);
/* vendor */
GST_WRITE_UINT32_LE (ext, 0);
/* decoder version */
......@@ -4285,6 +4288,7 @@ build_h263_extension (void)
GST_WRITE_UINT8 (ext + 5, 10);
GST_WRITE_UINT8 (ext + 6, 0);
buf = _gst_buffer_new_wrapped (ext, sizeof (ext), NULL);
res = build_codec_data_extension (GST_MAKE_FOURCC ('d', '2', '6', '3'), buf);
gst_buffer_unref (buf);
return res;
......@@ -4300,8 +4304,8 @@ build_gama_atom (gdouble gamma)
/* convert to uint32 from fixed point */
gamma_fp = (guint32) 65536 *gamma;
buf = gst_buffer_new_and_alloc (4);
GST_WRITE_UINT32_BE (GST_BUFFER_DATA (buf), gamma_fp);
gamma_fp = GUINT32_TO_BE (gamma_fp);
buf = _gst_buffer_new_wrapped (&gamma_fp, 4, NULL);
res = build_codec_data_extension (FOURCC_gama, buf);
gst_buffer_unref (buf);
return res;
......@@ -4312,14 +4316,17 @@ build_SMI_atom (const GstBuffer * seqh)
{
AtomInfo *res;
GstBuffer *buf;
gsize size;
guint8 *data;
/* the seqh plus its size and fourcc */
buf = gst_buffer_new_and_alloc (GST_BUFFER_SIZE (seqh) + 8);
size = gst_buffer_get_size ((GstBuffer *) seqh);
data = g_malloc (size + 8);
GST_WRITE_UINT32_LE (GST_BUFFER_DATA (buf), FOURCC_SEQH);
GST_WRITE_UINT32_BE (GST_BUFFER_DATA (buf) + 4, GST_BUFFER_SIZE (seqh));
memcpy (GST_BUFFER_DATA (buf) + 8, GST_BUFFER_DATA (seqh),
GST_BUFFER_SIZE (seqh));
GST_WRITE_UINT32_LE (data, FOURCC_SEQH);
GST_WRITE_UINT32_BE (data + 4, size + 8);
gst_buffer_extract ((GstBuffer *) seqh, 0, data + 8, size);
buf = _gst_buffer_new_wrapped (data, size + 8, g_free);
res = build_codec_data_extension (FOURCC_SMI_, buf);
gst_buffer_unref (buf);
return res;
......@@ -4341,8 +4348,7 @@ build_ima_adpcm_atom (gint channels, gint rate, gint blocksize)
within the WAVE header (below), it's little endian. */
fourcc = MS_WAVE_FOURCC (0x11);
buf = gst_buffer_new_and_alloc (ima_adpcm_atom_size);
data = GST_BUFFER_DATA (buf);
data = g_malloc (ima_adpcm_atom_size);
/* This atom's content is a WAVE header, including 2 bytes of extra data.
Note that all of this is little-endian, unlike most stuff in qt. */
......@@ -4359,6 +4365,7 @@ build_ima_adpcm_atom (gint channels, gint rate, gint blocksize)
GST_WRITE_UINT16_LE (data + 16, 2); /* Two extra bytes */
GST_WRITE_UINT16_LE (data + 18, samplesperblock);
buf = _gst_buffer_new_wrapped (data, ima_adpcm_atom_size, g_free);
atom_data = atom_data_new_from_gst_buffer (fourcc, buf);
gst_buffer_unref (buf);
......@@ -4402,6 +4409,7 @@ AtomInfo *
build_uuid_xmp_atom (GstBuffer * xmp_data)
{
AtomUUID *uuid;
gsize size;
static guint8 xmp_uuid[] = { 0xBE, 0x7A, 0xCF, 0xCB,
0x97, 0xA9, 0x42, 0xE8,
0x9C, 0x71, 0x99, 0x94,
......@@ -4414,9 +4422,10 @@ build_uuid_xmp_atom (GstBuffer * xmp_data)
uuid = atom_uuid_new ();
memcpy (uuid->uuid, xmp_uuid, 16);
uuid->data = g_malloc (GST_BUFFER_SIZE (xmp_data));
uuid->datalen = GST_BUFFER_SIZE (xmp_data);
memcpy (uuid->data, GST_BUFFER_DATA (xmp_data), GST_BUFFER_SIZE (xmp_data));
size = gst_buffer_get_size (xmp_data);
uuid->data = g_malloc (size);
uuid->datalen = size;
gst_buffer_extract (xmp_data, 0, uuid->data, size);
return build_atom_info_wrapper ((Atom *) uuid, atom_uuid_copy_data,
atom_uuid_free);
......
......@@ -108,10 +108,15 @@ atoms_recov_write_ftyp_info (FILE * f, AtomFTYP * ftyp, GstBuffer * prefix)
guint64 size = 0;
if (prefix) {
if (fwrite (GST_BUFFER_DATA (prefix), 1, GST_BUFFER_SIZE (prefix), f) !=
GST_BUFFER_SIZE (prefix)) {
guint8 *bdata;
gsize bsize;
bdata = gst_buffer_map (prefix, &bsize, NULL, GST_MAP_READ);
if (fwrite (bdata, 1, bsize, f) != bsize) {
gst_buffer_unmap (prefix, bdata, bsize);
return FALSE;
}
gst_buffer_unmap (prefix, bdata, bsize);
}
if (!atom_ftyp_copy_data (ftyp, &data, &size, &offset)) {
return FALSE;
......
......@@ -89,8 +89,8 @@ enum
PROP_FAST_START_MODE
};
GST_BOILERPLATE (GstQTMoovRecover, gst_qt_moov_recover, GstPipeline,
GST_TYPE_PIPELINE);
#define gst_qt_moov_recover_parent_class parent_class
G_DEFINE_TYPE (GstQTMoovRecover, gst_qt_moov_recover, GST_TYPE_PIPELINE);
/* property functions */
static void gst_qt_moov_recover_set_property (GObject * object,
......@@ -103,18 +103,6 @@ static GstStateChangeReturn gst_qt_moov_recover_change_state (GstElement *
static void gst_qt_moov_recover_finalize (GObject * object);
static void
gst_qt_moov_recover_base_init (gpointer g_class)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
#if 0
GstQTMoovRecoverClass *klass = (GstQTMoovRecoverClass *) g_class;
#endif
gst_element_class_set_details_simple (element_class, "QT Moov Recover",
"Util", "Recovers unfinished qtmux files",
"Thiago Santos <thiago.sousa.santos@collabora.co.uk>");
}
static void
gst_qt_moov_recover_class_init (GstQTMoovRecoverClass * klass)
{
......@@ -156,11 +144,14 @@ gst_qt_moov_recover_class_init (GstQTMoovRecoverClass * klass)
GST_DEBUG_CATEGORY_INIT (gst_qt_moov_recover_debug, "qtmoovrecover", 0,
"QT Moovie Recover");
gst_element_class_set_details_simple (gstelement_class, "QT Moov Recover",
"Util", "Recovers unfinished qtmux files",
"Thiago Santos <thiago.sousa.santos@collabora.co.uk>");
}
static void
gst_qt_moov_recover_init (GstQTMoovRecover * qtmr,
GstQTMoovRecoverClass * qtmr_klass)
gst_qt_moov_recover_init (GstQTMoovRecover * qtmr)
{
}
......
This diff is collapsed.
......@@ -125,6 +125,7 @@ struct _GstQTPad
/* if nothing is set, it won't be called */
GstQTPadPrepareBufferFunc prepare_buf_func;
gboolean (*set_caps) (GstPad * pad, GstCaps * caps);
};
typedef enum _GstQTMuxState
......
......@@ -153,10 +153,8 @@ GstQTMuxFormatProp gst_qt_mux_format_list[] = {
"GstQTMux",
GST_STATIC_CAPS ("video/quicktime, variant = (string) apple; "
"video/quicktime"),
GST_STATIC_CAPS ("video/x-raw-rgb, "
COMMON_VIDEO_CAPS "; "
"video/x-raw-yuv, "
"format = (fourcc) UYVY, "
GST_STATIC_CAPS ("video/x-raw, "
"format = (string) { RGB, UYVY }, "
COMMON_VIDEO_CAPS "; "
MPEG4V_CAPS "; "
H263_CAPS "; "
......@@ -361,12 +359,18 @@ gst_qt_mux_map_format_to_header (GstQTMuxFormat format, GstBuffer ** _prefix,
break;
}
case GST_QT_MUX_FORMAT_MJ2:
{
guint8 *bdata;
major = FOURCC_mjp2;
comp = mjp2_brands;
version = 0;
prefix = gst_buffer_new_and_alloc (sizeof (mjp2_prefix));
memcpy (GST_BUFFER_DATA (prefix), mjp2_prefix, GST_BUFFER_SIZE (prefix));
bdata = gst_buffer_map (prefix, NULL, NULL, GST_MAP_WRITE);
memcpy (bdata, mjp2_prefix, sizeof (mjp2_prefix));
gst_buffer_unmap (prefix, bdata, -1);
break;
}
default:
g_assert_not_reached ();
break;
......
......@@ -91,8 +91,8 @@ GST_STATIC_PAD_TEMPLATE ("sink",
"encoding-name = (string) { \"X-QT\", \"X-QUICKTIME\" }")
);
GST_BOILERPLATE (GstRtpXQTDepay, gst_rtp_xqt_depay, GstBaseRTPDepayload,
GST_TYPE_BASE_RTP_DEPAYLOAD);
#define gst_rtp_xqt_depay_parent_class parent_class
G_DEFINE_TYPE (GstRtpXQTDepay, gst_rtp_xqt_depay, GST_TYPE_BASE_RTP_DEPAYLOAD);
static void gst_rtp_xqt_depay_finalize (GObject * object);
......@@ -104,21 +104,6 @@ static GstBuffer *gst_rtp_xqt_depay_process (GstBaseRTPDepayload * depayload,
static GstStateChangeReturn gst_rtp_xqt_depay_change_state (GstElement *
element, GstStateChange transition);
static void
gst_rtp_xqt_depay_base_init (gpointer klass)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_rtp_xqt_depay_src_template));
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_rtp_xqt_depay_sink_template));
gst_element_class_set_details_simple (element_class, "RTP packet depayloader",
"Codec/Depayloader/Network",
"Extracts Quicktime audio/video from RTP packets",
"Wim Taymans <wim@fluendo.com>");
}
static void
gst_rtp_xqt_depay_class_init (GstRtpXQTDepayClass * klass)
......@@ -142,11 +127,20 @@ gst_rtp_xqt_depay_class_init (GstRtpXQTDepayClass * klass)
GST_DEBUG_CATEGORY_INIT (rtpxqtdepay_debug, "rtpxqtdepay", 0,
"QT Media RTP Depayloader");
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&gst_rtp_xqt_depay_src_template));
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&gst_rtp_xqt_depay_sink_template));
gst_element_class_set_details_simple (gstelement_class,
"RTP packet depayloader", "Codec/Depayloader/Network",
"Extracts Quicktime audio/video from RTP packets",
"Wim Taymans <wim@fluendo.com>");
}
static void
gst_rtp_xqt_depay_init (GstRtpXQTDepay * rtpxqtdepay,
GstRtpXQTDepayClass * klass)
gst_rtp_xqt_depay_init (GstRtpXQTDepay * rtpxqtdepay)
{
rtpxqtdepay->adapter = gst_adapter_new ();
}
......@@ -201,6 +195,7 @@ gst_rtp_quicktime_parse_sd (GstRtpXQTDepay * rtpxqtdepay, guint8 * data,
GstBuffer *buf;
gint size;
GstCaps *caps;
guint8 *bdata;
GST_DEBUG_OBJECT (rtpxqtdepay, "found avcC codec_data in sd, %u",
chlen);
......@@ -212,7 +207,9 @@ gst_rtp_quicktime_parse_sd (GstRtpXQTDepay * rtpxqtdepay, guint8 * data,
size = len - 8;
buf = gst_buffer_new_and_alloc (size);
memcpy (GST_BUFFER_DATA (buf), data + 8, size);
bdata = gst_buffer_map (buf, NULL, NULL, GST_MAP_WRITE);
memcpy (bdata, data + 8, size);
gst_buffer_unmap (buf, bdata, -1);
caps = gst_caps_new_simple ("video/x-h264",
"codec_data", GST_TYPE_BUFFER, buf, NULL);
gst_buffer_unref (buf);
......@@ -255,11 +252,14 @@ static GstBuffer *
gst_rtp_xqt_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
{
GstRtpXQTDepay *rtpxqtdepay;
GstBuffer *outbuf;
GstBuffer *outbuf = NULL;
gboolean m;
GstRTPBuffer rtp;
rtpxqtdepay = GST_RTP_XQT_DEPAY (depayload);
gst_rtp_buffer_map (buf, GST_MAP_READ, &rtp);
if (!gst_rtp_buffer_validate (buf))
goto bad_packet;
......@@ -270,7 +270,7 @@ gst_rtp_xqt_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
GST_DEBUG_OBJECT (rtpxqtdepay, "we need resync");
}
m = gst_rtp_buffer_get_marker (buf);
m = gst_rtp_buffer_get_marker (&rtp);
GST_LOG_OBJECT (rtpxqtdepay, "marker: %d", m);
{
......@@ -279,9 +279,11 @@ gst_rtp_xqt_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
guint8 *payload;
guint8 ver, pck;
gboolean s, q, l, d;
guint8 *bdata;
gsize bsize;
payload_len = gst_rtp_buffer_get_payload_len (buf);
payload = gst_rtp_buffer_get_payload (buf);
payload_len = gst_rtp_buffer_get_payload_len (&rtp);
payload = gst_rtp_buffer_get_payload (&rtp);
/* 1 2 3
* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
......@@ -545,8 +547,11 @@ gst_rtp_xqt_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
{
/* multiple samples per packet. */
outbuf = gst_buffer_new_and_alloc (payload_len);
memcpy (GST_BUFFER_DATA (outbuf), payload, payload_len);
return outbuf;
bdata = gst_buffer_map (outbuf, &bsize, NULL, GST_MAP_WRITE);
memcpy (bdata, payload, payload_len);
gst_buffer_unmap (outbuf, bdata, bsize);
goto done;
}
case 2:
{
......@@ -586,7 +591,9 @@ gst_rtp_xqt_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
slen = payload_len;
outbuf = gst_buffer_new_and_alloc (slen);
memcpy (GST_BUFFER_DATA (outbuf), payload, slen);
bdata = gst_buffer_map (outbuf, &bsize, NULL, GST_MAP_WRITE);
memcpy (bdata, payload, slen);
gst_buffer_unmap (outbuf, bdata, bsize);
if (!s)
GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_DELTA_UNIT);
......@@ -604,7 +611,9 @@ gst_rtp_xqt_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
{
/* one sample per packet, use adapter to combine based on marker bit. */
outbuf = gst_buffer_new_and_alloc (payload_len);
memcpy (GST_BUFFER_DATA (outbuf), payload, payload_len);
bdata = gst_buffer_map (outbuf, &bsize, NULL, GST_MAP_WRITE);
memcpy (bdata, payload, payload_len);
gst_buffer_unmap (outbuf, bdata, bsize);
gst_adapter_push (rtpxqtdepay->adapter, outbuf);
......@@ -617,48 +626,49 @@ gst_rtp_xqt_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
GST_DEBUG_OBJECT (rtpxqtdepay,
"gst_rtp_xqt_depay_chain: pushing buffer of size %u", avail);
return outbuf;
goto done;
}
}
}
done:
return NULL;
gst_rtp_buffer_unmap (&rtp);
return outbuf;
bad_packet:
{
GST_ELEMENT_WARNING (rtpxqtdepay, STREAM, DECODE,
("Packet did not validate."), (NULL));
return NULL;
goto done;
}
need_resync:
{
GST_DEBUG_OBJECT (rtpxqtdepay, "waiting for marker");
return NULL;
goto done;
}
wrong_version:
{
GST_ELEMENT_WARNING (rtpxqtdepay, STREAM, DECODE,
("Unknown payload version."), (NULL));
return NULL;
goto done;
}
pck_reserved:
{
GST_ELEMENT_WARNING (rtpxqtdepay, STREAM, DECODE,
("PCK reserved 0."), (NULL));
return NULL;
goto done;
}
wrong_length:
{
GST_ELEMENT_WARNING (rtpxqtdepay, STREAM, DECODE,
("Wrong payload length."), (NULL));
return NULL;
goto done;
}
unknown_format:
{
GST_ELEMENT_WARNING (rtpxqtdepay, STREAM, DECODE,
("Unknown payload format."), (NULL));
return NULL;
goto done;
}
}
......
This diff is collapsed.
......@@ -100,7 +100,6 @@ struct _GstQTDemux {
/* configured playback region */
GstSegment segment;
gboolean segment_running;
GstEvent *pending_newsegment;
/* gst index support */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment