ARX  1.0
The next-generation open source augmented reality toolkit.
Loading...
Searching...
No Matches
Functions
video.c File Reference
#include <stdio.h>
#include <ARX/ARVideo/video.h>
Include dependency graph for video.c:

Functions

AR_VIDEO_MODULE arVideoGetDefaultModule (void)
 
int arVideoOpen (const char *config)
 Open a video input module. More...
 
int arVideoOpenAsync (const char *config, void(*callback)(void *), void *userdata)
 Open a video input module, invoking a callback once opening is complete. More...
 
int arVideoClose (void)
 
int arVideoDispOption (void)
 
AR_VIDEO_MODULE arVideoGetModule (void)
 
int arVideoGetId (ARUint32 *id0, ARUint32 *id1)
 
int arVideoGetSize (int *x, int *y)
 
int arVideoGetPixelSize (void)
 
AR_PIXEL_FORMAT arVideoGetPixelFormat (void)
 
AR2VideoBufferTarVideoGetImage (void)
 Get a frame image from the video module. More...
 
int arVideoCapStart (void)
 Start video capture. More...
 
int arVideoCapStartAsync (AR_VIDEO_FRAME_READY_CALLBACK callback, void *userdata)
 Start video capture with asynchronous notification of new frame arrival. More...
 
int arVideoCapStop (void)
 Stop video capture. More...
 
int arVideoGetParami (int paramName, int *value)
 Get value of an integer parameter from active video module. More...
 
int arVideoSetParami (int paramName, int value)
 Set value of an integer parameter in active video module. More...
 
int arVideoGetParamd (int paramName, double *value)
 Get value of a double-precision floating-point parameter from active video module. More...
 
int arVideoSetParamd (int paramName, double value)
 Set value of a double-precision floating-point parameter in active video module. More...
 
int arVideoGetParams (const int paramName, char **value)
 Get value of a string parameter from active video module. More...
 
int arVideoSetParams (const int paramName, const char *value)
 Get value of a string parameter in active video module. More...
 
int arVideoSaveParam (char *filename)
 
int arVideoLoadParam (char *filename)
 
int arVideoSetBufferSize (const int width, const int height)
 
int arVideoGetBufferSize (int *width, int *height)
 
int arVideoGetCParam (ARParam *cparam)
 
int arVideoGetCParamAsync (void(*callback)(const ARParam *, void *), void *userdata)
 
int arVideoUtilGetPixelSize (const AR_PIXEL_FORMAT arPixelFormat)
 
const char * arVideoUtilGetPixelFormatName (const AR_PIXEL_FORMAT arPixelFormat)
 

Function Documentation

◆ arVideoCapStart()

int arVideoCapStart ( void  )

Start video capture.

Each call to arVideoCapStart must be balanced with a call to arVideoCapStop.

See also
arVideoCapStop
Here is the call graph for this function:

◆ arVideoCapStartAsync()

int arVideoCapStartAsync ( AR_VIDEO_FRAME_READY_CALLBACK  callback,
void *  userdata 
)

Start video capture with asynchronous notification of new frame arrival.

Parameters
callbackA function to call when a new frame arrives. This function may be called anytime until the function arVideoCapStop has been called successfully. The callback may occur on a different thread to the calling thread and it is up to the user to synchronise the callback with any procedures that must run on the main thread, a rendering thread, or other arbitrary thread.
userdataOptional user data pointer which will be passed to the callback as a parameter. May be NULL.
Here is the call graph for this function:

◆ arVideoCapStop()

int arVideoCapStop ( void  )

Stop video capture.

Each call to arVideoCapStop must match a call to arVideoCapStart.

See also
arVideoCapStart
Here is the call graph for this function:

◆ arVideoClose()

int arVideoClose ( void  )
Here is the call graph for this function:

◆ arVideoDispOption()

int arVideoDispOption ( void  )
Here is the call graph for this function:

◆ arVideoGetBufferSize()

int arVideoGetBufferSize ( int *  width,
int *  height 
)
Here is the call graph for this function:

◆ arVideoGetCParam()

int arVideoGetCParam ( ARParam cparam)
Here is the call graph for this function:

◆ arVideoGetCParamAsync()

int arVideoGetCParamAsync ( void(*)(const ARParam *, void *)  callback,
void *  userdata 
)
Here is the call graph for this function:

◆ arVideoGetDefaultModule()

AR_VIDEO_MODULE arVideoGetDefaultModule ( void  )

◆ arVideoGetId()

int arVideoGetId ( ARUint32 id0,
ARUint32 id1 
)
Here is the call graph for this function:

◆ arVideoGetImage()

AR2VideoBufferT * arVideoGetImage ( void  )

Get a frame image from the video module.

Returns
NULL if no image was available, or a pointer to an AR2VideoBufferT holding the image. The returned pointer remains valid until either the next call to arVideoGetImage, or a call to arVideoCapStop.
Here is the call graph for this function:

◆ arVideoGetModule()

AR_VIDEO_MODULE arVideoGetModule ( void  )
Here is the call graph for this function:

◆ arVideoGetParamd()

int arVideoGetParamd ( int  paramName,
double *  value 
)

Get value of a double-precision floating-point parameter from active video module.

