diff options
author | Thomas Vander Stichele <thomas@apestaart.org> | 2002-11-01 21:41:28 +0000 |
---|---|---|
committer | Thomas Vander Stichele <thomas@apestaart.org> | 2002-11-01 21:41:28 +0000 |
commit | ad67a1081dbfac7ef538c07cea8b6fc198646ddc (patch) | |
tree | f8d458717fa49a8b3b84d28f6d2385e6aa1fa7b7 /ext/snapshot | |
parent | 91b12107f6a134009995f01e0e923c24c7f5bd82 (diff) | |
download | gst-plugins-bad-ad67a1081dbfac7ef538c07cea8b6fc198646ddc.tar.gz gst-plugins-bad-ad67a1081dbfac7ef538c07cea8b6fc198646ddc.tar.bz2 gst-plugins-bad-ad67a1081dbfac7ef538c07cea8b6fc198646ddc.zip |
backmerge
Original commit message from CVS:
backmerge
Diffstat (limited to 'ext/snapshot')
-rw-r--r-- | ext/snapshot/gstsnapshot.c | 44 | ||||
-rw-r--r-- | ext/snapshot/gstsnapshot.h | 12 |
2 files changed, 28 insertions, 28 deletions
diff --git a/ext/snapshot/gstsnapshot.c b/ext/snapshot/gstsnapshot.c index 3b4d0528..712e04f5 100644 --- a/ext/snapshot/gstsnapshot.c +++ b/ext/snapshot/gstsnapshot.c @@ -68,7 +68,7 @@ GST_PAD_TEMPLATE_FACTORY (snapshot_sink_factory, ) -/* Shot signals and args */ +/* Snapshot signals and args */ enum { /* FILL ME */ SNAPSHOT_SIGNAL, @@ -82,8 +82,8 @@ enum { }; static GType gst_snapshot_get_type (void); -static void gst_snapshot_class_init (GstShotClass *klass); -static void gst_snapshot_init (GstShot *snapshot); +static void gst_snapshot_class_init (GstSnapshotClass *klass); +static void gst_snapshot_init (GstSnapshot *snapshot); static void gst_snapshot_chain (GstPad *pad, GstBuffer *buf); @@ -113,20 +113,20 @@ gst_snapshot_get_type (void) if (!snapshot_type) { static const GTypeInfo snapshot_info = { - sizeof(GstShotClass), NULL, NULL, (GClassInitFunc)gst_snapshot_class_init, + sizeof(GstSnapshotClass), NULL, NULL, (GClassInitFunc)gst_snapshot_class_init, NULL, NULL, - sizeof(GstShot), + sizeof(GstSnapshot), 0, (GInstanceInitFunc)gst_snapshot_init, }; - snapshot_type = g_type_register_static(GST_TYPE_ELEMENT, "GstShot", &snapshot_info, 0); + snapshot_type = g_type_register_static(GST_TYPE_ELEMENT, "GstSnapshot", &snapshot_info, 0); } return snapshot_type; } static void -gst_snapshot_class_init (GstShotClass *klass) +gst_snapshot_class_init (GstSnapshotClass *klass) { GObjectClass *gobject_class; GstElementClass *gstelement_class; @@ -145,7 +145,7 @@ gst_snapshot_class_init (GstShotClass *klass) gst_snapshot_signals[SNAPSHOT_SIGNAL] = g_signal_new("snapshot", G_TYPE_FROM_CLASS(klass), - G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(GstShotClass, snapshot), + G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(GstSnapshotClass, snapshot), NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); klass->snapshot = snapshot_handler; @@ -157,7 +157,7 @@ gst_snapshot_class_init (GstShotClass *klass) static void snapshot_handler(GstElement *element) { - GstShot *snapshot; + GstSnapshot *snapshot; snapshot = GST_SNAPSHOT( element ); snapshot->snapshot_asked=TRUE; @@ -167,7 +167,7 @@ snapshot_handler(GstElement *element) static gboolean gst_snapshot_sinkconnect (GstPad *pad, GstCaps *caps) { - GstShot *filter; + GstSnapshot *filter; GstCaps *from_caps, *to_caps; filter = GST_SNAPSHOT (gst_pad_get_parent (pad)); @@ -187,9 +187,9 @@ gst_snapshot_sinkconnect (GstPad *pad, GstCaps *caps) "format", GST_PROPS_FOURCC (GST_STR_FOURCC ("RGB ")), "width", GST_PROPS_INT( filter->width ), "height", GST_PROPS_INT( filter->height ), - "red_mask", GST_PROPS_INT (0xFF0000), + "red_mask", GST_PROPS_INT (0x0000FF), "green_mask", GST_PROPS_INT (0x00FF00), - "blue_mask", GST_PROPS_INT (0x0000FF), + "blue_mask", GST_PROPS_INT (0xFF0000), "bpp", GST_PROPS_INT( 24 ) ); @@ -202,11 +202,7 @@ gst_snapshot_sinkconnect (GstPad *pad, GstCaps *caps) "video/raw", "format", GST_PROPS_FOURCC (GST_STR_FOURCC ("I420")), "width", GST_PROPS_INT( filter->width ), - "height", GST_PROPS_INT( filter->height ), - "red_mask", GST_PROPS_INT (0xFF0000), - "green_mask", GST_PROPS_INT (0x00FF00), - "blue_mask", GST_PROPS_INT (0x0000FF), - "bpp", GST_PROPS_INT( 24 ) + "height", GST_PROPS_INT( filter->height ) ); filter->converter = gst_colorspace_yuv2rgb_get_converter ( from_caps, to_caps ); @@ -231,7 +227,7 @@ gst_snapshot_sinkconnect (GstPad *pad, GstCaps *caps) } static void -gst_snapshot_init (GstShot *snapshot) +gst_snapshot_init (GstSnapshot *snapshot) { snapshot->sinkpad = gst_pad_new_from_template (GST_PAD_TEMPLATE_GET (snapshot_sink_factory), "sink"); gst_pad_set_connect_function (snapshot->sinkpad, gst_snapshot_sinkconnect); @@ -250,7 +246,7 @@ gst_snapshot_init (GstShot *snapshot) static void gst_snapshot_chain (GstPad *pad, GstBuffer *buf) { - GstShot *snapshot; + GstSnapshot *snapshot; guchar *data, *data_to_convert, *buffer_i420, *data_converted; gulong size,image_size; GstBuffer *outbuf; @@ -292,7 +288,7 @@ gst_snapshot_chain (GstPad *pad, GstBuffer *buf) gst_colorspace_convert (snapshot->converter, data_to_convert, data_converted); - GST_INFO(0,"dumpfile : %s\n", snapshot->location ); + GST_INFO (0,"dumpfile : %s\n", snapshot->location ); fp = fopen( snapshot->location, "wb" ); if ( fp == NULL ) g_warning(" Can not open %s\n", snapshot->location ); @@ -322,6 +318,10 @@ gst_snapshot_chain (GstPad *pad, GstBuffer *buf) png_destroy_info_struct ( snapshot->png_struct_ptr, &snapshot->png_info_ptr ); png_destroy_write_struct( &snapshot->png_struct_ptr, (png_infopp)NULL ); fclose( fp ); + g_signal_emit (G_OBJECT (snapshot), + gst_snapshot_signals[SNAPSHOT_SIGNAL], 0); + + } } @@ -331,7 +331,7 @@ gst_snapshot_chain (GstPad *pad, GstBuffer *buf) static void gst_snapshot_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { - GstShot *snapshot; + GstSnapshot *snapshot; g_return_if_fail(GST_IS_SNAPSHOT(object)); snapshot = GST_SNAPSHOT(object); @@ -351,7 +351,7 @@ gst_snapshot_set_property (GObject *object, guint prop_id, const GValue *value, static void gst_snapshot_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { - GstShot *snapshot; + GstSnapshot *snapshot; g_return_if_fail(GST_IS_SNAPSHOT(object)); snapshot = GST_SNAPSHOT(object); diff --git a/ext/snapshot/gstsnapshot.h b/ext/snapshot/gstsnapshot.h index d0d7221c..c391beb3 100644 --- a/ext/snapshot/gstsnapshot.h +++ b/ext/snapshot/gstsnapshot.h @@ -38,18 +38,18 @@ extern "C" { #define GST_TYPE_SNAPSHOT \ (gst_snapshot_get_type()) #define GST_SNAPSHOT(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_SNAPSHOT,GstShot)) + (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_SNAPSHOT,GstSnapshot)) #define GST_SNAPSHOT_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_SNAPSHOT,GstShot)) + (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_SNAPSHOT,GstSnapshot)) #define GST_IS_SNAPSHOT(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_SNAPSHOT)) #define GST_IS_SNAPSHOT_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SNAPSHOT)) -typedef struct _GstShot GstShot; -typedef struct _GstShotClass GstShotClass; +typedef struct _GstSnapshot GstSnapshot; +typedef struct _GstSnapshotClass GstSnapshotClass; -struct _GstShot { +struct _GstSnapshot { GstElement element; guint32 format; @@ -69,7 +69,7 @@ struct _GstShot { GstPad *sinkpad,*srcpad; }; -struct _GstShotClass { +struct _GstSnapshotClass { GstElementClass parent_class; void (*snapshot) (GstElement *elem); |