diff --git a/gst/rtp/gstrtpvp8depay.c b/gst/rtp/gstrtpvp8depay.c index 9d7e5e6d82..2538a3d987 100644 --- a/gst/rtp/gstrtpvp8depay.c +++ b/gst/rtp/gstrtpvp8depay.c @@ -1,5 +1,4 @@ -/* - * gstrtpvp8depay.c - Source for GstRtpVP8Depay +/* gstrtpvp8depay.c - Source for GstRtpVP8Depay * Copyright (C) 2011 Sjoerd Simons * Copyright (C) 2011 Collabora Ltd. * Contact: Youness Alaoui @@ -19,7 +18,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ - #ifdef HAVE_CONFIG_H # include "config.h" #endif @@ -29,6 +27,12 @@ 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 = @@ -54,12 +58,6 @@ gst_rtp_vp8_depay_init (GstRtpVP8Depay * self) 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) { diff --git a/gst/rtp/gstrtpvp8depay.h b/gst/rtp/gstrtpvp8depay.h index 5cd5f433eb..f10b5637f0 100644 --- a/gst/rtp/gstrtpvp8depay.h +++ b/gst/rtp/gstrtpvp8depay.h @@ -20,11 +20,27 @@ #ifndef __GST_RTP_VP8_DEPAY_H__ #define __GST_RTP_VP8_DEPAY_H__ -#include #include #include -G_BEGIN_DECLS typedef struct _GstRtpVP8Depay GstRtpVP8Depay; +G_BEGIN_DECLS + +#define GST_TYPE_RTP_VP8_DEPAY \ + (gst_rtp_vp8_depay_get_type()) +#define GST_RTP_VP8_DEPAY(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_RTP_VP8_DEPAY, GstRtpVP8Depay)) +#define GST_RTP_VP8_DEPAY_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_RTP_VP8_DEPAY, \ + GstRtpVP8DepayClass)) +#define GST_IS_RTP_VP8_DEPAY(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_RTP_VP8_DEPAY)) +#define GST_IS_RTP_VP8_DEPAY_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_RTP_VP8_DEPAY)) +#define GST_RTP_VP8_DEPAY_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_RTP_VP8_DEPAY, \ + GstRtpVP8DepayClass)) + +typedef struct _GstRtpVP8Depay GstRtpVP8Depay; typedef struct _GstRtpVP8DepayClass GstRtpVP8DepayClass; struct _GstRtpVP8DepayClass @@ -41,23 +57,8 @@ struct _GstRtpVP8Depay GType gst_rtp_vp8_depay_get_type (void); -/* TYPE MACROS */ -#define GST_TYPE_RTP_VP8_DEPAY \ - (gst_rtp_vp8_depay_get_type()) -#define GST_RTP_VP8_DEPAY(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_RTP_VP8_DEPAY, GstRtpVP8Depay)) -#define GST_RTP_VP8_DEPAY_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_RTP_VP8_DEPAY, \ - GstRtpVP8DepayClass)) -#define GST_IS_RTP_VP8_DEPAY(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_RTP_VP8_DEPAY)) -#define GST_IS_RTP_VP8_DEPAY_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_RTP_VP8_DEPAY)) -#define GST_RTP_VP8_DEPAY_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_RTP_VP8_DEPAY, \ - GstRtpVP8DepayClass)) - gboolean gst_rtp_vp8_depay_plugin_init (GstPlugin * plugin); G_END_DECLS + #endif /* #ifndef __GST_RTP_VP8_DEPAY_H__ */ diff --git a/gst/rtp/gstrtpvp8pay.c b/gst/rtp/gstrtpvp8pay.c index 29d41c28b3..988d55da32 100644 --- a/gst/rtp/gstrtpvp8pay.c +++ b/gst/rtp/gstrtpvp8pay.c @@ -19,6 +19,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif #include #include @@ -35,6 +38,13 @@ GST_DEBUG_CATEGORY_STATIC (gst_rtp_vp8_pay_debug); #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 = @@ -62,14 +72,6 @@ gst_rtp_vp8_pay_init (GstRtpVP8Pay * obj) 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) { @@ -297,11 +299,11 @@ gst_rtp_vp8_calc_header_len (GstRtpVP8Pay * self) } } - 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); } diff --git a/gst/rtp/gstrtpvp8pay.h b/gst/rtp/gstrtpvp8pay.h index 2715a9ef30..2472060671 100644 --- a/gst/rtp/gstrtpvp8pay.h +++ b/gst/rtp/gstrtpvp8pay.h @@ -20,11 +20,24 @@ #ifndef __GST_RTP_VP8_PAY_H__ #define __GST_RTP_VP8_PAY_H__ -#include -#include #include -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; @@ -54,21 +67,8 @@ struct _GstRtpVP8Pay 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__ */