Parameters
paramNameName of parameter to get, as defined in <ARX/ARVideo/video.h>
valuePointer to double, which will be filled with the value of the parameter.
Returns
-1 in case of error, 0 in case of no error.
Here is the call graph for this function:

◆ arVideoGetParami()

int arVideoGetParami ( int  paramName,
int *  value 
)

Get value of an integer parameter from active video module.

Parameters
paramNameName of parameter to get, as defined in <ARX/ARVideo/video.h>
valuePointer to integer, which will be filled with the value of the parameter.
Returns
-1 in case of error, 0 in case of no error.
Here is the call graph for this function:

◆ arVideoGetParams()

int arVideoGetParams ( const int  paramName,
char **  value 
)

Get value of a string parameter from active video module.

Parameters
paramNameName of parameter to get, as defined in <ARX/ARVideo/video.h>
valuePointer to pointer, which will be filled with a pointer to a C-string (nul-terminated, UTF-8) containing the value of the parameter. The string returned is allocated internally, and it is the responsibility of the caller to call free() on the returned value.
Returns
-1 in case of error, 0 in case of no error.
Here is the call graph for this function:

◆ arVideoGetPixelFormat()

AR_PIXEL_FORMAT arVideoGetPixelFormat ( void  )
Here is the call graph for this function:

◆ arVideoGetPixelSize()

int arVideoGetPixelSize ( void  )
Here is the call graph for this function:

◆ arVideoGetSize()

int arVideoGetSize ( int *  x,
int *  y 
)
Here is the call graph for this function:

◆ arVideoLoadParam()

int arVideoLoadParam ( char *  filename)
Here is the call graph for this function:

◆ arVideoOpen()

int arVideoOpen ( const char *  config)

Open a video input module.

Opening a video input module selects, connects to, and configures a video source for other video operations. Once this call has returned, other APIs can be invoked. @oaram config A configuration string, consisting of a series of space-separated configuration tokens. While the configuration string options are largely platform- and system-dependent, the token "-module=X" where X is a video input module name is always accepted. For information on configuration options, see https://github.com/artoolkitx/artoolkitx/wiki/artoolkitX-video-module-configuration-reference

See also
arVideoOpenAsync ar2VideoOpen ar2VideoOpenAsync arVideoClose ar2VideoClose
Returns
-1 in case of error, 0 in case of no error.
Here is the call graph for this function:

◆ arVideoOpenAsync()

int arVideoOpenAsync ( const char *  config,
void(*)(void *)  callback,
void *  userdata 
)

Open a video input module, invoking a callback once opening is complete.

Opening a video input module selects, connects to, and configures a video source for other video operations. This variant returns immediately while continuing the opening operation asynchronously, invoking a user-supplied callback once opening has completed. The only API permissible to call between this function and the invocation of the callback is arVideoGetModule. @oaram config A configuration string, consisting of a series of space-separated configuration tokens. While the configuration string options are largely platform- and system-dependent, the token "-module=X" where X is a video input module name is always accepted. For information on configuration options, see https://github.com/artoolkitx/artoolkitx/wiki/artoolkitX-video-module-configuration-reference

Parameters
callbackThe callback to invoke once opening is complete. In most cases, the callback will be invoked on a different thread, so care must be taken if the caller is sensitive to this.
userdataAn arbitrary pointer which will be passed to the callback.
See also
arVideoOpenAsync ar2VideoOpen ar2VideoOpenAsync arVideoClose ar2VideoClose arVideoGetModule
Returns
-1 in case of error, 0 in case of no error.
Here is the call graph for this function:

◆ arVideoSaveParam()

int arVideoSaveParam ( char *  filename)
Here is the call graph for this function:

◆ arVideoSetBufferSize()

int arVideoSetBufferSize ( const int  width,
const int  height 
)
Here is the call graph for this function:

◆ arVideoSetParamd()

int arVideoSetParamd ( int  paramName,
double  value 
)

Set value of a double-precision floating-point parameter in active video module.

Parameters
paramNameName of parameter to set, as defined in <ARX/ARVideo/video.h>
valueDouble value to set the parameter to.
Returns
-1 in case of error, 0 in case of no error.
Here is the call graph for this function:

◆ arVideoSetParami()

int arVideoSetParami ( int  paramName,
int  value 
)

Set value of an integer parameter in active video module.

Parameters
paramNameName of parameter to set, as defined in <ARX/ARVideo/video.h>
valueInteger value to set the parameter to.
Returns
-1 in case of error, 0 in case of no error.
Here is the call graph for this function:

◆ arVideoSetParams()

int arVideoSetParams ( const int  paramName,
const char *  value 
)

Get value of a string parameter in active video module.

Parameters
paramNameName of parameter to set, as defined in <ARX/ARVideo/video.h>
valuePointer to C-string (nul-terminated, UTF-8) containing the value to set the parameter to.
Returns
-1 in case of error, 0 in case of no error.
Here is the call graph for this function:

◆ arVideoUtilGetPixelFormatName()

const char * arVideoUtilGetPixelFormatName ( const AR_PIXEL_FORMAT  arPixelFormat)

◆ arVideoUtilGetPixelSize()

int arVideoUtilGetPixelSize ( const AR_PIXEL_FORMAT  arPixelFormat)