• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1Capsnego patterns
2-----------------
3
4
5
6
7src negotiation recovery
8------------------------
9
10common pipelines like
11
12 filesrc -> mad -> osssink
13
14perform negotiation strictly left to right. At some point during
15iterate, mad will know the caps of the media stream and will need
16to inform osssink of this before pushing out a buffer.
17mad only has one set of fixed caps.
18
191) try_set_caps
20
21 mad does a try_set_caps with the caps if all goes well, osssink
22 accepts and negotiation succeeds.
23
24 if the try_set_caps function fails, the application should have
25 a change to recover.
26
27 - mad therefore calls gst_pad_caps_error_try_recover, this will
28   emit a signal on the pad that the app can catch. One of the
29   signal arguments will contain a list of possible caps.
30
31 - the app can use the allowed caps to find another element that
32   is compatible with the caps and the peer element caps.
33
34 - the app will connect the new element with mad, negotiation
35   will happen again, the link will fail or succeed, if it fails,
36   thr app knows because the link function returns FALSE.
37
38 - if the link succeeds, pad caps are set and the try_recover
39   function returns TRUE, mad then knows the issue was resolved
40   and can continue. It will have received the final caps in its
41   srclink function.
42
43 - if no signal handler is connected to the caps_nego_failure signal
44   the issue will remain unresolved and a big debug warning is
45   printed on the console to debug the issue. mad will get a
46   return value of FALSE and may stop.
47
48
49