[gst-devel] [libgstdshow] gstdshwvideosrc - patch to use other video size

Julien.Isorce at alumni.enseeiht.fr Julien.Isorce at alumni.enseeiht.fr
Sun Feb 17 03:19:31 CET 2008


Hi

In the actual source code of gstdshwvideosrc.h and .c, it is not possible
to use other video size than the default (one default for each video
format rgb ,yuv..., often 320*240)

So I found a solution to use other video sizes than the default for each
video format, for example if you want use 720*576 or 1920*1080 .. and if
the default is 320*240 ...)

I join to this mail the two new files gstdshowvideosrc.c et
gstdshowvideosrc.h

In gstdshowvideosrc.c I replace :
hres = IFilterGraph_ConnectDirect (src->filter_graph,
pin_mediatype->capture_pin, input_pin, NULL);
by this one :
hres = IFilterGraph_ConnectDirect (src->filter_graph,
pin_mediatype->capture_pin, input_pin, pin_mediatype->mediatype);

Then I defined 3 more properties:
force_size (is yes, filter will use given size)
width (given frame width)
height (given frame height)

So then gst-inspect-0.10 return :
  force-size          : Use forced size
                        flags: readable, writable
                        Boolean. Default: false Current: false
  width               : Forced frame width
                        flags: readable, writable
                        Integer. Range: 80 - 1920 Default: 720 Current: 0
  height              : Forced frame height
                        flags: readable, writable
                        Integer. Range: 60 - 1080 Default: 576 Current: 0

And the command line is like this :
gst-launch-0.10 dshowvideosrc force-size=1 width = 720 height = 576 !
ffmpegcolorspace ! autovideosink
or
gst-launch-0.10 dshowvideosrc force-size=1 width = 720 height = 576 !
video/x-raw-yuv, format=(fourcc)UYVY ! ffmpegcolorspace ! autovideosink if
I want to be sure to use UYVY for example.

It is possbile to use the filter normally :
gst-launch-0.10 dshowvideosrc ! ffmpegcolorspace ! autovideosink
or
gst-launch-0.10 dshowvideosrc ! video/x-raw-yuv, format=(fourcc)UYVY,
width=320, height=240 ! ffmpegcolorspace ! autovideosink
or
gst-launch-0.10 dshowvideosrc ! video/x-raw-rgb ! ffmpegcolorspace !
autovideosink
etc...

I join to this mail the two new files gstdshowvideosrc.c et
gstdshowvideosrc.h

I am waitting your reactions.

I will be happy that my addon be in the new release !

Sincerely,

Julien Isorce

(Actually mailing list cannot accept attachements, so i cannot join the
two files !)




More information about the gstreamer-devel mailing list