writing a new source plugin
ensonic at hora-obscura.de
Fri Mar 30 11:17:12 PDT 2012
On 03/30/2012 02:50 PM, Pazzo Da Legare wrote:
> Dear All,
> I would like to write a new gstreamer source plugin to put in a
> gstreamer pipeline a new type of data, say a metadata, calculated by
> an algorithm which uses a live video stream as input and give as
> output a stream of metadata.
A source plugin has no inputs. It only has outputs.
> Then I would like to put in sync the video stream and metadata, using
> the timestamp of video and timetamp of metadata.
This sounds more like a filter that receives video, analyzes it, ouputs
the video unmodified and emits the metadata. The metadata can be send as
messages to the application or also send as a separate stream. Usually
analyzers send them as messages (look at videoanalyse in plugins-bad).
> So I start reading a PWG (plugin writer's guide) and having a look a
> some examples but I didn't find one example that fit my will. I start
> inheriting from GstBaseSrc and now I'm trying to understand exactly
> how to use functions that have to be written (could be written for my
> In particular my src plugin receives calls (after get_caps, start,
> is_seekable, negotiate, stop):
> - [*do_seek] with seeking time segment start=0:00:00.000000000,
> stop=99:99:99.999999999, last_stop=0:00:00.000000000,
> duration=99:99:99.999999999, rate=1.000000, applied_rate=1.000000,
> flags=0x00, time=0:00:00.000000000, accum=0:00:00.000000000
> What should I do in my implementation, say I have a buffer of metadata
> starting a time t1 and ending a time t2 ?
> - [*create]: create called: offset -1, size 4096
> why gstreamer (my sink? I'm using a fakesink) is asking for offset -1
> and size 4096 (where it come from?); what should I implement/override
> for BaseSrc, (*get_size function ?).
> I forgot to say that I set my plugin through gst_base_src_set_format
> to GST_FORMAT_TIME.
> Finally could you please indicate to example of BaseSrc derived plugin
> to have a look at one for push and one for pull mode and eventually
> indicate me other documentation in addition to what I found on
> Gstreamer homepage?
> Thank you for your patience,
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
More information about the gstreamer-devel