Merge remote-tracking branch 'origin/0.10'
[platform/upstream/gstreamer.git] / docs / random / wtay / capsnego-cases
1 OUTDATED
2 --------
3
4
5 pad has caps
6 | pad has template
7 |/ pad has negotiate function
8 ||/
9 --- -> ---
10
11 always compatible
12
13 --+ -> ---
14
15 call negotiate function, set the resulting caps
16
17 -+- -> ---
18
19 always compatible
20
21 -++ -> ---
22
23 call negotiate function, set the resulting caps
24
25 +-- -> ---
26
27 always compatible, caps are those of the pad
28
29 +-+ -> ---
30
31 always compatible, caps are those of the pad
32
33 ++- -> ---
34
35 always compatible, caps are those of the pad
36
37 +++ -> ---
38
39 always compatible, caps are those of the pad
40
41 =====================================
42 pad has caps
43 | pad has template
44 |/ pad has negotiate function
45 ||/
46
47 --- -> --+
48
49 call negotiate function, set the resulting caps
50
51 --+ -> --+
52
53 negotiate until agreed
54
55 -+- -> --+
56
57 call negotiate until caps match padtemplate
58
59 -++ -> --+
60
61 negotiate until agreed, caps only got send to the
62 other pad if they match the padtemplate
63
64 +-- -> --+
65
66 call negotiate function with src caps, set caps if ok
67
68 +-+ -> --+
69
70 call negotiate function with src caps, negotiate until agreed
71
72 ++- -> --+
73
74 call negotiate function with src caps, set caps if ok
75
76 +++ -> --+
77
78 call negotiate function with src caps, negotiate until agreed
79
80 =====================================
81 pad has caps
82 | pad has template
83 |/ pad has negotiate function
84 ||/
85
86 --- -> -+-
87
88 always compatible
89
90 --+ -> -+-
91
92 call negotiate until caps match padtemplate
93
94 -+- -> -+-
95
96 check padtemplates, if compatible connect
97
98 -++ -> -+-
99
100 check templates, if compatible,
101 call negotiate, until it matches the padtemplate
102
103 +-- -> -+-
104
105 check caps against padtemplate, if compatible, connect
106
107 +-+ -> -+-
108
109 check caps against padtemplate, if compatible: connect
110 alse call negotiate until it matches template
111
112 ++- -> -+-
113
114 check caps against padtemplate, if match, connect
115
116 +++ -> -+-
117
118 check caps against padtemplate, if match, connect
119 alse check padtemplates if compatible,
120 call negotiate until match template
121
122
123 =====================================
124
125 pad has caps
126 | pad has template
127 |/ pad has negotiate function
128 ||/
129
130 --- -> -++
131
132 call negotiate, set resulting caps
133
134 --+ -> -++
135
136 call negotiate until agree, check src caps against
137 padtemplate before calling sink negotiate
138
139 -+- -> -++
140
141 check padtemplates, if match call negotiate until
142 match src padtemplate.
143
144 -++ -> -++
145
146 check padtemplates, if match call negotiate until
147 agree
148
149 +-- -> -++
150
151 check caps against padtemplate
152 call negotiate with caps, if agree, set caps
153
154 +-+ -> -++
155
156 check caps against padtemplate
157 call negotiate with caps, negotiate until agree
158
159 ++- -> -++
160
161 check caps against padtemplate
162 call negotiate with caps, call negotiate until
163 sink caps match src padtemplate
164
165 +++ -> -++
166
167 check caps against padtemplate
168 call negotiate with caps, negotiate until agree
169
170
171 =====================================
172
173
174 pad has caps
175 | pad has template
176 |/ pad has negotiate function
177 ||/
178
179 --- -> +--
180
181 connection fails
182
183 --+ -> +--
184
185
186
187 -+- -> +--
188
189
190 -++ -> +--
191
192
193 +-- -> +--
194
195
196 +-+ -> +--
197
198
199 ++- -> +--
200
201
202 +++ -> +--
203
204 check caps, 
205 call src negotiate with caps
206
207
208 =====================================
209
210 pad has caps
211 | pad has template
212 |/ pad has negotiate function
213 ||/
214
215 --- -> +-+
216
217
218 --+ -> +-+
219
220
221 -+- -> +-+
222
223
224 -++ -> +-+
225
226
227 +-- -> +-+
228
229
230 +-+ -> +-+
231
232
233 ++- -> +-+
234
235
236 +++ -> +-+
237
238
239 =====================================
240
241 pad has caps
242 | pad has template
243 |/ pad has negotiate function
244 ||/
245
246 --- -> ++-
247
248
249 --+ -> ++-
250
251
252 -+- -> ++-
253
254
255 -++ -> ++-
256
257
258 +-- -> ++-
259
260
261 +-+ -> ++-
262
263
264 ++- -> ++-
265
266
267 +++ -> ++-
268
269
270 =====================================
271
272 pad has caps
273 | pad has template
274 |/ pad has negotiate function
275 ||/
276
277 --- -> +++
278
279
280 --+ -> +++
281
282
283 -+- -> +++
284
285
286 -++ -> +++
287
288
289 +-- -> +++
290
291
292 +-+ -> +++
293
294
295 ++- -> +++
296
297
298 +++ -> +++
299
300
301 =====================================
302
303   srccaps = GST_PAD_CAPS (srcpad);
304   srctempl = FALSE;
305
306   do {
307
308     //no caps, get one
309     if (!srccaps) 
310     {
311       if (srcpad->negotiatefunc && !srctempl) 
312       {
313         srccaps = srcpad->negotiatefunc (srpad, srcaps, counter);
314         srctempl = FALSE;
315       }
316       else 
317       {
318         srccaps = gst_pad_get_caps (srcpad);    
319         srctempl = TRUE;
320       }
321     }
322
323     /* check against other pad */
324     
325     // the other pad doesn't want to negotiate
326     if (!sinkpad->negotiatefunc) 
327     {
328       sinkcaps = gst_pad_get_caps (sinkpad);
329
330       if (!sinkcaps)
331         break;
332
333       if (gst_caps_check_compatibility (srccaps, sinkcaps)) 
334       {
335         // cool
336         break;
337       }
338     }
339     else {
340       switch pads;      
341     }
342
343   } while (counter < 100);
344
345
346
347
348
349