[gst-devel] interlacing?

Ronald Bultje rbultje at ronald.bitfreak.net
Wed Oct 3 05:21:07 CEST 2001


Hey all,

how do I handle interlacing in gstreamer? The MJPEG-device-grabbed output
from v4lmjpegsrc might be interlaced so is there any convention yet on how
to tell that the buffer is interlaced and which kind of interlacing?
(topfieldfirst, bottomfieldfirst or not-interlaced).

I guess adding interlacing type to GstCaps for the plugin is the simplest
solution, but then you need a convention what is topfieldfirst,
bottomfieldfirst and such.... So I propose that somewhere in gstreamer, the
following #defines's are added:

#define GST_INTERLACING_NOT_INTERLACED     0
#define GST_INTERLACING_TOP_FIELD_FIRST    1
#define GST_INTERLACING_BOTTOM_FIELD_FIRST 2
(and maybe)
#define GST_INTERLACING_UNKNOWN            99

Then, I can simply use:

  caps = GST_CAPS_NEW ("v4lmjpegsrc_caps", "video/jpeg", gst_props_new(
    "width",       GST_PROPS_INT(plugin->width),
    "height",      GST_PROPS_INT(plugin->height),
    "interlacing", GST_PROPS_INT(plugin->interlacing),
    NULL));

in my gst_*_create_caps() function and be sure that other plugins also know
that 0 is actually not-interlaced and 1 is TFF and 2 is BFF. So, is this
acceptable?

Btw, jpegdec/jpegenc also need a rewrite because jpegdec doesn't handle
interlaced input JPEG data correctly. jpegenc cannot create interlaced
frames afaik. Our (mjpegtools') jpegutils.[ch] do handle this correctly
(they do exactly the same), so if you'll let me I can adapt
gstjpegdec/gstjpegenc to work with interlaced input/requests as well...
This would be very helpful for allowing framegrabbing from
MJPEG/V4l-devices and keeping the output movies compatible with the
mjpegtools.

Comments?

Ronald

-- 
-   .-.
-   /V\    | Ronald Bultje <rbultje at ronald.bitfreak.net>
-  // \\   | Running: Linux 2.4.4 and OpenBSD 2.8
- /(   )\  | http://ronald.bitfreak.net/
-  ^^-^^





More information about the gstreamer-devel mailing list