#define gst_rtp_jpeg_depay_parent_class parent_class
G_DEFINE_TYPE (GstRtpJPEGDepay, gst_rtp_jpeg_depay,
- GST_TYPE_BASE_RTP_DEPAYLOAD);
+ GST_TYPE_RTP_BASE_DEPAYLOAD);
static void gst_rtp_jpeg_depay_finalize (GObject * object);
static GstStateChangeReturn gst_rtp_jpeg_depay_change_state (GstElement *
element, GstStateChange transition);
-static gboolean gst_rtp_jpeg_depay_setcaps (GstBaseRTPDepayload * depayload,
+static gboolean gst_rtp_jpeg_depay_setcaps (GstRTPBaseDepayload * depayload,
GstCaps * caps);
-static GstBuffer *gst_rtp_jpeg_depay_process (GstBaseRTPDepayload * depayload,
+static GstBuffer *gst_rtp_jpeg_depay_process (GstRTPBaseDepayload * depayload,
GstBuffer * buf);
static void
{
GObjectClass *gobject_class;
GstElementClass *gstelement_class;
- GstBaseRTPDepayloadClass *gstbasertpdepayload_class;
+ GstRTPBaseDepayloadClass *gstrtpbasedepayload_class;
gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass;
- gstbasertpdepayload_class = (GstBaseRTPDepayloadClass *) klass;
+ gstrtpbasedepayload_class = (GstRTPBaseDepayloadClass *) klass;
gobject_class->finalize = gst_rtp_jpeg_depay_finalize;
gstelement_class->change_state = gst_rtp_jpeg_depay_change_state;
- gstbasertpdepayload_class->set_caps = gst_rtp_jpeg_depay_setcaps;
- gstbasertpdepayload_class->process = gst_rtp_jpeg_depay_process;
+ gstrtpbasedepayload_class->set_caps = gst_rtp_jpeg_depay_setcaps;
+ gstrtpbasedepayload_class->process = gst_rtp_jpeg_depay_process;
GST_DEBUG_CATEGORY_INIT (rtpjpegdepay_debug, "rtpjpegdepay", 0,
"JPEG Video RTP Depayloader");
};
static gboolean
-gst_rtp_jpeg_depay_setcaps (GstBaseRTPDepayload * depayload, GstCaps * caps)
+gst_rtp_jpeg_depay_setcaps (GstRTPBaseDepayload * depayload, GstCaps * caps)
{
GstRtpJPEGDepay *rtpjpegdepay;
GstStructure *structure;
}
static GstBuffer *
-gst_rtp_jpeg_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
+gst_rtp_jpeg_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
{
GstRtpJPEGDepay *rtpjpegdepay;
GstBuffer *outbuf;
guint type, width, height;
guint16 dri, precision, length;
guint8 *qtable;
- GstRTPBuffer rtp;
+ GstRTPBuffer rtp = { NULL };
rtpjpegdepay = GST_RTP_JPEG_DEPAY (depayload);
}
if (frag_offset == 0) {
+ GstMapInfo map;
guint size;
- guint8 *data;
if (rtpjpegdepay->width != width || rtpjpegdepay->height != height) {
GstCaps *outcaps;
}
/* max header length, should be big enough */
outbuf = gst_buffer_new_and_alloc (1000);
- data = gst_buffer_map (outbuf, NULL, NULL, GST_MAP_WRITE);
- size = MakeHeaders (data, type, width, height, qtable, precision, dri);
- gst_buffer_unmap (outbuf, data, size);
+ gst_buffer_map (outbuf, &map, GST_MAP_WRITE);
+ size = MakeHeaders (map.data, type, width, height, qtable, precision, dri);
+ gst_buffer_unmap (outbuf, &map);
+ gst_buffer_resize (outbuf, 0, size);
- GST_DEBUG_OBJECT (rtpjpegdepay,
- "pushing %" G_GSIZE_FORMAT " bytes of header", size);
+ GST_DEBUG_OBJECT (rtpjpegdepay, "pushing %u bytes of header", size);
gst_adapter_push (rtpjpegdepay->adapter, outbuf);
}
if (gst_rtp_buffer_get_marker (&rtp)) {
guint avail;
guint8 end[2];
- guint8 *data;
+ GstMapInfo map;
/* last buffer take all data out of the adapter */
avail = gst_adapter_available (rtpjpegdepay->adapter);
/* no EOI marker, add one */
outbuf = gst_buffer_new_and_alloc (2);
- data = gst_buffer_map (outbuf, NULL, NULL, GST_MAP_WRITE);
- data[0] = 0xff;
- data[1] = 0xd9;
- gst_buffer_unmap (outbuf, data, -1);
+ gst_buffer_map (outbuf, &map, GST_MAP_WRITE);
+ map.data[0] = 0xff;
+ map.data[1] = 0xd9;
+ gst_buffer_unmap (outbuf, &map);
gst_adapter_push (rtpjpegdepay->adapter, outbuf);
avail += 2;