[ Previous | Next | Contents | Glossary | Home | Search ]
Ultimedia Services Version 2 for AIX: Programmer's Guide and Reference

UMSVideoIO Object

UMSVideoIO provides methods to open, close, and access the Ultimedia Video I/O adapter. The UMSVideoIO object is not a generic class to access any video device driver. It provides methods to capture compressed JPEG frames and to capture uncompressed frames with YUV422, RGB8, and RGB24 format. It can also provide methods to output the compressed JPEG frames and the uncompressed frames with YUV422 format to analog video output.

To learn more about the UMSVideoIO object, see:

For introductory information, see Movie Capture and Playback Objects.

Enumeration Lists

enum ReturnCode {
   Success,
   Failure,
   UnsupportedFormat, 
    InvalidSubimage,
    InvalidImageSize,
    Uninitialized, 
   InvalidQualityFactor,
   InvalidTableID, 
    OutOfRange, 
    NotAvail,
    NoDevice,
    NotOpen,
    ValueChanged,
    NoBuffer,
    NullPointer,
   WrongIndex,
   BufferNotAvailable
   };
enum OnOff {
   Off, 
   On
   };
enum JPEGHeaderFlag {
   NoDQT_DHT,
   WithDQT, 
   WithDHT, 
   WithDQTandDHT 
   };
struct RingBufferElement {
   long Address,
   longAfterHeader
   long SizeOfBuffer,
   long SizeOfDataInBuffer,
   long InUseByCaller,
   long NumberOfOverruns,
   };

Usage of AfterHeader and Address

When uncompressed data is in the buffer, then Address and AfterHeader should be equal. When compressed data is in the buffer, then Address points to the start of the block of data. If the block of data does not have a JPEG header, then AfterHeader should be equal to the Address. If the block of data does have a header, then AfterHeader points to the data after the header. The Ultimedia Services Video I/O adapter does not process the header. For compressed capture the data does not have a header and Address and AfterHeader should be equal.

String Definitions

This object defines the following string definitions in the UMSStrings.h file in /usr/lpp/UMS6000/include:

#define NTSC  "NTSC"
#define PAL   "PAL"
 
#define YUV422  "YUV422"
#define RGB8Dither "RGB8Dither"
#define RGB24  "RGB24"
 
#define QTABLE_A_Y "QTABLE_A_Y"
#define QTABLE_A_C "QTABLE_A_C"
#define QTABLE_B_Y "QTABLE_B_Y"
#define QTABLE_B_C "QTABLE_B_C"
 
#define HUFFMANYDC "HUFFMANYDC"
#define HUFFMANYAC "HUFFMANYAC"
#define HUFFMANCDC "HUFFMANCDC"
#define HUFFMANCAC "HUFFMANCAC"
 
#define INPUT_COMPOSITE "INPUT_COMPOSITE"
#define INPUT_SVIDEO  "INPUT_SVIDEO"

Method Descriptions

ReturnCode open(in string path)

Description

This method opens the specified video device. If there is an error this method returns Failure code.

Arguments
in string path The name of a video device to be opened.
Return Values

Success

Failure

ReturnCode close()

Description

This method closes the video device. If the device is not open or the close command fails then NotOpen or Failure is returned.

Return Values

Success

Failure

NotOpen

ReturnCode set_input_image_size(inout long width, inout long height)

Description

This method sets the dimensions of the image coming from the analog source. This applies to both uncompressed images and compressed images. The valid sizes are format specific.

This method returns Success if width and height are valid. Otherwise, the closest valid width and height is set, and ValueChanged is returned.

For NTSC the valid image sizes are 640x240 and 320x240. For PAL the valid image sizes is 768x288 and 384x288. The default image size is 640x240.

Arguments
inout long width Specifies the width of the input image.
inout long height Specifies the height of the input image.
Return Values

Success

Failure

ValueChanged

NotOpen

ReturnCode get_input_image_size(inout long width, inout long height)

Description

This function allows the application to query the dimensions of the image size. This applies to both compressed and uncompressed images. The valid sizes are format specific.

Arguments
inout long width The current setting of the width of image size is returned.
inout long height The current setting of the height of image size is returned.
Return Values

Success

Failure

NotOpen

ReturnCode set_output_image_format(in string format)

Description

