summaryrefslogtreecommitdiffstats
path: root/gst-libs/gst/video
diff options
context:
space:
mode:
authorThomas Vander Stichele <thomas@apestaart.org>2004-03-14 22:34:33 +0000
committerThomas Vander Stichele <thomas@apestaart.org>2004-03-14 22:34:33 +0000
commit7a778ee4b7ec09a1f5b2185c9cceee3910dfbdf2 (patch)
treef863b467dea9559a6ec9c48affbfae11f8104164 /gst-libs/gst/video
parenta19db4bbdc4a15ea0d8f4d28e9a1302c9c3d1657 (diff)
downloadgst-plugins-bad-7a778ee4b7ec09a1f5b2185c9cceee3910dfbdf2.tar.gz
gst-plugins-bad-7a778ee4b7ec09a1f5b2185c9cceee3910dfbdf2.tar.bz2
gst-plugins-bad-7a778ee4b7ec09a1f5b2185c9cceee3910dfbdf2.zip
gst-indent
Original commit message from CVS: gst-indent
Diffstat (limited to 'gst-libs/gst/video')
-rw-r--r--gst-libs/gst/video/gstvideosink.c48
-rw-r--r--gst-libs/gst/video/video.c47
-rw-r--r--gst-libs/gst/video/video.h24
-rw-r--r--gst-libs/gst/video/videosink.h63
4 files changed, 83 insertions, 99 deletions
diff --git a/gst-libs/gst/video/gstvideosink.c b/gst-libs/gst/video/gstvideosink.c
index 15f27c16..2acf7e57 100644
--- a/gst-libs/gst/video/gstvideosink.c
+++ b/gst-libs/gst/video/gstvideosink.c
@@ -29,19 +29,19 @@ static GstElementClass *parent_class = NULL;
/* Private methods */
static void
-gst_videosink_set_clock (GstElement *element, GstClock *clock)
+gst_videosink_set_clock (GstElement * element, GstClock * clock)
{
GstVideoSink *videosink;
videosink = GST_VIDEOSINK (element);
-
+
videosink->clock = clock;
}
/* Initing stuff */
static void
-gst_videosink_init (GstVideoSink *videosink)
+gst_videosink_init (GstVideoSink * videosink)
{
videosink->width = 0;
videosink->height = 0;
@@ -49,13 +49,13 @@ gst_videosink_init (GstVideoSink *videosink)
}
static void
-gst_videosink_class_init (GstVideoSinkClass *klass)
+gst_videosink_class_init (GstVideoSinkClass * klass)
{
GObjectClass *gobject_class;
GstElementClass *gstelement_class;
- gobject_class = (GObjectClass*)klass;
- gstelement_class = (GstElementClass*)klass;
+ gobject_class = (GObjectClass *) klass;
+ gstelement_class = (GstElementClass *) klass;
parent_class = g_type_class_ref (GST_TYPE_ELEMENT);
@@ -69,24 +69,22 @@ gst_videosink_get_type (void)
{
static GType videosink_type = 0;
- if (!videosink_type)
- {
- static const GTypeInfo videosink_info = {
- sizeof (GstVideoSinkClass),
- NULL,
- NULL,
- (GClassInitFunc) gst_videosink_class_init,
- NULL,
- NULL,
- sizeof (GstVideoSink),
- 0,
- (GInstanceInitFunc) gst_videosink_init,
- };
-
- videosink_type = g_type_register_static (GST_TYPE_ELEMENT,
- "GstVideoSink",
- &videosink_info, 0);
- }
-
+ if (!videosink_type) {
+ static const GTypeInfo videosink_info = {
+ sizeof (GstVideoSinkClass),
+ NULL,
+ NULL,
+ (GClassInitFunc) gst_videosink_class_init,
+ NULL,
+ NULL,
+ sizeof (GstVideoSink),
+ 0,
+ (GInstanceInitFunc) gst_videosink_init,
+ };
+
+ videosink_type = g_type_register_static (GST_TYPE_ELEMENT,
+ "GstVideoSink", &videosink_info, 0);
+ }
+
return videosink_type;
}
diff --git a/gst-libs/gst/video/video.c b/gst-libs/gst/video/video.c
index 114b4bac..8fed1e76 100644
--- a/gst-libs/gst/video/video.c
+++ b/gst-libs/gst/video/video.c
@@ -27,7 +27,7 @@
/* This is simply a convenience function, nothing more or less */
gdouble
-gst_video_frame_rate (GstPad *pad)
+gst_video_frame_rate (GstPad * pad)
{
gdouble fps = 0.;
const GstCaps *caps = NULL;
@@ -37,30 +37,25 @@ gst_video_frame_rate (GstPad *pad)
caps = GST_PAD_CAPS (pad);
if (caps == NULL) {
g_warning ("gstvideo: failed to get caps of pad %s:%s",
- GST_ELEMENT_NAME (gst_pad_get_parent (pad)),
- GST_PAD_NAME(pad));
+ GST_ELEMENT_NAME (gst_pad_get_parent (pad)), GST_PAD_NAME (pad));
return 0.;
}
structure = gst_caps_get_structure (caps, 0);
- if (!gst_structure_get_double (structure, "framerate", &fps)){
+ if (!gst_structure_get_double (structure, "framerate", &fps)) {
g_warning ("gstvideo: failed to get framerate property of pad %s:%s",
- GST_ELEMENT_NAME (gst_pad_get_parent (pad)),
- GST_PAD_NAME (pad));
+ GST_ELEMENT_NAME (gst_pad_get_parent (pad)), GST_PAD_NAME (pad));
return 0.;
}
GST_DEBUG ("Framerate request on pad %s:%s: %f",
- GST_ELEMENT_NAME (gst_pad_get_parent (pad)),
- GST_PAD_NAME(pad), fps);
+ GST_ELEMENT_NAME (gst_pad_get_parent (pad)), GST_PAD_NAME (pad), fps);
return fps;
}
gboolean
-gst_video_get_size (GstPad *pad,
- gint *width,
- gint *height)
+gst_video_get_size (GstPad * pad, gint * width, gint * height)
{
const GstCaps *caps = NULL;
GstStructure *structure;
@@ -74,8 +69,7 @@ gst_video_get_size (GstPad *pad,
if (caps == NULL) {
g_warning ("gstvideo: failed to get caps of pad %s:%s",
- GST_ELEMENT_NAME (gst_pad_get_parent (pad)),
- GST_PAD_NAME(pad));
+ GST_ELEMENT_NAME (gst_pad_get_parent (pad)), GST_PAD_NAME (pad));
return FALSE;
}
@@ -85,34 +79,25 @@ gst_video_get_size (GstPad *pad,
if (!ret) {
g_warning ("gstvideo: failed to get size properties on pad %s:%s",
- GST_ELEMENT_NAME (gst_pad_get_parent (pad)),
- GST_PAD_NAME(pad));
+ GST_ELEMENT_NAME (gst_pad_get_parent (pad)), GST_PAD_NAME (pad));
return FALSE;
}
GST_DEBUG ("size request on pad %s:%s: %dx%d",
- GST_ELEMENT_NAME (gst_pad_get_parent (pad)),
- GST_PAD_NAME (pad),
- width ? *width : -1,
- height ? *height : -1);
+ GST_ELEMENT_NAME (gst_pad_get_parent (pad)),
+ GST_PAD_NAME (pad), width ? *width : -1, height ? *height : -1);
return TRUE;
}
static gboolean
-plugin_init (GstPlugin *plugin)
+plugin_init (GstPlugin * plugin)
{
return TRUE;
}
-GST_PLUGIN_DEFINE (
- GST_VERSION_MAJOR,
- GST_VERSION_MINOR,
- "gstvideo",
- "Convenience routines for video plugins",
- plugin_init,
- VERSION,
- GST_LICENSE,
- GST_PACKAGE,
- GST_ORIGIN
-)
+GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
+ GST_VERSION_MINOR,
+ "gstvideo",
+ "Convenience routines for video plugins",
+ plugin_init, VERSION, GST_LICENSE, GST_PACKAGE, GST_ORIGIN)
diff --git a/gst-libs/gst/video/video.h b/gst-libs/gst/video/video.h
index cb8727a9..5ebe444f 100644
--- a/gst-libs/gst/video/video.h
+++ b/gst-libs/gst/video/video.h
@@ -98,31 +98,31 @@
#define GST_VIDEO_CAPS_RGBx \
__GST_VIDEO_CAPS_MAKE_32 (1, 2, 3)
-
+
#define GST_VIDEO_CAPS_xRGB \
__GST_VIDEO_CAPS_MAKE_32 (2, 3, 4)
-
+
#define GST_VIDEO_CAPS_BGRx \
__GST_VIDEO_CAPS_MAKE_32 (3, 2, 1)
-
+
#define GST_VIDEO_CAPS_xBGR \
__GST_VIDEO_CAPS_MAKE_32 (4, 3, 2)
/* note: the macro name uses the order on BE systems */
#if G_BYTE_ORDER == G_BIG_ENDIAN
- #define GST_VIDEO_CAPS_xRGB_HOST_ENDIAN \
+#define GST_VIDEO_CAPS_xRGB_HOST_ENDIAN \
GST_VIDEO_CAPS_xRGB
- #define GST_VIDEO_CAPS_BGRx_HOST_ENDIAN \
+#define GST_VIDEO_CAPS_BGRx_HOST_ENDIAN \
GST_VIDEO_CAPS_BGRx
#else
- #define GST_VIDEO_CAPS_xRGB_HOST_ENDIAN \
+#define GST_VIDEO_CAPS_xRGB_HOST_ENDIAN \
GST_VIDEO_CAPS_BGRx
- #define GST_VIDEO_CAPS_BGRx_HOST_ENDIAN \
+#define GST_VIDEO_CAPS_BGRx_HOST_ENDIAN \
GST_VIDEO_CAPS_xRGB
#endif
-
+
/* 15/16 bit */
-
+
#define GST_VIDEO_CAPS_RGB_16 \
"video/x-raw-rgb, " \
"bpp = (int) 16, " \
@@ -155,9 +155,7 @@
"framerate = " GST_VIDEO_FPS_RANGE
/* functions */
-gdouble gst_video_frame_rate (GstPad *pad);
-gboolean gst_video_get_size (GstPad *pad,
- gint *width,
- gint *height);
+gdouble gst_video_frame_rate (GstPad * pad);
+gboolean gst_video_get_size (GstPad * pad, gint * width, gint * height);
#endif /* __GST_VIDEO_H__ */
diff --git a/gst-libs/gst/video/videosink.h b/gst-libs/gst/video/videosink.h
index 129a47d6..68de26fa 100644
--- a/gst-libs/gst/video/videosink.h
+++ b/gst-libs/gst/video/videosink.h
@@ -17,16 +17,17 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-
+
#ifndef __GST_VIDEOSINK_H__
#define __GST_VIDEOSINK_H__
#include <gst/gst.h>
#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
+extern "C"
+{
+#endif /* __cplusplus */
+
#define GST_TYPE_VIDEOSINK (gst_videosink_get_type())
#define GST_VIDEOSINK(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VIDEOSINK, GstVideoSink))
@@ -38,37 +39,39 @@ extern "C" {
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_VIDEOSINK))
#define GST_VIDEOSINK_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_VIDEOSINK, GstVideoSinkClass))
-
+
#define GST_VIDEOSINK_PAD(obj) (GST_VIDEOSINK (obj)->sinkpad)
#define GST_VIDEOSINK_WIDTH(obj) (GST_VIDEOSINK (obj)->width)
#define GST_VIDEOSINK_HEIGHT(obj) (GST_VIDEOSINK (obj)->height)
#define GST_VIDEOSINK_CLOCK(obj) (GST_VIDEOSINK (obj)->clock)
-
-typedef struct _GstVideoSink GstVideoSink;
-typedef struct _GstVideoSinkClass GstVideoSinkClass;
-
-struct _GstVideoSink {
- GstElement element;
-
- GstPad *sinkpad;
-
- gint width, height;
-
- GstClock *clock;
-
- gpointer _gst_reserved[GST_PADDING];
-};
-
-struct _GstVideoSinkClass {
- GstElementClass parent_class;
-
- gpointer _gst_reserved[GST_PADDING];
-};
-
-GType gst_videosink_get_type (void);
+
+ typedef struct _GstVideoSink GstVideoSink;
+ typedef struct _GstVideoSinkClass GstVideoSinkClass;
+
+ struct _GstVideoSink
+ {
+ GstElement element;
+
+ GstPad *sinkpad;
+
+ gint width, height;
+
+ GstClock *clock;
+
+ gpointer _gst_reserved[GST_PADDING];
+ };
+
+ struct _GstVideoSinkClass
+ {
+ GstElementClass parent_class;
+
+ gpointer _gst_reserved[GST_PADDING];
+ };
+
+ GType gst_videosink_get_type (void);
#ifdef __cplusplus
}
-#endif /* __cplusplus */
+#endif /* __cplusplus */
-#endif /* __GST_VIDEOSINK_H__ */
+#endif /* __GST_VIDEOSINK_H__ */