summaryrefslogtreecommitdiffstats
path: root/ext/divx
diff options
context:
space:
mode:
Diffstat (limited to 'ext/divx')
-rw-r--r--ext/divx/gstdivxdec.c49
-rw-r--r--ext/divx/gstdivxenc.c39
2 files changed, 48 insertions, 40 deletions
diff --git a/ext/divx/gstdivxdec.c b/ext/divx/gstdivxdec.c
index 737a14ec..d4aa4602 100644
--- a/ext/divx/gstdivxdec.c
+++ b/ext/divx/gstdivxdec.c
@@ -37,16 +37,16 @@ static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_STATIC_CAPS ("video/x-divx, "
- "divxversion = (int) [ 3, 5 ], "
- "width = (int) [ 16, 4096 ], "
- "height = (int) [ 16, 4096 ], " "framerate = (double) [ 0, MAX ]")
+ "divxversion = (int) [ 3, 5 ], "
+ "width = (int) [ 16, 4096 ], "
+ "height = (int) [ 16, 4096 ], " "framerate = (double) [ 0, MAX ]")
);
static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
GST_STATIC_CAPS (GST_VIDEO_CAPS_YUV ("{ I420, YUY2, YV12, UYVY }")
- /* FIXME: 15/16/24/32bpp RGB */
+ /* FIXME: 15/16/24/32bpp RGB */
)
);
@@ -125,8 +125,9 @@ gst_divxdec_get_type (void)
0,
(GInstanceInitFunc) gst_divxdec_init,
};
+
divxdec_type = g_type_register_static (GST_TYPE_ELEMENT,
- "GstDivxDec", &divxdec_info, 0);
+ "GstDivxDec", &divxdec_info, 0);
}
return divxdec_type;
}
@@ -222,7 +223,7 @@ gst_divxdec_setup (GstDivxDec * divxdec)
}
if ((ret = decore (&handle, DEC_OPT_INIT, &xinit, NULL)) != 0) {
GST_ELEMENT_ERROR (divxdec, LIBRARY, INIT, (NULL),
- ("divx library error: %s (%d)", gst_divxdec_error (ret), ret));
+ ("divx library error: %s (%d)", gst_divxdec_error (ret), ret));
return FALSE;
}
@@ -239,7 +240,7 @@ gst_divxdec_setup (GstDivxDec * divxdec)
if ((ret = decore (divxdec->handle, DEC_OPT_SETOUT, &output, NULL)) != 0) {
GST_ELEMENT_ERROR (divxdec, LIBRARY, SETTINGS, (NULL),
- ("error setting output: %s (%d)", gst_divxdec_error (ret), ret));
+ ("error setting output: %s (%d)", gst_divxdec_error (ret), ret));
gst_divxdec_unset (divxdec);
return FALSE;
}
@@ -275,7 +276,7 @@ gst_divxdec_chain (GstPad * pad, GstData * _data)
if (!divxdec->handle) {
if (gst_divxdec_negotiate (divxdec) <= 0) {
GST_ELEMENT_ERROR (divxdec, CORE, TOO_LAZY, (NULL),
- ("No format set - aborting"));
+ ("No format set - aborting"));
gst_buffer_unref (buf);
return;
}
@@ -296,7 +297,7 @@ gst_divxdec_chain (GstPad * pad, GstData * _data)
if ((ret = decore (divxdec->handle, DEC_OPT_FRAME, &xframe, NULL))) {
GST_ELEMENT_ERROR (divxdec, STREAM, DECODE, (NULL),
- ("Error decoding divx frame: %s (%d)", gst_divxdec_error (ret), ret));
+ ("Error decoding divx frame: %s (%d)", gst_divxdec_error (ret), ret));
gst_buffer_unref (buf);
return;
}
@@ -395,16 +396,22 @@ gst_divxdec_negotiate (GstDivxDec * divxdec)
gint depth, bpp;
guint32 csp;
gint bitcnt;
- } fmt_list[] = {
+ }
+ fmt_list[] =
+ {
{
GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'), 16, 16,
- GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'), 0}, {
+ GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'), 0}
+ , {
GST_MAKE_FOURCC ('U', 'Y', 'V', 'Y'), 16, 16,
- GST_MAKE_FOURCC ('U', 'Y', 'V', 'Y'), 0}, {
+ GST_MAKE_FOURCC ('U', 'Y', 'V', 'Y'), 0}
+ , {
GST_MAKE_FOURCC ('I', '4', '2', '0'), 12, 12,
- GST_MAKE_FOURCC ('I', '4', '2', '0'), 0}, {
+ GST_MAKE_FOURCC ('I', '4', '2', '0'), 0}
+ , {
GST_MAKE_FOURCC ('Y', 'V', '1', '2'), 12, 12,
- GST_MAKE_FOURCC ('Y', 'V', '1', '2'), 0}, {
+ GST_MAKE_FOURCC ('Y', 'V', '1', '2'), 0}
+ , {
0, 0, 0, 0, 0}
};
gint i;
@@ -413,13 +420,13 @@ gst_divxdec_negotiate (GstDivxDec * divxdec)
divxdec->csp = fmt_list[i].csp;
caps = gst_caps_new_simple ("video/x-raw-yuv",
- "width", G_TYPE_INT, divxdec->width,
- "height", G_TYPE_INT, divxdec->height,
- "framerate", G_TYPE_DOUBLE, divxdec->fps,
- "format", GST_TYPE_FOURCC, fmt_list[i].fourcc, NULL);
+ "width", G_TYPE_INT, divxdec->width,
+ "height", G_TYPE_INT, divxdec->height,
+ "framerate", G_TYPE_DOUBLE, divxdec->fps,
+ "format", GST_TYPE_FOURCC, fmt_list[i].fourcc, NULL);
if (gst_divxdec_setup (divxdec) &&
- gst_pad_set_explicit_caps (divxdec->srcpad, caps)) {
+ gst_pad_set_explicit_caps (divxdec->srcpad, caps)) {
divxdec->csp = fmt_list[i].csp;
divxdec->bpp = fmt_list[i].bpp;
divxdec->bitcnt = fmt_list[i].bitcnt;
@@ -468,8 +475,8 @@ plugin_init (GstPlugin * plugin)
lib_version = decore (NULL, DEC_OPT_VERSION, 0, 0);
if (lib_version != DECORE_VERSION) {
g_warning ("Version mismatch! This plugin was compiled for "
- "DivX version %d, while your library has version %d!",
- DECORE_VERSION, lib_version);
+ "DivX version %d, while your library has version %d!",
+ DECORE_VERSION, lib_version);
return FALSE;
}
diff --git a/ext/divx/gstdivxenc.c b/ext/divx/gstdivxenc.c
index 6d294bb8..3def13d1 100644
--- a/ext/divx/gstdivxenc.c
+++ b/ext/divx/gstdivxenc.c
@@ -38,7 +38,7 @@ static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_STATIC_CAPS (GST_VIDEO_CAPS_YUV ("{ I420, YUY2, YV12, YVYU, UYVY }")
- /* FIXME: 15/16/24/32bpp RGB */
+ /* FIXME: 15/16/24/32bpp RGB */
)
);
@@ -46,9 +46,9 @@ static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
GST_STATIC_CAPS ("video/x-divx, "
- "divxversion = (int) 5, "
- "width = (int) [ 16, 4096 ], "
- "height = (int) [ 16, 4096 ], " "framerate = (double) [ 0, MAX ]")
+ "divxversion = (int) 5, "
+ "width = (int) [ 16, 4096 ], "
+ "height = (int) [ 16, 4096 ], " "framerate = (double) [ 0, MAX ]")
);
@@ -137,8 +137,9 @@ gst_divxenc_get_type (void)
0,
(GInstanceInitFunc) gst_divxenc_init,
};
+
divxenc_type = g_type_register_static (GST_TYPE_ELEMENT,
- "GstDivxEnc", &divxenc_info, 0);
+ "GstDivxEnc", &divxenc_info, 0);
}
return divxenc_type;
}
@@ -171,20 +172,20 @@ gst_divxenc_class_init (GstDivxEncClass * klass)
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_BITRATE,
g_param_spec_ulong ("bitrate", "Bitrate",
- "Target video bitrate", 0, G_MAXULONG, 0, G_PARAM_READWRITE));
+ "Target video bitrate", 0, G_MAXULONG, 0, G_PARAM_READWRITE));
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_MAXKEYINTERVAL,
g_param_spec_int ("max_key_interval", "Max. Key Interval",
- "Maximum number of frames between two keyframes",
- 0, G_MAXINT, 0, G_PARAM_READWRITE));
+ "Maximum number of frames between two keyframes",
+ 0, G_MAXINT, 0, G_PARAM_READWRITE));
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_BUFSIZE,
g_param_spec_ulong ("buffer_size", "Buffer Size",
- "Size of the video buffers", 0, G_MAXULONG, 0, G_PARAM_READABLE));
+ "Size of the video buffers", 0, G_MAXULONG, 0, G_PARAM_READABLE));
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_QUALITY,
g_param_spec_int ("quality", "Quality",
- "Amount of Motion Estimation", 1, 5, 3, G_PARAM_READWRITE));
+ "Amount of Motion Estimation", 1, 5, 3, G_PARAM_READWRITE));
gobject_class->set_property = gst_divxenc_set_property;
gobject_class->get_property = gst_divxenc_get_property;
@@ -221,7 +222,7 @@ gst_divxenc_init (GstDivxEnc * divxenc)
/* bitrate, etc. */
divxenc->width = divxenc->height = divxenc->csp = divxenc->bitcnt = -1;
divxenc->bitrate = 512 * 1024;
- divxenc->max_key_interval = -1; /* default - 2*fps */
+ divxenc->max_key_interval = -1; /* default - 2*fps */
divxenc->buffer_size = 512 * 1024;
divxenc->quality = 3;
@@ -279,8 +280,8 @@ gst_divxenc_setup (GstDivxEnc * divxenc)
if ((ret = encore (&handle, ENC_OPT_INIT, &input, &output))) {
GST_ELEMENT_ERROR (divxenc, LIBRARY, SETTINGS, (NULL),
- ("Error setting up divx encoder: %s (%d)",
- gst_divxenc_error (ret), ret));
+ ("Error setting up divx encoder: %s (%d)",
+ gst_divxenc_error (ret), ret));
return FALSE;
}
@@ -339,7 +340,7 @@ gst_divxenc_chain (GstPad * pad, GstData * _data)
if ((ret = encore (divxenc->handle, ENC_OPT_ENCODE, &xframe, &xres))) {
GST_ELEMENT_ERROR (divxenc, LIBRARY, ENCODE, (NULL),
- ("Error encoding divx frame: %s (%d)", gst_divxenc_error (ret), ret));
+ ("Error encoding divx frame: %s (%d)", gst_divxenc_error (ret), ret));
gst_buffer_unref (buf);
return;
}
@@ -427,9 +428,9 @@ gst_divxenc_connect (GstPad * pad, const GstCaps * caps)
GstCaps *new_caps;
new_caps = gst_caps_new_simple ("video/x-divx",
- "divxversion", G_TYPE_INT, 5,
- "width", G_TYPE_INT, w,
- "height", G_TYPE_INT, h, "framerate", G_TYPE_DOUBLE, fps, NULL);
+ "divxversion", G_TYPE_INT, 5,
+ "width", G_TYPE_INT, w,
+ "height", G_TYPE_INT, h, "framerate", G_TYPE_DOUBLE, fps, NULL);
ret = gst_pad_set_explicit_caps (divxenc->srcpad, new_caps);
if (ret <= 0) {
@@ -509,8 +510,8 @@ plugin_init (GstPlugin * plugin)
lib_version = encore (NULL, ENC_OPT_VERSION, 0, 0);
if (lib_version != ENCORE_VERSION) {
g_warning ("Version mismatch! This plugin was compiled for "
- "DivX version %d, while your library has version %d!",
- ENCORE_VERSION, lib_version);
+ "DivX version %d, while your library has version %d!",
+ ENCORE_VERSION, lib_version);
return FALSE;
}