This function sets the format of the output image data to be created by the video device. This method is used for uncompressed images. If the format is unsupported an error code UnsupportedFormat is returned. If any other error happens an error code Failure is returned. The default format is YUV422.

Arguments
in string format The string specifies the desired format. Possible values of the format are YUV422, RGB8Dither, and RGB24.
Return Values

Success

Failure

NotOpen

UnsupportedFormat

ReturnCode get_output_image_format(out string format)

Description

This function allows the application to query the output image format for uncompressed images.

Arguments
out string format A string containing the current image format is returned. The possible values of the format are YUV422, RGB8Dither, and RGB24.
Return Values

Success

Failure

NotOpen

ReturnCode set_analog_video_format(in string format)

Description

This function sets the video format. The output and input video formats are the same for NTSC and PAL. The default video format is NTSC.

If the format is unsupported, an error code UnsupportedFormat is returned. If any other error happens, an error code Failure is returned.

Arguments
in string format The string specifies the video format. The possible values of the format are NTSC and PAL.
Return Values

Success

Failure

NotOpen

UnsupportedFormat

ReturnCode get_analog_video_format(out string format)

Description

This function allows the application to query the video format.

Arguments
out string format A string containing the video format is returned. The possible values of the format are NTSC and PAL.
Return Values

Success

Failure

NotOpen

ReturnCode set_capture_rate(inout double rate)

Description

This function allows the application to set the capture rate. This method returns Success if the rate is valid. Otherwise, the closest valid rate is set, and ValueChanged is returned.

Arguments
inout double rate Specifies number of frames per second to capture video.
Return Values

Success

Failure

NotOpen

ValueChanged

ReturnCode get_capture_rate(inout double rate)

Description

This function allows the application to query the capture rate.

Arguments
inout double rate The capture rate (the number of frames per second) is returned.
Return Values

Success

Failure

NotOpen

ReturnCode set_quality_factor(inout long factor)

Description

The quality factor lets you trade off compressed file size against quality of the reconstructed image. The higher the factor setting, the larger the JPEG file, and better quality it is. The range of the factor is between [1-100]. The default quality factor is 80.

This method returns Success if the factor is valid. Otherwise, the closest valid factor is set, and ValueChanged is returned.

Arguments
inout long factor Specifies quality factor of JPEG compression.
Return Values

Success

Failure

NotOpen

ValueChanged

ReturnCode get_quality_factor(inout long factor)

Description

This function allows the application to query the quality factor of the encoder.

Arguments
inout long factor The return value is the current quality factor setting. The value is between [1-100].
Return Values

Success

Failure

ReturnCode set_compression(in OnOff flag)

Description

This function allows the application to set the compression flag. When the flag is set On, the video device is ready for compress image. The setup_compressed_capture_buffers method must be issued before this call.

Arguments
in OnOff flag The flag to set compression.
Return Values

Success

Failure

NoBuffer Application must do a setup_compressed_capture_buffers before calling this method.

NotOpen

ReturnCode get_compression(inout OnOff flag)

Description

This method allows the application to query the compression flag.

Arguments
inout OnOff flag Reports whether capturing of compressed images is turned on. The possible Return Values are On and Off.
Return Values

Success

Failure

NotOpen

ReturnCode set_uncompression(in OnOff flag)

Description

This function allows the application to set the uncompression flag. When the flag is set On, the video device is ready for uncompressed images. setup_uncompressed_capture_buffer method must be issued prior to this call.

Arguments
in OnOff flag The flag to set uncompression.
Return Values

Success

Failure

NoBuffer Application must do a setup_uncompressed_capture_buffers before calling this method.

NotOpen

ReturnCode get_uncompression(inout OnOff flag)

Description

This method allows the application to query the uncompression flag.

Arguments
inout OnOff flag Reports whether capturing of uncompressed images is on. The possible Return Values are On and Off.
Return Values

Success

Failure

NotOpen

ReturnCode set_analog_video_monitor(in OnOff flag)

Description

This function allows the application to turn the analog video monitoring on or off. When the flag is set On, the video device begins monitoring. By default this is turned On.

This flag is turned Off during playback to video out.

Arguments
in OnOff flag The flag to set video out monitor.
Return Values

Success

Failure

NotOpen

ReturnCode get_analog_video_monitor(inout OnOff flag)

Description

This method allows the application to query the analog video monitor flag.

Arguments
inout OnOff flag The possible Return Values are On and Off.
Return Values

