Capture

Creates an interface instance to the capture device driver. This module will allow you to get and return capture buffers from the v4l2 capture device. All platforms support the driver allocating it's own buffers, and some (like dm6467) support the user allocating contiguous buffers using CMEM and passing them in at creation. Typical use case for driver allocated buffers (dm6446 video window 0):. More...

Data Structures

struct  Capture_Attrs
 Attributes used to create a Capture device driver instance. More...

Typedefs

typedef struct Capture_Object * Capture_Handle
 Handle through which to reference a Capture device instance.

Enumerations

enum  Capture_Input {
  Capture_Input_SVIDEO = 0,
  Capture_Input_COMPOSITE,
  Capture_Input_COMPONENT,
  Capture_Input_CAMERA,
  Capture_Input_COUNT
}
 Video capture inputs. More...

Functions

Capture_Handle Capture_create (BufTab_Handle hBufTab, Capture_Attrs *attrs)
 Creates a Capture driver instance.
Int Capture_detectVideoStd (Capture_Handle hCapture, VideoStd_Type *videoStdPtr, Capture_Attrs *attrs)
 Detects the video standard of the input connected to a video.
Int Capture_get (Capture_Handle hCapture, Buffer_Handle *hBufPtr)
 Receive a captured buffer from the capture device driver.
Int Capture_put (Capture_Handle hCapture, Buffer_Handle hBuf)
 Send a captured buffer to the capture device driver instance to be filled with captured data.
Int Capture_delete (Capture_Handle hCapture)
 Deletes a Capture device driver instance.
VideoStd_Type Capture_getVideoStd (Capture_Handle hCapture)
 Get the VideoStd_Type of a previously created Capture device driver instance.
BufTab_Handle Capture_getBufTab (Capture_Handle hCapture)
 Get the BufTab_Handle of a previously created Capture device driver instance.

Variables

const Capture_Attrs Capture_Attrs_DM6446_DM355_DEFAULT
 Default attributes for video window 0 on dm6446 and dm355.
const Capture_Attrs Capture_Attrs_DM6467_DEFAULT
 Default attributes for video window 0 on dm6467.
const Capture_Attrs Capture_Attrs_DM365_DEFAULT
 Default attributes for video window 0 on dm365.
const Capture_Attrs Capture_Attrs_OMAPL138_DEFAULT
 Default attributes for video window 0 on omapl138.
const Capture_Attrs Capture_Attrs_OMAP3530_DEFAULT
 Default attributes for video window 0 on omap3530.

Detailed Description

Creates an interface instance to the capture device driver. This module will allow you to get and return capture buffers from the v4l2 capture device. All platforms support the driver allocating it's own buffers, and some (like dm6467) support the user allocating contiguous buffers using CMEM and passing them in at creation. Typical use case for driver allocated buffers (dm6446 video window 0):.

   #include <xdc/std.h>
   #include <ti/sdo/dmai/Dmai.h>
   #include <ti/sdo/dmai/Capture.h>
   #include <ti/sdo/dmai/BufferGfx.h>
   BufferGfx_Handle cBuf;
   Capture_Attrs cAttrs = Capture_Attrs_DM6446_DM355_DEFAULT;
   Capture_Handle hCapture;

   Dmai_init();
   hCapture = Capture_create(NULL, &cAttrs);
   while (1) {
       Capture_get(hCapture, &cBuf);
       // Process captured buffer "cBuf".
       Capture_put(hCapture, cBuf);
   }
   Capture_delete(hCapture);

Typedef Documentation

typedef struct Capture_Object* Capture_Handle

Handle through which to reference a Capture device instance.


Enumeration Type Documentation

Video capture inputs.

Enumerator:
Capture_Input_SVIDEO  S-Video video input.
Capture_Input_COMPOSITE  Composite video input.
Capture_Input_COMPONENT  Component video input.
Capture_Input_CAMERA  Camera/Imager card video input.

Remarks:
only applicable on DM368
Capture_Input_COUNT 


Function Documentation

Capture_Handle Capture_create ( BufTab_Handle  hBufTab,
Capture_Attrs attrs 
)

Creates a Capture driver instance.

Parameters:
[in] hBufTab The BufTab with buffers to use with the capture device. If NULL is passed, the capture driver will allocate it's own buffers.
[in] attrs Capture_Attrs to use for creating the Capture driver instance.
Return values:
Handle for use in subsequent operations (see Capture_Handle).
NULL for failure.

Int Capture_detectVideoStd ( Capture_Handle  hCapture,
VideoStd_Type videoStdPtr,
Capture_Attrs attrs 
)

Detects the video standard of the input connected to a video.

