summaryrefslogtreecommitdiff
path: root/docs/random/design
blob: 6a337f46cc628e5b44387469da83cd9320dfd9b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
GNonLin Design Document

Global Overview
---------------

GNonLin works as a companion library for GStreamer, in order to be able to
easily manipulate and assemble media streams through time, and use that 
composition in any GStreamer graph just like any other GStreamer element.

GNonLin Object (GnlObject)
--------------------------

  Base class for all GNonLin objects. Virtual class.

  Contains all the properties, functions and methods for time-shifting.

* Properties:

  _ start: Start position of the object in it's container.
  _ duration: Duration of the object in it's container.
  _ stop: Stop position of the object in it's container (read-only, computed
	from start and duration properties).

  _ media-start: Start position of the element controlled by the object.
  _ media-duration: Duration of the element controlled by the object.
  _ media-stop: Stop position of the element controlled by the object
	(read-only, computed from media-start and media-duration properties).

  _ rate: Rate of the outgoing stream (read-only, computed from duration and
	media-duration properties).

  _ caps: GstCaps used to filter the object's caps. The first pad whose caps
	intersect with these caps will be used by the GnlObject.
  _ priority: Priority of the object in it's container GnlComposition. 0 is
	the highest priority (the object will supersed any other object set
	to play at the same time), and 2^32 is the lowest priority (the object
	will be scheduled to play if nothing else is set to play at that time).
  _ active: If set to FALSE, this object will not be used in it's container
	GnlComposition

* Time-shifting:

    The values set for start, duration, media-start and media-duration will be
  used to decide which section will be taken in the controlled element, and
  how it will be shifted in time.
    The outputted data will be [media-start -> media-stop] from the controlled
  element , shifted to appear as [start -> stop].
    This time-shifting is done by intercepting incoming and outgoing events in
  the element pad controlled by the GnlObject.

GNonLin source (GnlSource)
--------------------------

  Object for controlling source elements (only provide data).

* Controlling a GstElement:

    The GnlSource can control a source GstElement which is added to it (using
  the standard gst_bin_add() function).
    If the element provides several pads, the first pad whose caps intersect the
  one specified in the caps property will be used.

GNonLin file source (GnlFileSource)
-----------------------------------

  Convenience source. Contains a filesource and a decodebin element.

* Source file

    The location of the file to control.

GNonLin operation (GnlOperation)
--------------------------------

  Object for controlling multiple-input single-output elements.

* Controlling an effect GstElement:

    The same rules applies here as for GnlSource. The only difference is that
  the operation will check that the given element has (potential) input sources.

* Number of inputs:

    The number of inputs to be used by this operation is set with the 'inputs'
  priority. This will be used by the container composition to automatically
  link it to the proper sources.
    The default value, 0, means that it will be up to the parent composition to
  request new input pads if it needs more. If a value was specified, then the
  composition will only use those N inputs. This suits both the cases where, the
  developer automatically wants that operation to apply to all the underlying
  sources, and the case where the developers only wants that operation to apply
  to a given number of underlying sources.


GNonLin composition (GnlComposition)
------------------------------------

  Contains GnlObjects and connects them dynamicly to create a composition.

* Adding/Removing objects to the composition:

    Any GnlObject derivative can be added/removed to/from a composition using
  the standard gst_bin_add()/gst_bin_remove() methods.

* What is played at any given time:

    The object taken for output at one given time is the object:
    _ which is active
    _ AND is set for that time (start <= time < stop)
    _ AND has the highest priority (smallest numerical value)

    If that object is an operation which has N sinkpads, the composition will
  recursively connect the GnlObjects by increasing priorities:
    _ which are active
    _ AND set for that time (start <= time < stop)
    _ If the object is an operation, recursively apply this rule.


Object Hierarchy:
-----------------

GstBin
 !
 +--- GnlObject
       !
       +--- GnlSource
       !     !
       !     +--- GnlFileSource
       !
       +--- GnlOperation
       !
       +--- GnlComposition