writing a new source plugin
Pazzo Da Legare
pazzodalegare at gmail.com
Fri Mar 30 17:03:25 PDT 2012
Thank you for your answer.
2012/3/30 Stefan Sauer <ensonic at hora-obscura.de>:
> 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.
Yes, obviously you're right. I didn't explain very well. My source
will not receive video nor metadata (directly from other gstreamer
element) but will "read" a source of metadata (via network) coming
from piece of software, outside gstreamer world, that read a video
stream (live) and produce a stream of metadata.Those metadata, some of
them, can be overlayed on a video stream (live). The video stream has
a timestamp and metadata are produced with the same timestamp as
reference. I would like to mix metadata and video; so I start writing
a src plugin first and then an n-way-1 muxer to mix them.
>> 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
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
More information about the gstreamer-devel