diff options
Diffstat (limited to 'gst/rtjpeg/gstrtjpegenc.c')
-rw-r--r-- | gst/rtjpeg/gstrtjpegenc.c | 65 |
1 files changed, 35 insertions, 30 deletions
diff --git a/gst/rtjpeg/gstrtjpegenc.c b/gst/rtjpeg/gstrtjpegenc.c index d562471a..14d7df1f 100644 --- a/gst/rtjpeg/gstrtjpegenc.c +++ b/gst/rtjpeg/gstrtjpegenc.c @@ -32,24 +32,27 @@ GstElementDetails gst_rtjpegenc_details = { }; /* GstRTJpegEnc signals and args */ -enum { +enum +{ /* FILL ME */ LAST_SIGNAL }; -enum { +enum +{ ARG_0, ARG_QUALITY, }; -static void gst_rtjpegenc_class_init (GstRTJpegEncClass *klass); -static void gst_rtjpegenc_base_init (GstRTJpegEncClass *klass); -static void gst_rtjpegenc_init (GstRTJpegEnc *rtjpegenc); +static void gst_rtjpegenc_class_init (GstRTJpegEncClass * klass); +static void gst_rtjpegenc_base_init (GstRTJpegEncClass * klass); +static void gst_rtjpegenc_init (GstRTJpegEnc * rtjpegenc); -static void gst_rtjpegenc_chain (GstPad *pad, GstData *_data); +static void gst_rtjpegenc_chain (GstPad * pad, GstData * _data); static GstElementClass *parent_class = NULL; + /*static guint gst_rtjpegenc_signals[LAST_SIGNAL] = { 0 }; */ GType @@ -59,23 +62,25 @@ gst_rtjpegenc_get_type (void) if (!rtjpegenc_type) { static const GTypeInfo rtjpegenc_info = { - sizeof(GstRTJpegEncClass), - (GBaseInitFunc)gst_rtjpegenc_base_init, + sizeof (GstRTJpegEncClass), + (GBaseInitFunc) gst_rtjpegenc_base_init, NULL, - (GClassInitFunc)gst_rtjpegenc_class_init, + (GClassInitFunc) gst_rtjpegenc_class_init, NULL, NULL, - sizeof(GstRTJpegEnc), + sizeof (GstRTJpegEnc), 0, - (GInstanceInitFunc)gst_rtjpegenc_init, + (GInstanceInitFunc) gst_rtjpegenc_init, }; - rtjpegenc_type = g_type_register_static(GST_TYPE_ELEMENT, "GstRTJpegEnc", &rtjpegenc_info, 0); + rtjpegenc_type = + g_type_register_static (GST_TYPE_ELEMENT, "GstRTJpegEnc", + &rtjpegenc_info, 0); } return rtjpegenc_type; } static void -gst_rtjpegenc_base_init (GstRTJpegEncClass *klass) +gst_rtjpegenc_base_init (GstRTJpegEncClass * klass) { GstElementClass *element_class = GST_ELEMENT_CLASS (klass); @@ -83,42 +88,42 @@ gst_rtjpegenc_base_init (GstRTJpegEncClass *klass) } static void -gst_rtjpegenc_class_init (GstRTJpegEncClass *klass) +gst_rtjpegenc_class_init (GstRTJpegEncClass * klass) { GstElementClass *gstelement_class; - gstelement_class = (GstElementClass*)klass; + gstelement_class = (GstElementClass *) klass; - parent_class = g_type_class_ref(GST_TYPE_ELEMENT); + parent_class = g_type_class_ref (GST_TYPE_ELEMENT); } static void -gst_rtjpegenc_init (GstRTJpegEnc *rtjpegenc) +gst_rtjpegenc_init (GstRTJpegEnc * rtjpegenc) { - rtjpegenc->sinkpad = gst_pad_new("sink",GST_PAD_SINK); - gst_element_add_pad(GST_ELEMENT(rtjpegenc),rtjpegenc->sinkpad); - gst_pad_set_chain_function(rtjpegenc->sinkpad,gst_rtjpegenc_chain); - rtjpegenc->srcpad = gst_pad_new("src",GST_PAD_SRC); - gst_element_add_pad(GST_ELEMENT(rtjpegenc),rtjpegenc->srcpad); + rtjpegenc->sinkpad = gst_pad_new ("sink", GST_PAD_SINK); + gst_element_add_pad (GST_ELEMENT (rtjpegenc), rtjpegenc->sinkpad); + gst_pad_set_chain_function (rtjpegenc->sinkpad, gst_rtjpegenc_chain); + rtjpegenc->srcpad = gst_pad_new ("src", GST_PAD_SRC); + gst_element_add_pad (GST_ELEMENT (rtjpegenc), rtjpegenc->srcpad); } static void -gst_rtjpegenc_chain (GstPad *pad, GstData *_data) +gst_rtjpegenc_chain (GstPad * pad, GstData * _data) { GstBuffer *buf = GST_BUFFER (_data); GstRTJpegEnc *rtjpegenc; guchar *data; gulong size; - g_return_if_fail(pad != NULL); - g_return_if_fail(GST_IS_PAD(pad)); - g_return_if_fail(buf != NULL); + g_return_if_fail (pad != NULL); + g_return_if_fail (GST_IS_PAD (pad)); + g_return_if_fail (buf != NULL); rtjpegenc = GST_RTJPEGENC (GST_OBJECT_PARENT (pad)); - data = GST_BUFFER_DATA(buf); - size = GST_BUFFER_SIZE(buf); + data = GST_BUFFER_DATA (buf); + size = GST_BUFFER_SIZE (buf); - gst_info("would be encoding frame here\n"); + gst_info ("would be encoding frame here\n"); - gst_pad_push(rtjpegenc->srcpad,GST_DATA (buf)); + gst_pad_push (rtjpegenc->srcpad, GST_DATA (buf)); } |