old gst-plugins ChangeLog
[platform/upstream/gstreamer.git] / docs / random / walkthrough
1 OUTDATED
2 --------
3
4 You might start by creating a source element and put it into a pipeline.
5 At this point both element's state would be GST_STATE_NEW, since they
6 don't have enough state to actually run yet.  At this point you can set
7 the filename of the source, and possibly bytesperread and other things.
8
9 Then you'd want to discover the data type of the file you're sourcing.
10 This will typically be handled by the pipeline itself by calling
11 gst_pipeline_autoplug(), or gst_pipeline_find_pad_type(), or somesuch. The
12 pipeline would first set its state to GST_STATE_DISCOVERY.  A gstfindtype
13 sink would be added to the pipeline and connected to the source.  Its
14 HAVE_TYPE signal would be connected to a private pipeline function.
15
16 The pipeline would then set the the src state to GST_STATE_DISCOVERY, and
17 call the src's push() function until a the type is set by the function
18 connected to the gstfindtype element's signal.  At this point the pipeline
19 would disconnect the gstfindtype element from the src, set the type of the
20 pad to the type returned by the gstfindtype element.  At disconnection of
21 the find element, the src's state automatically reverts to NEW.
22
23 (The trick with the sources when they do DISCOVERY is that synchronous
24 sources can't go back and read data again.  So perhaps I should set up a
25 wrapper function for the push() function that uses either a sync or
26 async function as provided by the src instance to provide DISCOVERY and
27 normal operations.  It would use a [GstBufferCache] to read ahead into
28 memory if necessary, creating baby buffers as necessary to answer the
29 needs of each DISCOVERY sequence.)
30
31 If you called find_pad_type(), it would return right about now, with the
32 ID of the type it found.  At the same time, if you have connected a signal
33 to the pad's SET_TYPE signal, it would fire right as the type is set by
34 the find_pad_type() function.  This would allow your application to do its
35 own selection of filters to connect to the pad.
36
37 If you called autoplug(), the pipeline would make a selection of element
38 to connect.  The element would be created (state=NEW), added to the
39 pipeline, and the appropriate sink pad connected to the src in question.
40 (Note that multi-sink elements won't be supported unless there's a really
41 good and obvious way to do so)  The whole process would repeat until the
42 recently added element no longer has a src pad.