Parameters:
[in] hCapture The Capture_Handle of the device driver instance to get the video standard of. If this is set to NULL a temporary instance will be created for this call.
[out] videoStdPtr The VideoStd_Type of the capture device will be returned here.
[in] attrs Capture_Attrs which will be used to create the capture driver instance.
Return values:
Dmai_EOK for success.
Negative value for failure, see Dmai.h.

Int Capture_get ( Capture_Handle  hCapture,
Buffer_Handle hBufPtr 
)

Receive a captured buffer from the capture device driver.

Parameters:
[in] hCapture The Capture_Handle to get a buffer from.
[out] hBufPtr A pointer to the Buffer_Handle received.
Return values:
Dmai_EOK for success.
Negative value for failure, see Dmai.h.
Remarks:
Capture_create must be called before this function.

Int Capture_put ( Capture_Handle  hCapture,
Buffer_Handle  hBuf 
)

Send a captured buffer to the capture device driver instance to be filled with captured data.

Parameters:
[in] hCapture The Capture_Handle to send a buffer to.
[in] hBuf A Buffer_Handle to send to the capture device.
Return values:
Dmai_EOK for success.
Negative value for failure, see Dmai.h.
Remarks:
Capture_create must be called before this function.

Int Capture_delete ( Capture_Handle  hCapture  ) 

Deletes a Capture device driver instance.

Parameters:
[in] hCapture The Capture_Handle to delete.
Return values:
Dmai_EOK for success.
Negative value for failure, see Dmai.h.
Remarks:
Capture_create must be called before this function.

VideoStd_Type Capture_getVideoStd ( Capture_Handle  hCapture  ) 

Get the VideoStd_Type of a previously created Capture device driver instance.

Parameters:
[in] hCapture The Capture_Handle to get VideoStd_Type of.
Return values:
VideoStd_Type used by Capture device driver.
Remarks:
Capture_create must be called before this function.

BufTab_Handle Capture_getBufTab ( Capture_Handle  hCapture  ) 

Get the BufTab_Handle of a previously created Capture device driver instance.

Parameters:
[in] hCapture The Capture_Handle to get the BufTab_Handle from.
Return values:
VideoStd_Type used by Capture device driver.
Remarks:
Capture_create must be called before this function.


Variable Documentation

Default attributes for video window 0 on dm6446 and dm355.

 numBufs          = 3,
 videoInput       = Capture_Input_COMPOSITE,
 cropWidth        = -1,
 cropHeight       = -1,
 cropX            = -1,
 cropY            = -1,
 captureDevice    = "/dev/video0",
 smoothPad        = FALSE,
 videoStd         = VideoStd_AUTO,
 decoderIdx       = -1,
 colorSpace       = ColorSpace_UYVY,
 captureDimension = NULL,
 onTheFly         = FALSE

Default attributes for video window 0 on dm6467.

 numBufs          = 3,
 videoInput       = Capture_Input_COMPONENT,
 cropWidth        = -1,
 cropHeight       = -1,
 cropX            = -1,
 cropY            = -1,
 captureDevice    = "/dev/video0",
 smoothPad        = FALSE,
 videoStd         = VideoStd_AUTO,
 decoderIdx       = -1
 colorSpace       = ColorSpace_YUV422PSEMI,
 captureDimension = NULL,
 onTheFly         = FALSE

Default attributes for video window 0 on dm365.

 numBufs          = 3,
 videoInput       = Capture_Input_COMPONENT,
 cropWidth        = -1,
 cropHeight       = -1,
 cropX            = -1,
 cropY            = -1,
 captureDevice    = "/dev/video0",
 smoothPad        = FALSE,
 videoStd         = VideoStd_AUTO,
 decoderIdx       = -1
 colorSpace       = ColorSpace_YUV420PSEMI,
 captureDimension = NULL,
 onTheFly         = TRUE

Default attributes for video window 0 on omapl138.

 numBufs          = 3,
 videoInput       = Capture_Input_COMPOSITE,
 cropWidth        = -1,
 cropHeight       = -1,
 cropX            = -1,
 cropY            = -1,
 captureDevice    = "/dev/video0",
 smoothPad        = FALSE,
 videoStd         = VideoStd_AUTO,
 decoderIdx       = -1
 colorSpace       = ColorSpace_YUV422PSEMI,
 captureDimension = NULL,
 onTheFly         = FALSE

Default attributes for video window 0 on omap3530.

 numBufs          = 3,
 videoInput       = Capture_Input_COMPOSITE,
 cropWidth        = -1,
 cropHeight       = -1,
 cropX            = -1,
 cropY            = -1,
 captureDevice    = "/dev/video0",
 smoothPad        = FALSE,
 videoStd         = VideoStd_AUTO,
 decoderIdx       = -1
 colorSpace       = ColorSpace_UYVY,
 captureDimension = NULL,
 onTheFly         = FALSE


Copyright 2011, Texas Instruments Incorporated