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