Success

Failure

NotOpen

ReturnCode set_colormap(in sequence <octet> colormap)

Description

This function allows the application to set the color map of the uncompressed data returned from the video device. Not setting a colormap results in 3:3:2 RGB data being returned. Mapping is done in the VideoIO object, not in the hardware.

The colormap is used only if the output image format is RGB8Dither.

Arguments
in sequence <octet> colormap A pointer to a reserved memory area in the application space that can be used to copy the color lookup table from the decoder to the application. The colors are formatted as:
0, R, G, B, 0, R, G, B, ..., 0, R, G, B.
\_______/ \_______/   \_______/
  |    |      |
 Entry 0  Entry 1 .... Entry (size-1)

where each entry is a 32-bit record containing 8-bit color lookup values.

Return Values

Success

Failure

NullPointer

ReturnCode get_colormap(inout sequence <octet> colormap)

Description

This function allows the application to query the color map being used by the VideoIO object to map the uncompressed data received from the video device.

Arguments
inout sequence <octet> colormap Gets the entries in the colormap. The colors are formatted as:
0, R, G, B, 0, R, G, B, ..., 0, R, G, B.
\_______/ \_______/   \_______/
  |    |      |
 Entry 0  Entry 1 .... Entry (size-1)

where each entry is a 32-bit record containing 8-bit color lookup values.

Return Values

Success

Failure

NullPointer

ReturnCode get_component_number(in sequence <octet> comp_image, inout long component_number)

Description

This function gets the component number from the compressed image. For color images, component_number is equal to 3, and for mono images and Y only images, component_number is equal to 1. If comp_image is equal to NULL, the component_number corresponds to a compressed image captured from the video device.

Arguments
in sequence <octet> comp_image Pointer to the start of the compressed JPEG image header.
inout long component_number Number of components in the frame is returned.
Return Values

Success

Failure

UnsupportedFormat

NullPointer

ReturnCode set_colormap_index(inout long base_index)

Description

This method sets up the color map table characteristics of the VideoIO object. The default base_index is 128.

This method returns Success if the base_index is valid. Otherwise, the closest valid base_index is set, and ValueChanged is returned.

The colormap is used only if the output image format is RGB8Dither.

Arguments
inout long base_index Sets the base address of the uncompressed image's color map.
Return Values

Success

Failure

ValueChanged

ReturnCode get_colormap_index(inout long base_index)

Description

This method gets the base index for the color lookup table used by the VideoIO object to map the image frame.

Arguments
inout long base_index The base address of the uncompressed image's color map.
Return Values

Success

Failure

ReturnCode set_colormap_size(inout long size)

Description

This method sets up the color map table size of the VideoIO object. The default size is 128.

This method returns Success if the size is valid. Otherwise, the closest valid size is set, and ValueChanged is returned. The colormap is used only if the output image format is RGB8Dither.

Arguments
inout long size The number of color table entries that should be used by the VideoIO object.
Return Values

Success

Failure

ValueChanged

ReturnCode get_colormap_size(inout long size)

Description

This method gets the colormap size for the color lookup table used by the UMSVideoIO object to map the image frame.

Arguments
inout long size The length of the color map is returned.
Return Values

Success

Failure

ReturnCode set_subimage_size(inout long x_position, inout long y_position, inout long width, inout long height)

Description

This function allows a sub-frame within an image to be compressed. This function does not need to be called if the full image is to be encoded. The offsets must be positive integer and even values. The set_input_image_size function must also be called to specify the actual input image size.

The default subimage size is 640x480.

Arguments
inout long x_position Specifies the offset, within the input image, to begin encoding in the x direction.
inout long y_position Specifies the offset, within the input image, to begin encoding in the y direction.
inout long width Specifies the number of pixels in x to encode.
inout long height Specifies the number of pixels in y to encode.
Return Values

Success

Failure

NotOpen

OutOfRange

ReturnCode get_subimage_size(inout long x_position, inout long y_position, inout long width, inout long height)

Description

This function allows the application to query the clipping area. The default values for the x_position and y_position structure elements are 0. The default values for the width and height are the width and height of the image.

Arguments
inout long x_position The offset, within the input image, to begin encoding in the x direction is returned.
inout long y_position The offset, within the input image, to begin encoding in the y direction is returned.
inout long width Returns the number of pixels in x to encode.
inout long height Returns the number of pixels in y to encode.
Return Values

