RidgeRun Camera App

From RidgeRun Developer Wiki
Revision as of 14:16, 23 March 2015 by Spalli (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This article discusses libgstcam, RidgeRun's simplified library for gstreamer-oriented camera devices.

Introduction

libgstcam is a C library developed by RidgeRun, intended for the easy access to gstreamer multimedia capabilities that correspond to a set of generic functionality usually related to the handling of a camera type device.

Through this library, highly specific but yet commonly expected capabilities such as video recording, snapshot taking, video streaming and others can be accessed without having to worry about the inner technical details of the gstreamer API, working as a sort of glue that links it effortlessly with the client's application and intended functionality. libgstcam is currently in development, however an overview of its current state can be seen below.

Along with the library, a set of example client applications is available, so that its usage and utility may become clear, and highly specific applications may be developed either using them as a base or as a useful reference, effortlessly taking out time from the development process so that the client may focus on its product's unique selling points rather than having to invest time on a generic integration process.

Available Functionality

Through the wrapper developed for the Vala camera interface, it's possible to get access to different functions that may control its behavior and properties. Some of these and their expected behavior are documented below:

  • CameraApp Library Initialization:
The library provides support for easy initialization, and even offers and auto loop creation option for those applications that might require the library to create its own glib main loop, in case the application doesn't run its own main loop.
  • Camera Linking:
Through the cameraHandler type, a camera can be linked to be used by all the available functions described below:
  • Starting and stopping the camera:
Through the very simple and pretty much auto-explanatory camera_start and stop functions, the camera can be either started or stopped.
  • Setting camera properties: It's also possible to set different properties related to the camera through the functions provided:
    • View Finder: Sets the camera's view finder property.
    • Image Encoder: Sets the image encoder used by the camera.
    • Image Muxer: Sets the image muxer used by the camera.
    • Image Name: Sets the target image name value.
    • Camera Mode: Sets the camera mode (snapshots, recording, etc...)
  • Taking Snapshots:
Taking a snapshot is straightforward with the camera_snapshot function.
  • Recording Video:
Similarly, video recording can be done either by using the respective start and stop functions, or by using the timed recording function, which allows to preemptively specify the duration of the recording without having to handle the duration elsewhere.
  • Setting video properties: In a similar fashion to the properties describe above, the ones referring to recording can also be set:
    • Video Encoder: Sets the camera video encoder.
    • Video Muxer: Sets the camera video muxer.