From: Jan S. <th...@no...> - 2005-01-10 15:49:31
|
On Mon, 2005-01-10 at 15:15 +0100, Benjamin Otte wrote: > General comment: We need a good intro on what link and getcaps functions > do, since a lot of people have a hard time understanding what this part of > a plugin does. http://gstreamer.freedesktop.org/data/doc/gstreamer/head/pwg/html/chapter-building-pads.html and http://gstreamer.freedesktop.org/data/doc/gstreamer/head/pwg/html/section-pads-getcapsfn.html have something like this. Perhaps it could be expanded, or we could make a plugin-writers FAQ somewhere nearby or in the PWG? *snip* > It might be useful to dump some output to a file (via 4vlsrc ! filesink or > whatever) and use that. This is easy if Bayer frames are fixed size. > Just run the pipeline like this: > gst-launch gnomevfssrc location=/path/to/frames bytesperread=$framesize ! > bayerdec ! ... > (You need to use gnomevfssrc here because filesrc's blocksizes need to be > multiples of 2 iirc.) > > Off Topic: This trick works nicely for raw video dumps, too. Just run > something like > gst-launch gnomevfssrc location=/path/to/frames bytesperread=153600 ! > video/x-raw-yuv,width=320,height=240,framerate=25.0,format=\(fourcc\)I420 > ! xvimagesink > and you can view it. *snip* > Maybe have a look at a simple video decoder (if we have those - do we have > simple ones, I can only come up with mpeg2dec and ffmpeg and they're both > not simple) or colorspace transformation plugins (I believe there's an > alpha plugin somewhere that does I420=>AYUV or so?) > Anyway, some tips I find useful when doing caps stuff: > > 1) the simplest solution to get a plugin working first and not need > to care about link and getcaps is to only decode a fixed format. Elements > that only decode a fixed format don't need link or getcaps functions, they > specify the supported format in their fixed pad templates. Fixed caps can > easily be found: They don't contain ranges ("[x, y]") or lists ("{x, y, > ...}"). > > 2) when implementing caps stuff, particularly caps negotiation, the > GST_PADS debugging category is important. So running your app with > --gst-debug=GST_PADS:5 might clue you in on quite some stuff. > It might also be useful for general understanding to just watch what > happens when you run simple GStreamer pipelines with that debugging > output, like gst-launch videotestsrc ! xvimagesink --gst-debug=GST_PADS:5 > or gst-launch v4lsrc ! xvimagesink --gst-debug=GST_PADS:5 > > 3) Get to know gst-launch filtercaps syntax. It's very helpful if you can > just force a particular caps. > This is good stuff. I think it should go in the PWG somewhere too. J. -- Jan Schmidt <th...@no...> |