• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1=== Camerabin2 Source Requirements (draft) ===
2
3This small document contains a collection of notes on different requirements
4of a camerabin2 source element.
5
6
7-- General --
8It is recommended that camerabin2 source elements inherit from basecamerasrc
9from gst-plugins-bad.
10
11
12-- Pads --
13Camerabin2 sources must have 3 static pads named 'vfsrc', 'imgsrc' and
14'vidsrc'.
15
16From an external point of view, all 3 pads work independently and camerabin2
17makes no assumptions about relations about them (caps they can produce, or if
18the same buffer is pushed to 2 different pads).
19
20'vfsrc' is the pad where the viewfinder buffers should be pushed, it will
21be feeding a video sink. This is the same scenario as a 'regular' source
22feeding a video sink. Buffers should be continuously pushed on this pad.
23
24'imgsrc' is the pad where image capture buffers are pushed. Timestamps aren't
25really important here as the images are going to be encoded and saved
26separately from each other. For each capture in image mode, one buffer should
27be pushed on this pad.
28
29'vidsrc' is the pad where video capture buffers are pushed. Once capture is
30started, buffers should start being pushed on this pad until the capture is
31stopped.
32-> TODO - define how segments/timestamps should work here
33-> TODO - How to make audio and video sync properly
34
35
36-- Capture --
37The sources should have a 'mode' property that informs the source of the
38current capturing mode. The available options are image or video.
39
40There are 2 signals that should be implemented, start-capture and
41stop-capture, they take no arguments.
42
43On image mode, start-capture tells the source to push an image capture
44buffer on its imgsrc pad. For video mode, start-capture tells the source
45to start pushing buffers on the vidsrc pad, it should only stop
46pushing when a stop-capture signal is received. In either case, it is
47recommended that the viewfinder pad keeps pushing buffers so the user
48has a smooth experience.
49
50Note that basecamerasrc already has the mode property and start/stop-capture
51signals. It has functions that should be overridden by its child classes to
52implement the handling of these actions.
53
54
55-- Previews --
56Camerabin2 sources must have a post-previews boolean property that the user
57can select if we wants or not preview images.
58
59Previews are posted on the bus as custom 'preview-image' messages. This message
60must have a 'buffer' field that contains a GstBuffer, the preview.
61
62Additionally, there should be a preview-caps property that is used to inform the
63camera source what is the expected format of the preview image.
64
65A preview image should be posted for each capture.
66
67
68-- Negotiation --
69Capture caps selection on camerabin2 works just like gstreamer's default
70caps negotiation. Camerabin2 puts capsfilters downstream from each of the
71camera source pads. The camera source can simply get_caps on the peer of
72each of its pads to know what are the allowed caps for that pad.
73
74