![]() |
![]() |
![]() |
libunicapgtk Reference Manual | ![]() |
---|---|---|---|---|
UnicapgtkVideoDisplayCropping; UnicapgtkVideoDisplay; GType unicapgtk_video_display_get_type (void); GtkWidget* unicapgtk_video_display_new (void); GtkWidget* unicapgtk_video_display_new_by_device (unicap_device_t *device_spec); GtkWidget* unicapgtk_video_display_new_by_handle (unicap_handle_t handle); gboolean unicapgtk_video_display_start (UnicapgtkVideoDisplay *ugtk); void unicapgtk_video_display_stop (UnicapgtkVideoDisplay *ugtk); unicap_device_t* unicapgtk_video_display_get_device (UnicapgtkVideoDisplay *ugtk); unicap_handle_t unicapgtk_video_display_get_handle (UnicapgtkVideoDisplay *ugkt); gboolean unicapgtk_video_display_set_format (UnicapgtkVideoDisplay *ugtk, unicap_format_t *format_spec); void unicapgtk_video_display_get_format (UnicapgtkVideoDisplay *ugtk, unicap_format_t *format); void unicapgtk_video_display_set_pause (UnicapgtkVideoDisplay *ugtk, gboolean state); gboolean unicapgtk_video_display_get_pause (UnicapgtkVideoDisplay *ugtk); gboolean unicapgtk_video_display_set_device (UnicapgtkVideoDisplay *ugtk, unicap_device_t *device_spec); gboolean unicapgtk_video_display_set_handle (UnicapgtkVideoDisplay *ugtk, unicap_handle_t handle); GdkPixbuf* unicapgtk_video_display_get_still_image (UnicapgtkVideoDisplay *ugtk); void unicapgtk_video_display_set_still_image (UnicapgtkVideoDisplay *ugtk, unicap_data_buffer_t *buffer); void unicapgtk_video_display_get_data_buffer (UnicapgtkVideoDisplay *ugtk, unicap_data_buffer_t **dest_buffer); void unicapgtk_video_display_set_crop (UnicapgtkVideoDisplay *ugtk, UnicapgtkVideoDisplayCropping *crop); void unicapgtk_video_display_get_crop (UnicapgtkVideoDisplay *ugtk, UnicapgtkVideoDisplayCropping *crop); void unicapgtk_video_display_set_size (UnicapgtkVideoDisplay *ugtk, gint width, gint height); void unicapgtk_video_display_set_scale_to_fit (UnicapgtkVideoDisplay *ugtk, gboolean scale); unicap_new_frame_callback_t unicapgtk_video_display_set_new_frame_callback (UnicapgtkVideoDisplay *ugtk, UnicapgtkCallbackFlags flags, unicap_new_frame_callback_t cb, void *data);
GObject +----GInitiallyUnowned +----GtkObject +----GtkWidget +----GtkContainer +----GtkBin +----GtkFrame +----GtkAspectFrame +----UnicapgtkVideoDisplay
"backend" gchararray : Read / Write "backend-fourcc" guint : Read / Write "scale-to-fit" gboolean : Read / Write
"unicapgtk-video-display-predisplay" void user_function (UnicapgtkVideoDisplay *unicapgtkvideodisplay, gpointer arg1, gpointer user_data) : Run first / Action
typedef struct { int crop_x; int crop_y; int crop_width; int crop_height; } UnicapgtkVideoDisplayCropping;
GtkWidget* unicapgtk_video_display_new (void);
Creates a new UnicapgtkVideoDisplay
Returns : | a new UnicapgtkVideoDisplay |
GtkWidget* unicapgtk_video_display_new_by_device (unicap_device_t *device_spec);
Creates a new UnicapgtkVideoDisplay and opens the given device to operate with.
device_spec : |
the device to be used by this video display widget |
Returns : | a new UnicapgtkVideoDisplay |
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.
handle : |
a handle of the device to be used by this video display widget |
Returns : | a new UnicapgtkVideoDisplay |
gboolean unicapgtk_video_display_start (UnicapgtkVideoDisplay *ugtk);
Calls unicap_start_capture on the device and starts displaying the live video stream.
ugtk : |
an UnicapgtkVideoDisplay |
Returns : | TRUE when the live display could be successfully started. |
void unicapgtk_video_display_stop (UnicapgtkVideoDisplay *ugtk);
Calls unicap_stop_capture on the device and stops displaying the live video image.
ugtk : |
an UnicapgtkVideoDisplay |
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.
ugtk : |
an UnicapgtkVideoDisplay |
Returns : | an unicap_device_t |
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.
ugkt : |
|
Returns : | a cloned unicap_handle_t |
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.
ugtk : |
an UnicapgtkVideoDisplay |
format_spec : |
a unicap_format_t |
Returns : | TRUE when the format change was successfull. |
void unicapgtk_video_display_get_format (UnicapgtkVideoDisplay *ugtk, unicap_format_t *format);
ugtk : |
|
format : |
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.
ugtk : |
an UnicapgtkVideoDisplay |
state : |
TRUE to put the device into pause state; FALSE to put it into running state |
gboolean unicapgtk_video_display_get_pause (UnicapgtkVideoDisplay *ugtk);
Retrieve current pause state
ugtk : |
an UnicapgtkVideoDisplay |
Returns : | TRUE when the display is currently paused |
gboolean unicapgtk_video_display_set_device (UnicapgtkVideoDisplay *ugtk, unicap_device_t *device_spec);
Set a new device on the display.
ugtk : |
an UnicapgtkVideoDisplay |
device_spec : |
an unicap_device_t |
Returns : | TRUE when the new device could be successfully set. |
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.
ugtk : |
an UnicapgtkVideoDisplay |
handle : |
a unicap_handle_t |
Returns : | TRUE when the device change was successful. |
GdkPixbuf* unicapgtk_video_display_get_still_image (UnicapgtkVideoDisplay *ugtk);
Retrieves a still image from the live video stream.
ugtk : |
an UnicapgtkVideoDisplay |
Returns : | a new allocated GdkPixbuf |
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.
ugtk : |
an UnicapgtkVideoDisplay |
buffer : |
a data_buffer to be displayed |
void unicapgtk_video_display_get_data_buffer (UnicapgtkVideoDisplay *ugtk, unicap_data_buffer_t **dest_buffer);
Retrieves a still image from the live video stream.
ugtk : |
an UnicapgtkVideoDisplay |
dest_buffer : |
a pointer where to store the new data_buffer |
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.
ugtk : |
an UnicagtkVideoDisplay |
crop : |
cropping specification |
void unicapgtk_video_display_get_crop (UnicapgtkVideoDisplay *ugtk, UnicapgtkVideoDisplayCropping *crop);
Retrieves the current cropping window.
ugtk : |
an UnicapgtkVideoDisplay |
crop : |
pointer to where to store the UnicapgtkVideoDisplayCropping structure |
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.
ugtk : |
an UnicapgtkVideoDisplay |
width : |
new width |
height : |
new height |
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.
ugtk : |
an UnicapgtkVideoDisplay |
scale : |
TRUE if the display should scale to fit |
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.
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 |
void user_function (UnicapgtkVideoDisplay *unicapgtkvideodisplay, gpointer arg1, gpointer user_data) : Run first / Action
unicapgtkvideodisplay : |
the object which received the signal. |
arg1 : |
|
user_data : |
user data set when the signal handler was connected. |