indent

Original commit message from CVS:
indent
parent d5cfdabb
2004-03-29 Thomas Vander Stichele <thomas at apestaart dot org>
* ext/ffmpeg/*.c: indent
2004-03-25 Ronald Bultje <rbultje@ronald.bitfreak.net>
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_base_init):
......
......@@ -33,16 +33,16 @@
#include <ffmpeg/avformat.h>
#endif
extern gboolean gst_ffmpegdemux_register (GstPlugin *plugin);
extern gboolean gst_ffmpegdec_register (GstPlugin *plugin);
extern gboolean gst_ffmpegenc_register (GstPlugin *plugin);
extern gboolean gst_ffmpegmux_register (GstPlugin *plugin);
extern gboolean gst_ffmpegcsp_register (GstPlugin *plugin);
extern gboolean gst_ffmpegdemux_register (GstPlugin * plugin);
extern gboolean gst_ffmpegdec_register (GstPlugin * plugin);
extern gboolean gst_ffmpegenc_register (GstPlugin * plugin);
extern gboolean gst_ffmpegmux_register (GstPlugin * plugin);
extern gboolean gst_ffmpegcsp_register (GstPlugin * plugin);
extern URLProtocol gstreamer_protocol;
static gboolean
plugin_init (GstPlugin *plugin)
plugin_init (GstPlugin * plugin)
{
if (!gst_library_load ("gstbytestream"))
return FALSE;
......@@ -54,7 +54,7 @@ plugin_init (GstPlugin *plugin)
gst_ffmpegenc_register (plugin);
gst_ffmpegdec_register (plugin);
gst_ffmpegdemux_register (plugin);
/*gst_ffmpegmux_register (plugin);*/
/*gst_ffmpegmux_register (plugin); */
gst_ffmpegcsp_register (plugin);
register_protocol (&gstreamer_protocol);
......@@ -63,14 +63,9 @@ plugin_init (GstPlugin *plugin)
return TRUE;
}
GST_PLUGIN_DEFINE (
GST_VERSION_MAJOR,
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
GST_VERSION_MINOR,
"ffmpeg",
"All FFMPEG codecs",
plugin_init,
FFMPEG_VERSION,
"LGPL",
"FFMpeg",
"http://ffmpeg.sourceforge.net/"
)
FFMPEG_VERSION, "LGPL", "FFMpeg", "http://ffmpeg.sourceforge.net/")
This diff is collapsed.
......@@ -46,22 +46,21 @@
typedef struct _GstFFMpegCsp GstFFMpegCsp;
typedef struct _GstFFMpegCspClass GstFFMpegCspClass;
struct _GstFFMpegCsp {
struct _GstFFMpegCsp
{
GstElement element;
GstPad *sinkpad, *srcpad;
gint width, height;
gfloat fps;
enum PixelFormat
from_pixfmt,
to_pixfmt;
AVFrame *from_frame,
*to_frame;
enum PixelFormat from_pixfmt, to_pixfmt;
AVFrame *from_frame, *to_frame;
GstCaps *sinkcaps;
};
struct _GstFFMpegCspClass {
struct _GstFFMpegCspClass
{
GstElementClass parent_class;
};
......@@ -75,72 +74,68 @@ static GstElementDetails ffmpegcsp_details = {
/* Stereo signals and args */
enum {
enum
{
/* FILL ME */
LAST_SIGNAL
};
enum {
enum
{
ARG_0,
};
static GType gst_ffmpegcsp_get_type (void);
static void gst_ffmpegcsp_base_init (GstFFMpegCspClass *klass);
static void gst_ffmpegcsp_class_init (GstFFMpegCspClass *klass);
static void gst_ffmpegcsp_init (GstFFMpegCsp *space);
static void gst_ffmpegcsp_base_init (GstFFMpegCspClass * klass);
static void gst_ffmpegcsp_class_init (GstFFMpegCspClass * klass);
static void gst_ffmpegcsp_init (GstFFMpegCsp * space);
static void gst_ffmpegcsp_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec);
static void gst_ffmpegcsp_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec);
static void gst_ffmpegcsp_set_property (GObject * object,
guint prop_id, const GValue * value, GParamSpec * pspec);
static void gst_ffmpegcsp_get_property (GObject * object,
guint prop_id, GValue * value, GParamSpec * pspec);
static GstPadLinkReturn
gst_ffmpegcsp_pad_link (GstPad *pad,
const GstCaps *caps);
gst_ffmpegcsp_pad_link (GstPad * pad, const GstCaps * caps);
static void gst_ffmpegcsp_chain (GstPad *pad,
GstData *data);
static GstElementStateReturn
gst_ffmpegcsp_change_state (GstElement *element);
static void gst_ffmpegcsp_chain (GstPad * pad, GstData * data);
static GstElementStateReturn gst_ffmpegcsp_change_state (GstElement * element);
static GstPadTemplate *srctempl, *sinktempl;
static GstElementClass *parent_class = NULL;
/*static guint gst_ffmpegcsp_signals[LAST_SIGNAL] = { 0 }; */
static GstCaps *
gst_ffmpegcsp_caps_remove_format_info (GstCaps *caps)
gst_ffmpegcsp_caps_remove_format_info (GstCaps * caps)
{
int i;
GstStructure *structure;
GstCaps *rgbcaps;
for(i=0;i<gst_caps_get_size (caps);i++){
for (i = 0; i < gst_caps_get_size (caps); i++) {
structure = gst_caps_get_structure (caps, i);
gst_structure_set_name (structure,"video/x-raw-yuv");
gst_structure_remove_field (structure,"format");
gst_structure_remove_field (structure,"endianness");
gst_structure_remove_field (structure,"depth");
gst_structure_remove_field (structure,"bpp");
gst_structure_remove_field (structure,"red_mask");
gst_structure_remove_field (structure,"green_mask");
gst_structure_remove_field (structure,"blue_mask");
gst_structure_set_name (structure, "video/x-raw-yuv");
gst_structure_remove_field (structure, "format");
gst_structure_remove_field (structure, "endianness");
gst_structure_remove_field (structure, "depth");
gst_structure_remove_field (structure, "bpp");
gst_structure_remove_field (structure, "red_mask");
gst_structure_remove_field (structure, "green_mask");
gst_structure_remove_field (structure, "blue_mask");
}
rgbcaps = gst_caps_simplify (caps);
gst_caps_free (caps);
caps = gst_caps_copy (rgbcaps);
for(i=0;i<gst_caps_get_size (rgbcaps);i++){
for (i = 0; i < gst_caps_get_size (rgbcaps); i++) {
structure = gst_caps_get_structure (rgbcaps, i);
gst_structure_set_name (structure,"video/x-raw-rgb");
gst_structure_set_name (structure, "video/x-raw-rgb");
}
gst_caps_append (caps, rgbcaps);
......@@ -149,7 +144,7 @@ gst_ffmpegcsp_caps_remove_format_info (GstCaps *caps)
}
static GstCaps *
gst_ffmpegcsp_getcaps (GstPad *pad)
gst_ffmpegcsp_getcaps (GstPad * pad)
{
GstFFMpegCsp *space;
GstCaps *othercaps;
......@@ -171,8 +166,7 @@ gst_ffmpegcsp_getcaps (GstPad *pad)
}
static GstPadLinkReturn
gst_ffmpegcsp_pad_link (GstPad *pad,
const GstCaps *caps)
gst_ffmpegcsp_pad_link (GstPad * pad, const GstCaps * caps)
{
GstStructure *structure;
AVCodecContext *ctx;
......@@ -223,8 +217,7 @@ gst_ffmpegcsp_pad_link (GstPad *pad,
gst_caps_set_simple (caps,
"width", G_TYPE_INT, width,
"height", G_TYPE_INT, height,
"framerate", G_TYPE_DOUBLE, framerate,
NULL);
"framerate", G_TYPE_DOUBLE, framerate, NULL);
ret = gst_pad_try_set_caps (otherpad, caps);
if (GST_PAD_LINK_FAILED (ret)) {
return ret;
......@@ -270,15 +263,14 @@ gst_ffmpegcsp_get_type (void)
};
ffmpegcsp_type = g_type_register_static (GST_TYPE_ELEMENT,
"GstFFMpegCsp",
&ffmpegcsp_info, 0);
"GstFFMpegCsp", &ffmpegcsp_info, 0);
}
return ffmpegcsp_type;
}
static void
gst_ffmpegcsp_base_init (GstFFMpegCspClass *klass)
gst_ffmpegcsp_base_init (GstFFMpegCspClass * klass)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
......@@ -288,13 +280,13 @@ gst_ffmpegcsp_base_init (GstFFMpegCspClass *klass)
}
static void
gst_ffmpegcsp_class_init (GstFFMpegCspClass *klass)
gst_ffmpegcsp_class_init (GstFFMpegCspClass * 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);
......@@ -305,13 +297,13 @@ gst_ffmpegcsp_class_init (GstFFMpegCspClass *klass)
}
static void
gst_ffmpegcsp_init (GstFFMpegCsp *space)
gst_ffmpegcsp_init (GstFFMpegCsp * space)
{
space->sinkpad = gst_pad_new_from_template (sinktempl, "sink");
gst_pad_set_link_function (space->sinkpad, gst_ffmpegcsp_pad_link);
gst_pad_set_getcaps_function (space->sinkpad, gst_ffmpegcsp_getcaps);
gst_pad_set_chain_function (space->sinkpad,gst_ffmpegcsp_chain);
gst_element_add_pad (GST_ELEMENT(space), space->sinkpad);
gst_pad_set_chain_function (space->sinkpad, gst_ffmpegcsp_chain);
gst_element_add_pad (GST_ELEMENT (space), space->sinkpad);
space->srcpad = gst_pad_new_from_template (srctempl, "src");
gst_element_add_pad (GST_ELEMENT (space), space->srcpad);
......@@ -323,8 +315,7 @@ gst_ffmpegcsp_init (GstFFMpegCsp *space)
}
static void
gst_ffmpegcsp_chain (GstPad *pad,
GstData *data)
gst_ffmpegcsp_chain (GstPad * pad, GstData * data)
{
GstBuffer *inbuf = GST_BUFFER (data);
GstFFMpegCsp *space;
......@@ -339,8 +330,7 @@ gst_ffmpegcsp_chain (GstPad *pad,
g_return_if_fail (space != NULL);
g_return_if_fail (GST_IS_FFMPEGCSP (space));
if (space->from_pixfmt == PIX_FMT_NB ||
space->to_pixfmt == PIX_FMT_NB) {
if (space->from_pixfmt == PIX_FMT_NB || space->to_pixfmt == PIX_FMT_NB) {
GST_ELEMENT_ERROR (space, CORE, NOT_IMPLEMENTED, NULL,
("attempting to convert colorspaces between unknown formats"));
gst_buffer_unref (inbuf);
......@@ -354,8 +344,8 @@ gst_ffmpegcsp_chain (GstPad *pad,
guint size = avpicture_get_size (space->to_pixfmt,
space->width,
space->height);
outbuf = gst_pad_alloc_buffer (space->srcpad,
GST_BUFFER_OFFSET_NONE, size);
outbuf = gst_pad_alloc_buffer (space->srcpad, GST_BUFFER_OFFSET_NONE, size);
/* convert */
avpicture_fill ((AVPicture *) space->from_frame, GST_BUFFER_DATA (inbuf),
......@@ -376,7 +366,7 @@ gst_ffmpegcsp_chain (GstPad *pad,
}
static GstElementStateReturn
gst_ffmpegcsp_change_state (GstElement *element)
gst_ffmpegcsp_change_state (GstElement * element)
{
GstFFMpegCsp *space;
......@@ -400,10 +390,8 @@ gst_ffmpegcsp_change_state (GstElement *element)
}
static void
gst_ffmpegcsp_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
gst_ffmpegcsp_set_property (GObject * object,
guint prop_id, const GValue * value, GParamSpec * pspec)
{
GstFFMpegCsp *space;
......@@ -418,10 +406,8 @@ gst_ffmpegcsp_set_property (GObject *object,
}
static void
gst_ffmpegcsp_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
gst_ffmpegcsp_get_property (GObject * object,
guint prop_id, GValue * value, GParamSpec * pspec)
{
GstFFMpegCsp *space;
......@@ -437,7 +423,7 @@ gst_ffmpegcsp_get_property (GObject *object,
}
gboolean
gst_ffmpegcsp_register (GstPlugin *plugin)
gst_ffmpegcsp_register (GstPlugin * plugin)
{
GstCaps *caps;
......@@ -446,13 +432,8 @@ gst_ffmpegcsp_register (GstPlugin *plugin)
/* build templates */
srctempl = gst_pad_template_new ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
gst_caps_copy (caps));
sinktempl = gst_pad_template_new ("sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
caps);
GST_PAD_SRC, GST_PAD_ALWAYS, gst_caps_copy (caps));
sinktempl = gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, caps);
return gst_element_register (plugin, "ffcolorspace",
GST_RANK_NONE, GST_TYPE_FFMPEGCSP);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -34,7 +34,8 @@
typedef struct _GstProtocolInfo GstProtocolInfo;
struct _GstProtocolInfo {
struct _GstProtocolInfo
{
GstPad *pad;
int flags;
......@@ -43,9 +44,7 @@ struct _GstProtocolInfo {
};
static int
gst_ffmpegdata_open (URLContext *h,
const char *filename,
int flags)
gst_ffmpegdata_open (URLContext * h, const char *filename, int flags)
{
GstProtocolInfo *info;
GstPad *pad;
......@@ -54,8 +53,7 @@ gst_ffmpegdata_open (URLContext *h,
info->flags = flags;
/* we don't support R/W together */
if (flags != URL_RDONLY &&
flags != URL_WRONLY) {
if (flags != URL_RDONLY && flags != URL_WRONLY) {
g_warning ("Only read-only or write-only are supported");
return -EINVAL;
}
......@@ -88,9 +86,7 @@ gst_ffmpegdata_open (URLContext *h,
}
static int
gst_ffmpegdata_read (URLContext *h,
unsigned char *buf,
int size)
gst_ffmpegdata_read (URLContext * h, unsigned char *buf, int size)
{
GstByteStream *bs;
guint32 total, request;
......@@ -152,9 +148,7 @@ gst_ffmpegdata_read (URLContext *h,
}
static int
gst_ffmpegdata_write (URLContext *h,
unsigned char *buf,
int size)
gst_ffmpegdata_write (URLContext * h, unsigned char *buf, int size)
{
GstProtocolInfo *info;
GstBuffer *outbuf;
......@@ -174,9 +168,7 @@ gst_ffmpegdata_write (URLContext *h,
}
static offset_t
gst_ffmpegdata_seek (URLContext *h,
offset_t pos,
int whence)
gst_ffmpegdata_seek (URLContext * h, offset_t pos, int whence)
{
GstSeekType seek_type = 0;
GstProtocolInfo *info;
......@@ -216,16 +208,17 @@ gst_ffmpegdata_seek (URLContext *h,
}
static int
gst_ffmpegdata_close (URLContext *h)
gst_ffmpegdata_close (URLContext * h)
{
GstProtocolInfo *info;
info = (GstProtocolInfo *) h->priv_data;
switch (info->flags) {
case URL_WRONLY: {
case URL_WRONLY:{
/* send EOS - that closes down the stream */
GstEvent *event = gst_event_new (GST_EVENT_EOS);
gst_pad_push (info->pad, GST_DATA (event));
}
break;
......@@ -250,4 +243,3 @@ URLProtocol gstreamer_protocol = {
.url_seek = gst_ffmpegdata_seek,
.url_close = gst_ffmpegdata_close,
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment