mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-05 23:18:52 +00:00
Don't use GST_PLUGIN_LDFLAGS, because these aren't plugins.
Original commit message from CVS: Don't use GST_PLUGIN_LDFLAGS, because these aren't plugins. * gst-libs/gst/audio/Makefile.am: * gst-libs/gst/riff/Makefile.am: * gst-libs/gst/tag/Makefile.am: * gst-libs/gst/video/Makefile.am: * gst-libs/gst/xwindowlistener/Makefile.am: Convert to 0.9 API, seems to work: * sys/ximage/Makefile.am: * sys/ximage/ximagesink.c:
This commit is contained in:
parent
a31a3800b6
commit
ab06cc8f10
8 changed files with 132 additions and 77 deletions
13
ChangeLog
13
ChangeLog
|
@ -1,3 +1,16 @@
|
||||||
|
2005-04-25 David Schleef <ds@schleef.org>
|
||||||
|
|
||||||
|
Don't use GST_PLUGIN_LDFLAGS, because these aren't plugins.
|
||||||
|
* gst-libs/gst/audio/Makefile.am:
|
||||||
|
* gst-libs/gst/riff/Makefile.am:
|
||||||
|
* gst-libs/gst/tag/Makefile.am:
|
||||||
|
* gst-libs/gst/video/Makefile.am:
|
||||||
|
* gst-libs/gst/xwindowlistener/Makefile.am:
|
||||||
|
|
||||||
|
Convert to 0.9 API, seems to work:
|
||||||
|
* sys/ximage/Makefile.am:
|
||||||
|
* sys/ximage/ximagesink.c:
|
||||||
|
|
||||||
2005-04-24 David Schleef <ds@schleef.org>
|
2005-04-24 David Schleef <ds@schleef.org>
|
||||||
|
|
||||||
Link plugins against libraries:
|
Link plugins against libraries:
|
||||||
|
|
|
@ -18,9 +18,8 @@ libgstaudio_@GST_MAJORMINOR@_la_SOURCES = audio.c audioclock.c \
|
||||||
multichannel.c \
|
multichannel.c \
|
||||||
gstaudiosink.c \
|
gstaudiosink.c \
|
||||||
gstbaseaudiosink.c \
|
gstbaseaudiosink.c \
|
||||||
gstringbuffer.c \
|
gstringbuffer.c
|
||||||
multichannel-enumtypes.c
|
nodist_libgstaudio_@GST_MAJORMINOR@_la_SOURCES = $(built_sources) $(built_headers)
|
||||||
nodist_libgstaudio_la_SOURCES = $(built_sources)
|
|
||||||
|
|
||||||
libgstaudio_@GST_MAJORMINOR@includedir = $(includedir)/gstreamer-@GST_MAJORMINOR@/gst/audio
|
libgstaudio_@GST_MAJORMINOR@includedir = $(includedir)/gstreamer-@GST_MAJORMINOR@/gst/audio
|
||||||
libgstaudio_@GST_MAJORMINOR@include_HEADERS = \
|
libgstaudio_@GST_MAJORMINOR@include_HEADERS = \
|
||||||
|
@ -30,16 +29,15 @@ libgstaudio_@GST_MAJORMINOR@include_HEADERS = \
|
||||||
gstaudiosink.h \
|
gstaudiosink.h \
|
||||||
gstbaseaudiosink.h \
|
gstbaseaudiosink.h \
|
||||||
gstringbuffer.h \
|
gstringbuffer.h \
|
||||||
multichannel.h \
|
multichannel.h
|
||||||
multichannel-enumtypes.h
|
|
||||||
|
|
||||||
libgstaudio_@GST_MAJORMINOR@_la_LIBADD =
|
libgstaudio_@GST_MAJORMINOR@_la_LIBADD =
|
||||||
libgstaudio_@GST_MAJORMINOR@_la_CFLAGS = $(GST_CFLAGS)
|
libgstaudio_@GST_MAJORMINOR@_la_CFLAGS = $(GST_CFLAGS)
|
||||||
libgstaudio_@GST_MAJORMINOR@_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(GST_BASE_LIBS)
|
libgstaudio_@GST_MAJORMINOR@_la_LDFLAGS = $(GST_LDFLAGS) $(GST_BASE_LIBS)
|
||||||
|
|
||||||
libgstaudiofilter_@GST_MAJORMINOR@_la_SOURCES = gstaudiofilter.c gstaudiofilter.h
|
libgstaudiofilter_@GST_MAJORMINOR@_la_SOURCES = gstaudiofilter.c gstaudiofilter.h
|
||||||
libgstaudiofilter_@GST_MAJORMINOR@_la_CFLAGS = $(GST_CFLAGS)
|
libgstaudiofilter_@GST_MAJORMINOR@_la_CFLAGS = $(GST_CFLAGS)
|
||||||
libgstaudiofilter_@GST_MAJORMINOR@_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
|
libgstaudiofilter_@GST_MAJORMINOR@_la_LDFLAGS = $(GST_LDFLAGS)
|
||||||
|
|
||||||
libgstaudiofilterexample_la_SOURCES = gstaudiofilterexample.c
|
libgstaudiofilterexample_la_SOURCES = gstaudiofilterexample.c
|
||||||
libgstaudiofilterexample_la_CFLAGS = $(GST_CFLAGS)
|
libgstaudiofilterexample_la_CFLAGS = $(GST_CFLAGS)
|
||||||
|
|
|
@ -13,4 +13,4 @@ libgstriff_@GST_MAJORMINOR@include_HEADERS = \
|
||||||
|
|
||||||
libgstriff_@GST_MAJORMINOR@_la_LIBADD =
|
libgstriff_@GST_MAJORMINOR@_la_LIBADD =
|
||||||
libgstriff_@GST_MAJORMINOR@_la_CFLAGS = $(GST_CFLAGS)
|
libgstriff_@GST_MAJORMINOR@_la_CFLAGS = $(GST_CFLAGS)
|
||||||
libgstriff_@GST_MAJORMINOR@_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
|
libgstriff_@GST_MAJORMINOR@_la_LDFLAGS = $(GST_LDFLAGS)
|
||||||
|
|
|
@ -9,7 +9,7 @@ lib_LTLIBRARIES = libgsttagedit-@GST_MAJORMINOR@.la
|
||||||
libgsttagedit_@GST_MAJORMINOR@_la_SOURCES = gstvorbistag.c gsttagediting.c gstid3tag.c
|
libgsttagedit_@GST_MAJORMINOR@_la_SOURCES = gstvorbistag.c gsttagediting.c gstid3tag.c
|
||||||
libgsttagedit_@GST_MAJORMINOR@_la_CFLAGS = $(GST_CFLAGS) -I$(top_srcdir)/gst/tags
|
libgsttagedit_@GST_MAJORMINOR@_la_CFLAGS = $(GST_CFLAGS) -I$(top_srcdir)/gst/tags
|
||||||
libgsttagedit_@GST_MAJORMINOR@_la_LIBADD = $(GST_LIBS)
|
libgsttagedit_@GST_MAJORMINOR@_la_LIBADD = $(GST_LIBS)
|
||||||
libgsttagedit_@GST_MAJORMINOR@_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
|
libgsttagedit_@GST_MAJORMINOR@_la_LDFLAGS = $(GST_LDFLAGS)
|
||||||
|
|
||||||
noinst_HEADERS = gsttageditingprivate.h
|
noinst_HEADERS = gsttageditingprivate.h
|
||||||
|
|
||||||
|
|
|
@ -8,4 +8,4 @@ libgstvideoinclude_HEADERS = video.h videosink.h
|
||||||
|
|
||||||
libgstvideo_@GST_MAJORMINOR@_la_LIBADD =
|
libgstvideo_@GST_MAJORMINOR@_la_LIBADD =
|
||||||
libgstvideo_@GST_MAJORMINOR@_la_CFLAGS = $(GST_CFLAGS)
|
libgstvideo_@GST_MAJORMINOR@_la_CFLAGS = $(GST_CFLAGS)
|
||||||
libgstvideo_@GST_MAJORMINOR@_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(GST_BASE_LIBS)
|
libgstvideo_@GST_MAJORMINOR@_la_LDFLAGS = $(GST_LDFLAGS) $(GST_BASE_LIBS)
|
||||||
|
|
|
@ -7,4 +7,4 @@ libraryinclude_HEADERS = xwindowlistener.h
|
||||||
|
|
||||||
libgstxwindowlistener_la_LIBADD =$(GST_LIBS) $(GST_PLUGIN_LIBS) $(X_LIBS)
|
libgstxwindowlistener_la_LIBADD =$(GST_LIBS) $(GST_PLUGIN_LIBS) $(X_LIBS)
|
||||||
libgstxwindowlistener_la_CFLAGS = $(GST_CFLAGS) $(X_CFLAGS)
|
libgstxwindowlistener_la_CFLAGS = $(GST_CFLAGS) $(X_CFLAGS)
|
||||||
libgstxwindowlistener_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
|
libgstxwindowlistener_la_LDFLAGS = $(GST_LDFLAGS)
|
||||||
|
|
|
@ -4,7 +4,8 @@ plugin_LTLIBRARIES = libgstximagesink.la
|
||||||
libgstximagesink_la_SOURCES = ximagesink.c
|
libgstximagesink_la_SOURCES = ximagesink.c
|
||||||
libgstximagesink_la_CFLAGS = $(GST_CFLAGS) $(X_CFLAGS)
|
libgstximagesink_la_CFLAGS = $(GST_CFLAGS) $(X_CFLAGS)
|
||||||
libgstximagesink_la_LIBADD = $(X_LIBS) $(XSHM_LIBS) \
|
libgstximagesink_la_LIBADD = $(X_LIBS) $(XSHM_LIBS) \
|
||||||
$(top_builddir)/gst-libs/gst/libgstinterfaces-$(GST_MAJORMINOR).la
|
$(top_builddir)/gst-libs/gst/libgstinterfaces-$(GST_MAJORMINOR).la \
|
||||||
|
$(top_builddir)/gst-libs/gst/video/libgstvideo-$(GST_MAJORMINOR).la
|
||||||
libgstximagesink_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
|
libgstximagesink_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
|
||||||
|
|
||||||
noinst_HEADERS = ximagesink.h
|
noinst_HEADERS = ximagesink.h
|
||||||
|
|
|
@ -48,7 +48,9 @@ MotifWmHints, MwmHints;
|
||||||
static void gst_ximagesink_buffer_free (GstBuffer * buffer);
|
static void gst_ximagesink_buffer_free (GstBuffer * buffer);
|
||||||
static void gst_ximagesink_ximage_destroy (GstXImageSink * ximagesink,
|
static void gst_ximagesink_ximage_destroy (GstXImageSink * ximagesink,
|
||||||
GstXImage * ximage);
|
GstXImage * ximage);
|
||||||
|
#if 0
|
||||||
static void gst_ximagesink_send_pending_navigation (GstXImageSink * ximagesink);
|
static void gst_ximagesink_send_pending_navigation (GstXImageSink * ximagesink);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* ElementFactory information */
|
/* ElementFactory information */
|
||||||
static GstElementDetails gst_ximagesink_details =
|
static GstElementDetails gst_ximagesink_details =
|
||||||
|
@ -70,10 +72,10 @@ GST_STATIC_PAD_TEMPLATE ("sink",
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
ARG_0,
|
PROP_0,
|
||||||
ARG_DISPLAY,
|
PROP_DISPLAY,
|
||||||
ARG_SYNCHRONOUS,
|
PROP_SYNCHRONOUS,
|
||||||
ARG_PIXEL_ASPECT_RATIO
|
PROP_PIXEL_ASPECT_RATIO
|
||||||
/* FILL ME */
|
/* FILL ME */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -526,6 +528,8 @@ gst_ximagesink_renegotiate_size (GstXImageSink * ximagesink)
|
||||||
if (ximagesink->xwindow->width <= 1 || ximagesink->xwindow->height <= 1)
|
if (ximagesink->xwindow->width <= 1 || ximagesink->xwindow->height <= 1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
/* FIXME */
|
||||||
|
#if 0
|
||||||
if (GST_PAD_IS_NEGOTIATING (GST_VIDEOSINK_PAD (ximagesink)) ||
|
if (GST_PAD_IS_NEGOTIATING (GST_VIDEOSINK_PAD (ximagesink)) ||
|
||||||
!gst_pad_is_negotiated (GST_VIDEOSINK_PAD (ximagesink)))
|
!gst_pad_is_negotiated (GST_VIDEOSINK_PAD (ximagesink)))
|
||||||
return;
|
return;
|
||||||
|
@ -579,6 +583,7 @@ gst_ximagesink_renegotiate_size (GstXImageSink * ximagesink)
|
||||||
ximagesink->sw_scaling_failed = TRUE;
|
ximagesink->sw_scaling_failed = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This function handles XEvents that might be in the queue. It generates
|
/* This function handles XEvents that might be in the queue. It generates
|
||||||
|
@ -586,7 +591,7 @@ gst_ximagesink_renegotiate_size (GstXImageSink * ximagesink)
|
||||||
and navigation. It will also listen for configure events on the window to
|
and navigation. It will also listen for configure events on the window to
|
||||||
trigger caps renegotiation so on the fly software scaling can work. */
|
trigger caps renegotiation so on the fly software scaling can work. */
|
||||||
static void
|
static void
|
||||||
gst_ximagesink_handle_xevents (GstXImageSink * ximagesink, GstPad * pad)
|
gst_ximagesink_handle_xevents (GstXImageSink * ximagesink)
|
||||||
{
|
{
|
||||||
XEvent e;
|
XEvent e;
|
||||||
guint pointer_x = 0, pointer_y = 0;
|
guint pointer_x = 0, pointer_y = 0;
|
||||||
|
@ -861,7 +866,7 @@ gst_ximagesink_xcontext_clear (GstXImageSink * ximagesink)
|
||||||
g_return_if_fail (GST_IS_XIMAGESINK (ximagesink));
|
g_return_if_fail (GST_IS_XIMAGESINK (ximagesink));
|
||||||
g_return_if_fail (ximagesink->xcontext != NULL);
|
g_return_if_fail (ximagesink->xcontext != NULL);
|
||||||
|
|
||||||
gst_caps_free (ximagesink->xcontext->caps);
|
gst_caps_unref (ximagesink->xcontext->caps);
|
||||||
g_free (ximagesink->xcontext->par);
|
g_free (ximagesink->xcontext->par);
|
||||||
g_free (ximagesink->par);
|
g_free (ximagesink->par);
|
||||||
ximagesink->par = NULL;
|
ximagesink->par = NULL;
|
||||||
|
@ -894,6 +899,7 @@ gst_ximagesink_imagepool_clear (GstXImageSink * ximagesink)
|
||||||
|
|
||||||
/* Element stuff */
|
/* Element stuff */
|
||||||
|
|
||||||
|
#if 0
|
||||||
static GstCaps *
|
static GstCaps *
|
||||||
gst_ximagesink_fixate (GstPad * pad, const GstCaps * caps)
|
gst_ximagesink_fixate (GstPad * pad, const GstCaps * caps)
|
||||||
{
|
{
|
||||||
|
@ -919,24 +925,27 @@ gst_ximagesink_fixate (GstPad * pad, const GstCaps * caps)
|
||||||
return newcaps;
|
return newcaps;
|
||||||
}
|
}
|
||||||
|
|
||||||
gst_caps_free (newcaps);
|
gst_caps_unref (newcaps);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static GstCaps *
|
static GstCaps *
|
||||||
gst_ximagesink_getcaps (GstPad * pad)
|
gst_ximagesink_getcaps (GstBaseSink * bsink)
|
||||||
{
|
{
|
||||||
GstXImageSink *ximagesink;
|
GstXImageSink *ximagesink;
|
||||||
GstCaps *caps;
|
GstCaps *caps;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
ximagesink = GST_XIMAGESINK (gst_pad_get_parent (pad));
|
ximagesink = GST_XIMAGESINK (bsink);
|
||||||
|
|
||||||
if (ximagesink->xcontext)
|
if (ximagesink->xcontext)
|
||||||
return gst_caps_copy (ximagesink->xcontext->caps);
|
return gst_caps_ref (ximagesink->xcontext->caps);
|
||||||
|
|
||||||
/* get a template copy and add the pixel aspect ratio */
|
/* get a template copy and add the pixel aspect ratio */
|
||||||
caps = gst_caps_copy (gst_pad_get_pad_template_caps (pad));
|
caps =
|
||||||
|
gst_caps_copy (gst_pad_get_pad_template_caps (GST_BASESINK (ximagesink)->
|
||||||
|
sinkpad));
|
||||||
for (i = 0; i < gst_caps_get_size (caps); ++i) {
|
for (i = 0; i < gst_caps_get_size (caps); ++i) {
|
||||||
GstStructure *structure = gst_caps_get_structure (caps, i);
|
GstStructure *structure = gst_caps_get_structure (caps, i);
|
||||||
|
|
||||||
|
@ -952,18 +961,18 @@ gst_ximagesink_getcaps (GstPad * pad)
|
||||||
return caps;
|
return caps;
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstPadLinkReturn
|
static gboolean
|
||||||
gst_ximagesink_sink_link (GstPad * pad, const GstCaps * caps)
|
gst_ximagesink_setcaps (GstBaseSink * bsink, GstCaps * caps)
|
||||||
{
|
{
|
||||||
GstXImageSink *ximagesink;
|
GstXImageSink *ximagesink;
|
||||||
gboolean ret;
|
gboolean ret;
|
||||||
GstStructure *structure;
|
GstStructure *structure;
|
||||||
const GValue *par;
|
const GValue *par;
|
||||||
|
|
||||||
ximagesink = GST_XIMAGESINK (gst_pad_get_parent (pad));
|
ximagesink = GST_XIMAGESINK (bsink);
|
||||||
|
|
||||||
if (!ximagesink->xcontext)
|
if (!ximagesink->xcontext)
|
||||||
return GST_PAD_LINK_DELAYED;
|
return FALSE;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (ximagesink,
|
GST_DEBUG_OBJECT (ximagesink,
|
||||||
"sinkconnect possible caps %" GST_PTR_FORMAT " with given caps %"
|
"sinkconnect possible caps %" GST_PTR_FORMAT " with given caps %"
|
||||||
|
@ -977,7 +986,7 @@ gst_ximagesink_sink_link (GstPad * pad, const GstCaps * caps)
|
||||||
ret &= gst_structure_get_double (structure,
|
ret &= gst_structure_get_double (structure,
|
||||||
"framerate", &ximagesink->framerate);
|
"framerate", &ximagesink->framerate);
|
||||||
if (!ret)
|
if (!ret)
|
||||||
return GST_PAD_LINK_REFUSED;
|
return FALSE;
|
||||||
|
|
||||||
g_mutex_lock (ximagesink->stream_lock);
|
g_mutex_lock (ximagesink->stream_lock);
|
||||||
|
|
||||||
|
@ -987,7 +996,7 @@ gst_ximagesink_sink_link (GstPad * pad, const GstCaps * caps)
|
||||||
if (par) {
|
if (par) {
|
||||||
if (gst_value_compare (par, ximagesink->par) != GST_VALUE_EQUAL) {
|
if (gst_value_compare (par, ximagesink->par) != GST_VALUE_EQUAL) {
|
||||||
GST_INFO_OBJECT (ximagesink, "pixel aspect ratio does not match");
|
GST_INFO_OBJECT (ximagesink, "pixel aspect ratio does not match");
|
||||||
return GST_PAD_LINK_REFUSED;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1018,7 +1027,7 @@ gst_ximagesink_sink_link (GstPad * pad, const GstCaps * caps)
|
||||||
gst_x_overlay_got_desired_size (GST_X_OVERLAY (ximagesink),
|
gst_x_overlay_got_desired_size (GST_X_OVERLAY (ximagesink),
|
||||||
GST_VIDEOSINK_WIDTH (ximagesink), GST_VIDEOSINK_HEIGHT (ximagesink));
|
GST_VIDEOSINK_WIDTH (ximagesink), GST_VIDEOSINK_HEIGHT (ximagesink));
|
||||||
|
|
||||||
return GST_PAD_LINK_OK;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstElementStateReturn
|
static GstElementStateReturn
|
||||||
|
@ -1092,34 +1101,58 @@ gst_ximagesink_change_state (GstElement * element)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_ximagesink_chain (GstPad * pad, GstData * data)
|
gst_ximagesink_get_times (GstBaseSink * bsink, GstBuffer * buf,
|
||||||
|
GstClockTime * start, GstClockTime * end)
|
||||||
{
|
{
|
||||||
GstBuffer *buf = GST_BUFFER (data);
|
|
||||||
GstXImageSink *ximagesink;
|
GstXImageSink *ximagesink;
|
||||||
|
|
||||||
g_return_if_fail (GST_IS_PAD (pad));
|
ximagesink = GST_XIMAGESINK (bsink);
|
||||||
g_return_if_fail (buf != NULL);
|
|
||||||
|
|
||||||
ximagesink = GST_XIMAGESINK (gst_pad_get_parent (pad));
|
if (GST_BUFFER_TIMESTAMP_IS_VALID (buf)) {
|
||||||
|
*start = GST_BUFFER_TIMESTAMP (buf);
|
||||||
|
if (GST_BUFFER_DURATION_IS_VALID (buf)) {
|
||||||
|
*end = *start + GST_BUFFER_DURATION (buf);
|
||||||
|
} else {
|
||||||
|
if (ximagesink->framerate > 0) {
|
||||||
|
*end = *start + GST_SECOND / ximagesink->framerate;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static GstFlowReturn
|
||||||
|
gst_ximagesink_show_frame (GstBaseSink * bsink, GstBuffer * buf)
|
||||||
|
{
|
||||||
|
GstXImageSink *ximagesink;
|
||||||
|
|
||||||
|
g_return_val_if_fail (buf != NULL, GST_FLOW_ERROR);
|
||||||
|
|
||||||
|
ximagesink = GST_XIMAGESINK (bsink);
|
||||||
|
|
||||||
|
#if 0
|
||||||
if (GST_IS_EVENT (data)) {
|
if (GST_IS_EVENT (data)) {
|
||||||
gst_pad_event_default (pad, GST_EVENT (data));
|
gst_pad_event_default (pad, GST_EVENT (data));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
g_mutex_lock (ximagesink->stream_lock);
|
g_mutex_lock (ximagesink->stream_lock);
|
||||||
|
|
||||||
buf = GST_BUFFER (data);
|
#if 0
|
||||||
/* update time */
|
/* update time */
|
||||||
if (GST_BUFFER_TIMESTAMP_IS_VALID (buf)) {
|
if (GST_BUFFER_TIMESTAMP_IS_VALID (buf)) {
|
||||||
ximagesink->time = GST_BUFFER_TIMESTAMP (buf);
|
ximagesink->time = GST_BUFFER_TIMESTAMP (buf);
|
||||||
}
|
}
|
||||||
GST_LOG_OBJECT (ximagesink, "clock wait: %" GST_TIME_FORMAT,
|
GST_LOG_OBJECT (ximagesink, "clock wait: %" GST_TIME_FORMAT,
|
||||||
GST_TIME_ARGS (ximagesink->time));
|
GST_TIME_ARGS (ximagesink->time));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* FIXME */
|
||||||
|
#if 0
|
||||||
if (GST_VIDEOSINK_CLOCK (ximagesink)) {
|
if (GST_VIDEOSINK_CLOCK (ximagesink)) {
|
||||||
gst_element_wait (GST_ELEMENT (ximagesink), ximagesink->time);
|
gst_element_wait (GST_ELEMENT (ximagesink), ximagesink->time);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* If this buffer has been allocated using our buffer management we simply
|
/* If this buffer has been allocated using our buffer management we simply
|
||||||
put the ximage which is in the PRIVATE pointer */
|
put the ximage which is in the PRIVATE pointer */
|
||||||
|
@ -1139,7 +1172,7 @@ gst_ximagesink_chain (GstPad * pad, GstData * data)
|
||||||
gst_buffer_unref (buf);
|
gst_buffer_unref (buf);
|
||||||
GST_ELEMENT_ERROR (ximagesink, CORE, NEGOTIATION, (NULL),
|
GST_ELEMENT_ERROR (ximagesink, CORE, NEGOTIATION, (NULL),
|
||||||
("Failed creating an XImage in ximagesink chain function."));
|
("Failed creating an XImage in ximagesink chain function."));
|
||||||
return;
|
return GST_FLOW_ERROR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1149,17 +1182,21 @@ gst_ximagesink_chain (GstPad * pad, GstData * data)
|
||||||
gst_ximagesink_ximage_put (ximagesink, ximagesink->ximage);
|
gst_ximagesink_ximage_put (ximagesink, ximagesink->ximage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
/* set correct time for next buffer */
|
/* set correct time for next buffer */
|
||||||
if (!GST_BUFFER_TIMESTAMP_IS_VALID (buf) && ximagesink->framerate > 0) {
|
if (!GST_BUFFER_TIMESTAMP_IS_VALID (buf) && ximagesink->framerate > 0) {
|
||||||
ximagesink->time += GST_SECOND / ximagesink->framerate;
|
ximagesink->time += GST_SECOND / ximagesink->framerate;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
gst_buffer_unref (buf);
|
gst_ximagesink_handle_xevents (ximagesink);
|
||||||
|
#if 0
|
||||||
gst_ximagesink_handle_xevents (ximagesink, pad);
|
|
||||||
gst_ximagesink_send_pending_navigation (ximagesink);
|
gst_ximagesink_send_pending_navigation (ximagesink);
|
||||||
|
#endif
|
||||||
|
|
||||||
g_mutex_unlock (ximagesink->stream_lock);
|
g_mutex_unlock (ximagesink->stream_lock);
|
||||||
|
|
||||||
|
return GST_FLOW_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Buffer management */
|
/* Buffer management */
|
||||||
|
@ -1188,14 +1225,23 @@ gst_ximagesink_buffer_free (GstBuffer * buffer)
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstBuffer *
|
static GstBuffer *
|
||||||
gst_ximagesink_buffer_alloc (GstPad * pad, guint64 offset, guint size)
|
gst_ximagesink_buffer_alloc (GstBaseSink * bsink, guint64 offset, guint size,
|
||||||
|
GstCaps * caps)
|
||||||
{
|
{
|
||||||
GstXImageSink *ximagesink;
|
GstXImageSink *ximagesink;
|
||||||
GstBuffer *buffer;
|
GstBuffer *buffer;
|
||||||
GstXImage *ximage = NULL;
|
GstXImage *ximage = NULL;
|
||||||
gboolean not_found = TRUE;
|
gboolean not_found = TRUE;
|
||||||
|
|
||||||
ximagesink = GST_XIMAGESINK (gst_pad_get_parent (pad));
|
ximagesink = GST_XIMAGESINK (bsink);
|
||||||
|
|
||||||
|
/* FIXME, we should just parse the caps, and provide a buffer in this format,
|
||||||
|
* we should not just reconfigure ourselves yet */
|
||||||
|
if (caps && caps != GST_PAD_CAPS (GST_VIDEOSINK_PAD (ximagesink))) {
|
||||||
|
if (!gst_ximagesink_setcaps (bsink, caps)) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
g_mutex_lock (ximagesink->pool_lock);
|
g_mutex_lock (ximagesink->pool_lock);
|
||||||
|
|
||||||
|
@ -1259,6 +1305,7 @@ gst_ximagesink_interface_init (GstImplementsInterfaceClass * klass)
|
||||||
klass->supported = gst_ximagesink_interface_supported;
|
klass->supported = gst_ximagesink_interface_supported;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
/*
|
/*
|
||||||
* This function is called with the stream-lock held
|
* This function is called with the stream-lock held
|
||||||
*/
|
*/
|
||||||
|
@ -1316,6 +1363,7 @@ gst_ximagesink_send_pending_navigation (GstXImageSink * ximagesink)
|
||||||
|
|
||||||
g_slist_free (pend_events);
|
g_slist_free (pend_events);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_ximagesink_navigation_send_event (GstNavigation * navigation,
|
gst_ximagesink_navigation_send_event (GstNavigation * navigation,
|
||||||
|
@ -1408,6 +1456,7 @@ gst_ximagesink_set_xwindow_id (GstXOverlay * overlay, XID xwindow_id)
|
||||||
xwindow->gc = XCreateGC (ximagesink->xcontext->disp, xwindow->win, 0, NULL);
|
xwindow->gc = XCreateGC (ximagesink->xcontext->disp, xwindow->win, 0, NULL);
|
||||||
g_mutex_unlock (ximagesink->x_lock);
|
g_mutex_unlock (ximagesink->x_lock);
|
||||||
|
|
||||||
|
#if 0
|
||||||
/* If that new window geometry differs from our one we try to
|
/* If that new window geometry differs from our one we try to
|
||||||
renegotiate caps */
|
renegotiate caps */
|
||||||
if (gst_pad_is_negotiated (GST_VIDEOSINK_PAD (ximagesink)) &&
|
if (gst_pad_is_negotiated (GST_VIDEOSINK_PAD (ximagesink)) &&
|
||||||
|
@ -1445,6 +1494,7 @@ gst_ximagesink_set_xwindow_id (GstXOverlay * overlay, XID xwindow_id)
|
||||||
GST_VIDEOSINK_HEIGHT (ximagesink) = xwindow->height;
|
GST_VIDEOSINK_HEIGHT (ximagesink) = xwindow->height;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (xwindow)
|
if (xwindow)
|
||||||
|
@ -1515,10 +1565,10 @@ gst_ximagesink_set_property (GObject * object, guint prop_id,
|
||||||
ximagesink = GST_XIMAGESINK (object);
|
ximagesink = GST_XIMAGESINK (object);
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
case ARG_DISPLAY:
|
case PROP_DISPLAY:
|
||||||
ximagesink->display_name = g_strdup (g_value_get_string (value));
|
ximagesink->display_name = g_strdup (g_value_get_string (value));
|
||||||
break;
|
break;
|
||||||
case ARG_SYNCHRONOUS:
|
case PROP_SYNCHRONOUS:
|
||||||
ximagesink->synchronous = g_value_get_boolean (value);
|
ximagesink->synchronous = g_value_get_boolean (value);
|
||||||
if (ximagesink->xcontext) {
|
if (ximagesink->xcontext) {
|
||||||
GST_DEBUG_OBJECT (ximagesink, "XSynchronize called with %s",
|
GST_DEBUG_OBJECT (ximagesink, "XSynchronize called with %s",
|
||||||
|
@ -1528,7 +1578,7 @@ gst_ximagesink_set_property (GObject * object, guint prop_id,
|
||||||
g_mutex_unlock (ximagesink->x_lock);
|
g_mutex_unlock (ximagesink->x_lock);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ARG_PIXEL_ASPECT_RATIO:
|
case PROP_PIXEL_ASPECT_RATIO:
|
||||||
g_free (ximagesink->par);
|
g_free (ximagesink->par);
|
||||||
ximagesink->par = g_new0 (GValue, 1);
|
ximagesink->par = g_new0 (GValue, 1);
|
||||||
g_value_init (ximagesink->par, GST_TYPE_FRACTION);
|
g_value_init (ximagesink->par, GST_TYPE_FRACTION);
|
||||||
|
@ -1557,13 +1607,13 @@ gst_ximagesink_get_property (GObject * object, guint prop_id,
|
||||||
ximagesink = GST_XIMAGESINK (object);
|
ximagesink = GST_XIMAGESINK (object);
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
case ARG_DISPLAY:
|
case PROP_DISPLAY:
|
||||||
g_value_set_string (value, g_strdup (ximagesink->display_name));
|
g_value_set_string (value, g_strdup (ximagesink->display_name));
|
||||||
break;
|
break;
|
||||||
case ARG_SYNCHRONOUS:
|
case PROP_SYNCHRONOUS:
|
||||||
g_value_set_boolean (value, ximagesink->synchronous);
|
g_value_set_boolean (value, ximagesink->synchronous);
|
||||||
break;
|
break;
|
||||||
case ARG_PIXEL_ASPECT_RATIO:
|
case PROP_PIXEL_ASPECT_RATIO:
|
||||||
if (ximagesink->par)
|
if (ximagesink->par)
|
||||||
g_value_transform (ximagesink->par, value);
|
g_value_transform (ximagesink->par, value);
|
||||||
break;
|
break;
|
||||||
|
@ -1621,24 +1671,6 @@ gst_ximagesink_finalize (GObject * object)
|
||||||
static void
|
static void
|
||||||
gst_ximagesink_init (GstXImageSink * ximagesink)
|
gst_ximagesink_init (GstXImageSink * ximagesink)
|
||||||
{
|
{
|
||||||
GST_VIDEOSINK_PAD (ximagesink) =
|
|
||||||
gst_pad_new_from_template (gst_static_pad_template_get
|
|
||||||
(&gst_ximagesink_sink_template_factory), "sink");
|
|
||||||
|
|
||||||
gst_element_add_pad (GST_ELEMENT (ximagesink),
|
|
||||||
GST_VIDEOSINK_PAD (ximagesink));
|
|
||||||
|
|
||||||
gst_pad_set_chain_function (GST_VIDEOSINK_PAD (ximagesink),
|
|
||||||
gst_ximagesink_chain);
|
|
||||||
gst_pad_set_link_function (GST_VIDEOSINK_PAD (ximagesink),
|
|
||||||
gst_ximagesink_sink_link);
|
|
||||||
gst_pad_set_getcaps_function (GST_VIDEOSINK_PAD (ximagesink),
|
|
||||||
gst_ximagesink_getcaps);
|
|
||||||
gst_pad_set_fixate_function (GST_VIDEOSINK_PAD (ximagesink),
|
|
||||||
gst_ximagesink_fixate);
|
|
||||||
gst_pad_set_bufferalloc_function (GST_VIDEOSINK_PAD (ximagesink),
|
|
||||||
gst_ximagesink_buffer_alloc);
|
|
||||||
|
|
||||||
ximagesink->display_name = NULL;
|
ximagesink->display_name = NULL;
|
||||||
ximagesink->xcontext = NULL;
|
ximagesink->xcontext = NULL;
|
||||||
ximagesink->xwindow = NULL;
|
ximagesink->xwindow = NULL;
|
||||||
|
@ -1661,8 +1693,10 @@ gst_ximagesink_init (GstXImageSink * ximagesink)
|
||||||
ximagesink->nav_lock = g_mutex_new ();
|
ximagesink->nav_lock = g_mutex_new ();
|
||||||
ximagesink->pend_nav_events = NULL;
|
ximagesink->pend_nav_events = NULL;
|
||||||
|
|
||||||
|
#if 0
|
||||||
GST_FLAG_SET (ximagesink, GST_ELEMENT_THREAD_SUGGESTED);
|
GST_FLAG_SET (ximagesink, GST_ELEMENT_THREAD_SUGGESTED);
|
||||||
GST_FLAG_SET (ximagesink, GST_ELEMENT_EVENT_AWARE);
|
GST_FLAG_SET (ximagesink, GST_ELEMENT_EVENT_AWARE);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1681,28 +1715,37 @@ gst_ximagesink_class_init (GstXImageSinkClass * klass)
|
||||||
{
|
{
|
||||||
GObjectClass *gobject_class;
|
GObjectClass *gobject_class;
|
||||||
GstElementClass *gstelement_class;
|
GstElementClass *gstelement_class;
|
||||||
|
GstBaseSinkClass *gstbasesink_class;
|
||||||
|
|
||||||
gobject_class = (GObjectClass *) klass;
|
gobject_class = (GObjectClass *) klass;
|
||||||
gstelement_class = (GstElementClass *) klass;
|
gstelement_class = (GstElementClass *) klass;
|
||||||
|
gstbasesink_class = (GstBaseSinkClass *) klass;
|
||||||
|
|
||||||
parent_class = g_type_class_ref (GST_TYPE_VIDEOSINK);
|
parent_class = g_type_class_ref (GST_TYPE_VIDEOSINK);
|
||||||
|
|
||||||
g_object_class_install_property (gobject_class, ARG_DISPLAY,
|
|
||||||
g_param_spec_string ("display", "Display", "X Display name",
|
|
||||||
NULL, G_PARAM_READWRITE));
|
|
||||||
g_object_class_install_property (gobject_class, ARG_SYNCHRONOUS,
|
|
||||||
g_param_spec_boolean ("synchronous", "Synchronous", "When enabled, runs "
|
|
||||||
"the X display in synchronous mode. (used only for debugging)", FALSE,
|
|
||||||
G_PARAM_READWRITE));
|
|
||||||
g_object_class_install_property (gobject_class, ARG_PIXEL_ASPECT_RATIO,
|
|
||||||
g_param_spec_string ("pixel-aspect-ratio", "Pixel Aspect Ratio",
|
|
||||||
"The pixel aspect ratio of the device", "1/1", G_PARAM_READWRITE));
|
|
||||||
|
|
||||||
gobject_class->finalize = gst_ximagesink_finalize;
|
gobject_class->finalize = gst_ximagesink_finalize;
|
||||||
gobject_class->set_property = gst_ximagesink_set_property;
|
gobject_class->set_property = gst_ximagesink_set_property;
|
||||||
gobject_class->get_property = gst_ximagesink_get_property;
|
gobject_class->get_property = gst_ximagesink_get_property;
|
||||||
|
|
||||||
|
g_object_class_install_property (gobject_class, PROP_DISPLAY,
|
||||||
|
g_param_spec_string ("display", "Display", "X Display name",
|
||||||
|
NULL, G_PARAM_READWRITE));
|
||||||
|
g_object_class_install_property (gobject_class, PROP_SYNCHRONOUS,
|
||||||
|
g_param_spec_boolean ("synchronous", "Synchronous", "When enabled, runs "
|
||||||
|
"the X display in synchronous mode. (used only for debugging)", FALSE,
|
||||||
|
G_PARAM_READWRITE));
|
||||||
|
g_object_class_install_property (gobject_class, PROP_PIXEL_ASPECT_RATIO,
|
||||||
|
g_param_spec_string ("pixel-aspect-ratio", "Pixel Aspect Ratio",
|
||||||
|
"The pixel aspect ratio of the device", "1/1", G_PARAM_READWRITE));
|
||||||
|
|
||||||
gstelement_class->change_state = gst_ximagesink_change_state;
|
gstelement_class->change_state = gst_ximagesink_change_state;
|
||||||
|
|
||||||
|
gstbasesink_class->get_caps = gst_ximagesink_getcaps;
|
||||||
|
gstbasesink_class->set_caps = gst_ximagesink_setcaps;
|
||||||
|
gstbasesink_class->buffer_alloc = gst_ximagesink_buffer_alloc;
|
||||||
|
gstbasesink_class->get_times = gst_ximagesink_get_times;
|
||||||
|
gstbasesink_class->preroll = gst_ximagesink_show_frame;
|
||||||
|
gstbasesink_class->render = gst_ximagesink_show_frame;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ============================================================= */
|
/* ============================================================= */
|
||||||
|
|
Loading…
Reference in a new issue