Success

Failure

NotOpen

ReturnCode set_uncompressed_image_size(inout long width, inout long height)

Description

This method allows the application to specify the dimensions of the uncompressed image.

The default uncompressed image size is 640x480. For NTSC the minimum image size is 12x4 and the maximum size is 640x480. For PAL, the minimum image size is 12x8 and the maximum size is 768x576.

The value of the image size has to be even.

Arguments
inout long width Specifies the width of an uncompressed image.
inout long height Specifies the height of an uncompressed image.
Return Values

Success

Failure

NotOpen

OutOfRange

ReturnCode get_uncompressed_image_size(inout long width, inout long height)

Description

This function allows the application to query the dimensions of the uncompressed image.

Arguments
inout long width Returns the width of an uncompressed image.
inout long height Returns the height of an uncompressed image.
Return Values

Success

Failure

NotOpen

ReturnCode set_q_table(in string tableid, in sequence <octet> table)

Description

This method sets the quantization table of the video device. For each table, the size should be 64 bytes long. The valid table ids are 1, 2, 3, and 4. They are in zig-zag order, not in Visi order.

Arguments
in string tableid Specifies the string of the quantization table. The possible values of tableid are QTABLE_A_Y, QTABLE_A_C, QTABLE_B_Y, and QTABLE_B_C.

in sequence <octet> table

typedef struct
{
unsigned long _maximum;  Specifies the max. length of q_table
unsigned long _length;   Length of q_table
octet  *_buffer;         The pointer to the q_table
} 
_IDL_SEQUENCE_octet      Callers must allocate the buffer
Return Values

Success

Failure

InvalidTableID

NotOpen

NullPointer

ReturnCode get_q_table(in string tableid, inout sequence <octet> table)

Description

This method allows applications to query the quantization table of the video device. For each table, the size is 64 bytes long. The valid table ID are 1, 2, 3, and 4. They are in zigzag order, not in Visi order.

Arguments
in string tableid Specifies the string of the quantization table. The possible values of the tableid are QTABLE_A_Y, QTABLE_A_C, QTABLE_B_Y, and QTABLE_B_C.
inout sequence <octet> table Returns the pointer of the quantization table. The application must allocate the q_table structure and initialize the buffer pointer.
Return Values

Success

Failure

InvalidTableID

NotOpen

NullPointer

ReturnCode set_Huffman_table(in string tableid, in sequence <octet> table, in long table_size)

Description

This method sets the Huffman table of the video device. The elements of the table are one byte in size(unsigned char). The tables are of the type bits and values.

Arguments
in string tableid Specifies the string of the Huffman table. The possible values of tableid are HUFFMANYDC, HUFFMANYAC, HUFFMANCDC, and HUFFMANCAC.
in sequence <octet> table Specifies Huffman table.
typedef struct {
unsigned long _maximum;  Specifies the max. length of Huffman
                         Table
unsigned long _length;   Specifies length of Huffman table
octet  *_buffer;         The pointer to the Huffman Table
} 
_IDL_SEQUENCE_octet      Callers must allocate the Huffman table
                         buffer
in long table_size Specifies size of the Huffman table.
Return Values

Success

Failure

InvalidTableID

NotOpen

NullPointer

ReturnCode get_Huffman_table(in string tableid, inout sequence <octet> table, inout long table_size)

Description

This method allows the caller to query the Huffman tables of the video device. The elements of the table are one byte in size(unsigned char). The tables are of the type bits and values.

Arguments
in string tableid Specifies the ID of the Huffman table wanted. The possible values of tableid are HUFFMANYDC, HUFFMANYAC, HUFFMANCDC, and HUFFMANCAC.
inout sequence <octet> table The sequence buffer contains the requested Huffman table. The caller must malloc the Huffman table buffer.
inout long table_size Returns the size of the Huffman table.
Return Values

Success

Failure

InvalidTableID

NotOpen

NullPointer

ReturnCode put_compressed_frame(in long index)

Description

This method is used to put a compressed frame to the video out device's analog output.

Arguments
in long index Specifies the index of the structure in the ring buffer array that contains the image to be output.
Return Values

Success

Failure

NotOpen

WrongIndex The index does not correspond to the next available buffer

ReturnCode put_uncompressed_frame(in long index)

Description

