CameraBin

Contents

  1. CameraBin 2
    1. Modules
      1. CameraSrc
      2. Image Capture Bin
      3. Video Recording Bin
      4. Viewfinder Bin
    2. Use Cases
    3. Other features
    4. Intentionally not handled
    5. Open Questions
    6. Links
  2. CameraBin
    1. TODO
    2. dataflow
    3. focusing
    4. continuous shooting
    5. bracketing
    6. recording timestamps
    7. Open Items
      1. effect preview
      2. isp internal effects and effect selection
      3. highspeed capture

CameraBin 2

Current camerabin is a single element and has some complex code with input/output-selectors for controlling the flow of buffers. Making it more modularized and with less -selectors would simplify the code a lot. We hope caps negotiation will be simplified, too. And more tricky features could be implemented inside still/video capturing modules(bins). We could also switch a whole sub-bins to ones with a different implementations. The multi-pad source design enables optimizations for hardware that can stream simultaneously on all pads.

Even though the new camerabin will provide the same basic functions as the current one (and have quite similar API), it will be built from ground up again with a different design. We should make it camerabin2 and take it in parallel with camerabin. This way we avoid major regressions and api changes hassle to applications using current camerabin. When they feel ready, the switch to camerabin2 wouldn't be hard. Also, we can keep bugfixing on old camerabin and keeping everything using it working.

Modules

CameraBin2 will have 4 internal modules (bins), it should be possible to use any of them outside of camerabin2 (applications, like Empathy and Cheese could make use of those):

CameraBin2.png.

CameraSrc

The embedded world has complex camera drivers that offer more functionality that classic v4l2. E.g. they might have parallel outputs at the same time. The idea here is to make a more complex camerasource api. This could be implemented as a linux-camera-source (as a bin), reusing what we have in CameraBin, or be implemented on top of a different api providing these features as a monolithic block (e.g. gst-omx based camera-source).

This should be done as a baseclass (subclassing a GstBin), with the following features:

This would be the potential class hierarchy:

GstBin
  GstBaseCameraSrc
    GstSimpleV4l2CameraSrc
    GstOmxCameraSrc
    ...

If the actual camera plugin is already implemented extending e.g. GstPushSrc, then one would still subclass a new element from GstBaseCameraSrc and insert the GstPushSrc based camera element there. In the most simple case the wrapper for a powerful hardware based camera source proxies gobject properties and links the internal element pads to the bins ghostpads. We would definitely want to have a GstSimpleV4l2CameraSrc as a reference implementation and also providing legacy/fallback support.

Image Capture Bin

Received the image buffers from the camera source, encodes them and saves to disk. Must have queues internally to allow further captures to be taken while others are encoding.

Video Recording Bin

Responsible for recording video and audio. The video buffers are generated from the camera source, audio is recorded from a internal audio source element (that might be muted by the application).

Viewfinder Bin

Use Cases

Other features

Intentionally not handled

Open Questions

CameraBin

TODO

At some point we'd like to move CameraBin to gst-plugins-good. CameraBin already has unit tests and documentation. It is currently in use on Nokia N900 and is considered for cheese. This page lists things that should be done before declaring it stable.

dataflow

In current CameraBin we have a link from videobin back to viewfinder to so what we record. When we do the camera-source baseclass, we should move the input-selector to the GstSimpleV4l2CameraSrc implementation or even get rid of the selectors and provide paralell dataflow if needed. Keeping the viewfinder active is important for the cases where one has analyzers in e.g. the viewfinder-slot to get continuous analysis results in videorecording or continuous shooting.

Open items here:

focusing

We need more focus mode. Right now the API can start AF and get a signal when AF is done. There are also camera subsystems providing continuous focusing, where we would just lock the AF on half press, adjust frame and shot.

continuous shooting

We would set the queue to leaky and block the capture pad. In contrast to single capture mode, we would keep capture-setting frozen and let a frame through, each time the capture button is pressed.

bracketing

Lock settings, take various shots with some settings changed, merge single images with some filter. We can use the GstController for scheduling the parameter changes. Some issues with that though:

recording timestamps

Try pushing a newsegment to videobin, instead of rebasing timestamps with a buffer-probe.

Open Items

effect preview

When adding effects to imagebin or videobin, we might want to get a preview on viewfinder for those too. We either need to apply certain effect in the source already or add them twice.

isp internal effects and effect selection

Right now camerabin offers slots for setting effects on each of the imagebin, viewfinderbin and videobin. Some ISPs (image signal processor) come with internal effects (e.g. videostabilisation). Effect settings should then be exposed as gobject properties on the camera source, so that a camera ui can set a gstreamer plugin as an effect and link the ui to the gobject properties or activate the isp internal effect and connect the ui to the properties of that.

The effect parameters should not be added to GstPhotography to avoid it growing unbounded. GstPhotography is for capture settings. This is needed for post processing effects.

highspeed capture

We might need a videorate element infront of the viewfinder bin to reduce the framerate there.


TODO: add more from http://live.gnome.org/Cheese/ThreeZero?action=AttachFile&do=get&target=cheese-threezero-meeting-log.txt