-/*
- * gstrtpvp8depay.c - Source for GstRtpVP8Depay
+/* gstrtpvp8depay.c - Source for GstRtpVP8Depay
* Copyright (C) 2011 Sjoerd Simons <sjoerd@luon.net>
* Copyright (C) 2011 Collabora Ltd.
* Contact: Youness Alaoui <youness.alaoui@collabora.co.uk>
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
GST_DEBUG_CATEGORY_STATIC (gst_rtp_vp8_depay_debug);
#define GST_CAT_DEFAULT gst_rtp_vp8_depay_debug
+static void gst_rtp_vp8_depay_dispose (GObject * object);
+static GstBuffer *gst_rtp_vp8_depay_process (GstRTPBaseDepayload * depayload,
+ GstBuffer * buf);
+static gboolean gst_rtp_vp8_depay_set_caps (GstRTPBaseDepayload * depayload,
+ GstCaps * caps);
+
G_DEFINE_TYPE (GstRtpVP8Depay, gst_rtp_vp8_depay, GST_TYPE_RTP_BASE_DEPAYLOAD);
static GstStaticPadTemplate gst_rtp_vp8_depay_src_template =
self->started = FALSE;
}
-static void gst_rtp_vp8_depay_dispose (GObject * object);
-static GstBuffer *gst_rtp_vp8_depay_process (GstRTPBaseDepayload * depayload,
- GstBuffer * buf);
-static gboolean gst_rtp_vp8_depay_set_caps (GstRTPBaseDepayload * depayload,
- GstCaps * caps);
-
static void
gst_rtp_vp8_depay_class_init (GstRtpVP8DepayClass * gst_rtp_vp8_depay_class)
{
#ifndef __GST_RTP_VP8_DEPAY_H__
#define __GST_RTP_VP8_DEPAY_H__
-#include <glib-object.h>
#include <gst/base/gstadapter.h>
#include <gst/rtp/gstrtpbasedepayload.h>
-G_BEGIN_DECLS typedef struct _GstRtpVP8Depay GstRtpVP8Depay;
-typedef struct _GstRtpVP8DepayClass GstRtpVP8DepayClass;
-
-struct _GstRtpVP8DepayClass
-{
- GstRTPBaseDepayloadClass parent_class;
-};
-
-struct _GstRtpVP8Depay
-{
- GstRTPBaseDepayload parent;
- GstAdapter *adapter;
- gboolean started;
-};
-
-GType gst_rtp_vp8_depay_get_type (void);
+G_BEGIN_DECLS
-/* TYPE MACROS */
#define GST_TYPE_RTP_VP8_DEPAY \
(gst_rtp_vp8_depay_get_type())
#define GST_RTP_VP8_DEPAY(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_RTP_VP8_DEPAY, \
GstRtpVP8DepayClass))
+typedef struct _GstRtpVP8Depay GstRtpVP8Depay;
+typedef struct _GstRtpVP8DepayClass GstRtpVP8DepayClass;
+
+struct _GstRtpVP8DepayClass
+{
+ GstRTPBaseDepayloadClass parent_class;
+};
+
+struct _GstRtpVP8Depay
+{
+ GstRTPBaseDepayload parent;
+ GstAdapter *adapter;
+ gboolean started;
+};
+
+GType gst_rtp_vp8_depay_get_type (void);
+
gboolean gst_rtp_vp8_depay_plugin_init (GstPlugin * plugin);
G_END_DECLS
+
#endif /* #ifndef __GST_RTP_VP8_DEPAY_H__ */
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
#include <stdio.h>
#include <stdlib.h>
#define DEFAULT_PICTURE_ID_MODE VP8_PAY_PICTURE_ID_7BITS
+static GstFlowReturn gst_rtp_vp8_pay_handle_buffer (GstRTPBasePayload * payload,
+ GstBuffer * buffer);
+static gboolean gst_rtp_vp8_pay_sink_event (GstRTPBasePayload * payload,
+ GstEvent * event);
+static gboolean gst_rtp_vp8_pay_set_caps (GstRTPBasePayload * payload,
+ GstCaps * caps);
+
G_DEFINE_TYPE (GstRtpVP8Pay, gst_rtp_vp8_pay, GST_TYPE_RTP_BASE_PAYLOAD);
static GstStaticPadTemplate gst_rtp_vp8_pay_src_template =
obj->picture_id = g_random_int_range (0, G_MAXUINT16) & 0x7FFF;
}
-static GstFlowReturn gst_rtp_vp8_pay_handle_buffer (GstRTPBasePayload * payload,
- GstBuffer * buffer);
-static gboolean gst_rtp_vp8_pay_sink_event (GstRTPBasePayload * payload,
- GstEvent * event);
-static gboolean gst_rtp_vp8_pay_set_caps (GstRTPBasePayload * payload,
- GstCaps * caps);
-
-
static void
gst_rtp_vp8_pay_class_init (GstRtpVP8PayClass * gst_rtp_vp8_pay_class)
{
}
}
-
static gsize
gst_rtp_vp8_calc_payload_len (GstRtpVP8Pay * self)
{
GstRTPBasePayload *payload = GST_RTP_BASE_PAYLOAD (self);
+
return gst_rtp_buffer_calc_payload_len (GST_RTP_BASE_PAYLOAD_MTU (payload) -
gst_rtp_vp8_calc_header_len (self), 0, 0);
}
#ifndef __GST_RTP_VP8_PAY_H__
#define __GST_RTP_VP8_PAY_H__
-#include <glib-object.h>
-#include <gst/base/gstadapter.h>
#include <gst/rtp/gstrtpbasepayload.h>
-G_BEGIN_DECLS typedef struct _GstRtpVP8Pay GstRtpVP8Pay;
+G_BEGIN_DECLS
+
+#define GST_TYPE_RTP_VP8_PAY \
+ (gst_rtp_vp8_pay_get_type())
+#define GST_RTP_VP8_PAY(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_RTP_VP8_PAY, GstRtpVP8Pay))
+#define GST_RTP_VP8_PAY_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_RTP_VP8_PAY, GstRtpVP8PayClass))
+#define GST_IS_RTP_VP8_PAY(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_RTP_VP8_PAY))
+#define GST_IS_RTP_VP8_PAY_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_RTP_VP8_PAY))
+#define GST_RTP_VP8_PAY_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_RTP_VP8_PAY, GstRtpVP8PayClass))
+
+typedef struct _GstRtpVP8Pay GstRtpVP8Pay;
typedef struct _GstRtpVP8PayClass GstRtpVP8PayClass;
typedef enum _PictureIDMode PictureIDMode;
GType gst_rtp_vp8_pay_get_type (void);
-/* TYPE MACROS */
-#define GST_TYPE_RTP_VP8_PAY \
- (gst_rtp_vp8_pay_get_type())
-#define GST_RTP_VP8_PAY(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_RTP_VP8_PAY, GstRtpVP8Pay))
-#define GST_RTP_VP8_PAY_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_RTP_VP8_PAY, GstRtpVP8PayClass))
-#define GST_IS_RTP_VP8_PAY(obj) \
- (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_RTP_VP8_PAY))
-#define GST_IS_RTP_VP8_PAY_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_RTP_VP8_PAY))
-#define GST_RTP_VP8_PAY_GET_CLASS(obj) \
- (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_RTP_VP8_PAY, GstRtpVP8PayClass))
-
gboolean gst_rtp_vp8_pay_plugin_init (GstPlugin * plugin);
G_END_DECLS
+
#endif /* #ifndef __GST_RTP_VP8_PAY_H__ */