This method is used to put an uncompressed frame to the video out device's analog output. The data must be YUV422 format. The image size is 640x480.

Arguments
in long index Specifies the index of the structure in the ring buffer array that contains the image to be output.
Return Values

Success

Failure

NotOpen

WrongIndex The index does not correspond to the next available buffer

ReturnCode get_compressed_frame(inout long index, in long blocking_flag)

Description

This method returns the index of a ring buffer structure that contains a compressed frame from the video device. There is NO JPEG header in the JPEG data. The caller must have previously provided the capture ring buffer.

Arguments
inout long index The index into the ring buffer structure array that contains the compressed frame is returned. Information about the captured frame is in the ring buffer structure array element.
in long blocking_flag The setting of blocking_flag determines whether the device driver call blocks or returns with an error when a compressed frame is not available.
Return Values

Success

Failure

NotOpen

BufferNotAvailable Compressed buffer is not available

ReturnCode get_uncompressed_frame(inout long index, in long blocking_flag)

Description

This method returns the index of a ring buffer structure that contains an uncompressed frame from the video device. The caller must have previously provided the capture buffer.

Arguments
inout long index The index into the ring buffer structure array that contains the uncompressed frame is returned. Information about the captured frame is in the ring buffer structure array element.
in long blocking_flag The setting of blocking_flag determines whether the device driver call blocks or returns with an error when an uncompressed frame is not available.
Return Values

Success

Failure

NotOpen

BufferNotAvailable Uncompressed buffer is not available and the blocking_flag is set to NON blocking.

ReturnCode get_next_compressed_video_out_buffer(inout long index, in long blocking_flag)

Description

This method returns the index of a ring buffer structure that can be used as a compressed buffer to be output to the video device's analog output.

Arguments
inout long index The index into the ring buffer structure array that can be used for the next compressed frame is returned.
in long blocking_flag The setting of blocking_flag determines whether the device driver call blocks or returns with an error when a compressed buffer is not available.
Return Values

Success

Failure

NotOpen

BufferNotAvailable Compressed buffer is not available and the blocking_flag is set to NON blocking.

ReturnCode get_next_uncompressed_video_out_buffer(inout long index, in long blocking_flag)

Description

This method returns the index of a ring buffer structure that can be used as an uncompressed buffer to be output to the video device's analog output.

Arguments
inout long index The index into the ring buffer structure array that can be used for the next uncompressed frame is returned.
in long blocking_flag The setting of blocking_flag determines whether the device driver call blocks or returns with an error when an uncompressed buffer is not available.
Return Values

Success

Failure

NotOpen

BufferNotAvailable Uncompressed buffer is not available and the blocking_flag is set to NON blocking.

ReturnCode set_video_input_connector(in string video_in)

Description

This function sets the video input connector. The default value for video_in is INPUT_COMPOSITE.

Arguments
in string video_in The string specifies the video input connector. The possible values of the video_in are INPUT_COMPOSITE and INPUT_SVIDEO.
Return Values

Success

Failure

NotOpen

UnsupportedFormat

ReturnCode get_video_input_connector(out string video_in)

Description

This function allows the application to query the setting of the video input connector.

Arguments
out string video_in A string containing the video_in is returned. The possible values of the video_in are INPUT_COMPOSITE and INPUT_SVIDEO.
Return Values

Success

Failure

NotOpen

ReturnCode put_jpeg_header(in sequence <octet> jpeg_header)

Description

This function allows the application to input a JPEG header. This method returns Success if the JPEG header markers are valid. There should be NO JPEG data in the header.

Arguments
in sequence <octet> jpeg_header
typedef struct {
unsigned long _maximum;  Specifies the max.length of header
unsigned long _length;   Specifies Jpeg header length
octet   *_buffer;        Pointer to the jpeg_header data
} 
_IDL_SEQUENCE_octet      The caller must malloc the buffer 
Return Values

Success

Failure

NotOpen

NullPointer

UnsupportedFormat

ReturnCode get_jpeg_header_size(inout long size, in JPEGHeaderFlag flag)

Description

This function returns the size of a JPEG header that contains the desired elements.

Arguments
inout long size Size of the JPEG header is returned.
in JPEGHeaderFlag flag This flag contains the desired elements of the JPEG header. The values are:
enum JPEGHeaderFlag{
   NoDQT_DHT,
   WithDQT, 
   WithDHT, 
   WithDQTandDHT
   }
