diff --git a/sys/v4l2/Makefile.am b/sys/v4l2/Makefile.am index edf336ef52..b4431c17d5 100644 --- a/sys/v4l2/Makefile.am +++ b/sys/v4l2/Makefile.am @@ -1,7 +1,7 @@ plugin_LTLIBRARIES = libgstvideo4linux2.la if USE_XVIDEO -xv_source = gstv4l2xoverlay.c +xv_source = gstv4l2videooverlay.c xv_libs = $(X_LIBS) $(XVIDEO_LIBS) else xv_source = @@ -51,5 +51,5 @@ noinst_HEADERS = \ gstv4l2radio.h \ gstv4l2tuner.h \ gstv4l2vidorient.h \ - gstv4l2xoverlay.h \ + gstv4l2videooverlay.h \ v4l2_calls.h diff --git a/sys/v4l2/gstv4l2object.c b/sys/v4l2/gstv4l2object.c index bcfbb54fae..37926de6e9 100644 --- a/sys/v4l2/gstv4l2object.c +++ b/sys/v4l2/gstv4l2object.c @@ -35,7 +35,7 @@ #include "v4l2_calls.h" #include "gstv4l2tuner.h" #ifdef HAVE_XVIDEO -#include "gstv4l2xoverlay.h" +#include "gstv4l2videooverlay.h" #endif #include "gstv4l2colorbalance.h" @@ -797,7 +797,7 @@ gst_v4l2_object_open (GstV4l2Object * v4l2object) return FALSE; #ifdef HAVE_XVIDEO - gst_v4l2_xoverlay_start (v4l2object); + gst_v4l2_video_overlay_start (v4l2object); #endif return TRUE; @@ -807,7 +807,7 @@ gboolean gst_v4l2_object_close (GstV4l2Object * v4l2object) { #ifdef HAVE_XVIDEO - gst_v4l2_xoverlay_stop (v4l2object); + gst_v4l2_video_overlay_stop (v4l2object); #endif if (!gst_v4l2_close (v4l2object)) diff --git a/sys/v4l2/gstv4l2sink.c b/sys/v4l2/gstv4l2sink.c index 9d5845b75d..93bb207733 100644 --- a/sys/v4l2/gstv4l2sink.c +++ b/sys/v4l2/gstv4l2sink.c @@ -58,7 +58,7 @@ #include "gstv4l2colorbalance.h" #include "gstv4l2tuner.h" #ifdef HAVE_XVIDEO -#include "gstv4l2xoverlay.h" +#include "gstv4l2videooverlay.h" #endif #include "gstv4l2vidorient.h" @@ -91,7 +91,7 @@ GST_IMPLEMENT_V4L2_PROBE_METHODS (GstV4l2SinkClass, gst_v4l2sink); GST_IMPLEMENT_V4L2_COLOR_BALANCE_METHODS (GstV4l2Sink, gst_v4l2sink); GST_IMPLEMENT_V4L2_TUNER_METHODS (GstV4l2Sink, gst_v4l2sink); #ifdef HAVE_XVIDEO -GST_IMPLEMENT_V4L2_XOVERLAY_METHODS (GstV4l2Sink, gst_v4l2sink); +GST_IMPLEMENT_V4L2_VIDEO_OVERLAY_METHODS (GstV4l2Sink, gst_v4l2sink); #endif GST_IMPLEMENT_V4L2_VIDORIENT_METHODS (GstV4l2Sink, gst_v4l2sink); @@ -109,8 +109,8 @@ gst_v4l2sink_navigation_init (GstNavigationInterface * iface) G_DEFINE_TYPE_WITH_CODE (GstV4l2Sink, gst_v4l2sink, GST_TYPE_VIDEO_SINK, G_IMPLEMENT_INTERFACE (GST_TYPE_TUNER, gst_v4l2sink_tuner_interface_init); #ifdef HAVE_XVIDEO - G_IMPLEMENT_INTERFACE (GST_TYPE_X_OVERLAY, - gst_v4l2sink_xoverlay_interface_init); + G_IMPLEMENT_INTERFACE (GST_TYPE_VIDEO_OVERLAY, + gst_v4l2sink_video_overlay_interface_init); G_IMPLEMENT_INTERFACE (GST_TYPE_NAVIGATION, gst_v4l2sink_navigation_init); #endif G_IMPLEMENT_INTERFACE (GST_TYPE_COLOR_BALANCE, @@ -589,7 +589,7 @@ gst_v4l2sink_set_caps (GstBaseSink * bsink, GstCaps * caps) gst_v4l2sink_sync_crop_fields (v4l2sink); #ifdef HAVE_XVIDEO - gst_v4l2_xoverlay_prepare_xwindow_id (v4l2sink->v4l2object, TRUE); + gst_v4l2_video_overlay_prepare_window_handle (v4l2sink->v4l2object, TRUE); #endif GST_INFO_OBJECT (v4l2sink, "outputting buffers via mmap()"); @@ -720,7 +720,7 @@ gst_v4l2sink_navigation_send_event (GstNavigation * navigation, GstVideoRectangle rect; gdouble x, y, xscale = 1.0, yscale = 1.0; - gst_v4l2_xoverlay_get_render_rect (v4l2sink->v4l2object, &rect); + gst_v4l2_video_overlay_get_render_rect (v4l2sink->v4l2object, &rect); /* We calculate scaling using the original video frames geometry to * include pixel aspect ratio scaling. diff --git a/sys/v4l2/gstv4l2xoverlay.c b/sys/v4l2/gstv4l2videooverlay.c similarity index 90% rename from sys/v4l2/gstv4l2xoverlay.c rename to sys/v4l2/gstv4l2videooverlay.c index 80f114d202..6c2fd68b94 100644 --- a/sys/v4l2/gstv4l2xoverlay.c +++ b/sys/v4l2/gstv4l2videooverlay.c @@ -1,9 +1,8 @@ /* GStreamer - * * Copyright (C) 2003 Ronald Bultje * 2006 Edgard Lima * - * 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 @@ -35,7 +34,7 @@ #include -#include "gstv4l2xoverlay.h" +#include "gstv4l2videooverlay.h" #include "gstv4l2object.h" #include "v4l2_calls.h" @@ -52,14 +51,14 @@ GST_DEBUG_CATEGORY_STATIC (v4l2xv_debug); #define GST_CAT_DEFAULT v4l2xv_debug void -gst_v4l2_xoverlay_interface_init (GstXOverlayClass * klass) +gst_v4l2_video_overlay_interface_init (GstVideoOverlayIface * klass) { 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; @@ -137,12 +136,13 @@ gst_v4l2_xoverlay_open (GstV4l2Object * v4l2object) 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; @@ -150,7 +150,7 @@ gst_v4l2_xoverlay_close (GstV4l2Object * v4l2object) 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); @@ -164,17 +164,17 @@ gst_v4l2_xoverlay_close (GstV4l2Object * v4l2object) } 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 */ @@ -197,7 +197,7 @@ get_render_rect (GstV4l2Object * v4l2object, GstVideoRectangle * rect) } gboolean -gst_v4l2_xoverlay_get_render_rect (GstV4l2Object * v4l2object, +gst_v4l2_video_overlay_get_render_rect (GstV4l2Object * v4l2object, GstVideoRectangle * rect) { GstV4l2Xv *v4l2xv = v4l2object->xv; @@ -363,7 +363,8 @@ event_refresh (gpointer data) } 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; @@ -373,7 +374,7 @@ gst_v4l2_xoverlay_set_window_handle (GstV4l2Object * v4l2object, guintptr 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; @@ -417,7 +418,7 @@ gst_v4l2_xoverlay_set_window_handle (GstV4l2Object * v4l2object, guintptr id) } /** - * 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) @@ -425,13 +426,16 @@ gst_v4l2_xoverlay_set_window_handle (GstV4l2Object * v4l2object, guintptr id) * 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; @@ -440,15 +444,15 @@ gst_v4l2_xoverlay_prepare_xwindow_id (GstV4l2Object * v4l2object, 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); @@ -480,6 +484,6 @@ gst_v4l2_xoverlay_prepare_xwindow_id (GstV4l2Object * v4l2object, GST_DEBUG_OBJECT (v4l2object->element, "got window"); - gst_v4l2_xoverlay_set_window_handle (v4l2object, win); + gst_v4l2_video_overlay_set_window_handle (v4l2object, win); } } diff --git a/sys/v4l2/gstv4l2xoverlay.h b/sys/v4l2/gstv4l2videooverlay.h similarity index 60% rename from sys/v4l2/gstv4l2xoverlay.h rename to sys/v4l2/gstv4l2videooverlay.h index 1a09306836..601366687f 100644 --- a/sys/v4l2/gstv4l2xoverlay.h +++ b/sys/v4l2/gstv4l2videooverlay.h @@ -1,9 +1,8 @@ /* GStreamer - * * Copyright (C) 2003 Ronald Bultje * 2006 Edgard Lima * - * gstv4l2xoverlay.h: tv mixer interface implementation for V4L2 + * gstv4l2videooverlay.h: tv mixer 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 @@ -21,13 +20,13 @@ * Boston, MA 02111-1307, USA. */ -#ifndef __GST_V4L2_X_OVERLAY_H__ -#define __GST_V4L2_X_OVERLAY_H__ +#ifndef __GST_V4L2_VIDEO_OVERLAY_H__ +#define __GST_V4L2_VIDEO_OVERLAY_H__ #include #include -#include +#include #include #include /* for GstVideoRectange */ @@ -35,36 +34,36 @@ G_BEGIN_DECLS -void gst_v4l2_xoverlay_start (GstV4l2Object *v4l2object); -void gst_v4l2_xoverlay_stop (GstV4l2Object *v4l2object); -gboolean gst_v4l2_xoverlay_get_render_rect (GstV4l2Object *v4l2object, +void gst_v4l2_video_overlay_start (GstV4l2Object *v4l2object); +void gst_v4l2_video_overlay_stop (GstV4l2Object *v4l2object); +gboolean gst_v4l2_video_overlay_get_render_rect (GstV4l2Object *v4l2object, GstVideoRectangle *rect); -void gst_v4l2_xoverlay_interface_init (GstXOverlayClass * klass); -void gst_v4l2_xoverlay_set_window_handle (GstV4l2Object * v4l2object, +void gst_v4l2_video_overlay_interface_init (GstVideoOverlayIface * iface); +void gst_v4l2_video_overlay_set_window_handle (GstV4l2Object * v4l2object, guintptr id); -void gst_v4l2_xoverlay_prepare_xwindow_id (GstV4l2Object * v4l2object, +void gst_v4l2_video_overlay_prepare_window_handle (GstV4l2Object * v4l2object, gboolean required); -#define GST_IMPLEMENT_V4L2_XOVERLAY_METHODS(Type, interface_as_function) \ +#define GST_IMPLEMENT_V4L2_VIDEO_OVERLAY_METHODS(Type, interface_as_function) \ \ static void \ -interface_as_function ## _xoverlay_set_window_handle (GstXOverlay * xoverlay, \ - guintptr id) \ +interface_as_function ## _video_overlay_set_window_handle (GstVideoOverlay * overlay, \ + guintptr id) \ { \ - Type *this = (Type*) xoverlay; \ - gst_v4l2_xoverlay_set_window_handle (this->v4l2object, id); \ + Type *this = (Type*) overlay; \ + gst_v4l2_video_overlay_set_window_handle (this->v4l2object, id); \ } \ \ static void \ -interface_as_function ## _xoverlay_interface_init (GstXOverlayClass * klass) \ +interface_as_function ## _video_overlay_interface_init (GstVideoOverlayIface * iface) \ { \ /* default virtual functions */ \ - klass->set_window_handle = interface_as_function ## _xoverlay_set_window_handle; \ + iface->set_window_handle = interface_as_function ## _video_overlay_set_window_handle; \ \ - gst_v4l2_xoverlay_interface_init(klass); \ + gst_v4l2_video_overlay_interface_init (iface); \ } \ -#endif /* __GST_V4L2_X_OVERLAY_H__ */ +#endif /* __GST_V4L2_VIDEO_OVERLAY_H__ */