mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-22 00:06:36 +00:00
v4l2: re-enable x-overlay support
This commit is contained in:
parent
417b899c44
commit
67cd90408f
5 changed files with 32 additions and 24 deletions
|
@ -1,13 +1,12 @@
|
|||
plugin_LTLIBRARIES = libgstvideo4linux2.la
|
||||
|
||||
# overlay is still not supported in current implementation
|
||||
# if USE_XVIDEO
|
||||
#xv_source = gstv4l2xoverlay.c
|
||||
#xv_libs = $(X_LIBS) $(XVIDEO_LIBS)
|
||||
#else
|
||||
#xv_source =
|
||||
#xv_libs =
|
||||
#endif
|
||||
if USE_XVIDEO
|
||||
xv_source = gstv4l2xoverlay.c
|
||||
xv_libs = $(X_LIBS) $(XVIDEO_LIBS)
|
||||
else
|
||||
xv_source =
|
||||
xv_libs =
|
||||
endif
|
||||
|
||||
libgstvideo4linux2_la_SOURCES = gstv4l2.c \
|
||||
gstv4l2colorbalance.c \
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
|
||||
#include "v4l2_calls.h"
|
||||
#include "gstv4l2tuner.h"
|
||||
#if 0 /* overlay is still not implemented #ifdef HAVE_XVIDEO */
|
||||
#ifdef HAVE_XVIDEO
|
||||
#include "gstv4l2xoverlay.h"
|
||||
#endif
|
||||
#include "gstv4l2colorbalance.h"
|
||||
|
@ -695,7 +695,7 @@ gst_v4l2_object_start (GstV4l2Object * v4l2object)
|
|||
else
|
||||
return FALSE;
|
||||
|
||||
#if 0 /* overlay is still not implemented #ifdef HAVE_XVIDEO */
|
||||
#ifdef HAVE_XVIDEO
|
||||
gst_v4l2_xoverlay_start (v4l2object);
|
||||
#endif
|
||||
|
||||
|
@ -705,7 +705,7 @@ gst_v4l2_object_start (GstV4l2Object * v4l2object)
|
|||
gboolean
|
||||
gst_v4l2_object_stop (GstV4l2Object * v4l2object)
|
||||
{
|
||||
#if 0 /* overlay is still not implemented #ifdef HAVE_XVIDEO */
|
||||
#ifdef HAVE_XVIDEO
|
||||
gst_v4l2_xoverlay_stop (v4l2object);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
|
||||
|
||||
#include "gstv4l2colorbalance.h"
|
||||
#if 0 /* overlay is still not implemented #ifdef HAVE_XVIDEO */
|
||||
#ifdef HAVE_XVIDEO
|
||||
#include "gstv4l2xoverlay.h"
|
||||
#endif
|
||||
#include "gstv4l2vidorient.h"
|
||||
|
@ -75,7 +75,7 @@ enum
|
|||
|
||||
GST_IMPLEMENT_V4L2_PROBE_METHODS (GstV4l2SinkClass, gst_v4l2sink);
|
||||
GST_IMPLEMENT_V4L2_COLOR_BALANCE_METHODS (GstV4l2Sink, gst_v4l2sink);
|
||||
#if 0 /* overlay is still not implemented #ifdef HAVE_XVIDEO */
|
||||
#ifdef HAVE_XVIDEO
|
||||
GST_IMPLEMENT_V4L2_XOVERLAY_METHODS (GstV4l2Sink, gst_v4l2sink);
|
||||
#endif
|
||||
GST_IMPLEMENT_V4L2_VIDORIENT_METHODS (GstV4l2Sink, gst_v4l2sink);
|
||||
|
@ -85,7 +85,7 @@ gst_v4l2sink_iface_supported (GstImplementsInterface * iface, GType iface_type)
|
|||
{
|
||||
GstV4l2Object *v4l2object = GST_V4L2SINK (iface)->v4l2object;
|
||||
|
||||
#if 0 /* overlay is still not implemented #ifdef HAVE_XVIDEO */
|
||||
#ifdef HAVE_XVIDEO
|
||||
g_assert (iface_type == GST_TYPE_X_OVERLAY ||
|
||||
iface_type == GST_TYPE_COLOR_BALANCE ||
|
||||
iface_type == GST_TYPE_VIDEO_ORIENTATION);
|
||||
|
@ -97,7 +97,7 @@ gst_v4l2sink_iface_supported (GstImplementsInterface * iface, GType iface_type)
|
|||
if (v4l2object->video_fd == -1)
|
||||
return FALSE;
|
||||
|
||||
#if 0 /* overlay is still not implemented #ifdef HAVE_XVIDEO */
|
||||
#ifdef HAVE_XVIDEO
|
||||
if (iface_type == GST_TYPE_X_OVERLAY && !GST_V4L2_IS_OVERLAY (v4l2object))
|
||||
return FALSE;
|
||||
#endif
|
||||
|
@ -122,7 +122,7 @@ gst_v4l2sink_init_interfaces (GType type)
|
|||
NULL,
|
||||
NULL,
|
||||
};
|
||||
#if 0 /* overlay is still not implemented #ifdef HAVE_XVIDEO */
|
||||
#ifdef HAVE_XVIDEO
|
||||
static const GInterfaceInfo v4l2_xoverlay_info = {
|
||||
(GInterfaceInitFunc) gst_v4l2sink_xoverlay_interface_init,
|
||||
NULL,
|
||||
|
@ -147,7 +147,7 @@ gst_v4l2sink_init_interfaces (GType type)
|
|||
|
||||
g_type_add_interface_static (type,
|
||||
GST_TYPE_IMPLEMENTS_INTERFACE, &v4l2iface_info);
|
||||
#if 0 /* overlay is still not implemented #ifdef HAVE_XVIDEO */
|
||||
#ifdef HAVE_XVIDEO
|
||||
g_type_add_interface_static (type, GST_TYPE_X_OVERLAY, &v4l2_xoverlay_info);
|
||||
#endif
|
||||
g_type_add_interface_static (type,
|
||||
|
@ -638,6 +638,12 @@ gst_v4l2sink_buffer_alloc (GstBaseSink * bsink, guint64 offset, guint size,
|
|||
V4L2_BUF_TYPE_VIDEO_OUTPUT))) {
|
||||
return GST_FLOW_ERROR;
|
||||
}
|
||||
#ifdef HAVE_XVIDEO
|
||||
if (GST_V4L2_IS_OVERLAY (v4l2sink->v4l2object)) {
|
||||
gst_x_overlay_prepare_xwindow_id (GST_X_OVERLAY (v4l2sink));
|
||||
}
|
||||
#endif
|
||||
|
||||
v4l2sink->state = STATE_PENDING_STREAMON;
|
||||
|
||||
GST_INFO_OBJECT (v4l2sink, "outputting buffers via mmap()");
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
|
||||
#include "gstv4l2colorbalance.h"
|
||||
#include "gstv4l2tuner.h"
|
||||
#if 0 /* overlay is still not implemented #ifdef HAVE_XVIDEO */
|
||||
#ifdef HAVE_XVIDEO
|
||||
#include "gstv4l2xoverlay.h"
|
||||
#endif
|
||||
#include "gstv4l2vidorient.h"
|
||||
|
@ -79,7 +79,7 @@ enum
|
|||
GST_IMPLEMENT_V4L2_PROBE_METHODS (GstV4l2SrcClass, gst_v4l2src);
|
||||
GST_IMPLEMENT_V4L2_COLOR_BALANCE_METHODS (GstV4l2Src, gst_v4l2src);
|
||||
GST_IMPLEMENT_V4L2_TUNER_METHODS (GstV4l2Src, gst_v4l2src);
|
||||
#if 0 /* overlay is still not implemented #ifdef HAVE_XVIDEO */
|
||||
#ifdef HAVE_XVIDEO
|
||||
GST_IMPLEMENT_V4L2_XOVERLAY_METHODS (GstV4l2Src, gst_v4l2src);
|
||||
#endif
|
||||
GST_IMPLEMENT_V4L2_VIDORIENT_METHODS (GstV4l2Src, gst_v4l2src);
|
||||
|
@ -92,7 +92,7 @@ gst_v4l2src_iface_supported (GstImplementsInterface * iface, GType iface_type)
|
|||
{
|
||||
GstV4l2Object *v4l2object = GST_V4L2SRC (iface)->v4l2object;
|
||||
|
||||
#if 0 /* overlay is still not implemented #ifdef HAVE_XVIDEO */
|
||||
#ifdef HAVE_XVIDEO
|
||||
g_assert (iface_type == GST_TYPE_TUNER ||
|
||||
iface_type == GST_TYPE_X_OVERLAY ||
|
||||
iface_type == GST_TYPE_COLOR_BALANCE ||
|
||||
|
@ -106,7 +106,7 @@ gst_v4l2src_iface_supported (GstImplementsInterface * iface, GType iface_type)
|
|||
if (v4l2object->video_fd == -1)
|
||||
return FALSE;
|
||||
|
||||
#if 0 /* overlay is still not implemented #ifdef HAVE_XVIDEO */
|
||||
#ifdef HAVE_XVIDEO
|
||||
if (iface_type == GST_TYPE_X_OVERLAY && !GST_V4L2_IS_OVERLAY (v4l2object))
|
||||
return FALSE;
|
||||
#endif
|
||||
|
@ -142,7 +142,7 @@ gst_v4l2src_init_interfaces (GType type)
|
|||
NULL,
|
||||
NULL,
|
||||
};
|
||||
#if 0 /* overlay is still not implemented #ifdef HAVE_XVIDEO */
|
||||
#ifdef HAVE_XVIDEO
|
||||
static const GInterfaceInfo v4l2_xoverlay_info = {
|
||||
(GInterfaceInitFunc) gst_v4l2src_xoverlay_interface_init,
|
||||
NULL,
|
||||
|
@ -169,7 +169,7 @@ gst_v4l2src_init_interfaces (GType type)
|
|||
g_type_add_interface_static (type,
|
||||
GST_TYPE_IMPLEMENTS_INTERFACE, &v4l2iface_info);
|
||||
g_type_add_interface_static (type, GST_TYPE_TUNER, &v4l2_tuner_info);
|
||||
#if 0 /* overlay is still not implemented #ifdef HAVE_XVIDEO */
|
||||
#ifdef HAVE_XVIDEO
|
||||
g_type_add_interface_static (type, GST_TYPE_X_OVERLAY, &v4l2_xoverlay_info);
|
||||
#endif
|
||||
g_type_add_interface_static (type,
|
||||
|
|
|
@ -37,6 +37,8 @@
|
|||
#include "gstv4l2object.h"
|
||||
#include "v4l2_calls.h"
|
||||
|
||||
#include "gst/gst-i18n-plugin.h"
|
||||
|
||||
struct _GstV4l2Xv
|
||||
{
|
||||
Display *dpy;
|
||||
|
@ -101,7 +103,8 @@ gst_v4l2_xoverlay_open (GstV4l2Object * v4l2object)
|
|||
}
|
||||
min = s.st_rdev & 0xff;
|
||||
for (i = 0; i < anum; i++) {
|
||||
if (!strcmp (ai[i].name, "video4linux2")) {
|
||||
if (!strcmp (ai[i].name, "video4linux2") ||
|
||||
!strcmp (ai[i].name, "video4linux")) {
|
||||
if (first_id == 0)
|
||||
first_id = ai[i].base_id;
|
||||
|
||||
|
|
Loading…
Reference in a new issue