Return Values

Success

Failure

ReturnCode get_jpeg_header(inout sequence <octet> jpeg_header, in JPEGHeaderFlag flag)

Description

This function returns a JPEG header containing the desired elements.

Arguments

inout sequence <octet> jpeg_header

typedef struct {
unsigned long _maximum;  Specifies the max. length of header
unsigned long _length;   Length of JPEG header is returned by
                         VideioIO Object
octet  *_buffer;         Pointer to the jpeg_header data
} 
_IDL_SEQUENCE_octet      The caller must malloc the buffer
in JPEGHeaderFlag flag This flag sets the information of the JPEG header that application requires. The values are:
enum JPEGHeaderFlag{
   NoDQT_DHT,
   WithDQT, 
   WithDHT, 
   WithDQTandDHT
   }
Return Values

Success

Failure

NotOpen

NullPointer

ReturnCode setup_uncompressed_capture_buffers (inout sequence <RingBufferElement> ring_buffer)

Description

This method enables an area of memory to be used to capture uncompressed video frames. The caller provides the memory containing the video capture buffer.

Attention: The array of structures describing the buffers and the buffers must not share the same page of memory. No single page can be used for more than one buffer or the array of structures. The PAGESIZE definition can be found in /usr/include/sys/parm.h.
Arguments
inout sequence <RingBufferElement> ring_buffer Specifies the area of memory containing the captured uncompressed video frames. The input is a structure as follows:
typedef struct {
unsigned long _maximum;
unsigned long _length;   The number of elements. Must be
                                  greater than or equal to 2
UMSVideoIO_RingBufferElement *_buffer;   The pointer to the array
                                  of RingBufferElement structures
} 
_IDL_SEQUENCE_UMSVideoIO_RingBufferElement;

An index to this array is returned by the get_uncompressed_frame method.

struct RingBufferElement {
   long Address;      The pointer for video image buffer.
   long AfterHeader;       The pointer for video image data not including
            the JPEG header.
   long SizeOfBuffer;       Specifies the maximum image size.
   long SizeOfDataInBuffer;    Initialize this field to 0. This field is updated by
            the device driver after the return of the
            get_uncompressed_frame method.
   long InUseByCaller;      This field is updated by device driver if the buffer
            is in use. The caller sets the field to 0 when the
            buffer is no longer in use.
   long NumberOfOverruns;    An indication of how many frames were lost.
            Data already in the buffer is not removed until
            the InUseByCaller flag is reset.
    };
Return Values

Success

Failure

NotOpen

NullPointer

ReturnCode setup_uncompressed_video_out_buffers (inout sequence <RingBufferElement> ring_buffer)

Description

This method enables an area of memory to be used to output uncompressed video frames. The caller provides the memory containing the video output buffer.

Attention: The array of structures describing the buffers and the buffers must not share the same page of memory. No single page can be used for more than one buffer or the array of structures. The PAGESIZE definition can be found in /usr/include/sys/parm.h.
Arguments
inout sequence <RingBufferElement> ring_buffer Specifies the area of memory containing the uncompressed video frames to be output to the analog output. The input is a structure as follows:
typedef struct {
unsigned long _maximum;
unsigned long _length;  The number of elements. Must be
                                 greater than or equal to 2
UMSVideoIO_RingBufferElement *_buffer;
                                 The pointer to the array
                                 of RingBufferElement structures
} 
_IDL_SEQUENCE_UMSVideoIO_RingBufferElement;

An index to this array is returned by the get_next_uncompressed_video_out_buffer method.

struct RingBufferElement {
   long Address;       The pointer for video image buffer.
   long AfterHeader;       The pointer for video image data not including
            the JPEG header.
   long SizeOfBuffer;       Specifies the maximum image size.
   long SizeOfDataInBuffer;   This field is initialized by the caller.
   long InUseByCaller;       This field is updated by Device Driver after the
            buffer is output.
   long NumberOfOverruns;    An indication of how many frames were
            duplicated while waiting for the next frame to be
            output.
   };
Return Values

Success

Failure

NotOpen

NullPointer

ReturnCode setup_compressed_capture_buffers (inout sequence <RingBufferElement> ring_buffer)

Description

This method enables an area of memory to be used to capture compressed video frames. The caller provides the memory containing the video capture buffer.

