Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Marc-André Lureau
gst-plugins-good
Commits
d5db5ca9
Commit
d5db5ca9
authored
Aug 08, 2011
by
Tim-Philipp Müller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
v4l2: update for GstXOverlay => GstVideoOverlay rename
parent
71346020
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
57 additions
and
54 deletions
+57
-54
sys/v4l2/Makefile.am
sys/v4l2/Makefile.am
+2
-2
sys/v4l2/gstv4l2object.c
sys/v4l2/gstv4l2object.c
+3
-3
sys/v4l2/gstv4l2sink.c
sys/v4l2/gstv4l2sink.c
+6
-6
sys/v4l2/gstv4l2videooverlay.c
sys/v4l2/gstv4l2videooverlay.c
+27
-23
sys/v4l2/gstv4l2videooverlay.h
sys/v4l2/gstv4l2videooverlay.h
+19
-20
No files found.
sys/v4l2/Makefile.am
View file @
d5db5ca9
plugin_LTLIBRARIES
=
libgstvideo4linux2.la
if
USE_XVIDEO
xv_source
=
gstv4l2
x
overlay.c
xv_source
=
gstv4l2
video
overlay.c
xv_libs
=
$(X_LIBS)
$(XVIDEO_LIBS)
else
xv_source
=
...
...
@@ -51,5 +51,5 @@ noinst_HEADERS = \
gstv4l2radio.h
\
gstv4l2tuner.h
\
gstv4l2vidorient.h
\
gstv4l2
x
overlay.h
\
gstv4l2
video
overlay.h
\
v4l2_calls.h
sys/v4l2/gstv4l2object.c
View file @
d5db5ca9
...
...
@@ -35,7 +35,7 @@
#include "v4l2_calls.h"
#include "gstv4l2tuner.h"
#ifdef HAVE_XVIDEO
#include "gstv4l2
x
overlay.h"
#include "gstv4l2
video
overlay.h"
#endif
#include "gstv4l2colorbalance.h"
...
...
@@ -797,7 +797,7 @@ gst_v4l2_object_open (GstV4l2Object * v4l2object)
return
FALSE
;
#ifdef HAVE_XVIDEO
gst_v4l2_
x
overlay_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_
x
overlay_stop
(
v4l2object
);
gst_v4l2_
video_
overlay_stop
(
v4l2object
);
#endif
if
(
!
gst_v4l2_close
(
v4l2object
))
...
...
sys/v4l2/gstv4l2sink.c
View file @
d5db5ca9
...
...
@@ -58,7 +58,7 @@
#include "gstv4l2colorbalance.h"
#include "gstv4l2tuner.h"
#ifdef HAVE_XVIDEO
#include "gstv4l2
x
overlay.h"
#include "gstv4l2
video
overlay.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_
X
OVERLAY_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_
x
overlay_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_
x
overlay_prepare_
x
window_
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_
x
overlay_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.
...
...
sys/v4l2/gstv4l2
x
overlay.c
→
sys/v4l2/gstv4l2
video
overlay.c
View file @
d5db5ca9
/* GStreamer
*
* Copyright (C) 2003 Ronald Bultje <rbultje@ronald.bitfreak.net>
* 2006 Edgard Lima <edgard.lima@indt.org.br>
*
* gstv4l2
x
overlay.c: X-based overlay interface implementation for V4L2
* gstv4l2
video_
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 <gst/interfaces/navigation.h>
#include "gstv4l2
x
overlay.h"
#include "gstv4l2
video
overlay.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_
x
overlay_interface_init
(
Gst
X
Overlay
Class
*
klass
)
gst_v4l2_
video_
overlay_interface_init
(
Gst
Video
Overlay
Iface
*
klass
)
{
GST_DEBUG_CATEGORY_INIT
(
v4l2xv_debug
,
"v4l2xv"
,
0
,
"V4L2
X
Overlay interface debugging"
);
"V4L2
GstVideo
Overlay interface debugging"
);
}
static
void
gst_v4l2_
x
overlay_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_
x
overlay_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_
x
overlay_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_
x
overlay_start
(
GstV4l2Object
*
v4l2object
)
gst_v4l2_
video_
overlay_start
(
GstV4l2Object
*
v4l2object
)
{
if
(
v4l2object
->
xwindow_id
)
{
gst_v4l2_
x
overlay_open
(
v4l2object
);
gst_v4l2_
video_
overlay_open
(
v4l2object
);
}
}
void
gst_v4l2_
x
overlay_stop
(
GstV4l2Object
*
v4l2object
)
gst_v4l2_
video_
overlay_stop
(
GstV4l2Object
*
v4l2object
)
{
gst_v4l2_
x
overlay_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_
x
overlay_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_
x
overlay_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_
x
overlay_prepare_
x
window_
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_
x
overlay_prepare_
x
window_
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_
x
overlay_open
(
v4l2object
);
gst_v4l2_
video_
overlay_open
(
v4l2object
);
v4l2xv
=
v4l2object
->
xv
;
/* if
x
overlay is not supported, just bail */
/* if
video_
overlay is not supported, just bail */
if
(
!
v4l2xv
)
return
;
/*
x
overlay 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_
x
overlay_set_window_handle
(
v4l2object
,
win
);
gst_v4l2_
video_
overlay_set_window_handle
(
v4l2object
,
win
);
}
}
sys/v4l2/gstv4l2
x
overlay.h
→
sys/v4l2/gstv4l2
video
overlay.h
View file @
d5db5ca9
/* GStreamer
*
* Copyright (C) 2003 Ronald Bultje <rbultje@ronald.bitfreak.net>
* 2006 Edgard Lima <edgard.lima@indt.org.br>
*
* gstv4l2
x
overlay.h: tv mixer interface implementation for V4L2
* gstv4l2
video
overlay.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 <X11/X.h>
#include <gst/gst.h>
#include <gst/interfaces/
x
overlay.h>
#include <gst/interfaces/
video
overlay.h>
#include <gst/interfaces/navigation.h>
#include <gst/video/gstvideosink.h>
/* for GstVideoRectange */
...
...
@@ -35,36 +34,36 @@
G_BEGIN_DECLS
void
gst_v4l2_
x
overlay_start
(
GstV4l2Object
*
v4l2object
);
void
gst_v4l2_
x
overlay_stop
(
GstV4l2Object
*
v4l2object
);
gboolean
gst_v4l2_
x
overlay_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_
x
overlay_interface_init
(
Gst
X
Overlay
Class
*
klass
);
void
gst_v4l2_
x
overlay_set_window_handle
(
GstV4l2Object
*
v4l2object
,
void
gst_v4l2_
video_
overlay_interface_init
(
Gst
Video
Overlay
Iface
*
iface
);
void
gst_v4l2_
video_
overlay_set_window_handle
(
GstV4l2Object
*
v4l2object
,
guintptr
id
);
void
gst_v4l2_
x
overlay_prepare_
x
window_
id
(
GstV4l2Object
*
v4l2object
,
void
gst_v4l2_
video_
overlay_prepare_window_
handle
(
GstV4l2Object
*
v4l2object
,
gboolean
required
);
#define GST_IMPLEMENT_V4L2_
X
OVERLAY_METHODS(Type, interface_as_function)
\
#define GST_IMPLEMENT_V4L2_
VIDEO_
OVERLAY_METHODS(Type, interface_as_function) \
\
static void \
interface_as_function ## _
x
overlay_set_window_handle (Gst
X
Overlay *
x
overlay, \
guintptr id)
\
interface_as_function ## _
video_
overlay_set_window_handle (Gst
Video
Overlay * overlay, \
guintptr id) \
{ \
Type *this = (Type*)
x
overlay; \
gst_v4l2_
x
overlay_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 ## _
x
overlay_interface_init (Gst
X
Overlay
Class * klass
) \
interface_as_function ## _
video_
overlay_interface_init (Gst
Video
Overlay
Iface * iface
) \
{ \
/* default virtual functions */
\
klass
->set_window_handle = interface_as_function ## _
x
overlay_set_window_handle; \
iface
->set_window_handle = interface_as_function ## _
video_
overlay_set_window_handle; \
\
gst_v4l2_
x
overlay_interface_init
(klass);
\
gst_v4l2_
video_
overlay_interface_init
(iface);
\
} \
#endif
/* __GST_V4L2_
X
_OVERLAY_H__ */
#endif
/* __GST_V4L2_
VIDEO
_OVERLAY_H__ */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment