UnicapgtkVideoDisplay

UnicapgtkVideoDisplay

Functions

Properties

gchar * backend Read / Write
guint backend-fourcc Read / Write
gboolean scale-to-fit Read / Write
gboolean store-original Read / Write

Signals

Types and Values

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── GtkObject
            ╰── GtkWidget
                ╰── GtkContainer
                    ╰── GtkBin
                        ╰── GtkFrame
                            ╰── GtkAspectFrame
                                ╰── UnicapgtkVideoDisplay

Implemented Interfaces

UnicapgtkVideoDisplay implements AtkImplementorIface and GtkBuildable.

Description

Functions

unicapgtk_video_display_get_type ()

GType
unicapgtk_video_display_get_type (void);

unicapgtk_video_display_new ()

GtkWidget *
unicapgtk_video_display_new (void);

Creates a new UnicapgtkVideoDisplay

Returns

a new UnicapgtkVideoDisplay


unicapgtk_video_display_new_by_device ()

GtkWidget *
unicapgtk_video_display_new_by_device (unicap_device_t *device_spec);

Creates a new UnicapgtkVideoDisplay and opens the given device to operate with.

Parameters

device_spec

the device to be used by this video display widget

 

Returns

a new UnicapgtkVideoDisplay


unicapgtk_video_display_new_by_handle ()

GtkWidget *
unicapgtk_video_display_new_by_handle (unicap_handle_t handle);

Creates a new UnicapgtkVideoDisplay and uses the handle to control the video device. The handle gets cloned by this call.

Parameters

handle

a handle of the device to be used by this video display widget

 

Returns

a new UnicapgtkVideoDisplay


unicapgtk_video_display_start ()

gboolean
unicapgtk_video_display_start (UnicapgtkVideoDisplay *ugtk);

Calls unicap_start_capture on the device and starts displaying the live video stream.

Parameters

Returns

TRUE when the live display could be successfully started.


unicapgtk_video_display_stop ()

void
unicapgtk_video_display_stop (UnicapgtkVideoDisplay *ugtk);

Calls unicap_stop_capture on the device and stops displaying the live video image.

Parameters


unicapgtk_video_display_get_device ()

unicap_device_t *
unicapgtk_video_display_get_device (UnicapgtkVideoDisplay *ugtk);

Returns the device currently used by the video display. The returned data is owned by the library and should not be freed by the application.

Parameters

Returns

an unicap_device_t


unicapgtk_video_display_get_handle ()

unicap_handle_t
unicapgtk_video_display_get_handle (UnicapgtkVideoDisplay *ugkt);

Returns a handle to the device currently used by the display. This is a clone of the handle used by the display so unicap_close must be called on this handle by the calling application.

Parameters

Returns

a cloned unicap_handle_t


unicapgtk_video_display_set_format ()

gboolean
unicapgtk_video_display_set_format (UnicapgtkVideoDisplay *ugtk,
                                    unicap_format_t *format_spec);

Sets the video format used by the display. If a handle is set on the display ( ie. the display controls a device ), the video format is also changed and only video formats supported by the device can be set.

Parameters

ugtk

an UnicapgtkVideoDisplay

 

format_spec

a unicap_format_t

 

Returns

TRUE when the format change was successfull.


unicapgtk_video_display_get_format ()

void
unicapgtk_video_display_get_format (UnicapgtkVideoDisplay *ugtk,
                                    unicap_format_t *format);

unicapgtk_video_display_set_pause ()

void
unicapgtk_video_display_set_pause (UnicapgtkVideoDisplay *ugtk,
                                   gboolean state);

Pauses or unpauses the video display. If the display is controling a device, the device is not stopped or paused by this call. When the video display is paused, no new frames are retrieved from the device and the display is constantly updated with the last image retrieved from the device.

Buffer display events are still called. This way an application can still draw an overlay onto the image.

Parameters

ugtk

an UnicapgtkVideoDisplay

 

state

TRUE to put the device into pause state; FALSE to put it into running state

 

unicapgtk_video_display_get_pause ()

gboolean
unicapgtk_video_display_get_pause (UnicapgtkVideoDisplay *ugtk);

Retrieve current pause state

Parameters

Returns

TRUE when the display is currently paused


unicapgtk_video_display_set_device ()

gboolean
unicapgtk_video_display_set_device (UnicapgtkVideoDisplay *ugtk,
                                    unicap_device_t *device_spec);

Set a new device on the display.

Parameters

ugtk

an UnicapgtkVideoDisplay

 

device_spec

an unicap_device_t

 

Returns

TRUE when the new device could be successfully set.


unicapgtk_video_display_set_handle ()

gboolean
unicapgtk_video_display_set_handle (UnicapgtkVideoDisplay *ugtk,
                                    unicap_handle_t handle);

Set a new device on the display, specified by a handle. The handle gets cloned by this call.

Parameters

ugtk

an UnicapgtkVideoDisplay

 

handle

a unicap_handle_t

 

Returns

TRUE when the device change was successful.


unicapgtk_video_display_get_still_image ()

GdkPixbuf *
unicapgtk_video_display_get_still_image
                               (UnicapgtkVideoDisplay *ugtk);

Retrieves a still image from the live video stream.

Parameters

Returns

a new allocated GdkPixbuf


unicapgtk_video_display_set_still_image ()

void
unicapgtk_video_display_set_still_image
                               (UnicapgtkVideoDisplay *ugtk,
                                unicap_data_buffer_t *buffer);

Sets a still image. If the video display is currently running, it is put to pause state by this call.

Parameters

ugtk

an UnicapgtkVideoDisplay

 

buffer

a data_buffer to be displayed

 

unicapgtk_video_display_get_data_buffer ()

void
unicapgtk_video_display_get_data_buffer
                               (UnicapgtkVideoDisplay *ugtk,
                                unicap_data_buffer_t **dest_buffer);

Retrieves a still image from the live video stream.

Parameters

ugtk

an UnicapgtkVideoDisplay

 

dest_buffer

a pointer where to store the new data_buffer

 

unicapgtk_video_display_set_crop ()

void
unicapgtk_video_display_set_crop (UnicapgtkVideoDisplay *ugtk,
                                  UnicapgtkVideoDisplayCropping *crop);

Set a cropping window. The video display will only display the region specified in the cropping window.

Parameters

ugtk

an UnicagtkVideoDisplay

 

crop

cropping specification

 

unicapgtk_video_display_get_crop ()

void
unicapgtk_video_display_get_crop (UnicapgtkVideoDisplay *ugtk,
                                  UnicapgtkVideoDisplayCropping *crop);

Retrieves the current cropping window.

Parameters

ugtk

an UnicapgtkVideoDisplay

 

crop

pointer to where to store the UnicapgtkVideoDisplayCropping structure

 

unicapgtk_video_display_set_size ()

void
unicapgtk_video_display_set_size (UnicapgtkVideoDisplay *ugtk,
                                  gint width,
                                  gint height);

Sets the output size of the display. Video data that is to be displayed will be scaled to this size.

Parameters

ugtk

an UnicapgtkVideoDisplay

 

width

new width

 

height

new height

 

unicapgtk_video_display_set_scale_to_fit ()

void
unicapgtk_video_display_set_scale_to_fit
                               (UnicapgtkVideoDisplay *ugtk,
                                gboolean scale);

If scale_to_fit is set, the video display will get scaled to the size allocated to the widget.

Parameters

ugtk

an UnicapgtkVideoDisplay

 

scale

TRUE if the display should scale to fit

 

unicapgtk_video_display_set_new_frame_callback ()

unicap_new_frame_callback_t
unicapgtk_video_display_set_new_frame_callback
                               (UnicapgtkVideoDisplay *ugtk,
                                UnicapgtkCallbackFlags flags,
                                unicap_new_frame_callback_t cb,
                                void *data);

Registers a callback function which is called in the unicap capture thread context.

Parameters

ugtk

an UnicapgtkVideoDisplay

 

flags

flags

 

cb

a callback function

 

data

a pointer to user data that is passed to the callback function

 

Returns

old callback

Types and Values

UnicapgtkVideoDisplayCropping

typedef struct {
  int crop_x;
  int crop_y;
  int crop_width;
  int crop_height;
} UnicapgtkVideoDisplayCropping;

UnicapgtkVideoDisplay

typedef struct _UnicapgtkVideoDisplay UnicapgtkVideoDisplay;

Property Details

The “backend” property

  “backend”                  gchar *

Owner: UnicapgtkVideoDisplay

Flags: Read / Write

Default value: NULL


The “backend-fourcc” property

  “backend-fourcc”           guint

Owner: UnicapgtkVideoDisplay

Flags: Read / Write

Default value: 0


The “scale-to-fit” property

  “scale-to-fit”             gboolean

Owner: UnicapgtkVideoDisplay

Flags: Read / Write

Default value: FALSE


The “store-original” property

  “store-original”           gboolean

Owner: UnicapgtkVideoDisplay

Flags: Read / Write

Default value: FALSE

Signal Details

The “unicapgtk-video-display-predisplay” signal

void
user_function (UnicapgtkVideoDisplay *unicapgtkvideodisplay,
               gpointer               arg1,
               gpointer               user_data)

Flags: Action