/* GStreamer
- *
* Copyright (C) 2003 Ronald Bultje <rbultje@ronald.bitfreak.net>
* 2006 Edgard Lima <edgard.lima@indt.org.br>
*
- * gstv4l2xoverlay.c: X-based overlay interface implementation for V4L2
+ * gstv4l2video_overlay.c: X-based overlay interface implementation for V4L2
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
#include <gst/interfaces/navigation.h>
-#include "gstv4l2xoverlay.h"
+#include "gstv4l2videooverlay.h"
#include "gstv4l2object.h"
#include "v4l2_calls.h"
#define GST_CAT_DEFAULT v4l2xv_debug
void
-gst_v4l2_xoverlay_interface_init (GstXOverlayClass * klass)
+gst_v4l2_video_overlay_interface_init (GstVideoOverlayInterface * iface)
{
GST_DEBUG_CATEGORY_INIT (v4l2xv_debug, "v4l2xv", 0,
- "V4L2 XOverlay interface debugging");
+ "V4L2 GstVideoOverlay interface debugging");
}
static void
-gst_v4l2_xoverlay_open (GstV4l2Object * v4l2object)
+gst_v4l2_video_overlay_open (GstV4l2Object * v4l2object)
{
struct stat s;
GstV4l2Xv *v4l2xv;
v4l2object->xv = v4l2xv;
if (v4l2object->xwindow_id) {
- gst_v4l2_xoverlay_set_window_handle (v4l2object, v4l2object->xwindow_id);
+ gst_v4l2_video_overlay_set_window_handle (v4l2object,
+ v4l2object->xwindow_id);
}
}
static void
-gst_v4l2_xoverlay_close (GstV4l2Object * v4l2object)
+gst_v4l2_video_overlay_close (GstV4l2Object * v4l2object)
{
GstV4l2Xv *v4l2xv = v4l2object->xv;
return;
if (v4l2object->xwindow_id) {
- gst_v4l2_xoverlay_set_window_handle (v4l2object, 0);
+ gst_v4l2_video_overlay_set_window_handle (v4l2object, 0);
}
XCloseDisplay (v4l2xv->dpy);
}
void
-gst_v4l2_xoverlay_start (GstV4l2Object * v4l2object)
+gst_v4l2_video_overlay_start (GstV4l2Object * v4l2object)
{
if (v4l2object->xwindow_id) {
- gst_v4l2_xoverlay_open (v4l2object);
+ gst_v4l2_video_overlay_open (v4l2object);
}
}
void
-gst_v4l2_xoverlay_stop (GstV4l2Object * v4l2object)
+gst_v4l2_video_overlay_stop (GstV4l2Object * v4l2object)
{
- gst_v4l2_xoverlay_close (v4l2object);
+ gst_v4l2_video_overlay_close (v4l2object);
}
/* should be called with mutex held */
}
gboolean
-gst_v4l2_xoverlay_get_render_rect (GstV4l2Object * v4l2object,
+gst_v4l2_video_overlay_get_render_rect (GstV4l2Object * v4l2object,
GstVideoRectangle * rect)
{
GstV4l2Xv *v4l2xv = v4l2object->xv;
}
void
-gst_v4l2_xoverlay_set_window_handle (GstV4l2Object * v4l2object, guintptr id)
+gst_v4l2_video_overlay_set_window_handle (GstV4l2Object * v4l2object,
+ guintptr id)
{
GstV4l2Xv *v4l2xv;
XID xwindow_id = id;
(gulong) xwindow_id);
if (!v4l2object->xv && GST_V4L2_IS_OPEN (v4l2object))
- gst_v4l2_xoverlay_open (v4l2object);
+ gst_v4l2_video_overlay_open (v4l2object);
v4l2xv = v4l2object->xv;
}
/**
- * gst_v4l2_xoverlay_prepare_xwindow_id:
+ * gst_v4l2_video_overlay_prepare_window_handle:
* @v4l2object: the v4l2object
* @required: %TRUE if display is required (ie. TRUE for v4l2sink, but
* FALSE for any other element with optional overlay capabilities)
* Helper function to create a windo if none is set from the application.
*/
void
-gst_v4l2_xoverlay_prepare_xwindow_id (GstV4l2Object * v4l2object,
+gst_v4l2_video_overlay_prepare_window_handle (GstV4l2Object * v4l2object,
gboolean required)
{
+ GstVideoOverlay *overlay;
+
if (!GST_V4L2_IS_OVERLAY (v4l2object))
return;
- gst_x_overlay_prepare_xwindow_id (GST_X_OVERLAY (v4l2object->element));
+ overlay = GST_VIDEO_OVERLAY (v4l2object->element);
+ gst_video_overlay_prepare_window_handle (overlay);
if (required && !v4l2object->xwindow_id) {
GstV4l2Xv *v4l2xv;
long event_mask;
if (!v4l2object->xv && GST_V4L2_IS_OPEN (v4l2object))
- gst_v4l2_xoverlay_open (v4l2object);
+ gst_v4l2_video_overlay_open (v4l2object);
v4l2xv = v4l2object->xv;
- /* if xoverlay is not supported, just bail */
+ /* if video_overlay is not supported, just bail */
if (!v4l2xv)
return;
- /* xoverlay is supported, but we don't have a window.. so create one */
+ /* video_overlay is supported, but we don't have a window.. so create one */
GST_DEBUG_OBJECT (v4l2object->element, "creating window");
g_mutex_lock (v4l2xv->mutex);
GST_DEBUG_OBJECT (v4l2object->element, "got window");
- gst_v4l2_xoverlay_set_window_handle (v4l2object, win);
+ gst_v4l2_video_overlay_set_window_handle (v4l2object, win);
}
}