diff options
Diffstat (limited to 'ext/xvid')
-rw-r--r-- | ext/xvid/gstxvid.c | 262 | ||||
-rw-r--r-- | ext/xvid/gstxviddec.c | 45 | ||||
-rw-r--r-- | ext/xvid/gstxvidenc.c | 63 |
3 files changed, 186 insertions, 184 deletions
diff --git a/ext/xvid/gstxvid.c b/ext/xvid/gstxvid.c index 1e22dbfd..d09489eb 100644 --- a/ext/xvid/gstxvid.c +++ b/ext/xvid/gstxvid.c @@ -99,30 +99,30 @@ gst_xvid_structure_to_csp (GstStructure * structure, gst_structure_get_fourcc (structure, "format", &fourcc); switch (fourcc) { case GST_MAKE_FOURCC ('I', '4', '2', '0'): - xvid_cs = XVID_CSP_I420; - stride = w; - bpp = 12; - break; + xvid_cs = XVID_CSP_I420; + stride = w; + bpp = 12; + break; case GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'): - xvid_cs = XVID_CSP_YUY2; - stride = w * 2; - bpp = 16; - break; + xvid_cs = XVID_CSP_YUY2; + stride = w * 2; + bpp = 16; + break; case GST_MAKE_FOURCC ('Y', 'V', '1', '2'): - xvid_cs = XVID_CSP_YV12; - stride = w; - bpp = 12; - break; + xvid_cs = XVID_CSP_YV12; + stride = w; + bpp = 12; + break; case GST_MAKE_FOURCC ('U', 'Y', 'V', 'Y'): - xvid_cs = XVID_CSP_UYVY; - stride = w * 2; - bpp = 16; - break; + xvid_cs = XVID_CSP_UYVY; + stride = w * 2; + bpp = 16; + break; case GST_MAKE_FOURCC ('Y', 'V', 'Y', 'U'): - xvid_cs = XVID_CSP_YVYU; - stride = w * 2; - bpp = 16; - break; + xvid_cs = XVID_CSP_YVYU; + stride = w * 2; + bpp = 16; + break; } } else { gint depth, r_mask; @@ -133,35 +133,35 @@ gst_xvid_structure_to_csp (GstStructure * structure, switch (depth) { case 15: - xvid_cs = XVID_CSP_RGB555; - break; + xvid_cs = XVID_CSP_RGB555; + break; case 16: - xvid_cs = XVID_CSP_RGB565; - break; + xvid_cs = XVID_CSP_RGB565; + break; case 24: - if (bpp == 24) { - xvid_cs = XVID_CSP_BGR; - } else { - switch (r_mask) { - case 0xff000000: - xvid_cs = XVID_CSP_RGBA; - break; + if (bpp == 24) { + xvid_cs = XVID_CSP_BGR; + } else { + switch (r_mask) { + case 0xff000000: + xvid_cs = XVID_CSP_RGBA; + break; #ifdef XVID_CSP_ARGB - case 0x00ff0000: - xvid_cs = XVID_CSP_ARGB; - break; + case 0x00ff0000: + xvid_cs = XVID_CSP_ARGB; + break; #endif - case 0x0000ff00: - xvid_cs = XVID_CSP_BGRA; - break; - case 0x000000ff: - xvid_cs = XVID_CSP_ABGR; - break; - } - } - break; + case 0x0000ff00: + xvid_cs = XVID_CSP_BGRA; + break; + case 0x000000ff: + xvid_cs = XVID_CSP_ABGR; + break; + } + } + break; default: - break; + break; } stride = w * bpp / 8; @@ -191,79 +191,79 @@ gst_xvid_csp_to_caps (gint csp, gint w, gint h, gdouble fps) #endif case XVID_CSP_RGBA:{ gint r_mask = 0, b_mask = 0, g_mask = 0, - endianness = 0, bpp = 0, depth = 0; + endianness = 0, bpp = 0, depth = 0; switch (csp) { - case XVID_CSP_RGB555: - r_mask = GST_VIDEO_RED_MASK_15_INT; - g_mask = GST_VIDEO_GREEN_MASK_15_INT; - b_mask = GST_VIDEO_BLUE_MASK_15_INT; - endianness = G_BYTE_ORDER; - depth = 15; - bpp = 16; - break; - case XVID_CSP_RGB565: - r_mask = GST_VIDEO_RED_MASK_16_INT; - g_mask = GST_VIDEO_GREEN_MASK_16_INT; - b_mask = GST_VIDEO_BLUE_MASK_16_INT; - endianness = G_BYTE_ORDER; - depth = 16; - bpp = 16; - break; - case XVID_CSP_BGR: - r_mask = 0x0000ff; - g_mask = 0x00ff00; - b_mask = 0xff0000; - endianness = G_BIG_ENDIAN; - depth = 24; - bpp = 24; - break; - case XVID_CSP_ABGR: - r_mask = 0x000000ff; - g_mask = 0x0000ff00; - b_mask = 0x00ff0000; - endianness = G_BIG_ENDIAN; - depth = 24; - bpp = 32; - break; - case XVID_CSP_BGRA: - r_mask = 0x0000ff00; - g_mask = 0x00ff0000; - b_mask = 0xff000000; - endianness = G_BIG_ENDIAN; - depth = 24; - bpp = 32; - break; + case XVID_CSP_RGB555: + r_mask = GST_VIDEO_RED_MASK_15_INT; + g_mask = GST_VIDEO_GREEN_MASK_15_INT; + b_mask = GST_VIDEO_BLUE_MASK_15_INT; + endianness = G_BYTE_ORDER; + depth = 15; + bpp = 16; + break; + case XVID_CSP_RGB565: + r_mask = GST_VIDEO_RED_MASK_16_INT; + g_mask = GST_VIDEO_GREEN_MASK_16_INT; + b_mask = GST_VIDEO_BLUE_MASK_16_INT; + endianness = G_BYTE_ORDER; + depth = 16; + bpp = 16; + break; + case XVID_CSP_BGR: + r_mask = 0x0000ff; + g_mask = 0x00ff00; + b_mask = 0xff0000; + endianness = G_BIG_ENDIAN; + depth = 24; + bpp = 24; + break; + case XVID_CSP_ABGR: + r_mask = 0x000000ff; + g_mask = 0x0000ff00; + b_mask = 0x00ff0000; + endianness = G_BIG_ENDIAN; + depth = 24; + bpp = 32; + break; + case XVID_CSP_BGRA: + r_mask = 0x0000ff00; + g_mask = 0x00ff0000; + b_mask = 0xff000000; + endianness = G_BIG_ENDIAN; + depth = 24; + bpp = 32; + break; #ifdef XVID_CSP_ARGB - case XVID_CSP_ARGB: - r_mask = 0x00ff0000; - g_mask = 0x0000ff00; - b_mask = 0x000000ff; - endianness = G_BIG_ENDIAN; - depth = 24; - bpp = 32; - break; + case XVID_CSP_ARGB: + r_mask = 0x00ff0000; + g_mask = 0x0000ff00; + b_mask = 0x000000ff; + endianness = G_BIG_ENDIAN; + depth = 24; + bpp = 32; + break; #endif - case XVID_CSP_RGBA: - r_mask = 0xff000000; - g_mask = 0x00ff0000; - b_mask = 0x0000ff00; - endianness = G_BIG_ENDIAN; - depth = 24; - bpp = 32; - break; + case XVID_CSP_RGBA: + r_mask = 0xff000000; + g_mask = 0x00ff0000; + b_mask = 0x0000ff00; + endianness = G_BIG_ENDIAN; + depth = 24; + bpp = 32; + break; } caps = gst_caps_new_simple ("video/x-raw-rgb", - "width", G_TYPE_INT, w, - "height", G_TYPE_INT, h, - "depth", G_TYPE_INT, depth, - "bpp", G_TYPE_INT, bpp, - "endianness", G_TYPE_INT, endianness, - "red_mask", G_TYPE_INT, r_mask, - "green_mask", G_TYPE_INT, g_mask, - "blue_mask", G_TYPE_INT, b_mask, - "framerate", G_TYPE_DOUBLE, fps, NULL); + "width", G_TYPE_INT, w, + "height", G_TYPE_INT, h, + "depth", G_TYPE_INT, depth, + "bpp", G_TYPE_INT, bpp, + "endianness", G_TYPE_INT, endianness, + "red_mask", G_TYPE_INT, r_mask, + "green_mask", G_TYPE_INT, g_mask, + "blue_mask", G_TYPE_INT, b_mask, + "framerate", G_TYPE_DOUBLE, fps, NULL); break; } @@ -275,28 +275,28 @@ gst_xvid_csp_to_caps (gint csp, gint w, gint h, gdouble fps) guint32 fourcc = 0; switch (csp) { - case XVID_CSP_YUY2: - fourcc = GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'); - break; - case XVID_CSP_YVYU: - fourcc = GST_MAKE_FOURCC ('Y', 'V', 'Y', 'U'); - break; - case XVID_CSP_UYVY: - fourcc = GST_MAKE_FOURCC ('U', 'Y', 'V', 'Y'); - break; - case XVID_CSP_I420: - fourcc = GST_MAKE_FOURCC ('I', '4', '2', '0'); - break; - case XVID_CSP_YV12: - fourcc = GST_MAKE_FOURCC ('Y', 'V', '1', '2'); - break; + case XVID_CSP_YUY2: + fourcc = GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'); + break; + case XVID_CSP_YVYU: + fourcc = GST_MAKE_FOURCC ('Y', 'V', 'Y', 'U'); + break; + case XVID_CSP_UYVY: + fourcc = GST_MAKE_FOURCC ('U', 'Y', 'V', 'Y'); + break; + case XVID_CSP_I420: + fourcc = GST_MAKE_FOURCC ('I', '4', '2', '0'); + break; + case XVID_CSP_YV12: + fourcc = GST_MAKE_FOURCC ('Y', 'V', '1', '2'); + break; } caps = gst_caps_new_simple ("video/x-raw-yuv", - "width", G_TYPE_INT, w, - "height", G_TYPE_INT, h, - "format", GST_TYPE_FOURCC, fourcc, - "framerate", G_TYPE_DOUBLE, fps, NULL); + "width", G_TYPE_INT, w, + "height", G_TYPE_INT, h, + "format", GST_TYPE_FOURCC, fourcc, + "framerate", G_TYPE_DOUBLE, fps, NULL); break; } } @@ -309,9 +309,9 @@ static gboolean plugin_init (GstPlugin * plugin) { return (gst_element_register (plugin, "xvidenc", - GST_RANK_NONE, GST_TYPE_XVIDENC) && + GST_RANK_NONE, GST_TYPE_XVIDENC) && gst_element_register (plugin, "xviddec", - GST_RANK_SECONDARY, GST_TYPE_XVIDDEC)); + GST_RANK_SECONDARY, GST_TYPE_XVIDDEC)); } GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, diff --git a/ext/xvid/gstxviddec.c b/ext/xvid/gstxviddec.c index cab1a027..49c9d6ef 100644 --- a/ext/xvid/gstxviddec.c +++ b/ext/xvid/gstxviddec.c @@ -39,20 +39,20 @@ static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS ("video/x-xvid, " - "width = (int) [ 0, MAX ], " - "height = (int) [ 0, MAX ], " "framerate = (double) [ 0, MAX ]") + "width = (int) [ 0, MAX ], " + "height = (int) [ 0, MAX ], " "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, YVYU, UYVY }") - "; " RGB_24_32_STATIC_CAPS (32, 0x00ff0000, 0x0000ff00, - 0x000000ff) "; " RGB_24_32_STATIC_CAPS (32, 0xff000000, 0x00ff0000, - 0x0000ff00) "; " RGB_24_32_STATIC_CAPS (32, 0x0000ff00, 0x00ff0000, - 0xff000000) "; " RGB_24_32_STATIC_CAPS (32, 0x000000ff, 0x0000ff00, - 0x00ff0000) "; " RGB_24_32_STATIC_CAPS (24, 0x0000ff, 0x00ff00, - 0xff0000) "; " GST_VIDEO_CAPS_RGB_15 "; " GST_VIDEO_CAPS_RGB_16) + "; " RGB_24_32_STATIC_CAPS (32, 0x00ff0000, 0x0000ff00, + 0x000000ff) "; " RGB_24_32_STATIC_CAPS (32, 0xff000000, 0x00ff0000, + 0x0000ff00) "; " RGB_24_32_STATIC_CAPS (32, 0x0000ff00, 0x00ff0000, + 0xff000000) "; " RGB_24_32_STATIC_CAPS (32, 0x000000ff, 0x0000ff00, + 0x00ff0000) "; " RGB_24_32_STATIC_CAPS (24, 0x0000ff, 0x00ff00, + 0xff0000) "; " GST_VIDEO_CAPS_RGB_15 "; " GST_VIDEO_CAPS_RGB_16) ); @@ -103,8 +103,9 @@ gst_xviddec_get_type (void) 0, (GInstanceInitFunc) gst_xviddec_init, }; + xviddec_type = g_type_register_static (GST_TYPE_ELEMENT, - "GstXvidDec", &xviddec_info, 0); + "GstXvidDec", &xviddec_info, 0); } return xviddec_type; } @@ -187,9 +188,9 @@ gst_xviddec_setup (GstXvidDec * xviddec) if ((ret = xvid_decore (NULL, XVID_DEC_CREATE, &xdec, NULL)) < 0) { GST_ELEMENT_ERROR (xviddec, LIBRARY, SETTINGS, (NULL), - ("Setting parameters %dx%d@%d failed: %s (%d)", - xviddec->width, xviddec->height, xviddec->csp, - gst_xvid_error (ret), ret)); + ("Setting parameters %dx%d@%d failed: %s (%d)", + xviddec->width, xviddec->height, xviddec->csp, + gst_xvid_error (ret), ret)); return FALSE; } @@ -213,7 +214,7 @@ gst_xviddec_chain (GstPad * pad, GstData * _data) if (!xviddec->handle) { GST_ELEMENT_ERROR (xviddec, CORE, NEGOTIATION, (NULL), - ("format wasn't negotiated before chain function")); + ("format wasn't negotiated before chain function")); gst_buffer_unref (buf); return; } @@ -234,9 +235,9 @@ gst_xviddec_chain (GstPad * pad, GstData * _data) if (xviddec->width == xviddec->stride) { xframe.output.plane[0] = GST_BUFFER_DATA (outbuf); xframe.output.plane[1] = - xframe.output.plane[0] + (xviddec->width * xviddec->height); + xframe.output.plane[0] + (xviddec->width * xviddec->height); xframe.output.plane[2] = - xframe.output.plane[1] + (xviddec->width * xviddec->height / 4); + xframe.output.plane[1] + (xviddec->width * xviddec->height / 4); xframe.output.stride[0] = xviddec->width; xframe.output.stride[1] = xviddec->width / 2; xframe.output.stride[2] = xviddec->width / 2; @@ -247,7 +248,7 @@ gst_xviddec_chain (GstPad * pad, GstData * _data) if ((ret = xvid_decore (xviddec->handle, XVID_DEC_DECODE, &xframe, NULL)) < 0) { GST_ELEMENT_ERROR (xviddec, STREAM, DECODE, (NULL), - ("Error decoding xvid frame: %s (%d)\n", gst_xvid_error (ret), ret)); + ("Error decoding xvid frame: %s (%d)\n", gst_xvid_error (ret), ret)); gst_buffer_unref (buf); gst_buffer_unref (outbuf); return; @@ -289,7 +290,7 @@ gst_xviddec_src_getcaps (GstPad * pad) caps = gst_caps_new_empty (); for (i = 0; csp[i] != 0; i++) { GstCaps *one = gst_xvid_csp_to_caps (csp[i], xviddec->width, - xviddec->height, xviddec->fps); + xviddec->height, xviddec->fps); gst_caps_append (caps, one); } @@ -350,13 +351,13 @@ gst_xviddec_sink_link (GstPad * pad, const GstCaps * vscaps) for (i = 0; i < gst_caps_get_size (vscaps); i++) { csp = gst_xvid_structure_to_csp (gst_caps_get_structure (vscaps, i), - 0, NULL, NULL); + 0, NULL, NULL); new = - gst_xvid_csp_to_caps (csp, xviddec->width, xviddec->height, - xviddec->fps); + gst_xvid_csp_to_caps (csp, xviddec->width, xviddec->height, + xviddec->fps); ret = gst_pad_try_set_caps (xviddec->srcpad, new); if (ret != GST_PAD_LINK_REFUSED) - return ret; + return ret; } return GST_PAD_LINK_REFUSED; @@ -373,7 +374,7 @@ gst_xviddec_change_state (GstElement * element) switch (GST_STATE_PENDING (element)) { case GST_STATE_PAUSED_TO_READY: if (xviddec->handle) { - gst_xviddec_unset (xviddec); + gst_xviddec_unset (xviddec); } break; default: diff --git a/ext/xvid/gstxvidenc.c b/ext/xvid/gstxvidenc.c index 5a9b34ba..db9d1add 100644 --- a/ext/xvid/gstxvidenc.c +++ b/ext/xvid/gstxvidenc.c @@ -40,20 +40,20 @@ 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 }") - "; " RGB_24_32_STATIC_CAPS (32, 0x00ff0000, 0x0000ff00, - 0x000000ff) "; " RGB_24_32_STATIC_CAPS (32, 0xff000000, 0x00ff0000, - 0x0000ff00) "; " RGB_24_32_STATIC_CAPS (32, 0x0000ff00, 0x00ff0000, - 0xff000000) "; " RGB_24_32_STATIC_CAPS (32, 0x000000ff, 0x0000ff00, - 0x00ff0000) "; " RGB_24_32_STATIC_CAPS (24, 0x0000ff, 0x00ff00, - 0xff0000) "; " GST_VIDEO_CAPS_RGB_15 "; " GST_VIDEO_CAPS_RGB_16) + "; " RGB_24_32_STATIC_CAPS (32, 0x00ff0000, 0x0000ff00, + 0x000000ff) "; " RGB_24_32_STATIC_CAPS (32, 0xff000000, 0x00ff0000, + 0x0000ff00) "; " RGB_24_32_STATIC_CAPS (32, 0x0000ff00, 0x00ff0000, + 0xff000000) "; " RGB_24_32_STATIC_CAPS (32, 0x000000ff, 0x0000ff00, + 0x00ff0000) "; " RGB_24_32_STATIC_CAPS (24, 0x0000ff, 0x00ff00, + 0xff0000) "; " GST_VIDEO_CAPS_RGB_15 "; " GST_VIDEO_CAPS_RGB_16) ); static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS ("video/x-xvid, " - "width = (int) [ 0, MAX ], " - "height = (int) [ 0, MAX ], " "framerate = (double) [ 0.0, MAX ]") + "width = (int) [ 0, MAX ], " + "height = (int) [ 0, MAX ], " "framerate = (double) [ 0.0, MAX ]") ); @@ -111,13 +111,13 @@ gst_xvidenc_profile_get_type (void) {XVID_PROFILE_S_L2, "S_L2", "Simple profile, L2"}, {XVID_PROFILE_S_L3, "S_L3", "Simple profile, L3"}, {XVID_PROFILE_ARTS_L1, "ARTS_L1", - "Advanced real-time simple profile, L1"}, + "Advanced real-time simple profile, L1"}, {XVID_PROFILE_ARTS_L2, "ARTS_L2", - "Advanced real-time simple profile, L2"}, + "Advanced real-time simple profile, L2"}, {XVID_PROFILE_ARTS_L3, "ARTS_L3", - "Advanced real-time simple profile, L3"}, + "Advanced real-time simple profile, L3"}, {XVID_PROFILE_ARTS_L4, "ARTS_L4", - "Advanced real-time simple profile, L4"}, + "Advanced real-time simple profile, L4"}, {XVID_PROFILE_AS_L0, "AS_L0", "Advanced simple profile, L0"}, {XVID_PROFILE_AS_L1, "AS_L1", "Advanced simple profile, L1"}, {XVID_PROFILE_AS_L2, "AS_L2", "Advanced simple profile, L2"}, @@ -127,7 +127,7 @@ gst_xvidenc_profile_get_type (void) }; xvidenc_profile_type = - g_enum_register_static ("GstXvidEncProfiles", xvidenc_profiles); + g_enum_register_static ("GstXvidEncProfiles", xvidenc_profiles); } return xvidenc_profile_type; @@ -150,8 +150,9 @@ gst_xvidenc_get_type (void) 0, (GInstanceInitFunc) gst_xvidenc_init, }; + xvidenc_type = g_type_register_static (GST_TYPE_ELEMENT, - "GstXvidEnc", &xvidenc_info, 0); + "GstXvidEnc", &xvidenc_info, 0); } return xvidenc_type; } @@ -182,22 +183,22 @@ gst_xvidenc_class_init (GstXvidEncClass * klass) /* encoding profile */ g_object_class_install_property (gobject_class, ARG_PROFILE, g_param_spec_enum ("profile", "Profile", "XviD/MPEG-4 encoding profile", - GST_TYPE_XVIDENC_PROFILE, XVID_PROFILE_S_L0, G_PARAM_READWRITE)); + GST_TYPE_XVIDENC_PROFILE, XVID_PROFILE_S_L0, G_PARAM_READWRITE)); /* bitrate */ g_object_class_install_property (gobject_class, ARG_BITRATE, g_param_spec_int ("bitrate", "Bitrate", - "Target video bitrate (kbps)", 0, G_MAXINT, 512, G_PARAM_READWRITE)); + "Target video bitrate (kbps)", 0, G_MAXINT, 512, G_PARAM_READWRITE)); /* keyframe interval */ g_object_class_install_property (gobject_class, 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 (gobject_class, ARG_BUFSIZE, g_param_spec_ulong ("buffer_size", "Buffer Size", - "Size of the video buffers", 0, G_MAXULONG, 0, G_PARAM_READWRITE)); + "Size of the video buffers", 0, G_MAXULONG, 0, G_PARAM_READWRITE)); gobject_class->set_property = gst_xvidenc_set_property; gobject_class->get_property = gst_xvidenc_get_property; @@ -236,7 +237,7 @@ gst_xvidenc_init (GstXvidEnc * xvidenc) xvidenc->profile = XVID_PROFILE_S_L0; xvidenc->bitrate = 512; xvidenc->max_b_frames = 2; - xvidenc->max_key_interval = -1; /* default - 2*fps */ + xvidenc->max_key_interval = -1; /* default - 2*fps */ xvidenc->buffer_size = 512; /* set xvid handle to NULL */ @@ -281,7 +282,7 @@ gst_xvidenc_setup (GstXvidEnc * xvidenc) if ((ret = xvid_encore (NULL, XVID_ENC_CREATE, &xenc, NULL)) < 0) { GST_ELEMENT_ERROR (xvidenc, LIBRARY, INIT, (NULL), - ("Error setting up xvid encoder: %s (%d)", gst_xvid_error (ret), ret)); + ("Error setting up xvid encoder: %s (%d)", gst_xvid_error (ret), ret)); return FALSE; } @@ -318,9 +319,9 @@ gst_xvidenc_chain (GstPad * pad, GstData * _data) if (xvidenc->width == xvidenc->stride) { xframe.input.plane[0] = GST_BUFFER_DATA (buf); xframe.input.plane[1] = - xframe.input.plane[0] + (xvidenc->width * xvidenc->height); + xframe.input.plane[0] + (xvidenc->width * xvidenc->height); xframe.input.plane[2] = - xframe.input.plane[1] + (xvidenc->width * xvidenc->height / 4); + xframe.input.plane[1] + (xvidenc->width * xvidenc->height / 4); xframe.input.stride[0] = xvidenc->width; xframe.input.stride[1] = xvidenc->width / 2; xframe.input.stride[2] = xvidenc->width / 2; @@ -334,9 +335,9 @@ gst_xvidenc_chain (GstPad * pad, GstData * _data) gst_xvid_init_struct (xstats); if ((ret = xvid_encore (xvidenc->handle, XVID_ENC_ENCODE, - &xframe, &xstats)) < 0) { + &xframe, &xstats)) < 0) { GST_ELEMENT_ERROR (xvidenc, LIBRARY, ENCODE, (NULL), - ("Error encoding xvid frame: %s (%d)", gst_xvid_error (ret), ret)); + ("Error encoding xvid frame: %s (%d)", gst_xvid_error (ret), ret)); gst_buffer_unref (buf); gst_buffer_unref (outbuf); return; @@ -397,13 +398,13 @@ gst_xvidenc_link (GstPad * pad, const GstCaps * vscaps) GstCaps *new_caps; new_caps = gst_caps_new_simple ("video/x-xvid", - "width", G_TYPE_INT, w, - "height", G_TYPE_INT, h, "framerate", G_TYPE_DOUBLE, fps, NULL); + "width", G_TYPE_INT, w, + "height", G_TYPE_INT, h, "framerate", G_TYPE_DOUBLE, fps, NULL); ret = gst_pad_try_set_caps (xvidenc->srcpad, new_caps); if (GST_PAD_LINK_FAILED (ret)) { if (xvidenc->handle) { - xvid_encore (xvidenc->handle, XVID_ENC_DESTROY, NULL, NULL); - xvidenc->handle = NULL; + xvid_encore (xvidenc->handle, XVID_ENC_DESTROY, NULL, NULL); + xvidenc->handle = NULL; } } @@ -482,8 +483,8 @@ gst_xvidenc_change_state (GstElement * element) switch (GST_STATE_PENDING (element)) { case GST_STATE_PAUSED_TO_READY: if (xvidenc->handle) { - xvid_encore (xvidenc->handle, XVID_ENC_DESTROY, NULL, NULL); - xvidenc->handle = NULL; + xvid_encore (xvidenc->handle, XVID_ENC_DESTROY, NULL, NULL); + xvidenc->handle = NULL; } break; default: |