Attention: The array of structures describing the buffers and the buffers must not share the same page of memory. No single page can be used for more than one buffer or the array of structures. The PAGESIZE definition can be found in /usr/include/sys/parm.h.
Arguments
inout sequence <RingBufferElement> ring_buffer Specifies the area of memory containing the captured compressed video frames. The input is a structure as follows:
typedef struct {
unsigned long _maximum;
unsigned long _length;  The number of elements. Must be
                                 greater than or equal to 2
UMSVideoIO_RingBufferElement *_buffer;   The pointer to the array
                                         of RingBufferElement
                                         structures.
} _IDL_SEQUENCE_UMSVideoIO_RingBufferElement;

An index to this array is returned by the get_compressed_frame method.

struct RingBufferElement {
   long Address;       The pointer for video image buffer.
   long AfterHeader;       The pointer for video image data not including
            the JPEG header.
   long SizeOfBuffer;       Specifies the maximum image size.
   long SizeOfDataInBuffer;    Initialize this field to 0. This field is updated by
            device driver after the return of the
            get_compressed_frame method.
   long InUseByCaller;       This field is updated by Device Driver if the
            buffer is in use. The caller sets the field to 0 
            when the buffer is no longer in use.
   long NumberOfOverruns;   An indication of how many frames were lost.
            Data already in the buffer is not removed until
            the InUseByCaller flag is reset.
   };
Return Values

Success

Failure

NotOpen

NullPointer

ReturnCode setup_compressed_video_out_buffers (inout sequence <RingBufferElement> ring_buffer)

Description

This method enables an area of memory to be used to output compressed video frames. The caller provides the memory containing the video output buffer.

Attention: The array of structures describing the buffers and the buffers must not share the same page of memory. No single page can be used for more than one buffer or the array of structures. The PAGESIZE definition can be found in /usr/include/sys/parm.h.
Arguments
inout sequence <RingBufferElement> ring_buffer Specifies the area of memory containing the compressed video frames to be output to the analog output. The input is a structure as follows:
typedef struct {
unsigned long _maximum;
unsigned long _length;   The number of elements. Must be
                                 greater than or equal to 2.
UMSVideoIO_RingBufferElement *_buffer;   The pointer to the array
                                         of RingBufferElement
                                         structures.
} _IDL_SEQUENCE_UMSVideoIO_RingBufferElement;

An index to this array is returned by the get_next_compressed_video_out_buffer method.

struct RingBufferElement {
   long Address;       The pointer for video image buffer.
   long AfterHeader;       The pointer for video image data not including
            the JPEG header.
   long SizeOfBuffer;      Specifies the maximum image size.
   long SizeOfDataInBuffer;   This field is initialized by the
            caller.
   long InUseByCaller;      This field is updated by Device Driver after the
            buffer is output.
   long NumberOfOverruns;   An indication of how many frames were
            duplicated while waiting for the next frame to be
            output.
    };
Return Values

Success

Failure

NotOpen

NullPointer

ReturnCode flush_uncompressed_capture_buffers()

Description

This method discards any remaining data in the uncompressed capture buffers.

Return Values

Success

Failure

NotOpen

ReturnCode flush_uncompressed_video_out_buffers()

Description

This method discards any remaining data in the uncompressed output buffers.

Return Values

Success

Failure

NotOpen

ReturnCode flush_compressed_capture_buffers()

Description

This method discards any remaining data in the compressed capture buffers.

Return Values

Success

Failure

NotOpen

ReturnCode flush_compressed_video_out_buffers()

Description

This method discards any remaining data in the compressed output buffers.

Return Values

Success

Failure

NotOpen

ReturnCode get_compressed_output_ready_count (inout long count)

Description

This method returns the number of compressed frames awaiting output to video out.

Arguments
inout long count Returns the number of compressed frames in the ring buffer awaiting output to video out
Return Values

Success

Failure

NotOpen

ReturnCode get_uncompressed_output_ready_count (inout long count)

Description

This method returns the number of uncompressed frames awaiting output to video out.

Arguments
inout long count Returns the number of uncompressed frames in the ring buffer awaiting output to video out
Return Values

Success

Failure

NotOpen

UMSVideoIO Object Limitations

The UMSVideoIO object has the following limitations:

For introductory information, see Movie Capture and Playback Objects.


[ Previous | Next | Contents | Glossary | Home | Search ]