mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-10 17:35:59 +00:00
x/xv_image_sink: rename for consitency
Insert '_' to match the CamelCase. This is needed so that the plugin docs can guess the names from the type name.
This commit is contained in:
parent
fb68b71165
commit
923d72d399
11 changed files with 326 additions and 319 deletions
|
@ -941,17 +941,17 @@ gst_vorbis_tag_get_type
|
||||||
GstXImageSink
|
GstXImageSink
|
||||||
<SUBSECTION Standard>
|
<SUBSECTION Standard>
|
||||||
GstXImageSinkClass
|
GstXImageSinkClass
|
||||||
GST_XIMAGESINK
|
GST_X_IMAGE_SINK
|
||||||
GST_IS_XIMAGESINK
|
GST_IS_X_IMAGE_SINK
|
||||||
GST_XIMAGESINK_CLASS
|
GST_X_IMAGE_SINK_CLASS
|
||||||
GST_IS_XIMAGESINK_CLASS
|
GST_IS_X_IMAGE_SINK_CLASS
|
||||||
GST_TYPE_XIMAGESINK
|
GST_TYPE_X_IMAGE_SINK
|
||||||
GstXImageBuffer
|
GstXImageBuffer
|
||||||
GstXImageBufferClass
|
GstXImageBufferClass
|
||||||
GstXContext
|
GstXContext
|
||||||
GstXWindow
|
GstXWindow
|
||||||
<SUBSECTION Private>
|
<SUBSECTION Private>
|
||||||
gst_ximage_sink_get_type
|
gst_x_image_sink_get_type
|
||||||
</SECTION>
|
</SECTION>
|
||||||
|
|
||||||
<SECTION>
|
<SECTION>
|
||||||
|
@ -960,14 +960,14 @@ gst_ximage_sink_get_type
|
||||||
GstXvImageSink
|
GstXvImageSink
|
||||||
<SUBSECTION Standard>
|
<SUBSECTION Standard>
|
||||||
GstXvImageSinkClass
|
GstXvImageSinkClass
|
||||||
GST_XVIMAGESINK
|
GST_XV_IMAGE_SINK
|
||||||
GST_IS_XVIMAGESINK
|
GST_IS_XV_IMAGE_SINK
|
||||||
GST_XVIMAGESINK_CLASS
|
GST_XV_IMAGE_SINK_CLASS
|
||||||
GST_IS_XVIMAGESINK_CLASS
|
GST_IS_XV_IMAGE_SINK_CLASS
|
||||||
GST_TYPE_XVIMAGESINK
|
GST_TYPE_XV_IMAGE_SINK
|
||||||
GstXvImageBuffer
|
GstXvImageBuffer
|
||||||
GstXvImageBufferClass
|
GstXvImageBufferClass
|
||||||
GstXvImageFormat
|
GstXvImageFormat
|
||||||
<SUBSECTION Private>
|
<SUBSECTION Private>
|
||||||
gst_xvimage_sink_get_type
|
gst_xv_image_sink_get_type
|
||||||
</SECTION>
|
</SECTION>
|
||||||
|
|
|
@ -23,20 +23,20 @@
|
||||||
|
|
||||||
#include "ximagesink.h"
|
#include "ximagesink.h"
|
||||||
|
|
||||||
GST_DEBUG_CATEGORY (gst_debug_ximagepool);
|
GST_DEBUG_CATEGORY (gst_debug_x_image_pool);
|
||||||
GST_DEBUG_CATEGORY (gst_debug_ximagesink);
|
GST_DEBUG_CATEGORY (gst_debug_x_image_sink);
|
||||||
GST_DEBUG_CATEGORY_STATIC (GST_CAT_PERFORMANCE);
|
GST_DEBUG_CATEGORY_STATIC (GST_CAT_PERFORMANCE);
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
plugin_init (GstPlugin * plugin)
|
plugin_init (GstPlugin * plugin)
|
||||||
{
|
{
|
||||||
if (!gst_element_register (plugin, "ximagesink",
|
if (!gst_element_register (plugin, "ximagesink",
|
||||||
GST_RANK_SECONDARY, GST_TYPE_XIMAGESINK))
|
GST_RANK_SECONDARY, GST_TYPE_X_IMAGE_SINK))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
GST_DEBUG_CATEGORY_INIT (gst_debug_ximagesink, "ximagesink", 0,
|
GST_DEBUG_CATEGORY_INIT (gst_debug_x_image_sink, "ximagesink", 0,
|
||||||
"ximagesink element");
|
"ximagesink element");
|
||||||
GST_DEBUG_CATEGORY_INIT (gst_debug_ximagepool, "ximagepool", 0,
|
GST_DEBUG_CATEGORY_INIT (gst_debug_x_image_pool, "ximagepool", 0,
|
||||||
"ximagepool object");
|
"ximagepool object");
|
||||||
|
|
||||||
GST_DEBUG_CATEGORY_GET (GST_CAT_PERFORMANCE, "GST_PERFORMANCE");
|
GST_DEBUG_CATEGORY_GET (GST_CAT_PERFORMANCE, "GST_PERFORMANCE");
|
||||||
|
|
|
@ -32,8 +32,8 @@
|
||||||
#include <gst/video/gstvideometa.h>
|
#include <gst/video/gstvideometa.h>
|
||||||
#include <gst/video/gstvideopool.h>
|
#include <gst/video/gstvideopool.h>
|
||||||
|
|
||||||
GST_DEBUG_CATEGORY_EXTERN (gst_debug_ximagepool);
|
GST_DEBUG_CATEGORY_EXTERN (gst_debug_x_image_pool);
|
||||||
#define GST_CAT_DEFAULT gst_debug_ximagepool
|
#define GST_CAT_DEFAULT gst_debug_x_image_pool
|
||||||
|
|
||||||
/* X11 stuff */
|
/* X11 stuff */
|
||||||
static gboolean error_caught = FALSE;
|
static gboolean error_caught = FALSE;
|
||||||
|
@ -419,7 +419,7 @@ xattach_failed:
|
||||||
/* This function checks that it is actually really possible to create an image
|
/* This function checks that it is actually really possible to create an image
|
||||||
using XShm */
|
using XShm */
|
||||||
gboolean
|
gboolean
|
||||||
gst_ximagesink_check_xshm_calls (GstXImageSink * ximagesink,
|
gst_x_image_sink_check_xshm_calls (GstXImageSink * ximagesink,
|
||||||
GstXContext * xcontext)
|
GstXContext * xcontext)
|
||||||
{
|
{
|
||||||
XImage *ximage;
|
XImage *ximage;
|
||||||
|
@ -672,7 +672,7 @@ gst_ximage_buffer_pool_new (GstXImageSink * ximagesink)
|
||||||
{
|
{
|
||||||
GstXImageBufferPool *pool;
|
GstXImageBufferPool *pool;
|
||||||
|
|
||||||
g_return_val_if_fail (GST_IS_XIMAGESINK (ximagesink), NULL);
|
g_return_val_if_fail (GST_IS_X_IMAGE_SINK (ximagesink), NULL);
|
||||||
|
|
||||||
pool = g_object_new (GST_TYPE_XIMAGE_BUFFER_POOL, NULL);
|
pool = g_object_new (GST_TYPE_XIMAGE_BUFFER_POOL, NULL);
|
||||||
pool->sink = gst_object_ref (ximagesink);
|
pool->sink = gst_object_ref (ximagesink);
|
||||||
|
|
|
@ -105,7 +105,7 @@ GType gst_ximage_buffer_pool_get_type (void);
|
||||||
|
|
||||||
GstBufferPool * gst_ximage_buffer_pool_new (GstXImageSink * ximagesink);
|
GstBufferPool * gst_ximage_buffer_pool_new (GstXImageSink * ximagesink);
|
||||||
|
|
||||||
gboolean gst_ximagesink_check_xshm_calls (GstXImageSink * ximagesink,
|
gboolean gst_x_image_sink_check_xshm_calls (GstXImageSink * ximagesink,
|
||||||
GstXContext * xcontext);
|
GstXContext * xcontext);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
|
@ -118,9 +118,9 @@
|
||||||
/* for XkbKeycodeToKeysym */
|
/* for XkbKeycodeToKeysym */
|
||||||
#include <X11/XKBlib.h>
|
#include <X11/XKBlib.h>
|
||||||
|
|
||||||
GST_DEBUG_CATEGORY_EXTERN (gst_debug_ximagesink);
|
GST_DEBUG_CATEGORY_EXTERN (gst_debug_x_image_sink);
|
||||||
GST_DEBUG_CATEGORY_EXTERN (GST_CAT_PERFORMANCE);
|
GST_DEBUG_CATEGORY_EXTERN (GST_CAT_PERFORMANCE);
|
||||||
#define GST_CAT_DEFAULT gst_debug_ximagesink
|
#define GST_CAT_DEFAULT gst_debug_x_image_sink
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
@ -134,11 +134,12 @@ MotifWmHints, MwmHints;
|
||||||
|
|
||||||
#define MWM_HINTS_DECORATIONS (1L << 1)
|
#define MWM_HINTS_DECORATIONS (1L << 1)
|
||||||
|
|
||||||
static void gst_ximagesink_reset (GstXImageSink * ximagesink);
|
static void gst_x_image_sink_reset (GstXImageSink * ximagesink);
|
||||||
static void gst_ximagesink_xwindow_update_geometry (GstXImageSink * ximagesink);
|
static void gst_x_image_sink_xwindow_update_geometry (GstXImageSink *
|
||||||
static void gst_ximagesink_expose (GstVideoOverlay * overlay);
|
ximagesink);
|
||||||
|
static void gst_x_image_sink_expose (GstVideoOverlay * overlay);
|
||||||
|
|
||||||
static GstStaticPadTemplate gst_ximagesink_sink_template_factory =
|
static GstStaticPadTemplate gst_x_image_sink_sink_template_factory =
|
||||||
GST_STATIC_PAD_TEMPLATE ("sink",
|
GST_STATIC_PAD_TEMPLATE ("sink",
|
||||||
GST_PAD_SINK,
|
GST_PAD_SINK,
|
||||||
GST_PAD_ALWAYS,
|
GST_PAD_ALWAYS,
|
||||||
|
@ -171,14 +172,15 @@ enum
|
||||||
/* Object typing & Creation */
|
/* Object typing & Creation */
|
||||||
/* */
|
/* */
|
||||||
/* =========================================== */
|
/* =========================================== */
|
||||||
static void gst_ximagesink_navigation_init (GstNavigationInterface * iface);
|
static void gst_x_image_sink_navigation_init (GstNavigationInterface * iface);
|
||||||
static void gst_ximagesink_video_overlay_init (GstVideoOverlayInterface *
|
static void gst_x_image_sink_video_overlay_init (GstVideoOverlayInterface *
|
||||||
iface);
|
iface);
|
||||||
#define gst_ximagesink_parent_class parent_class
|
#define gst_x_image_sink_parent_class parent_class
|
||||||
G_DEFINE_TYPE_WITH_CODE (GstXImageSink, gst_ximagesink, GST_TYPE_VIDEO_SINK,
|
G_DEFINE_TYPE_WITH_CODE (GstXImageSink, gst_x_image_sink, GST_TYPE_VIDEO_SINK,
|
||||||
G_IMPLEMENT_INTERFACE (GST_TYPE_NAVIGATION, gst_ximagesink_navigation_init);
|
G_IMPLEMENT_INTERFACE (GST_TYPE_NAVIGATION,
|
||||||
|
gst_x_image_sink_navigation_init);
|
||||||
G_IMPLEMENT_INTERFACE (GST_TYPE_VIDEO_OVERLAY,
|
G_IMPLEMENT_INTERFACE (GST_TYPE_VIDEO_OVERLAY,
|
||||||
gst_ximagesink_video_overlay_init));
|
gst_x_image_sink_video_overlay_init));
|
||||||
|
|
||||||
/* ============================================================= */
|
/* ============================================================= */
|
||||||
/* */
|
/* */
|
||||||
|
@ -190,10 +192,10 @@ G_DEFINE_TYPE_WITH_CODE (GstXImageSink, gst_ximagesink, GST_TYPE_VIDEO_SINK,
|
||||||
|
|
||||||
/* We are called with the x_lock taken */
|
/* We are called with the x_lock taken */
|
||||||
static void
|
static void
|
||||||
gst_ximagesink_xwindow_draw_borders (GstXImageSink * ximagesink,
|
gst_x_image_sink_xwindow_draw_borders (GstXImageSink * ximagesink,
|
||||||
GstXWindow * xwindow, GstVideoRectangle rect)
|
GstXWindow * xwindow, GstVideoRectangle rect)
|
||||||
{
|
{
|
||||||
g_return_if_fail (GST_IS_XIMAGESINK (ximagesink));
|
g_return_if_fail (GST_IS_X_IMAGE_SINK (ximagesink));
|
||||||
g_return_if_fail (xwindow != NULL);
|
g_return_if_fail (xwindow != NULL);
|
||||||
|
|
||||||
XSetForeground (ximagesink->xcontext->disp, xwindow->gc,
|
XSetForeground (ximagesink->xcontext->disp, xwindow->gc,
|
||||||
|
@ -226,7 +228,7 @@ gst_ximagesink_xwindow_draw_borders (GstXImageSink * ximagesink,
|
||||||
|
|
||||||
/* This function puts a GstXImageBuffer on a GstXImageSink's window */
|
/* This function puts a GstXImageBuffer on a GstXImageSink's window */
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_ximagesink_ximage_put (GstXImageSink * ximagesink, GstBuffer * ximage)
|
gst_x_image_sink_ximage_put (GstXImageSink * ximagesink, GstBuffer * ximage)
|
||||||
{
|
{
|
||||||
GstXImageMemory *mem;
|
GstXImageMemory *mem;
|
||||||
GstVideoCropMeta *crop;
|
GstVideoCropMeta *crop;
|
||||||
|
@ -295,7 +297,7 @@ gst_ximagesink_ximage_put (GstXImageSink * ximagesink, GstBuffer * ximage)
|
||||||
g_mutex_lock (&ximagesink->x_lock);
|
g_mutex_lock (&ximagesink->x_lock);
|
||||||
|
|
||||||
if (draw_border) {
|
if (draw_border) {
|
||||||
gst_ximagesink_xwindow_draw_borders (ximagesink, ximagesink->xwindow,
|
gst_x_image_sink_xwindow_draw_borders (ximagesink, ximagesink->xwindow,
|
||||||
result);
|
result);
|
||||||
ximagesink->draw_border = FALSE;
|
ximagesink->draw_border = FALSE;
|
||||||
}
|
}
|
||||||
|
@ -330,13 +332,13 @@ gst_ximagesink_ximage_put (GstXImageSink * ximagesink, GstBuffer * ximage)
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_ximagesink_xwindow_decorate (GstXImageSink * ximagesink,
|
gst_x_image_sink_xwindow_decorate (GstXImageSink * ximagesink,
|
||||||
GstXWindow * window)
|
GstXWindow * window)
|
||||||
{
|
{
|
||||||
Atom hints_atom = None;
|
Atom hints_atom = None;
|
||||||
MotifWmHints *hints;
|
MotifWmHints *hints;
|
||||||
|
|
||||||
g_return_val_if_fail (GST_IS_XIMAGESINK (ximagesink), FALSE);
|
g_return_val_if_fail (GST_IS_X_IMAGE_SINK (ximagesink), FALSE);
|
||||||
g_return_val_if_fail (window != NULL, FALSE);
|
g_return_val_if_fail (window != NULL, FALSE);
|
||||||
|
|
||||||
g_mutex_lock (&ximagesink->x_lock);
|
g_mutex_lock (&ximagesink->x_lock);
|
||||||
|
@ -367,7 +369,7 @@ gst_ximagesink_xwindow_decorate (GstXImageSink * ximagesink,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_ximagesink_xwindow_set_title (GstXImageSink * ximagesink,
|
gst_x_image_sink_xwindow_set_title (GstXImageSink * ximagesink,
|
||||||
GstXWindow * xwindow, const gchar * media_title)
|
GstXWindow * xwindow, const gchar * media_title)
|
||||||
{
|
{
|
||||||
if (media_title) {
|
if (media_title) {
|
||||||
|
@ -417,12 +419,13 @@ gst_ximagesink_xwindow_set_title (GstXImageSink * ximagesink,
|
||||||
|
|
||||||
/* This function handles a GstXWindow creation */
|
/* This function handles a GstXWindow creation */
|
||||||
static GstXWindow *
|
static GstXWindow *
|
||||||
gst_ximagesink_xwindow_new (GstXImageSink * ximagesink, gint width, gint height)
|
gst_x_image_sink_xwindow_new (GstXImageSink * ximagesink, gint width,
|
||||||
|
gint height)
|
||||||
{
|
{
|
||||||
GstXWindow *xwindow = NULL;
|
GstXWindow *xwindow = NULL;
|
||||||
XGCValues values;
|
XGCValues values;
|
||||||
|
|
||||||
g_return_val_if_fail (GST_IS_XIMAGESINK (ximagesink), NULL);
|
g_return_val_if_fail (GST_IS_X_IMAGE_SINK (ximagesink), NULL);
|
||||||
|
|
||||||
xwindow = g_new0 (GstXWindow, 1);
|
xwindow = g_new0 (GstXWindow, 1);
|
||||||
|
|
||||||
|
@ -441,7 +444,7 @@ gst_ximagesink_xwindow_new (GstXImageSink * ximagesink, gint width, gint height)
|
||||||
XSetWindowBackgroundPixmap (ximagesink->xcontext->disp, xwindow->win, None);
|
XSetWindowBackgroundPixmap (ximagesink->xcontext->disp, xwindow->win, None);
|
||||||
|
|
||||||
/* set application name as a title */
|
/* set application name as a title */
|
||||||
gst_ximagesink_xwindow_set_title (ximagesink, xwindow, NULL);
|
gst_x_image_sink_xwindow_set_title (ximagesink, xwindow, NULL);
|
||||||
|
|
||||||
if (ximagesink->handle_events) {
|
if (ximagesink->handle_events) {
|
||||||
Atom wm_delete;
|
Atom wm_delete;
|
||||||
|
@ -467,7 +470,7 @@ gst_ximagesink_xwindow_new (GstXImageSink * ximagesink, gint width, gint height)
|
||||||
|
|
||||||
g_mutex_unlock (&ximagesink->x_lock);
|
g_mutex_unlock (&ximagesink->x_lock);
|
||||||
|
|
||||||
gst_ximagesink_xwindow_decorate (ximagesink, xwindow);
|
gst_x_image_sink_xwindow_decorate (ximagesink, xwindow);
|
||||||
|
|
||||||
gst_video_overlay_got_window_handle (GST_VIDEO_OVERLAY (ximagesink),
|
gst_video_overlay_got_window_handle (GST_VIDEO_OVERLAY (ximagesink),
|
||||||
xwindow->win);
|
xwindow->win);
|
||||||
|
@ -477,11 +480,11 @@ gst_ximagesink_xwindow_new (GstXImageSink * ximagesink, gint width, gint height)
|
||||||
|
|
||||||
/* This function destroys a GstXWindow */
|
/* This function destroys a GstXWindow */
|
||||||
static void
|
static void
|
||||||
gst_ximagesink_xwindow_destroy (GstXImageSink * ximagesink,
|
gst_x_image_sink_xwindow_destroy (GstXImageSink * ximagesink,
|
||||||
GstXWindow * xwindow)
|
GstXWindow * xwindow)
|
||||||
{
|
{
|
||||||
g_return_if_fail (xwindow != NULL);
|
g_return_if_fail (xwindow != NULL);
|
||||||
g_return_if_fail (GST_IS_XIMAGESINK (ximagesink));
|
g_return_if_fail (GST_IS_X_IMAGE_SINK (ximagesink));
|
||||||
|
|
||||||
g_mutex_lock (&ximagesink->x_lock);
|
g_mutex_lock (&ximagesink->x_lock);
|
||||||
|
|
||||||
|
@ -501,12 +504,12 @@ gst_ximagesink_xwindow_destroy (GstXImageSink * ximagesink,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_ximagesink_xwindow_update_geometry (GstXImageSink * ximagesink)
|
gst_x_image_sink_xwindow_update_geometry (GstXImageSink * ximagesink)
|
||||||
{
|
{
|
||||||
XWindowAttributes attr;
|
XWindowAttributes attr;
|
||||||
gboolean reconfigure;
|
gboolean reconfigure;
|
||||||
|
|
||||||
g_return_if_fail (GST_IS_XIMAGESINK (ximagesink));
|
g_return_if_fail (GST_IS_X_IMAGE_SINK (ximagesink));
|
||||||
|
|
||||||
/* Update the window geometry */
|
/* Update the window geometry */
|
||||||
g_mutex_lock (&ximagesink->x_lock);
|
g_mutex_lock (&ximagesink->x_lock);
|
||||||
|
@ -532,10 +535,11 @@ gst_ximagesink_xwindow_update_geometry (GstXImageSink * ximagesink)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_ximagesink_xwindow_clear (GstXImageSink * ximagesink, GstXWindow * xwindow)
|
gst_x_image_sink_xwindow_clear (GstXImageSink * ximagesink,
|
||||||
|
GstXWindow * xwindow)
|
||||||
{
|
{
|
||||||
g_return_if_fail (xwindow != NULL);
|
g_return_if_fail (xwindow != NULL);
|
||||||
g_return_if_fail (GST_IS_XIMAGESINK (ximagesink));
|
g_return_if_fail (GST_IS_X_IMAGE_SINK (ximagesink));
|
||||||
|
|
||||||
g_mutex_lock (&ximagesink->x_lock);
|
g_mutex_lock (&ximagesink->x_lock);
|
||||||
|
|
||||||
|
@ -554,14 +558,14 @@ gst_ximagesink_xwindow_clear (GstXImageSink * ximagesink, GstXWindow * xwindow)
|
||||||
GstEvent that will be sent upstream in the pipeline to handle interactivity
|
GstEvent that will be sent upstream in the pipeline to handle interactivity
|
||||||
and navigation.*/
|
and navigation.*/
|
||||||
static void
|
static void
|
||||||
gst_ximagesink_handle_xevents (GstXImageSink * ximagesink)
|
gst_x_image_sink_handle_xevents (GstXImageSink * ximagesink)
|
||||||
{
|
{
|
||||||
XEvent e;
|
XEvent e;
|
||||||
guint pointer_x = 0, pointer_y = 0;
|
guint pointer_x = 0, pointer_y = 0;
|
||||||
gboolean pointer_moved = FALSE;
|
gboolean pointer_moved = FALSE;
|
||||||
gboolean exposed = FALSE, configured = FALSE;
|
gboolean exposed = FALSE, configured = FALSE;
|
||||||
|
|
||||||
g_return_if_fail (GST_IS_XIMAGESINK (ximagesink));
|
g_return_if_fail (GST_IS_X_IMAGE_SINK (ximagesink));
|
||||||
|
|
||||||
/* Then we get all pointer motion events, only the last position is
|
/* Then we get all pointer motion events, only the last position is
|
||||||
interesting. */
|
interesting. */
|
||||||
|
@ -661,7 +665,7 @@ gst_ximagesink_handle_xevents (GstXImageSink * ximagesink)
|
||||||
break;
|
break;
|
||||||
case ConfigureNotify:
|
case ConfigureNotify:
|
||||||
g_mutex_unlock (&ximagesink->x_lock);
|
g_mutex_unlock (&ximagesink->x_lock);
|
||||||
gst_ximagesink_xwindow_update_geometry (ximagesink);
|
gst_x_image_sink_xwindow_update_geometry (ximagesink);
|
||||||
g_mutex_lock (&ximagesink->x_lock);
|
g_mutex_lock (&ximagesink->x_lock);
|
||||||
configured = TRUE;
|
configured = TRUE;
|
||||||
break;
|
break;
|
||||||
|
@ -674,7 +678,7 @@ gst_ximagesink_handle_xevents (GstXImageSink * ximagesink)
|
||||||
g_mutex_unlock (&ximagesink->x_lock);
|
g_mutex_unlock (&ximagesink->x_lock);
|
||||||
g_mutex_unlock (&ximagesink->flow_lock);
|
g_mutex_unlock (&ximagesink->flow_lock);
|
||||||
|
|
||||||
gst_ximagesink_expose (GST_VIDEO_OVERLAY (ximagesink));
|
gst_x_image_sink_expose (GST_VIDEO_OVERLAY (ximagesink));
|
||||||
|
|
||||||
g_mutex_lock (&ximagesink->flow_lock);
|
g_mutex_lock (&ximagesink->flow_lock);
|
||||||
g_mutex_lock (&ximagesink->x_lock);
|
g_mutex_lock (&ximagesink->x_lock);
|
||||||
|
@ -696,7 +700,7 @@ gst_ximagesink_handle_xevents (GstXImageSink * ximagesink)
|
||||||
("Output window was closed"), (NULL));
|
("Output window was closed"), (NULL));
|
||||||
|
|
||||||
g_mutex_unlock (&ximagesink->x_lock);
|
g_mutex_unlock (&ximagesink->x_lock);
|
||||||
gst_ximagesink_xwindow_destroy (ximagesink, ximagesink->xwindow);
|
gst_x_image_sink_xwindow_destroy (ximagesink, ximagesink->xwindow);
|
||||||
ximagesink->xwindow = NULL;
|
ximagesink->xwindow = NULL;
|
||||||
g_mutex_lock (&ximagesink->x_lock);
|
g_mutex_lock (&ximagesink->x_lock);
|
||||||
}
|
}
|
||||||
|
@ -712,16 +716,16 @@ gst_ximagesink_handle_xevents (GstXImageSink * ximagesink)
|
||||||
}
|
}
|
||||||
|
|
||||||
static gpointer
|
static gpointer
|
||||||
gst_ximagesink_event_thread (GstXImageSink * ximagesink)
|
gst_x_image_sink_event_thread (GstXImageSink * ximagesink)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (GST_IS_XIMAGESINK (ximagesink), NULL);
|
g_return_val_if_fail (GST_IS_X_IMAGE_SINK (ximagesink), NULL);
|
||||||
|
|
||||||
GST_OBJECT_LOCK (ximagesink);
|
GST_OBJECT_LOCK (ximagesink);
|
||||||
while (ximagesink->running) {
|
while (ximagesink->running) {
|
||||||
GST_OBJECT_UNLOCK (ximagesink);
|
GST_OBJECT_UNLOCK (ximagesink);
|
||||||
|
|
||||||
if (ximagesink->xwindow) {
|
if (ximagesink->xwindow) {
|
||||||
gst_ximagesink_handle_xevents (ximagesink);
|
gst_x_image_sink_handle_xevents (ximagesink);
|
||||||
}
|
}
|
||||||
/* FIXME: do we want to align this with the framerate or anything else? */
|
/* FIXME: do we want to align this with the framerate or anything else? */
|
||||||
g_usleep (G_USEC_PER_SEC / 20);
|
g_usleep (G_USEC_PER_SEC / 20);
|
||||||
|
@ -734,7 +738,7 @@ gst_ximagesink_event_thread (GstXImageSink * ximagesink)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_ximagesink_manage_event_thread (GstXImageSink * ximagesink)
|
gst_x_image_sink_manage_event_thread (GstXImageSink * ximagesink)
|
||||||
{
|
{
|
||||||
GThread *thread = NULL;
|
GThread *thread = NULL;
|
||||||
|
|
||||||
|
@ -751,7 +755,7 @@ gst_ximagesink_manage_event_thread (GstXImageSink * ximagesink)
|
||||||
ximagesink->handle_expose, ximagesink->handle_events);
|
ximagesink->handle_expose, ximagesink->handle_events);
|
||||||
ximagesink->running = TRUE;
|
ximagesink->running = TRUE;
|
||||||
ximagesink->event_thread = g_thread_try_new ("ximagesink-events",
|
ximagesink->event_thread = g_thread_try_new ("ximagesink-events",
|
||||||
(GThreadFunc) gst_ximagesink_event_thread, ximagesink, NULL);
|
(GThreadFunc) gst_x_image_sink_event_thread, ximagesink, NULL);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (ximagesink->event_thread) {
|
if (ximagesink->event_thread) {
|
||||||
|
@ -775,7 +779,7 @@ gst_ximagesink_manage_event_thread (GstXImageSink * ximagesink)
|
||||||
/* This function calculates the pixel aspect ratio based on the properties
|
/* This function calculates the pixel aspect ratio based on the properties
|
||||||
* in the xcontext structure and stores it there. */
|
* in the xcontext structure and stores it there. */
|
||||||
static void
|
static void
|
||||||
gst_ximagesink_calculate_pixel_aspect_ratio (GstXContext * xcontext)
|
gst_x_image_sink_calculate_pixel_aspect_ratio (GstXContext * xcontext)
|
||||||
{
|
{
|
||||||
static const gint par[][2] = {
|
static const gint par[][2] = {
|
||||||
{1, 1}, /* regular screen */
|
{1, 1}, /* regular screen */
|
||||||
|
@ -835,7 +839,7 @@ gst_ximagesink_calculate_pixel_aspect_ratio (GstXContext * xcontext)
|
||||||
here that caps for supported format are generated without any window or
|
here that caps for supported format are generated without any window or
|
||||||
image creation */
|
image creation */
|
||||||
static GstXContext *
|
static GstXContext *
|
||||||
gst_ximagesink_xcontext_get (GstXImageSink * ximagesink)
|
gst_x_image_sink_xcontext_get (GstXImageSink * ximagesink)
|
||||||
{
|
{
|
||||||
GstXContext *xcontext = NULL;
|
GstXContext *xcontext = NULL;
|
||||||
XPixmapFormatValues *px_formats = NULL;
|
XPixmapFormatValues *px_formats = NULL;
|
||||||
|
@ -844,7 +848,7 @@ gst_ximagesink_xcontext_get (GstXImageSink * ximagesink)
|
||||||
GstVideoFormat vformat;
|
GstVideoFormat vformat;
|
||||||
guint32 alpha_mask;
|
guint32 alpha_mask;
|
||||||
|
|
||||||
g_return_val_if_fail (GST_IS_XIMAGESINK (ximagesink), NULL);
|
g_return_val_if_fail (GST_IS_X_IMAGE_SINK (ximagesink), NULL);
|
||||||
|
|
||||||
xcontext = g_new0 (GstXContext, 1);
|
xcontext = g_new0 (GstXContext, 1);
|
||||||
|
|
||||||
|
@ -876,7 +880,7 @@ gst_ximagesink_xcontext_get (GstXImageSink * ximagesink)
|
||||||
GST_DEBUG_OBJECT (ximagesink, "X reports %dx%d pixels and %d mm x %d mm",
|
GST_DEBUG_OBJECT (ximagesink, "X reports %dx%d pixels and %d mm x %d mm",
|
||||||
xcontext->width, xcontext->height, xcontext->widthmm, xcontext->heightmm);
|
xcontext->width, xcontext->height, xcontext->widthmm, xcontext->heightmm);
|
||||||
|
|
||||||
gst_ximagesink_calculate_pixel_aspect_ratio (xcontext);
|
gst_x_image_sink_calculate_pixel_aspect_ratio (xcontext);
|
||||||
|
|
||||||
/* We get supported pixmap formats at supported depth */
|
/* We get supported pixmap formats at supported depth */
|
||||||
px_formats = XListPixmapFormats (xcontext->disp, &nb_formats);
|
px_formats = XListPixmapFormats (xcontext->disp, &nb_formats);
|
||||||
|
@ -905,7 +909,7 @@ gst_ximagesink_xcontext_get (GstXImageSink * ximagesink)
|
||||||
/* Search for XShm extension support */
|
/* Search for XShm extension support */
|
||||||
#ifdef HAVE_XSHM
|
#ifdef HAVE_XSHM
|
||||||
if (XShmQueryExtension (xcontext->disp) &&
|
if (XShmQueryExtension (xcontext->disp) &&
|
||||||
gst_ximagesink_check_xshm_calls (ximagesink, xcontext)) {
|
gst_x_image_sink_check_xshm_calls (ximagesink, xcontext)) {
|
||||||
xcontext->use_xshm = TRUE;
|
xcontext->use_xshm = TRUE;
|
||||||
GST_DEBUG ("ximagesink is using XShm extension");
|
GST_DEBUG ("ximagesink is using XShm extension");
|
||||||
} else
|
} else
|
||||||
|
@ -966,11 +970,11 @@ unknown_format:
|
||||||
/* This function cleans the X context. Closing the Display and unrefing the
|
/* This function cleans the X context. Closing the Display and unrefing the
|
||||||
caps for supported formats. */
|
caps for supported formats. */
|
||||||
static void
|
static void
|
||||||
gst_ximagesink_xcontext_clear (GstXImageSink * ximagesink)
|
gst_x_image_sink_xcontext_clear (GstXImageSink * ximagesink)
|
||||||
{
|
{
|
||||||
GstXContext *xcontext;
|
GstXContext *xcontext;
|
||||||
|
|
||||||
g_return_if_fail (GST_IS_XIMAGESINK (ximagesink));
|
g_return_if_fail (GST_IS_X_IMAGE_SINK (ximagesink));
|
||||||
|
|
||||||
GST_OBJECT_LOCK (ximagesink);
|
GST_OBJECT_LOCK (ximagesink);
|
||||||
if (ximagesink->xcontext == NULL) {
|
if (ximagesink->xcontext == NULL) {
|
||||||
|
@ -1006,13 +1010,13 @@ gst_ximagesink_xcontext_clear (GstXImageSink * ximagesink)
|
||||||
/* Element stuff */
|
/* Element stuff */
|
||||||
|
|
||||||
static GstCaps *
|
static GstCaps *
|
||||||
gst_ximagesink_getcaps (GstBaseSink * bsink, GstCaps * filter)
|
gst_x_image_sink_getcaps (GstBaseSink * bsink, GstCaps * filter)
|
||||||
{
|
{
|
||||||
GstXImageSink *ximagesink;
|
GstXImageSink *ximagesink;
|
||||||
GstCaps *caps;
|
GstCaps *caps;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
ximagesink = GST_XIMAGESINK (bsink);
|
ximagesink = GST_X_IMAGE_SINK (bsink);
|
||||||
|
|
||||||
g_mutex_lock (&ximagesink->x_lock);
|
g_mutex_lock (&ximagesink->x_lock);
|
||||||
if (ximagesink->xcontext) {
|
if (ximagesink->xcontext) {
|
||||||
|
@ -1094,7 +1098,7 @@ gst_ximagesink_getcaps (GstBaseSink * bsink, GstCaps * filter)
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstBufferPool *
|
static GstBufferPool *
|
||||||
gst_ximagesink_create_pool (GstXImageSink * ximagesink, GstCaps * caps,
|
gst_x_image_sink_create_pool (GstXImageSink * ximagesink, GstCaps * caps,
|
||||||
gsize size, gint min)
|
gsize size, gint min)
|
||||||
{
|
{
|
||||||
static GstAllocationParams params = { 0, 15, 0, 0, };
|
static GstAllocationParams params = { 0, 15, 0, 0, };
|
||||||
|
@ -1122,7 +1126,7 @@ config_failed:
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_ximagesink_setcaps (GstBaseSink * bsink, GstCaps * caps)
|
gst_x_image_sink_setcaps (GstBaseSink * bsink, GstCaps * caps)
|
||||||
{
|
{
|
||||||
GstXImageSink *ximagesink;
|
GstXImageSink *ximagesink;
|
||||||
GstStructure *structure;
|
GstStructure *structure;
|
||||||
|
@ -1130,7 +1134,7 @@ gst_ximagesink_setcaps (GstBaseSink * bsink, GstCaps * caps)
|
||||||
GstBufferPool *newpool, *oldpool;
|
GstBufferPool *newpool, *oldpool;
|
||||||
const GValue *par;
|
const GValue *par;
|
||||||
|
|
||||||
ximagesink = GST_XIMAGESINK (bsink);
|
ximagesink = GST_X_IMAGE_SINK (bsink);
|
||||||
|
|
||||||
if (!ximagesink->xcontext)
|
if (!ximagesink->xcontext)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -1183,7 +1187,7 @@ gst_ximagesink_setcaps (GstBaseSink * bsink, GstCaps * caps)
|
||||||
|
|
||||||
g_mutex_lock (&ximagesink->flow_lock);
|
g_mutex_lock (&ximagesink->flow_lock);
|
||||||
if (!ximagesink->xwindow) {
|
if (!ximagesink->xwindow) {
|
||||||
ximagesink->xwindow = gst_ximagesink_xwindow_new (ximagesink,
|
ximagesink->xwindow = gst_x_image_sink_xwindow_new (ximagesink,
|
||||||
GST_VIDEO_SINK_WIDTH (ximagesink), GST_VIDEO_SINK_HEIGHT (ximagesink));
|
GST_VIDEO_SINK_WIDTH (ximagesink), GST_VIDEO_SINK_HEIGHT (ximagesink));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1193,7 +1197,7 @@ gst_ximagesink_setcaps (GstBaseSink * bsink, GstCaps * caps)
|
||||||
ximagesink->draw_border = TRUE;
|
ximagesink->draw_border = TRUE;
|
||||||
|
|
||||||
/* create a new internal pool for the new configuration */
|
/* create a new internal pool for the new configuration */
|
||||||
newpool = gst_ximagesink_create_pool (ximagesink, caps, info.size, 2);
|
newpool = gst_x_image_sink_create_pool (ximagesink, caps, info.size, 2);
|
||||||
|
|
||||||
/* we don't activate the internal pool yet as it may not be needed */
|
/* we don't activate the internal pool yet as it may not be needed */
|
||||||
oldpool = ximagesink->pool;
|
oldpool = ximagesink->pool;
|
||||||
|
@ -1233,19 +1237,19 @@ invalid_size:
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstStateChangeReturn
|
static GstStateChangeReturn
|
||||||
gst_ximagesink_change_state (GstElement * element, GstStateChange transition)
|
gst_x_image_sink_change_state (GstElement * element, GstStateChange transition)
|
||||||
{
|
{
|
||||||
GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS;
|
GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS;
|
||||||
GstXImageSink *ximagesink;
|
GstXImageSink *ximagesink;
|
||||||
GstXContext *xcontext = NULL;
|
GstXContext *xcontext = NULL;
|
||||||
|
|
||||||
ximagesink = GST_XIMAGESINK (element);
|
ximagesink = GST_X_IMAGE_SINK (element);
|
||||||
|
|
||||||
switch (transition) {
|
switch (transition) {
|
||||||
case GST_STATE_CHANGE_NULL_TO_READY:
|
case GST_STATE_CHANGE_NULL_TO_READY:
|
||||||
/* Initializing the XContext */
|
/* Initializing the XContext */
|
||||||
if (ximagesink->xcontext == NULL) {
|
if (ximagesink->xcontext == NULL) {
|
||||||
xcontext = gst_ximagesink_xcontext_get (ximagesink);
|
xcontext = gst_x_image_sink_xcontext_get (ximagesink);
|
||||||
if (xcontext == NULL) {
|
if (xcontext == NULL) {
|
||||||
ret = GST_STATE_CHANGE_FAILURE;
|
ret = GST_STATE_CHANGE_FAILURE;
|
||||||
goto beach;
|
goto beach;
|
||||||
|
@ -1262,12 +1266,12 @@ gst_ximagesink_change_state (GstElement * element, GstStateChange transition)
|
||||||
g_mutex_lock (&ximagesink->x_lock);
|
g_mutex_lock (&ximagesink->x_lock);
|
||||||
XSynchronize (ximagesink->xcontext->disp, ximagesink->synchronous);
|
XSynchronize (ximagesink->xcontext->disp, ximagesink->synchronous);
|
||||||
g_mutex_unlock (&ximagesink->x_lock);
|
g_mutex_unlock (&ximagesink->x_lock);
|
||||||
gst_ximagesink_manage_event_thread (ximagesink);
|
gst_x_image_sink_manage_event_thread (ximagesink);
|
||||||
break;
|
break;
|
||||||
case GST_STATE_CHANGE_READY_TO_PAUSED:
|
case GST_STATE_CHANGE_READY_TO_PAUSED:
|
||||||
g_mutex_lock (&ximagesink->flow_lock);
|
g_mutex_lock (&ximagesink->flow_lock);
|
||||||
if (ximagesink->xwindow)
|
if (ximagesink->xwindow)
|
||||||
gst_ximagesink_xwindow_clear (ximagesink, ximagesink->xwindow);
|
gst_x_image_sink_xwindow_clear (ximagesink, ximagesink->xwindow);
|
||||||
g_mutex_unlock (&ximagesink->flow_lock);
|
g_mutex_unlock (&ximagesink->flow_lock);
|
||||||
break;
|
break;
|
||||||
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
|
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
|
||||||
|
@ -1292,7 +1296,7 @@ gst_ximagesink_change_state (GstElement * element, GstStateChange transition)
|
||||||
g_mutex_unlock (&ximagesink->flow_lock);
|
g_mutex_unlock (&ximagesink->flow_lock);
|
||||||
break;
|
break;
|
||||||
case GST_STATE_CHANGE_READY_TO_NULL:
|
case GST_STATE_CHANGE_READY_TO_NULL:
|
||||||
gst_ximagesink_reset (ximagesink);
|
gst_x_image_sink_reset (ximagesink);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -1303,12 +1307,12 @@ beach:
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_ximagesink_get_times (GstBaseSink * bsink, GstBuffer * buf,
|
gst_x_image_sink_get_times (GstBaseSink * bsink, GstBuffer * buf,
|
||||||
GstClockTime * start, GstClockTime * end)
|
GstClockTime * start, GstClockTime * end)
|
||||||
{
|
{
|
||||||
GstXImageSink *ximagesink;
|
GstXImageSink *ximagesink;
|
||||||
|
|
||||||
ximagesink = GST_XIMAGESINK (bsink);
|
ximagesink = GST_X_IMAGE_SINK (bsink);
|
||||||
|
|
||||||
if (GST_BUFFER_TIMESTAMP_IS_VALID (buf)) {
|
if (GST_BUFFER_TIMESTAMP_IS_VALID (buf)) {
|
||||||
*start = GST_BUFFER_TIMESTAMP (buf);
|
*start = GST_BUFFER_TIMESTAMP (buf);
|
||||||
|
@ -1325,14 +1329,14 @@ gst_ximagesink_get_times (GstBaseSink * bsink, GstBuffer * buf,
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstFlowReturn
|
static GstFlowReturn
|
||||||
gst_ximagesink_show_frame (GstVideoSink * vsink, GstBuffer * buf)
|
gst_x_image_sink_show_frame (GstVideoSink * vsink, GstBuffer * buf)
|
||||||
{
|
{
|
||||||
GstFlowReturn res;
|
GstFlowReturn res;
|
||||||
GstXImageSink *ximagesink;
|
GstXImageSink *ximagesink;
|
||||||
GstXImageMemory *mem;
|
GstXImageMemory *mem;
|
||||||
GstBuffer *to_put = NULL;
|
GstBuffer *to_put = NULL;
|
||||||
|
|
||||||
ximagesink = GST_XIMAGESINK (vsink);
|
ximagesink = GST_X_IMAGE_SINK (vsink);
|
||||||
|
|
||||||
if (gst_buffer_n_memory (buf) == 1
|
if (gst_buffer_n_memory (buf) == 1
|
||||||
&& (mem = (GstXImageMemory *) gst_buffer_peek_memory (buf, 0))
|
&& (mem = (GstXImageMemory *) gst_buffer_peek_memory (buf, 0))
|
||||||
|
@ -1383,7 +1387,7 @@ gst_ximagesink_show_frame (GstVideoSink * vsink, GstBuffer * buf)
|
||||||
gst_video_frame_unmap (&src);
|
gst_video_frame_unmap (&src);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!gst_ximagesink_ximage_put (ximagesink, to_put))
|
if (!gst_x_image_sink_ximage_put (ximagesink, to_put))
|
||||||
goto no_window;
|
goto no_window;
|
||||||
|
|
||||||
done:
|
done:
|
||||||
|
@ -1429,9 +1433,9 @@ activate_failed:
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_ximagesink_event (GstBaseSink * sink, GstEvent * event)
|
gst_x_image_sink_event (GstBaseSink * sink, GstEvent * event)
|
||||||
{
|
{
|
||||||
GstXImageSink *ximagesink = GST_XIMAGESINK (sink);
|
GstXImageSink *ximagesink = GST_X_IMAGE_SINK (sink);
|
||||||
|
|
||||||
switch (GST_EVENT_TYPE (event)) {
|
switch (GST_EVENT_TYPE (event)) {
|
||||||
case GST_EVENT_TAG:{
|
case GST_EVENT_TAG:{
|
||||||
|
@ -1443,7 +1447,7 @@ gst_ximagesink_event (GstBaseSink * sink, GstEvent * event)
|
||||||
|
|
||||||
if (title) {
|
if (title) {
|
||||||
GST_DEBUG_OBJECT (ximagesink, "got tags, title='%s'", title);
|
GST_DEBUG_OBJECT (ximagesink, "got tags, title='%s'", title);
|
||||||
gst_ximagesink_xwindow_set_title (ximagesink, ximagesink->xwindow,
|
gst_x_image_sink_xwindow_set_title (ximagesink, ximagesink->xwindow,
|
||||||
title);
|
title);
|
||||||
|
|
||||||
g_free (title);
|
g_free (title);
|
||||||
|
@ -1457,9 +1461,9 @@ gst_ximagesink_event (GstBaseSink * sink, GstEvent * event)
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_ximagesink_propose_allocation (GstBaseSink * bsink, GstQuery * query)
|
gst_x_image_sink_propose_allocation (GstBaseSink * bsink, GstQuery * query)
|
||||||
{
|
{
|
||||||
GstXImageSink *ximagesink = GST_XIMAGESINK (bsink);
|
GstXImageSink *ximagesink = GST_X_IMAGE_SINK (bsink);
|
||||||
GstBufferPool *pool = NULL;
|
GstBufferPool *pool = NULL;
|
||||||
GstCaps *caps;
|
GstCaps *caps;
|
||||||
guint size;
|
guint size;
|
||||||
|
@ -1476,7 +1480,7 @@ gst_ximagesink_propose_allocation (GstBaseSink * bsink, GstQuery * query)
|
||||||
if (!gst_video_info_from_caps (&info, caps))
|
if (!gst_video_info_from_caps (&info, caps))
|
||||||
goto invalid_caps;
|
goto invalid_caps;
|
||||||
|
|
||||||
pool = gst_ximagesink_create_pool (ximagesink, caps, info.size, 0);
|
pool = gst_x_image_sink_create_pool (ximagesink, caps, info.size, 0);
|
||||||
|
|
||||||
/* the normal size of a frame */
|
/* the normal size of a frame */
|
||||||
size = info.size;
|
size = info.size;
|
||||||
|
@ -1517,10 +1521,10 @@ no_pool:
|
||||||
|
|
||||||
/* Interfaces stuff */
|
/* Interfaces stuff */
|
||||||
static void
|
static void
|
||||||
gst_ximagesink_navigation_send_event (GstNavigation * navigation,
|
gst_x_image_sink_navigation_send_event (GstNavigation * navigation,
|
||||||
GstStructure * structure)
|
GstStructure * structure)
|
||||||
{
|
{
|
||||||
GstXImageSink *ximagesink = GST_XIMAGESINK (navigation);
|
GstXImageSink *ximagesink = GST_X_IMAGE_SINK (navigation);
|
||||||
GstEvent *event;
|
GstEvent *event;
|
||||||
gint x_offset, y_offset;
|
gint x_offset, y_offset;
|
||||||
gdouble x, y;
|
gdouble x, y;
|
||||||
|
@ -1566,16 +1570,16 @@ gst_ximagesink_navigation_send_event (GstNavigation * navigation,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_ximagesink_navigation_init (GstNavigationInterface * iface)
|
gst_x_image_sink_navigation_init (GstNavigationInterface * iface)
|
||||||
{
|
{
|
||||||
iface->send_event = gst_ximagesink_navigation_send_event;
|
iface->send_event = gst_x_image_sink_navigation_send_event;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_ximagesink_set_window_handle (GstVideoOverlay * overlay, guintptr id)
|
gst_x_image_sink_set_window_handle (GstVideoOverlay * overlay, guintptr id)
|
||||||
{
|
{
|
||||||
XID xwindow_id = id;
|
XID xwindow_id = id;
|
||||||
GstXImageSink *ximagesink = GST_XIMAGESINK (overlay);
|
GstXImageSink *ximagesink = GST_X_IMAGE_SINK (overlay);
|
||||||
GstXWindow *xwindow = NULL;
|
GstXWindow *xwindow = NULL;
|
||||||
XWindowAttributes attr;
|
XWindowAttributes attr;
|
||||||
|
|
||||||
|
@ -1592,7 +1596,7 @@ gst_ximagesink_set_window_handle (GstVideoOverlay * overlay, guintptr id)
|
||||||
|
|
||||||
/* If the element has not initialized the X11 context try to do so */
|
/* If the element has not initialized the X11 context try to do so */
|
||||||
if (!ximagesink->xcontext &&
|
if (!ximagesink->xcontext &&
|
||||||
!(ximagesink->xcontext = gst_ximagesink_xcontext_get (ximagesink))) {
|
!(ximagesink->xcontext = gst_x_image_sink_xcontext_get (ximagesink))) {
|
||||||
g_mutex_unlock (&ximagesink->flow_lock);
|
g_mutex_unlock (&ximagesink->flow_lock);
|
||||||
/* we have thrown a GST_ELEMENT_ERROR now */
|
/* we have thrown a GST_ELEMENT_ERROR now */
|
||||||
return;
|
return;
|
||||||
|
@ -1600,7 +1604,7 @@ gst_ximagesink_set_window_handle (GstVideoOverlay * overlay, guintptr id)
|
||||||
|
|
||||||
/* If a window is there already we destroy it */
|
/* If a window is there already we destroy it */
|
||||||
if (ximagesink->xwindow) {
|
if (ximagesink->xwindow) {
|
||||||
gst_ximagesink_xwindow_destroy (ximagesink, ximagesink->xwindow);
|
gst_x_image_sink_xwindow_destroy (ximagesink, ximagesink->xwindow);
|
||||||
ximagesink->xwindow = NULL;
|
ximagesink->xwindow = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1609,7 +1613,7 @@ gst_ximagesink_set_window_handle (GstVideoOverlay * overlay, guintptr id)
|
||||||
/* If no width/height caps nego did not happen window will be created
|
/* If no width/height caps nego did not happen window will be created
|
||||||
during caps nego then */
|
during caps nego then */
|
||||||
if (GST_VIDEO_SINK_WIDTH (ximagesink) && GST_VIDEO_SINK_HEIGHT (ximagesink)) {
|
if (GST_VIDEO_SINK_WIDTH (ximagesink) && GST_VIDEO_SINK_HEIGHT (ximagesink)) {
|
||||||
xwindow = gst_ximagesink_xwindow_new (ximagesink,
|
xwindow = gst_x_image_sink_xwindow_new (ximagesink,
|
||||||
GST_VIDEO_SINK_WIDTH (ximagesink),
|
GST_VIDEO_SINK_WIDTH (ximagesink),
|
||||||
GST_VIDEO_SINK_HEIGHT (ximagesink));
|
GST_VIDEO_SINK_HEIGHT (ximagesink));
|
||||||
}
|
}
|
||||||
|
@ -1642,19 +1646,19 @@ gst_ximagesink_set_window_handle (GstVideoOverlay * overlay, guintptr id)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_ximagesink_expose (GstVideoOverlay * overlay)
|
gst_x_image_sink_expose (GstVideoOverlay * overlay)
|
||||||
{
|
{
|
||||||
GstXImageSink *ximagesink = GST_XIMAGESINK (overlay);
|
GstXImageSink *ximagesink = GST_X_IMAGE_SINK (overlay);
|
||||||
|
|
||||||
gst_ximagesink_xwindow_update_geometry (ximagesink);
|
gst_x_image_sink_xwindow_update_geometry (ximagesink);
|
||||||
gst_ximagesink_ximage_put (ximagesink, NULL);
|
gst_x_image_sink_ximage_put (ximagesink, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_ximagesink_set_event_handling (GstVideoOverlay * overlay,
|
gst_x_image_sink_set_event_handling (GstVideoOverlay * overlay,
|
||||||
gboolean handle_events)
|
gboolean handle_events)
|
||||||
{
|
{
|
||||||
GstXImageSink *ximagesink = GST_XIMAGESINK (overlay);
|
GstXImageSink *ximagesink = GST_X_IMAGE_SINK (overlay);
|
||||||
|
|
||||||
ximagesink->handle_events = handle_events;
|
ximagesink->handle_events = handle_events;
|
||||||
|
|
||||||
|
@ -1687,11 +1691,11 @@ gst_ximagesink_set_event_handling (GstVideoOverlay * overlay,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_ximagesink_video_overlay_init (GstVideoOverlayInterface * iface)
|
gst_x_image_sink_video_overlay_init (GstVideoOverlayInterface * iface)
|
||||||
{
|
{
|
||||||
iface->set_window_handle = gst_ximagesink_set_window_handle;
|
iface->set_window_handle = gst_x_image_sink_set_window_handle;
|
||||||
iface->expose = gst_ximagesink_expose;
|
iface->expose = gst_x_image_sink_expose;
|
||||||
iface->handle_events = gst_ximagesink_set_event_handling;
|
iface->handle_events = gst_x_image_sink_set_event_handling;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* =========================================== */
|
/* =========================================== */
|
||||||
|
@ -1701,14 +1705,14 @@ gst_ximagesink_video_overlay_init (GstVideoOverlayInterface * iface)
|
||||||
/* =========================================== */
|
/* =========================================== */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_ximagesink_set_property (GObject * object, guint prop_id,
|
gst_x_image_sink_set_property (GObject * object, guint prop_id,
|
||||||
const GValue * value, GParamSpec * pspec)
|
const GValue * value, GParamSpec * pspec)
|
||||||
{
|
{
|
||||||
GstXImageSink *ximagesink;
|
GstXImageSink *ximagesink;
|
||||||
|
|
||||||
g_return_if_fail (GST_IS_XIMAGESINK (object));
|
g_return_if_fail (GST_IS_X_IMAGE_SINK (object));
|
||||||
|
|
||||||
ximagesink = GST_XIMAGESINK (object);
|
ximagesink = GST_X_IMAGE_SINK (object);
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
case PROP_DISPLAY:
|
case PROP_DISPLAY:
|
||||||
|
@ -1748,13 +1752,13 @@ gst_ximagesink_set_property (GObject * object, guint prop_id,
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PROP_HANDLE_EVENTS:
|
case PROP_HANDLE_EVENTS:
|
||||||
gst_ximagesink_set_event_handling (GST_VIDEO_OVERLAY (ximagesink),
|
gst_x_image_sink_set_event_handling (GST_VIDEO_OVERLAY (ximagesink),
|
||||||
g_value_get_boolean (value));
|
g_value_get_boolean (value));
|
||||||
gst_ximagesink_manage_event_thread (ximagesink);
|
gst_x_image_sink_manage_event_thread (ximagesink);
|
||||||
break;
|
break;
|
||||||
case PROP_HANDLE_EXPOSE:
|
case PROP_HANDLE_EXPOSE:
|
||||||
ximagesink->handle_expose = g_value_get_boolean (value);
|
ximagesink->handle_expose = g_value_get_boolean (value);
|
||||||
gst_ximagesink_manage_event_thread (ximagesink);
|
gst_x_image_sink_manage_event_thread (ximagesink);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
|
@ -1763,14 +1767,14 @@ gst_ximagesink_set_property (GObject * object, guint prop_id,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_ximagesink_get_property (GObject * object, guint prop_id,
|
gst_x_image_sink_get_property (GObject * object, guint prop_id,
|
||||||
GValue * value, GParamSpec * pspec)
|
GValue * value, GParamSpec * pspec)
|
||||||
{
|
{
|
||||||
GstXImageSink *ximagesink;
|
GstXImageSink *ximagesink;
|
||||||
|
|
||||||
g_return_if_fail (GST_IS_XIMAGESINK (object));
|
g_return_if_fail (GST_IS_X_IMAGE_SINK (object));
|
||||||
|
|
||||||
ximagesink = GST_XIMAGESINK (object);
|
ximagesink = GST_X_IMAGE_SINK (object);
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
case PROP_DISPLAY:
|
case PROP_DISPLAY:
|
||||||
|
@ -1811,7 +1815,7 @@ gst_ximagesink_get_property (GObject * object, guint prop_id,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_ximagesink_reset (GstXImageSink * ximagesink)
|
gst_x_image_sink_reset (GstXImageSink * ximagesink)
|
||||||
{
|
{
|
||||||
GThread *thread;
|
GThread *thread;
|
||||||
|
|
||||||
|
@ -1839,23 +1843,23 @@ gst_ximagesink_reset (GstXImageSink * ximagesink)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ximagesink->xwindow) {
|
if (ximagesink->xwindow) {
|
||||||
gst_ximagesink_xwindow_clear (ximagesink, ximagesink->xwindow);
|
gst_x_image_sink_xwindow_clear (ximagesink, ximagesink->xwindow);
|
||||||
gst_ximagesink_xwindow_destroy (ximagesink, ximagesink->xwindow);
|
gst_x_image_sink_xwindow_destroy (ximagesink, ximagesink->xwindow);
|
||||||
ximagesink->xwindow = NULL;
|
ximagesink->xwindow = NULL;
|
||||||
}
|
}
|
||||||
g_mutex_unlock (&ximagesink->flow_lock);
|
g_mutex_unlock (&ximagesink->flow_lock);
|
||||||
|
|
||||||
gst_ximagesink_xcontext_clear (ximagesink);
|
gst_x_image_sink_xcontext_clear (ximagesink);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_ximagesink_finalize (GObject * object)
|
gst_x_image_sink_finalize (GObject * object)
|
||||||
{
|
{
|
||||||
GstXImageSink *ximagesink;
|
GstXImageSink *ximagesink;
|
||||||
|
|
||||||
ximagesink = GST_XIMAGESINK (object);
|
ximagesink = GST_X_IMAGE_SINK (object);
|
||||||
|
|
||||||
gst_ximagesink_reset (ximagesink);
|
gst_x_image_sink_reset (ximagesink);
|
||||||
|
|
||||||
if (ximagesink->display_name) {
|
if (ximagesink->display_name) {
|
||||||
g_free (ximagesink->display_name);
|
g_free (ximagesink->display_name);
|
||||||
|
@ -1874,7 +1878,7 @@ gst_ximagesink_finalize (GObject * object)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_ximagesink_init (GstXImageSink * ximagesink)
|
gst_x_image_sink_init (GstXImageSink * ximagesink)
|
||||||
{
|
{
|
||||||
ximagesink->display_name = NULL;
|
ximagesink->display_name = NULL;
|
||||||
ximagesink->xcontext = NULL;
|
ximagesink->xcontext = NULL;
|
||||||
|
@ -1901,7 +1905,7 @@ gst_ximagesink_init (GstXImageSink * ximagesink)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_ximagesink_class_init (GstXImageSinkClass * klass)
|
gst_x_image_sink_class_init (GstXImageSinkClass * klass)
|
||||||
{
|
{
|
||||||
GObjectClass *gobject_class;
|
GObjectClass *gobject_class;
|
||||||
GstElementClass *gstelement_class;
|
GstElementClass *gstelement_class;
|
||||||
|
@ -1913,9 +1917,9 @@ gst_ximagesink_class_init (GstXImageSinkClass * klass)
|
||||||
gstbasesink_class = (GstBaseSinkClass *) klass;
|
gstbasesink_class = (GstBaseSinkClass *) klass;
|
||||||
videosink_class = (GstVideoSinkClass *) klass;
|
videosink_class = (GstVideoSinkClass *) klass;
|
||||||
|
|
||||||
gobject_class->finalize = gst_ximagesink_finalize;
|
gobject_class->finalize = gst_x_image_sink_finalize;
|
||||||
gobject_class->set_property = gst_ximagesink_set_property;
|
gobject_class->set_property = gst_x_image_sink_set_property;
|
||||||
gobject_class->get_property = gst_ximagesink_get_property;
|
gobject_class->get_property = gst_x_image_sink_get_property;
|
||||||
|
|
||||||
g_object_class_install_property (gobject_class, PROP_DISPLAY,
|
g_object_class_install_property (gobject_class, PROP_DISPLAY,
|
||||||
g_param_spec_string ("display", "Display", "X Display name",
|
g_param_spec_string ("display", "Display", "X Display name",
|
||||||
|
@ -1969,16 +1973,16 @@ gst_ximagesink_class_init (GstXImageSinkClass * klass)
|
||||||
"A standard X based videosink", "Julien Moutte <julien@moutte.net>");
|
"A standard X based videosink", "Julien Moutte <julien@moutte.net>");
|
||||||
|
|
||||||
gst_element_class_add_pad_template (gstelement_class,
|
gst_element_class_add_pad_template (gstelement_class,
|
||||||
gst_static_pad_template_get (&gst_ximagesink_sink_template_factory));
|
gst_static_pad_template_get (&gst_x_image_sink_sink_template_factory));
|
||||||
|
|
||||||
gstelement_class->change_state = gst_ximagesink_change_state;
|
gstelement_class->change_state = gst_x_image_sink_change_state;
|
||||||
|
|
||||||
gstbasesink_class->get_caps = GST_DEBUG_FUNCPTR (gst_ximagesink_getcaps);
|
gstbasesink_class->get_caps = GST_DEBUG_FUNCPTR (gst_x_image_sink_getcaps);
|
||||||
gstbasesink_class->set_caps = GST_DEBUG_FUNCPTR (gst_ximagesink_setcaps);
|
gstbasesink_class->set_caps = GST_DEBUG_FUNCPTR (gst_x_image_sink_setcaps);
|
||||||
gstbasesink_class->get_times = GST_DEBUG_FUNCPTR (gst_ximagesink_get_times);
|
gstbasesink_class->get_times = GST_DEBUG_FUNCPTR (gst_x_image_sink_get_times);
|
||||||
gstbasesink_class->propose_allocation =
|
gstbasesink_class->propose_allocation =
|
||||||
GST_DEBUG_FUNCPTR (gst_ximagesink_propose_allocation);
|
GST_DEBUG_FUNCPTR (gst_x_image_sink_propose_allocation);
|
||||||
gstbasesink_class->event = GST_DEBUG_FUNCPTR (gst_ximagesink_event);
|
gstbasesink_class->event = GST_DEBUG_FUNCPTR (gst_x_image_sink_event);
|
||||||
|
|
||||||
videosink_class->show_frame = GST_DEBUG_FUNCPTR (gst_ximagesink_show_frame);
|
videosink_class->show_frame = GST_DEBUG_FUNCPTR (gst_x_image_sink_show_frame);
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,8 +17,8 @@
|
||||||
* Boston, MA 02110-1301, USA.
|
* Boston, MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __GST_XIMAGESINK_H__
|
#ifndef __GST_X_IMAGE_SINK_H__
|
||||||
#define __GST_XIMAGESINK_H__
|
#define __GST_X_IMAGE_SINK_H__
|
||||||
|
|
||||||
#include <gst/video/gstvideosink.h>
|
#include <gst/video/gstvideosink.h>
|
||||||
|
|
||||||
|
@ -42,16 +42,16 @@
|
||||||
#include <gst/video/video.h>
|
#include <gst/video/video.h>
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
#define GST_TYPE_XIMAGESINK \
|
#define GST_TYPE_X_IMAGE_SINK \
|
||||||
(gst_ximagesink_get_type())
|
(gst_x_image_sink_get_type())
|
||||||
#define GST_XIMAGESINK(obj) \
|
#define GST_X_IMAGE_SINK(obj) \
|
||||||
(G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_XIMAGESINK, GstXImageSink))
|
(G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_X_IMAGE_SINK, GstXImageSink))
|
||||||
#define GST_XIMAGESINK_CLASS(klass) \
|
#define GST_X_IMAGE_SINK_CLASS(klass) \
|
||||||
(G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_XIMAGESINK, GstXImageSinkClass))
|
(G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_X_IMAGE_SINK, GstXImageSinkClass))
|
||||||
#define GST_IS_XIMAGESINK(obj) \
|
#define GST_IS_X_IMAGE_SINK(obj) \
|
||||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_XIMAGESINK))
|
(G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_X_IMAGE_SINK))
|
||||||
#define GST_IS_XIMAGESINK_CLASS(klass) \
|
#define GST_IS_X_IMAGE_SINK_CLASS(klass) \
|
||||||
(G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_XIMAGESINK))
|
(G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_X_IMAGE_SINK))
|
||||||
|
|
||||||
typedef struct _GstXContext GstXContext;
|
typedef struct _GstXContext GstXContext;
|
||||||
typedef struct _GstXWindow GstXWindow;
|
typedef struct _GstXWindow GstXWindow;
|
||||||
|
@ -204,7 +204,7 @@ struct _GstXImageSinkClass
|
||||||
GstVideoSinkClass parent_class;
|
GstVideoSinkClass parent_class;
|
||||||
};
|
};
|
||||||
|
|
||||||
GType gst_ximagesink_get_type (void);
|
GType gst_x_image_sink_get_type (void);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
#endif /* __GST_XIMAGESINK_H__ */
|
#endif /* __GST_X_IMAGE_SINK_H__ */
|
||||||
|
|
|
@ -33,9 +33,9 @@
|
||||||
/* for XkbKeycodeToKeysym */
|
/* for XkbKeycodeToKeysym */
|
||||||
#include <X11/XKBlib.h>
|
#include <X11/XKBlib.h>
|
||||||
|
|
||||||
GST_DEBUG_CATEGORY_EXTERN (gst_debug_xvcontext);
|
GST_DEBUG_CATEGORY_EXTERN (gst_debug_xv_context);
|
||||||
GST_DEBUG_CATEGORY_EXTERN (GST_CAT_PERFORMANCE);
|
GST_DEBUG_CATEGORY_EXTERN (GST_CAT_PERFORMANCE);
|
||||||
#define GST_CAT_DEFAULT gst_debug_xvcontext
|
#define GST_CAT_DEFAULT gst_debug_xv_context
|
||||||
|
|
||||||
void
|
void
|
||||||
gst_xvcontext_config_clear (GstXvContextConfig * config)
|
gst_xvcontext_config_clear (GstXvContextConfig * config)
|
||||||
|
|
|
@ -23,23 +23,23 @@
|
||||||
|
|
||||||
#include "xvimagesink.h"
|
#include "xvimagesink.h"
|
||||||
|
|
||||||
GST_DEBUG_CATEGORY (gst_debug_xvcontext);
|
GST_DEBUG_CATEGORY (gst_debug_xv_context);
|
||||||
GST_DEBUG_CATEGORY (gst_debug_xvimagepool);
|
GST_DEBUG_CATEGORY (gst_debug_xv_image_pool);
|
||||||
GST_DEBUG_CATEGORY (gst_debug_xvimagesink);
|
GST_DEBUG_CATEGORY (gst_debug_xv_image_sink);
|
||||||
GST_DEBUG_CATEGORY_STATIC (GST_CAT_PERFORMANCE);
|
GST_DEBUG_CATEGORY_STATIC (GST_CAT_PERFORMANCE);
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
plugin_init (GstPlugin * plugin)
|
plugin_init (GstPlugin * plugin)
|
||||||
{
|
{
|
||||||
if (!gst_element_register (plugin, "xvimagesink",
|
if (!gst_element_register (plugin, "xvimagesink",
|
||||||
GST_RANK_PRIMARY, GST_TYPE_XVIMAGESINK))
|
GST_RANK_PRIMARY, GST_TYPE_XV_IMAGE_SINK))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
GST_DEBUG_CATEGORY_INIT (gst_debug_xvcontext, "xcontext", 0,
|
GST_DEBUG_CATEGORY_INIT (gst_debug_xv_context, "xcontext", 0,
|
||||||
"xcontext miniobject");
|
"xcontext miniobject");
|
||||||
GST_DEBUG_CATEGORY_INIT (gst_debug_xvimagesink, "xvimagesink", 0,
|
GST_DEBUG_CATEGORY_INIT (gst_debug_xv_image_sink, "xvimagesink", 0,
|
||||||
"xvimagesink element");
|
"xvimagesink element");
|
||||||
GST_DEBUG_CATEGORY_INIT (gst_debug_xvimagepool, "xvimagepool", 0,
|
GST_DEBUG_CATEGORY_INIT (gst_debug_xv_image_pool, "xvimagepool", 0,
|
||||||
"xvimagepool object");
|
"xvimagepool object");
|
||||||
|
|
||||||
GST_DEBUG_CATEGORY_GET (GST_CAT_PERFORMANCE, "GST_PERFORMANCE");
|
GST_DEBUG_CATEGORY_GET (GST_CAT_PERFORMANCE, "GST_PERFORMANCE");
|
||||||
|
|
|
@ -34,8 +34,8 @@
|
||||||
#include <gst/video/gstvideopool.h>
|
#include <gst/video/gstvideopool.h>
|
||||||
|
|
||||||
|
|
||||||
GST_DEBUG_CATEGORY_EXTERN (gst_debug_xvimagepool);
|
GST_DEBUG_CATEGORY_EXTERN (gst_debug_xv_image_pool);
|
||||||
#define GST_CAT_DEFAULT gst_debug_xvimagepool
|
#define GST_CAT_DEFAULT gst_debug_xv_image_pool
|
||||||
|
|
||||||
/* bufferpool */
|
/* bufferpool */
|
||||||
static void gst_xvimage_buffer_pool_finalize (GObject * object);
|
static void gst_xvimage_buffer_pool_finalize (GObject * object);
|
||||||
|
|
|
@ -133,9 +133,9 @@
|
||||||
/* for XkbKeycodeToKeysym */
|
/* for XkbKeycodeToKeysym */
|
||||||
#include <X11/XKBlib.h>
|
#include <X11/XKBlib.h>
|
||||||
|
|
||||||
GST_DEBUG_CATEGORY_EXTERN (gst_debug_xvimagesink);
|
GST_DEBUG_CATEGORY_EXTERN (gst_debug_xv_image_sink);
|
||||||
GST_DEBUG_CATEGORY_EXTERN (GST_CAT_PERFORMANCE);
|
GST_DEBUG_CATEGORY_EXTERN (GST_CAT_PERFORMANCE);
|
||||||
#define GST_CAT_DEFAULT gst_debug_xvimagesink
|
#define GST_CAT_DEFAULT gst_debug_xv_image_sink
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
@ -149,15 +149,15 @@ MotifWmHints, MwmHints;
|
||||||
|
|
||||||
#define MWM_HINTS_DECORATIONS (1L << 1)
|
#define MWM_HINTS_DECORATIONS (1L << 1)
|
||||||
|
|
||||||
static gboolean gst_xvimagesink_open (GstXvImageSink * xvimagesink);
|
static gboolean gst_xv_image_sink_open (GstXvImageSink * xvimagesink);
|
||||||
static void gst_xvimagesink_close (GstXvImageSink * xvimagesink);
|
static void gst_xv_image_sink_close (GstXvImageSink * xvimagesink);
|
||||||
static void gst_xvimagesink_xwindow_update_geometry (GstXvImageSink *
|
static void gst_xv_image_sink_xwindow_update_geometry (GstXvImageSink *
|
||||||
xvimagesink);
|
xvimagesink);
|
||||||
static void gst_xvimagesink_expose (GstVideoOverlay * overlay);
|
static void gst_xv_image_sink_expose (GstVideoOverlay * overlay);
|
||||||
|
|
||||||
/* Default template - initiated with class struct to allow gst-register to work
|
/* Default template - initiated with class struct to allow gst-register to work
|
||||||
without X running */
|
without X running */
|
||||||
static GstStaticPadTemplate gst_xvimagesink_sink_template_factory =
|
static GstStaticPadTemplate gst_xv_image_sink_sink_template_factory =
|
||||||
GST_STATIC_PAD_TEMPLATE ("sink",
|
GST_STATIC_PAD_TEMPLATE ("sink",
|
||||||
GST_PAD_SINK,
|
GST_PAD_SINK,
|
||||||
GST_PAD_ALWAYS,
|
GST_PAD_ALWAYS,
|
||||||
|
@ -200,19 +200,19 @@ enum
|
||||||
/* Object typing & Creation */
|
/* Object typing & Creation */
|
||||||
/* */
|
/* */
|
||||||
/* =========================================== */
|
/* =========================================== */
|
||||||
static void gst_xvimagesink_navigation_init (GstNavigationInterface * iface);
|
static void gst_xv_image_sink_navigation_init (GstNavigationInterface * iface);
|
||||||
static void gst_xvimagesink_video_overlay_init (GstVideoOverlayInterface *
|
static void gst_xv_image_sink_video_overlay_init (GstVideoOverlayInterface *
|
||||||
iface);
|
iface);
|
||||||
static void gst_xvimagesink_colorbalance_init (GstColorBalanceInterface *
|
static void gst_xv_image_sink_colorbalance_init (GstColorBalanceInterface *
|
||||||
iface);
|
iface);
|
||||||
#define gst_xvimagesink_parent_class parent_class
|
#define gst_xv_image_sink_parent_class parent_class
|
||||||
G_DEFINE_TYPE_WITH_CODE (GstXvImageSink, gst_xvimagesink, GST_TYPE_VIDEO_SINK,
|
G_DEFINE_TYPE_WITH_CODE (GstXvImageSink, gst_xv_image_sink, GST_TYPE_VIDEO_SINK,
|
||||||
G_IMPLEMENT_INTERFACE (GST_TYPE_NAVIGATION,
|
G_IMPLEMENT_INTERFACE (GST_TYPE_NAVIGATION,
|
||||||
gst_xvimagesink_navigation_init);
|
gst_xv_image_sink_navigation_init);
|
||||||
G_IMPLEMENT_INTERFACE (GST_TYPE_VIDEO_OVERLAY,
|
G_IMPLEMENT_INTERFACE (GST_TYPE_VIDEO_OVERLAY,
|
||||||
gst_xvimagesink_video_overlay_init);
|
gst_xv_image_sink_video_overlay_init);
|
||||||
G_IMPLEMENT_INTERFACE (GST_TYPE_COLOR_BALANCE,
|
G_IMPLEMENT_INTERFACE (GST_TYPE_COLOR_BALANCE,
|
||||||
gst_xvimagesink_colorbalance_init));
|
gst_xv_image_sink_colorbalance_init));
|
||||||
|
|
||||||
|
|
||||||
/* ============================================================= */
|
/* ============================================================= */
|
||||||
|
@ -225,7 +225,8 @@ G_DEFINE_TYPE_WITH_CODE (GstXvImageSink, gst_xvimagesink, GST_TYPE_VIDEO_SINK,
|
||||||
/* This function puts a GstXvImage on a GstXvImageSink's window. Returns FALSE
|
/* This function puts a GstXvImage on a GstXvImageSink's window. Returns FALSE
|
||||||
* if no window was available */
|
* if no window was available */
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_xvimagesink_xvimage_put (GstXvImageSink * xvimagesink, GstBuffer * xvimage)
|
gst_xv_image_sink_xvimage_put (GstXvImageSink * xvimagesink,
|
||||||
|
GstBuffer * xvimage)
|
||||||
{
|
{
|
||||||
GstXvImageMemory *mem;
|
GstXvImageMemory *mem;
|
||||||
GstVideoCropMeta *crop;
|
GstVideoCropMeta *crop;
|
||||||
|
@ -315,7 +316,7 @@ gst_xvimagesink_xvimage_put (GstXvImageSink * xvimagesink, GstBuffer * xvimage)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_xvimagesink_xwindow_set_title (GstXvImageSink * xvimagesink,
|
gst_xv_image_sink_xwindow_set_title (GstXvImageSink * xvimagesink,
|
||||||
GstXWindow * xwindow, const gchar * media_title)
|
GstXWindow * xwindow, const gchar * media_title)
|
||||||
{
|
{
|
||||||
if (media_title) {
|
if (media_title) {
|
||||||
|
@ -348,20 +349,20 @@ gst_xvimagesink_xwindow_set_title (GstXvImageSink * xvimagesink,
|
||||||
/* This function handles a GstXWindow creation
|
/* This function handles a GstXWindow creation
|
||||||
* The width and height are the actual pixel size on the display */
|
* The width and height are the actual pixel size on the display */
|
||||||
static GstXWindow *
|
static GstXWindow *
|
||||||
gst_xvimagesink_xwindow_new (GstXvImageSink * xvimagesink,
|
gst_xv_image_sink_xwindow_new (GstXvImageSink * xvimagesink,
|
||||||
gint width, gint height)
|
gint width, gint height)
|
||||||
{
|
{
|
||||||
GstXWindow *xwindow = NULL;
|
GstXWindow *xwindow = NULL;
|
||||||
GstXvContext *context;
|
GstXvContext *context;
|
||||||
|
|
||||||
g_return_val_if_fail (GST_IS_XVIMAGESINK (xvimagesink), NULL);
|
g_return_val_if_fail (GST_IS_XV_IMAGE_SINK (xvimagesink), NULL);
|
||||||
|
|
||||||
context = xvimagesink->context;
|
context = xvimagesink->context;
|
||||||
|
|
||||||
xwindow = gst_xvcontext_create_xwindow (context, width, height);
|
xwindow = gst_xvcontext_create_xwindow (context, width, height);
|
||||||
|
|
||||||
/* set application name as a title */
|
/* set application name as a title */
|
||||||
gst_xvimagesink_xwindow_set_title (xvimagesink, xwindow, NULL);
|
gst_xv_image_sink_xwindow_set_title (xvimagesink, xwindow, NULL);
|
||||||
|
|
||||||
gst_xwindow_set_event_handling (xwindow, xvimagesink->handle_events);
|
gst_xwindow_set_event_handling (xwindow, xvimagesink->handle_events);
|
||||||
|
|
||||||
|
@ -372,9 +373,9 @@ gst_xvimagesink_xwindow_new (GstXvImageSink * xvimagesink,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_xvimagesink_xwindow_update_geometry (GstXvImageSink * xvimagesink)
|
gst_xv_image_sink_xwindow_update_geometry (GstXvImageSink * xvimagesink)
|
||||||
{
|
{
|
||||||
g_return_if_fail (GST_IS_XVIMAGESINK (xvimagesink));
|
g_return_if_fail (GST_IS_XV_IMAGE_SINK (xvimagesink));
|
||||||
|
|
||||||
/* Update the window geometry */
|
/* Update the window geometry */
|
||||||
g_mutex_lock (&xvimagesink->flow_lock);
|
g_mutex_lock (&xvimagesink->flow_lock);
|
||||||
|
@ -386,11 +387,11 @@ gst_xvimagesink_xwindow_update_geometry (GstXvImageSink * xvimagesink)
|
||||||
/* This function commits our internal colorbalance settings to our grabbed Xv
|
/* This function commits our internal colorbalance settings to our grabbed Xv
|
||||||
port. If the context is not initialized yet it simply returns */
|
port. If the context is not initialized yet it simply returns */
|
||||||
static void
|
static void
|
||||||
gst_xvimagesink_update_colorbalance (GstXvImageSink * xvimagesink)
|
gst_xv_image_sink_update_colorbalance (GstXvImageSink * xvimagesink)
|
||||||
{
|
{
|
||||||
GstXvContext *context;
|
GstXvContext *context;
|
||||||
|
|
||||||
g_return_if_fail (GST_IS_XVIMAGESINK (xvimagesink));
|
g_return_if_fail (GST_IS_XV_IMAGE_SINK (xvimagesink));
|
||||||
|
|
||||||
/* If we haven't initialized the X context we can't update anything */
|
/* If we haven't initialized the X context we can't update anything */
|
||||||
if ((context = xvimagesink->context) == NULL)
|
if ((context = xvimagesink->context) == NULL)
|
||||||
|
@ -404,14 +405,14 @@ gst_xvimagesink_update_colorbalance (GstXvImageSink * xvimagesink)
|
||||||
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_xvimagesink_handle_xevents (GstXvImageSink * xvimagesink)
|
gst_xv_image_sink_handle_xevents (GstXvImageSink * xvimagesink)
|
||||||
{
|
{
|
||||||
XEvent e;
|
XEvent e;
|
||||||
guint pointer_x = 0, pointer_y = 0;
|
guint pointer_x = 0, pointer_y = 0;
|
||||||
gboolean pointer_moved = FALSE;
|
gboolean pointer_moved = FALSE;
|
||||||
gboolean exposed = FALSE, configured = FALSE;
|
gboolean exposed = FALSE, configured = FALSE;
|
||||||
|
|
||||||
g_return_if_fail (GST_IS_XVIMAGESINK (xvimagesink));
|
g_return_if_fail (GST_IS_XV_IMAGE_SINK (xvimagesink));
|
||||||
|
|
||||||
/* Handle Interaction, produces navigation events */
|
/* Handle Interaction, produces navigation events */
|
||||||
|
|
||||||
|
@ -517,7 +518,7 @@ gst_xvimagesink_handle_xevents (GstXvImageSink * xvimagesink)
|
||||||
g_mutex_unlock (&xvimagesink->context->lock);
|
g_mutex_unlock (&xvimagesink->context->lock);
|
||||||
g_mutex_unlock (&xvimagesink->flow_lock);
|
g_mutex_unlock (&xvimagesink->flow_lock);
|
||||||
|
|
||||||
gst_xvimagesink_xwindow_update_geometry (xvimagesink);
|
gst_xv_image_sink_xwindow_update_geometry (xvimagesink);
|
||||||
|
|
||||||
g_mutex_lock (&xvimagesink->flow_lock);
|
g_mutex_lock (&xvimagesink->flow_lock);
|
||||||
g_mutex_lock (&xvimagesink->context->lock);
|
g_mutex_lock (&xvimagesink->context->lock);
|
||||||
|
@ -532,7 +533,7 @@ gst_xvimagesink_handle_xevents (GstXvImageSink * xvimagesink)
|
||||||
g_mutex_unlock (&xvimagesink->context->lock);
|
g_mutex_unlock (&xvimagesink->context->lock);
|
||||||
g_mutex_unlock (&xvimagesink->flow_lock);
|
g_mutex_unlock (&xvimagesink->flow_lock);
|
||||||
|
|
||||||
gst_xvimagesink_expose (GST_VIDEO_OVERLAY (xvimagesink));
|
gst_xv_image_sink_expose (GST_VIDEO_OVERLAY (xvimagesink));
|
||||||
|
|
||||||
g_mutex_lock (&xvimagesink->flow_lock);
|
g_mutex_lock (&xvimagesink->flow_lock);
|
||||||
g_mutex_lock (&xvimagesink->context->lock);
|
g_mutex_lock (&xvimagesink->context->lock);
|
||||||
|
@ -570,16 +571,16 @@ gst_xvimagesink_handle_xevents (GstXvImageSink * xvimagesink)
|
||||||
}
|
}
|
||||||
|
|
||||||
static gpointer
|
static gpointer
|
||||||
gst_xvimagesink_event_thread (GstXvImageSink * xvimagesink)
|
gst_xv_image_sink_event_thread (GstXvImageSink * xvimagesink)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (GST_IS_XVIMAGESINK (xvimagesink), NULL);
|
g_return_val_if_fail (GST_IS_XV_IMAGE_SINK (xvimagesink), NULL);
|
||||||
|
|
||||||
GST_OBJECT_LOCK (xvimagesink);
|
GST_OBJECT_LOCK (xvimagesink);
|
||||||
while (xvimagesink->running) {
|
while (xvimagesink->running) {
|
||||||
GST_OBJECT_UNLOCK (xvimagesink);
|
GST_OBJECT_UNLOCK (xvimagesink);
|
||||||
|
|
||||||
if (xvimagesink->xwindow) {
|
if (xvimagesink->xwindow) {
|
||||||
gst_xvimagesink_handle_xevents (xvimagesink);
|
gst_xv_image_sink_handle_xevents (xvimagesink);
|
||||||
}
|
}
|
||||||
/* FIXME: do we want to align this with the framerate or anything else? */
|
/* FIXME: do we want to align this with the framerate or anything else? */
|
||||||
g_usleep (G_USEC_PER_SEC / 20);
|
g_usleep (G_USEC_PER_SEC / 20);
|
||||||
|
@ -592,7 +593,7 @@ gst_xvimagesink_event_thread (GstXvImageSink * xvimagesink)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_xvimagesink_manage_event_thread (GstXvImageSink * xvimagesink)
|
gst_xv_image_sink_manage_event_thread (GstXvImageSink * xvimagesink)
|
||||||
{
|
{
|
||||||
GThread *thread = NULL;
|
GThread *thread = NULL;
|
||||||
|
|
||||||
|
@ -609,7 +610,7 @@ gst_xvimagesink_manage_event_thread (GstXvImageSink * xvimagesink)
|
||||||
xvimagesink->handle_expose, xvimagesink->handle_events);
|
xvimagesink->handle_expose, xvimagesink->handle_events);
|
||||||
xvimagesink->running = TRUE;
|
xvimagesink->running = TRUE;
|
||||||
xvimagesink->event_thread = g_thread_try_new ("xvimagesink-events",
|
xvimagesink->event_thread = g_thread_try_new ("xvimagesink-events",
|
||||||
(GThreadFunc) gst_xvimagesink_event_thread, xvimagesink, NULL);
|
(GThreadFunc) gst_xv_image_sink_event_thread, xvimagesink, NULL);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (xvimagesink->event_thread) {
|
if (xvimagesink->event_thread) {
|
||||||
|
@ -632,12 +633,12 @@ gst_xvimagesink_manage_event_thread (GstXvImageSink * xvimagesink)
|
||||||
/* Element stuff */
|
/* Element stuff */
|
||||||
|
|
||||||
static GstCaps *
|
static GstCaps *
|
||||||
gst_xvimagesink_getcaps (GstBaseSink * bsink, GstCaps * filter)
|
gst_xv_image_sink_getcaps (GstBaseSink * bsink, GstCaps * filter)
|
||||||
{
|
{
|
||||||
GstXvImageSink *xvimagesink;
|
GstXvImageSink *xvimagesink;
|
||||||
GstCaps *caps;
|
GstCaps *caps;
|
||||||
|
|
||||||
xvimagesink = GST_XVIMAGESINK (bsink);
|
xvimagesink = GST_XV_IMAGE_SINK (bsink);
|
||||||
|
|
||||||
if (xvimagesink->context) {
|
if (xvimagesink->context) {
|
||||||
if (filter)
|
if (filter)
|
||||||
|
@ -660,7 +661,7 @@ gst_xvimagesink_getcaps (GstBaseSink * bsink, GstCaps * filter)
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstBufferPool *
|
static GstBufferPool *
|
||||||
gst_xvimagesink_create_pool (GstXvImageSink * xvimagesink, GstCaps * caps,
|
gst_xv_image_sink_create_pool (GstXvImageSink * xvimagesink, GstCaps * caps,
|
||||||
gsize size, gint min)
|
gsize size, gint min)
|
||||||
{
|
{
|
||||||
GstBufferPool *pool;
|
GstBufferPool *pool;
|
||||||
|
@ -685,7 +686,7 @@ config_failed:
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_xvimagesink_setcaps (GstBaseSink * bsink, GstCaps * caps)
|
gst_xv_image_sink_setcaps (GstBaseSink * bsink, GstCaps * caps)
|
||||||
{
|
{
|
||||||
GstXvImageSink *xvimagesink;
|
GstXvImageSink *xvimagesink;
|
||||||
GstXvContext *context;
|
GstXvContext *context;
|
||||||
|
@ -696,7 +697,7 @@ gst_xvimagesink_setcaps (GstBaseSink * bsink, GstCaps * caps)
|
||||||
gint display_par_n, display_par_d; /* display's PAR */
|
gint display_par_n, display_par_d; /* display's PAR */
|
||||||
guint num, den;
|
guint num, den;
|
||||||
|
|
||||||
xvimagesink = GST_XVIMAGESINK (bsink);
|
xvimagesink = GST_XV_IMAGE_SINK (bsink);
|
||||||
context = xvimagesink->context;
|
context = xvimagesink->context;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (xvimagesink,
|
GST_DEBUG_OBJECT (xvimagesink,
|
||||||
|
@ -787,7 +788,7 @@ gst_xvimagesink_setcaps (GstBaseSink * bsink, GstCaps * caps)
|
||||||
|
|
||||||
g_mutex_lock (&xvimagesink->flow_lock);
|
g_mutex_lock (&xvimagesink->flow_lock);
|
||||||
if (!xvimagesink->xwindow) {
|
if (!xvimagesink->xwindow) {
|
||||||
xvimagesink->xwindow = gst_xvimagesink_xwindow_new (xvimagesink,
|
xvimagesink->xwindow = gst_xv_image_sink_xwindow_new (xvimagesink,
|
||||||
GST_VIDEO_SINK_WIDTH (xvimagesink),
|
GST_VIDEO_SINK_WIDTH (xvimagesink),
|
||||||
GST_VIDEO_SINK_HEIGHT (xvimagesink));
|
GST_VIDEO_SINK_HEIGHT (xvimagesink));
|
||||||
}
|
}
|
||||||
|
@ -799,7 +800,7 @@ gst_xvimagesink_setcaps (GstBaseSink * bsink, GstCaps * caps)
|
||||||
xvimagesink->redraw_border = TRUE;
|
xvimagesink->redraw_border = TRUE;
|
||||||
|
|
||||||
/* create a new pool for the new configuration */
|
/* create a new pool for the new configuration */
|
||||||
newpool = gst_xvimagesink_create_pool (xvimagesink, caps, info.size, 2);
|
newpool = gst_xv_image_sink_create_pool (xvimagesink, caps, info.size, 2);
|
||||||
|
|
||||||
/* we don't activate the internal pool yet as it may not be needed */
|
/* we don't activate the internal pool yet as it may not be needed */
|
||||||
oldpool = xvimagesink->pool;
|
oldpool = xvimagesink->pool;
|
||||||
|
@ -841,16 +842,16 @@ no_display_size:
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstStateChangeReturn
|
static GstStateChangeReturn
|
||||||
gst_xvimagesink_change_state (GstElement * element, GstStateChange transition)
|
gst_xv_image_sink_change_state (GstElement * element, GstStateChange transition)
|
||||||
{
|
{
|
||||||
GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS;
|
GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS;
|
||||||
GstXvImageSink *xvimagesink;
|
GstXvImageSink *xvimagesink;
|
||||||
|
|
||||||
xvimagesink = GST_XVIMAGESINK (element);
|
xvimagesink = GST_XV_IMAGE_SINK (element);
|
||||||
|
|
||||||
switch (transition) {
|
switch (transition) {
|
||||||
case GST_STATE_CHANGE_NULL_TO_READY:
|
case GST_STATE_CHANGE_NULL_TO_READY:
|
||||||
if (!gst_xvimagesink_open (xvimagesink))
|
if (!gst_xv_image_sink_open (xvimagesink))
|
||||||
goto error;
|
goto error;
|
||||||
break;
|
break;
|
||||||
case GST_STATE_CHANGE_READY_TO_PAUSED:
|
case GST_STATE_CHANGE_READY_TO_PAUSED:
|
||||||
|
@ -879,7 +880,7 @@ gst_xvimagesink_change_state (GstElement * element, GstStateChange transition)
|
||||||
g_mutex_unlock (&xvimagesink->flow_lock);
|
g_mutex_unlock (&xvimagesink->flow_lock);
|
||||||
break;
|
break;
|
||||||
case GST_STATE_CHANGE_READY_TO_NULL:
|
case GST_STATE_CHANGE_READY_TO_NULL:
|
||||||
gst_xvimagesink_close (xvimagesink);
|
gst_xv_image_sink_close (xvimagesink);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -893,12 +894,12 @@ error:
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_xvimagesink_get_times (GstBaseSink * bsink, GstBuffer * buf,
|
gst_xv_image_sink_get_times (GstBaseSink * bsink, GstBuffer * buf,
|
||||||
GstClockTime * start, GstClockTime * end)
|
GstClockTime * start, GstClockTime * end)
|
||||||
{
|
{
|
||||||
GstXvImageSink *xvimagesink;
|
GstXvImageSink *xvimagesink;
|
||||||
|
|
||||||
xvimagesink = GST_XVIMAGESINK (bsink);
|
xvimagesink = GST_XV_IMAGE_SINK (bsink);
|
||||||
|
|
||||||
if (GST_BUFFER_TIMESTAMP_IS_VALID (buf)) {
|
if (GST_BUFFER_TIMESTAMP_IS_VALID (buf)) {
|
||||||
*start = GST_BUFFER_TIMESTAMP (buf);
|
*start = GST_BUFFER_TIMESTAMP (buf);
|
||||||
|
@ -915,14 +916,14 @@ gst_xvimagesink_get_times (GstBaseSink * bsink, GstBuffer * buf,
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstFlowReturn
|
static GstFlowReturn
|
||||||
gst_xvimagesink_show_frame (GstVideoSink * vsink, GstBuffer * buf)
|
gst_xv_image_sink_show_frame (GstVideoSink * vsink, GstBuffer * buf)
|
||||||
{
|
{
|
||||||
GstFlowReturn res;
|
GstFlowReturn res;
|
||||||
GstXvImageSink *xvimagesink;
|
GstXvImageSink *xvimagesink;
|
||||||
GstBuffer *to_put = NULL;
|
GstBuffer *to_put = NULL;
|
||||||
GstMemory *mem;
|
GstMemory *mem;
|
||||||
|
|
||||||
xvimagesink = GST_XVIMAGESINK (vsink);
|
xvimagesink = GST_XV_IMAGE_SINK (vsink);
|
||||||
|
|
||||||
if (gst_buffer_n_memory (buf) == 1 && (mem = gst_buffer_peek_memory (buf, 0))
|
if (gst_buffer_n_memory (buf) == 1 && (mem = gst_buffer_peek_memory (buf, 0))
|
||||||
&& gst_xvimage_memory_is_from_context (mem, xvimagesink->context)) {
|
&& gst_xvimage_memory_is_from_context (mem, xvimagesink->context)) {
|
||||||
|
@ -972,7 +973,7 @@ gst_xvimagesink_show_frame (GstVideoSink * vsink, GstBuffer * buf)
|
||||||
gst_video_frame_unmap (&src);
|
gst_video_frame_unmap (&src);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!gst_xvimagesink_xvimage_put (xvimagesink, to_put))
|
if (!gst_xv_image_sink_xvimage_put (xvimagesink, to_put))
|
||||||
goto no_window;
|
goto no_window;
|
||||||
|
|
||||||
done:
|
done:
|
||||||
|
@ -1018,9 +1019,9 @@ activate_failed:
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_xvimagesink_event (GstBaseSink * sink, GstEvent * event)
|
gst_xv_image_sink_event (GstBaseSink * sink, GstEvent * event)
|
||||||
{
|
{
|
||||||
GstXvImageSink *xvimagesink = GST_XVIMAGESINK (sink);
|
GstXvImageSink *xvimagesink = GST_XV_IMAGE_SINK (sink);
|
||||||
|
|
||||||
switch (GST_EVENT_TYPE (event)) {
|
switch (GST_EVENT_TYPE (event)) {
|
||||||
case GST_EVENT_TAG:{
|
case GST_EVENT_TAG:{
|
||||||
|
@ -1032,7 +1033,7 @@ gst_xvimagesink_event (GstBaseSink * sink, GstEvent * event)
|
||||||
|
|
||||||
if (title) {
|
if (title) {
|
||||||
GST_DEBUG_OBJECT (xvimagesink, "got tags, title='%s'", title);
|
GST_DEBUG_OBJECT (xvimagesink, "got tags, title='%s'", title);
|
||||||
gst_xvimagesink_xwindow_set_title (xvimagesink, xvimagesink->xwindow,
|
gst_xv_image_sink_xwindow_set_title (xvimagesink, xvimagesink->xwindow,
|
||||||
title);
|
title);
|
||||||
|
|
||||||
g_free (title);
|
g_free (title);
|
||||||
|
@ -1046,9 +1047,9 @@ gst_xvimagesink_event (GstBaseSink * sink, GstEvent * event)
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_xvimagesink_propose_allocation (GstBaseSink * bsink, GstQuery * query)
|
gst_xv_image_sink_propose_allocation (GstBaseSink * bsink, GstQuery * query)
|
||||||
{
|
{
|
||||||
GstXvImageSink *xvimagesink = GST_XVIMAGESINK (bsink);
|
GstXvImageSink *xvimagesink = GST_XV_IMAGE_SINK (bsink);
|
||||||
GstBufferPool *pool = NULL;
|
GstBufferPool *pool = NULL;
|
||||||
GstCaps *caps;
|
GstCaps *caps;
|
||||||
guint size;
|
guint size;
|
||||||
|
@ -1066,7 +1067,7 @@ gst_xvimagesink_propose_allocation (GstBaseSink * bsink, GstQuery * query)
|
||||||
goto invalid_caps;
|
goto invalid_caps;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (xvimagesink, "create new pool");
|
GST_DEBUG_OBJECT (xvimagesink, "create new pool");
|
||||||
pool = gst_xvimagesink_create_pool (xvimagesink, caps, info.size, 0);
|
pool = gst_xv_image_sink_create_pool (xvimagesink, caps, info.size, 0);
|
||||||
|
|
||||||
/* the normal size of a frame */
|
/* the normal size of a frame */
|
||||||
size = info.size;
|
size = info.size;
|
||||||
|
@ -1107,10 +1108,10 @@ no_pool:
|
||||||
|
|
||||||
/* Interfaces stuff */
|
/* Interfaces stuff */
|
||||||
static void
|
static void
|
||||||
gst_xvimagesink_navigation_send_event (GstNavigation * navigation,
|
gst_xv_image_sink_navigation_send_event (GstNavigation * navigation,
|
||||||
GstStructure * structure)
|
GstStructure * structure)
|
||||||
{
|
{
|
||||||
GstXvImageSink *xvimagesink = GST_XVIMAGESINK (navigation);
|
GstXvImageSink *xvimagesink = GST_XV_IMAGE_SINK (navigation);
|
||||||
GstPad *peer;
|
GstPad *peer;
|
||||||
gboolean handled = FALSE;
|
gboolean handled = FALSE;
|
||||||
GstEvent *event = NULL;
|
GstEvent *event = NULL;
|
||||||
|
@ -1182,20 +1183,20 @@ gst_xvimagesink_navigation_send_event (GstNavigation * navigation,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_xvimagesink_navigation_init (GstNavigationInterface * iface)
|
gst_xv_image_sink_navigation_init (GstNavigationInterface * iface)
|
||||||
{
|
{
|
||||||
iface->send_event = gst_xvimagesink_navigation_send_event;
|
iface->send_event = gst_xv_image_sink_navigation_send_event;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_xvimagesink_set_window_handle (GstVideoOverlay * overlay, guintptr id)
|
gst_xv_image_sink_set_window_handle (GstVideoOverlay * overlay, guintptr id)
|
||||||
{
|
{
|
||||||
XID xwindow_id = id;
|
XID xwindow_id = id;
|
||||||
GstXvImageSink *xvimagesink = GST_XVIMAGESINK (overlay);
|
GstXvImageSink *xvimagesink = GST_XV_IMAGE_SINK (overlay);
|
||||||
GstXWindow *xwindow = NULL;
|
GstXWindow *xwindow = NULL;
|
||||||
GstXvContext *context;
|
GstXvContext *context;
|
||||||
|
|
||||||
g_return_if_fail (GST_IS_XVIMAGESINK (xvimagesink));
|
g_return_if_fail (GST_IS_XV_IMAGE_SINK (xvimagesink));
|
||||||
|
|
||||||
g_mutex_lock (&xvimagesink->flow_lock);
|
g_mutex_lock (&xvimagesink->flow_lock);
|
||||||
|
|
||||||
|
@ -1216,7 +1217,7 @@ gst_xvimagesink_set_window_handle (GstVideoOverlay * overlay, guintptr id)
|
||||||
|
|
||||||
context = xvimagesink->context;
|
context = xvimagesink->context;
|
||||||
|
|
||||||
gst_xvimagesink_update_colorbalance (xvimagesink);
|
gst_xv_image_sink_update_colorbalance (xvimagesink);
|
||||||
|
|
||||||
/* If a window is there already we destroy it */
|
/* If a window is there already we destroy it */
|
||||||
if (xvimagesink->xwindow) {
|
if (xvimagesink->xwindow) {
|
||||||
|
@ -1231,7 +1232,7 @@ gst_xvimagesink_set_window_handle (GstVideoOverlay * overlay, guintptr id)
|
||||||
if (GST_VIDEO_SINK_WIDTH (xvimagesink)
|
if (GST_VIDEO_SINK_WIDTH (xvimagesink)
|
||||||
&& GST_VIDEO_SINK_HEIGHT (xvimagesink)) {
|
&& GST_VIDEO_SINK_HEIGHT (xvimagesink)) {
|
||||||
xwindow =
|
xwindow =
|
||||||
gst_xvimagesink_xwindow_new (xvimagesink,
|
gst_xv_image_sink_xwindow_new (xvimagesink,
|
||||||
GST_VIDEO_SINK_WIDTH (xvimagesink),
|
GST_VIDEO_SINK_WIDTH (xvimagesink),
|
||||||
GST_VIDEO_SINK_HEIGHT (xvimagesink));
|
GST_VIDEO_SINK_HEIGHT (xvimagesink));
|
||||||
}
|
}
|
||||||
|
@ -1247,20 +1248,20 @@ gst_xvimagesink_set_window_handle (GstVideoOverlay * overlay, guintptr id)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_xvimagesink_expose (GstVideoOverlay * overlay)
|
gst_xv_image_sink_expose (GstVideoOverlay * overlay)
|
||||||
{
|
{
|
||||||
GstXvImageSink *xvimagesink = GST_XVIMAGESINK (overlay);
|
GstXvImageSink *xvimagesink = GST_XV_IMAGE_SINK (overlay);
|
||||||
|
|
||||||
GST_DEBUG ("doing expose");
|
GST_DEBUG ("doing expose");
|
||||||
gst_xvimagesink_xwindow_update_geometry (xvimagesink);
|
gst_xv_image_sink_xwindow_update_geometry (xvimagesink);
|
||||||
gst_xvimagesink_xvimage_put (xvimagesink, NULL);
|
gst_xv_image_sink_xvimage_put (xvimagesink, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_xvimagesink_set_event_handling (GstVideoOverlay * overlay,
|
gst_xv_image_sink_set_event_handling (GstVideoOverlay * overlay,
|
||||||
gboolean handle_events)
|
gboolean handle_events)
|
||||||
{
|
{
|
||||||
GstXvImageSink *xvimagesink = GST_XVIMAGESINK (overlay);
|
GstXvImageSink *xvimagesink = GST_XV_IMAGE_SINK (overlay);
|
||||||
|
|
||||||
g_mutex_lock (&xvimagesink->flow_lock);
|
g_mutex_lock (&xvimagesink->flow_lock);
|
||||||
xvimagesink->handle_events = handle_events;
|
xvimagesink->handle_events = handle_events;
|
||||||
|
@ -1270,10 +1271,10 @@ gst_xvimagesink_set_event_handling (GstVideoOverlay * overlay,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_xvimagesink_set_render_rectangle (GstVideoOverlay * overlay, gint x, gint y,
|
gst_xv_image_sink_set_render_rectangle (GstVideoOverlay * overlay, gint x,
|
||||||
gint width, gint height)
|
gint y, gint width, gint height)
|
||||||
{
|
{
|
||||||
GstXvImageSink *xvimagesink = GST_XVIMAGESINK (overlay);
|
GstXvImageSink *xvimagesink = GST_XV_IMAGE_SINK (overlay);
|
||||||
|
|
||||||
g_mutex_lock (&xvimagesink->flow_lock);
|
g_mutex_lock (&xvimagesink->flow_lock);
|
||||||
if (G_LIKELY (xvimagesink->xwindow))
|
if (G_LIKELY (xvimagesink->xwindow))
|
||||||
|
@ -1283,20 +1284,20 @@ gst_xvimagesink_set_render_rectangle (GstVideoOverlay * overlay, gint x, gint y,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_xvimagesink_video_overlay_init (GstVideoOverlayInterface * iface)
|
gst_xv_image_sink_video_overlay_init (GstVideoOverlayInterface * iface)
|
||||||
{
|
{
|
||||||
iface->set_window_handle = gst_xvimagesink_set_window_handle;
|
iface->set_window_handle = gst_xv_image_sink_set_window_handle;
|
||||||
iface->expose = gst_xvimagesink_expose;
|
iface->expose = gst_xv_image_sink_expose;
|
||||||
iface->handle_events = gst_xvimagesink_set_event_handling;
|
iface->handle_events = gst_xv_image_sink_set_event_handling;
|
||||||
iface->set_render_rectangle = gst_xvimagesink_set_render_rectangle;
|
iface->set_render_rectangle = gst_xv_image_sink_set_render_rectangle;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const GList *
|
static const GList *
|
||||||
gst_xvimagesink_colorbalance_list_channels (GstColorBalance * balance)
|
gst_xv_image_sink_colorbalance_list_channels (GstColorBalance * balance)
|
||||||
{
|
{
|
||||||
GstXvImageSink *xvimagesink = GST_XVIMAGESINK (balance);
|
GstXvImageSink *xvimagesink = GST_XV_IMAGE_SINK (balance);
|
||||||
|
|
||||||
g_return_val_if_fail (GST_IS_XVIMAGESINK (xvimagesink), NULL);
|
g_return_val_if_fail (GST_IS_XV_IMAGE_SINK (xvimagesink), NULL);
|
||||||
|
|
||||||
if (xvimagesink->context)
|
if (xvimagesink->context)
|
||||||
return xvimagesink->context->channels_list;
|
return xvimagesink->context->channels_list;
|
||||||
|
@ -1305,12 +1306,12 @@ gst_xvimagesink_colorbalance_list_channels (GstColorBalance * balance)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_xvimagesink_colorbalance_set_value (GstColorBalance * balance,
|
gst_xv_image_sink_colorbalance_set_value (GstColorBalance * balance,
|
||||||
GstColorBalanceChannel * channel, gint value)
|
GstColorBalanceChannel * channel, gint value)
|
||||||
{
|
{
|
||||||
GstXvImageSink *xvimagesink = GST_XVIMAGESINK (balance);
|
GstXvImageSink *xvimagesink = GST_XV_IMAGE_SINK (balance);
|
||||||
|
|
||||||
g_return_if_fail (GST_IS_XVIMAGESINK (xvimagesink));
|
g_return_if_fail (GST_IS_XV_IMAGE_SINK (xvimagesink));
|
||||||
g_return_if_fail (channel->label != NULL);
|
g_return_if_fail (channel->label != NULL);
|
||||||
|
|
||||||
xvimagesink->config.cb_changed = TRUE;
|
xvimagesink->config.cb_changed = TRUE;
|
||||||
|
@ -1332,17 +1333,17 @@ gst_xvimagesink_colorbalance_set_value (GstColorBalance * balance,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
gst_xvimagesink_update_colorbalance (xvimagesink);
|
gst_xv_image_sink_update_colorbalance (xvimagesink);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gint
|
static gint
|
||||||
gst_xvimagesink_colorbalance_get_value (GstColorBalance * balance,
|
gst_xv_image_sink_colorbalance_get_value (GstColorBalance * balance,
|
||||||
GstColorBalanceChannel * channel)
|
GstColorBalanceChannel * channel)
|
||||||
{
|
{
|
||||||
GstXvImageSink *xvimagesink = GST_XVIMAGESINK (balance);
|
GstXvImageSink *xvimagesink = GST_XV_IMAGE_SINK (balance);
|
||||||
gint value = 0;
|
gint value = 0;
|
||||||
|
|
||||||
g_return_val_if_fail (GST_IS_XVIMAGESINK (xvimagesink), 0);
|
g_return_val_if_fail (GST_IS_XV_IMAGE_SINK (xvimagesink), 0);
|
||||||
g_return_val_if_fail (channel->label != NULL, 0);
|
g_return_val_if_fail (channel->label != NULL, 0);
|
||||||
|
|
||||||
if (g_ascii_strcasecmp (channel->label, "XV_HUE") == 0) {
|
if (g_ascii_strcasecmp (channel->label, "XV_HUE") == 0) {
|
||||||
|
@ -1365,23 +1366,23 @@ gst_xvimagesink_colorbalance_get_value (GstColorBalance * balance,
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstColorBalanceType
|
static GstColorBalanceType
|
||||||
gst_xvimagesink_colorbalance_get_balance_type (GstColorBalance * balance)
|
gst_xv_image_sink_colorbalance_get_balance_type (GstColorBalance * balance)
|
||||||
{
|
{
|
||||||
return GST_COLOR_BALANCE_HARDWARE;
|
return GST_COLOR_BALANCE_HARDWARE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_xvimagesink_colorbalance_init (GstColorBalanceInterface * iface)
|
gst_xv_image_sink_colorbalance_init (GstColorBalanceInterface * iface)
|
||||||
{
|
{
|
||||||
iface->list_channels = gst_xvimagesink_colorbalance_list_channels;
|
iface->list_channels = gst_xv_image_sink_colorbalance_list_channels;
|
||||||
iface->set_value = gst_xvimagesink_colorbalance_set_value;
|
iface->set_value = gst_xv_image_sink_colorbalance_set_value;
|
||||||
iface->get_value = gst_xvimagesink_colorbalance_get_value;
|
iface->get_value = gst_xv_image_sink_colorbalance_get_value;
|
||||||
iface->get_balance_type = gst_xvimagesink_colorbalance_get_balance_type;
|
iface->get_balance_type = gst_xv_image_sink_colorbalance_get_balance_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
static const GList *
|
static const GList *
|
||||||
gst_xvimagesink_probe_get_properties (GstPropertyProbe * probe)
|
gst_xv_image_sink_probe_get_properties (GstPropertyProbe * probe)
|
||||||
{
|
{
|
||||||
GObjectClass *klass = G_OBJECT_GET_CLASS (probe);
|
GObjectClass *klass = G_OBJECT_GET_CLASS (probe);
|
||||||
static GList *list = NULL;
|
static GList *list = NULL;
|
||||||
|
@ -1402,10 +1403,10 @@ gst_xvimagesink_probe_get_properties (GstPropertyProbe * probe)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_xvimagesink_probe_probe_property (GstPropertyProbe * probe,
|
gst_xv_image_sink_probe_probe_property (GstPropertyProbe * probe,
|
||||||
guint prop_id, const GParamSpec * pspec)
|
guint prop_id, const GParamSpec * pspec)
|
||||||
{
|
{
|
||||||
GstXvImageSink *xvimagesink = GST_XVIMAGESINK (probe);
|
GstXvImageSink *xvimagesink = GST_XV_IMAGE_SINK (probe);
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
case PROP_DEVICE:
|
case PROP_DEVICE:
|
||||||
|
@ -1416,7 +1417,7 @@ gst_xvimagesink_probe_probe_property (GstPropertyProbe * probe,
|
||||||
"probing device list and get capabilities");
|
"probing device list and get capabilities");
|
||||||
if (!xvimagesink->context) {
|
if (!xvimagesink->context) {
|
||||||
GST_DEBUG_OBJECT (xvimagesink, "generating context");
|
GST_DEBUG_OBJECT (xvimagesink, "generating context");
|
||||||
xvimagesink->context = gst_xvimagesink_context_get (xvimagesink);
|
xvimagesink->context = gst_xv_image_sink_context_get (xvimagesink);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -1426,10 +1427,10 @@ gst_xvimagesink_probe_probe_property (GstPropertyProbe * probe,
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_xvimagesink_probe_needs_probe (GstPropertyProbe * probe,
|
gst_xv_image_sink_probe_needs_probe (GstPropertyProbe * probe,
|
||||||
guint prop_id, const GParamSpec * pspec)
|
guint prop_id, const GParamSpec * pspec)
|
||||||
{
|
{
|
||||||
GstXvImageSink *xvimagesink = GST_XVIMAGESINK (probe);
|
GstXvImageSink *xvimagesink = GST_XV_IMAGE_SINK (probe);
|
||||||
gboolean ret = FALSE;
|
gboolean ret = FALSE;
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
|
@ -1452,10 +1453,10 @@ gst_xvimagesink_probe_needs_probe (GstPropertyProbe * probe,
|
||||||
}
|
}
|
||||||
|
|
||||||
static GValueArray *
|
static GValueArray *
|
||||||
gst_xvimagesink_probe_get_values (GstPropertyProbe * probe,
|
gst_xv_image_sink_probe_get_values (GstPropertyProbe * probe,
|
||||||
guint prop_id, const GParamSpec * pspec)
|
guint prop_id, const GParamSpec * pspec)
|
||||||
{
|
{
|
||||||
GstXvImageSink *xvimagesink = GST_XVIMAGESINK (probe);
|
GstXvImageSink *xvimagesink = GST_XV_IMAGE_SINK (probe);
|
||||||
GValueArray *array = NULL;
|
GValueArray *array = NULL;
|
||||||
|
|
||||||
if (G_UNLIKELY (!xvimagesink->context)) {
|
if (G_UNLIKELY (!xvimagesink->context)) {
|
||||||
|
@ -1530,13 +1531,13 @@ beach:
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_xvimagesink_property_probe_interface_init (GstPropertyProbeInterface *
|
gst_xv_image_sink_property_probe_interface_init (GstPropertyProbeInterface *
|
||||||
iface)
|
iface)
|
||||||
{
|
{
|
||||||
iface->get_properties = gst_xvimagesink_probe_get_properties;
|
iface->get_properties = gst_xv_image_sink_probe_get_properties;
|
||||||
iface->probe_property = gst_xvimagesink_probe_probe_property;
|
iface->probe_property = gst_xv_image_sink_probe_probe_property;
|
||||||
iface->needs_probe = gst_xvimagesink_probe_needs_probe;
|
iface->needs_probe = gst_xv_image_sink_probe_needs_probe;
|
||||||
iface->get_values = gst_xvimagesink_probe_get_values;
|
iface->get_values = gst_xv_image_sink_probe_get_values;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1547,35 +1548,35 @@ gst_xvimagesink_property_probe_interface_init (GstPropertyProbeInterface *
|
||||||
/* =========================================== */
|
/* =========================================== */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_xvimagesink_set_property (GObject * object, guint prop_id,
|
gst_xv_image_sink_set_property (GObject * object, guint prop_id,
|
||||||
const GValue * value, GParamSpec * pspec)
|
const GValue * value, GParamSpec * pspec)
|
||||||
{
|
{
|
||||||
GstXvImageSink *xvimagesink;
|
GstXvImageSink *xvimagesink;
|
||||||
|
|
||||||
g_return_if_fail (GST_IS_XVIMAGESINK (object));
|
g_return_if_fail (GST_IS_XV_IMAGE_SINK (object));
|
||||||
|
|
||||||
xvimagesink = GST_XVIMAGESINK (object);
|
xvimagesink = GST_XV_IMAGE_SINK (object);
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
case PROP_HUE:
|
case PROP_HUE:
|
||||||
xvimagesink->config.hue = g_value_get_int (value);
|
xvimagesink->config.hue = g_value_get_int (value);
|
||||||
xvimagesink->config.cb_changed = TRUE;
|
xvimagesink->config.cb_changed = TRUE;
|
||||||
gst_xvimagesink_update_colorbalance (xvimagesink);
|
gst_xv_image_sink_update_colorbalance (xvimagesink);
|
||||||
break;
|
break;
|
||||||
case PROP_CONTRAST:
|
case PROP_CONTRAST:
|
||||||
xvimagesink->config.contrast = g_value_get_int (value);
|
xvimagesink->config.contrast = g_value_get_int (value);
|
||||||
xvimagesink->config.cb_changed = TRUE;
|
xvimagesink->config.cb_changed = TRUE;
|
||||||
gst_xvimagesink_update_colorbalance (xvimagesink);
|
gst_xv_image_sink_update_colorbalance (xvimagesink);
|
||||||
break;
|
break;
|
||||||
case PROP_BRIGHTNESS:
|
case PROP_BRIGHTNESS:
|
||||||
xvimagesink->config.brightness = g_value_get_int (value);
|
xvimagesink->config.brightness = g_value_get_int (value);
|
||||||
xvimagesink->config.cb_changed = TRUE;
|
xvimagesink->config.cb_changed = TRUE;
|
||||||
gst_xvimagesink_update_colorbalance (xvimagesink);
|
gst_xv_image_sink_update_colorbalance (xvimagesink);
|
||||||
break;
|
break;
|
||||||
case PROP_SATURATION:
|
case PROP_SATURATION:
|
||||||
xvimagesink->config.saturation = g_value_get_int (value);
|
xvimagesink->config.saturation = g_value_get_int (value);
|
||||||
xvimagesink->config.cb_changed = TRUE;
|
xvimagesink->config.cb_changed = TRUE;
|
||||||
gst_xvimagesink_update_colorbalance (xvimagesink);
|
gst_xv_image_sink_update_colorbalance (xvimagesink);
|
||||||
break;
|
break;
|
||||||
case PROP_DISPLAY:
|
case PROP_DISPLAY:
|
||||||
g_free (xvimagesink->config.display_name);
|
g_free (xvimagesink->config.display_name);
|
||||||
|
@ -1604,16 +1605,16 @@ gst_xvimagesink_set_property (GObject * object, guint prop_id,
|
||||||
xvimagesink->keep_aspect = g_value_get_boolean (value);
|
xvimagesink->keep_aspect = g_value_get_boolean (value);
|
||||||
break;
|
break;
|
||||||
case PROP_HANDLE_EVENTS:
|
case PROP_HANDLE_EVENTS:
|
||||||
gst_xvimagesink_set_event_handling (GST_VIDEO_OVERLAY (xvimagesink),
|
gst_xv_image_sink_set_event_handling (GST_VIDEO_OVERLAY (xvimagesink),
|
||||||
g_value_get_boolean (value));
|
g_value_get_boolean (value));
|
||||||
gst_xvimagesink_manage_event_thread (xvimagesink);
|
gst_xv_image_sink_manage_event_thread (xvimagesink);
|
||||||
break;
|
break;
|
||||||
case PROP_DEVICE:
|
case PROP_DEVICE:
|
||||||
xvimagesink->config.adaptor_nr = atoi (g_value_get_string (value));
|
xvimagesink->config.adaptor_nr = atoi (g_value_get_string (value));
|
||||||
break;
|
break;
|
||||||
case PROP_HANDLE_EXPOSE:
|
case PROP_HANDLE_EXPOSE:
|
||||||
xvimagesink->handle_expose = g_value_get_boolean (value);
|
xvimagesink->handle_expose = g_value_get_boolean (value);
|
||||||
gst_xvimagesink_manage_event_thread (xvimagesink);
|
gst_xv_image_sink_manage_event_thread (xvimagesink);
|
||||||
break;
|
break;
|
||||||
case PROP_DOUBLE_BUFFER:
|
case PROP_DOUBLE_BUFFER:
|
||||||
xvimagesink->double_buffer = g_value_get_boolean (value);
|
xvimagesink->double_buffer = g_value_get_boolean (value);
|
||||||
|
@ -1634,14 +1635,14 @@ gst_xvimagesink_set_property (GObject * object, guint prop_id,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_xvimagesink_get_property (GObject * object, guint prop_id,
|
gst_xv_image_sink_get_property (GObject * object, guint prop_id,
|
||||||
GValue * value, GParamSpec * pspec)
|
GValue * value, GParamSpec * pspec)
|
||||||
{
|
{
|
||||||
GstXvImageSink *xvimagesink;
|
GstXvImageSink *xvimagesink;
|
||||||
|
|
||||||
g_return_if_fail (GST_IS_XVIMAGESINK (object));
|
g_return_if_fail (GST_IS_XV_IMAGE_SINK (object));
|
||||||
|
|
||||||
xvimagesink = GST_XVIMAGESINK (object);
|
xvimagesink = GST_XV_IMAGE_SINK (object);
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
case PROP_HUE:
|
case PROP_HUE:
|
||||||
|
@ -1723,7 +1724,7 @@ gst_xvimagesink_get_property (GObject * object, guint prop_id,
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_xvimagesink_open (GstXvImageSink * xvimagesink)
|
gst_xv_image_sink_open (GstXvImageSink * xvimagesink)
|
||||||
{
|
{
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
|
@ -1750,8 +1751,8 @@ gst_xvimagesink_open (GstXvImageSink * xvimagesink)
|
||||||
/* call XSynchronize with the current value of synchronous */
|
/* call XSynchronize with the current value of synchronous */
|
||||||
gst_xvcontext_set_synchronous (xvimagesink->context,
|
gst_xvcontext_set_synchronous (xvimagesink->context,
|
||||||
xvimagesink->synchronous);
|
xvimagesink->synchronous);
|
||||||
gst_xvimagesink_update_colorbalance (xvimagesink);
|
gst_xv_image_sink_update_colorbalance (xvimagesink);
|
||||||
gst_xvimagesink_manage_event_thread (xvimagesink);
|
gst_xv_image_sink_manage_event_thread (xvimagesink);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
|
@ -1765,7 +1766,7 @@ no_context:
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_xvimagesink_close (GstXvImageSink * xvimagesink)
|
gst_xv_image_sink_close (GstXvImageSink * xvimagesink)
|
||||||
{
|
{
|
||||||
GThread *thread;
|
GThread *thread;
|
||||||
GstXvContext *context;
|
GstXvContext *context;
|
||||||
|
@ -1819,13 +1820,13 @@ gst_xvimagesink_close (GstXvImageSink * xvimagesink)
|
||||||
* We use mutexes and don't reset stuff to NULL here so let's register
|
* We use mutexes and don't reset stuff to NULL here so let's register
|
||||||
* as a finalize. */
|
* as a finalize. */
|
||||||
static void
|
static void
|
||||||
gst_xvimagesink_finalize (GObject * object)
|
gst_xv_image_sink_finalize (GObject * object)
|
||||||
{
|
{
|
||||||
GstXvImageSink *xvimagesink;
|
GstXvImageSink *xvimagesink;
|
||||||
|
|
||||||
xvimagesink = GST_XVIMAGESINK (object);
|
xvimagesink = GST_XV_IMAGE_SINK (object);
|
||||||
|
|
||||||
gst_xvimagesink_close (xvimagesink);
|
gst_xv_image_sink_close (xvimagesink);
|
||||||
|
|
||||||
gst_xvcontext_config_clear (&xvimagesink->config);
|
gst_xvcontext_config_clear (&xvimagesink->config);
|
||||||
|
|
||||||
|
@ -1840,7 +1841,7 @@ gst_xvimagesink_finalize (GObject * object)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_xvimagesink_init (GstXvImageSink * xvimagesink)
|
gst_xv_image_sink_init (GstXvImageSink * xvimagesink)
|
||||||
{
|
{
|
||||||
xvimagesink->config.display_name = NULL;
|
xvimagesink->config.display_name = NULL;
|
||||||
xvimagesink->config.adaptor_nr = 0;
|
xvimagesink->config.adaptor_nr = 0;
|
||||||
|
@ -1878,7 +1879,7 @@ gst_xvimagesink_init (GstXvImageSink * xvimagesink)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_xvimagesink_class_init (GstXvImageSinkClass * klass)
|
gst_xv_image_sink_class_init (GstXvImageSinkClass * klass)
|
||||||
{
|
{
|
||||||
GObjectClass *gobject_class;
|
GObjectClass *gobject_class;
|
||||||
GstElementClass *gstelement_class;
|
GstElementClass *gstelement_class;
|
||||||
|
@ -1892,8 +1893,8 @@ gst_xvimagesink_class_init (GstXvImageSinkClass * klass)
|
||||||
|
|
||||||
parent_class = g_type_class_peek_parent (klass);
|
parent_class = g_type_class_peek_parent (klass);
|
||||||
|
|
||||||
gobject_class->set_property = gst_xvimagesink_set_property;
|
gobject_class->set_property = gst_xv_image_sink_set_property;
|
||||||
gobject_class->get_property = gst_xvimagesink_get_property;
|
gobject_class->get_property = gst_xv_image_sink_get_property;
|
||||||
|
|
||||||
g_object_class_install_property (gobject_class, PROP_CONTRAST,
|
g_object_class_install_property (gobject_class, PROP_CONTRAST,
|
||||||
g_param_spec_int ("contrast", "Contrast", "The contrast of the video",
|
g_param_spec_int ("contrast", "Contrast", "The contrast of the video",
|
||||||
|
@ -2008,24 +2009,26 @@ gst_xvimagesink_class_init (GstXvImageSinkClass * klass)
|
||||||
"Height of the window", 0, G_MAXUINT64, 0,
|
"Height of the window", 0, G_MAXUINT64, 0,
|
||||||
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
|
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
gobject_class->finalize = gst_xvimagesink_finalize;
|
gobject_class->finalize = gst_xv_image_sink_finalize;
|
||||||
|
|
||||||
gst_element_class_set_static_metadata (gstelement_class,
|
gst_element_class_set_static_metadata (gstelement_class,
|
||||||
"Video sink", "Sink/Video",
|
"Video sink", "Sink/Video",
|
||||||
"A Xv based videosink", "Julien Moutte <julien@moutte.net>");
|
"A Xv based videosink", "Julien Moutte <julien@moutte.net>");
|
||||||
|
|
||||||
gst_element_class_add_pad_template (gstelement_class,
|
gst_element_class_add_pad_template (gstelement_class,
|
||||||
gst_static_pad_template_get (&gst_xvimagesink_sink_template_factory));
|
gst_static_pad_template_get (&gst_xv_image_sink_sink_template_factory));
|
||||||
|
|
||||||
gstelement_class->change_state =
|
gstelement_class->change_state =
|
||||||
GST_DEBUG_FUNCPTR (gst_xvimagesink_change_state);
|
GST_DEBUG_FUNCPTR (gst_xv_image_sink_change_state);
|
||||||
|
|
||||||
gstbasesink_class->get_caps = GST_DEBUG_FUNCPTR (gst_xvimagesink_getcaps);
|
gstbasesink_class->get_caps = GST_DEBUG_FUNCPTR (gst_xv_image_sink_getcaps);
|
||||||
gstbasesink_class->set_caps = GST_DEBUG_FUNCPTR (gst_xvimagesink_setcaps);
|
gstbasesink_class->set_caps = GST_DEBUG_FUNCPTR (gst_xv_image_sink_setcaps);
|
||||||
gstbasesink_class->get_times = GST_DEBUG_FUNCPTR (gst_xvimagesink_get_times);
|
gstbasesink_class->get_times =
|
||||||
|
GST_DEBUG_FUNCPTR (gst_xv_image_sink_get_times);
|
||||||
gstbasesink_class->propose_allocation =
|
gstbasesink_class->propose_allocation =
|
||||||
GST_DEBUG_FUNCPTR (gst_xvimagesink_propose_allocation);
|
GST_DEBUG_FUNCPTR (gst_xv_image_sink_propose_allocation);
|
||||||
gstbasesink_class->event = GST_DEBUG_FUNCPTR (gst_xvimagesink_event);
|
gstbasesink_class->event = GST_DEBUG_FUNCPTR (gst_xv_image_sink_event);
|
||||||
|
|
||||||
videosink_class->show_frame = GST_DEBUG_FUNCPTR (gst_xvimagesink_show_frame);
|
videosink_class->show_frame =
|
||||||
|
GST_DEBUG_FUNCPTR (gst_xv_image_sink_show_frame);
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,8 +17,8 @@
|
||||||
* Boston, MA 02110-1301, USA.
|
* Boston, MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __GST_XVIMAGESINK_H__
|
#ifndef __GST_XV_IMAGE_SINK_H__
|
||||||
#define __GST_XVIMAGESINK_H__
|
#define __GST_XV_IMAGE_SINK_H__
|
||||||
|
|
||||||
#include <gst/video/gstvideosink.h>
|
#include <gst/video/gstvideosink.h>
|
||||||
|
|
||||||
|
@ -26,16 +26,16 @@
|
||||||
#include <gst/video/video.h>
|
#include <gst/video/video.h>
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
#define GST_TYPE_XVIMAGESINK \
|
#define GST_TYPE_XV_IMAGE_SINK \
|
||||||
(gst_xvimagesink_get_type())
|
(gst_xv_image_sink_get_type())
|
||||||
#define GST_XVIMAGESINK(obj) \
|
#define GST_XV_IMAGE_SINK(obj) \
|
||||||
(G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_XVIMAGESINK, GstXvImageSink))
|
(G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_XV_IMAGE_SINK, GstXvImageSink))
|
||||||
#define GST_XVIMAGESINK_CLASS(klass) \
|
#define GST_XV_IMAGE_SINK_CLASS(klass) \
|
||||||
(G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_XVIMAGESINK, GstXvImageSinkClass))
|
(G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_XV_IMAGE_SINK, GstXvImageSinkClass))
|
||||||
#define GST_IS_XVIMAGESINK(obj) \
|
#define GST_IS_XV_IMAGE_SINK(obj) \
|
||||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_XVIMAGESINK))
|
(G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_XV_IMAGE_SINK))
|
||||||
#define GST_IS_XVIMAGESINK_CLASS(klass) \
|
#define GST_IS_XV_IMAGE_SINK_CLASS(klass) \
|
||||||
(G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_XVIMAGESINK))
|
(G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_XV_IMAGE_SINK))
|
||||||
|
|
||||||
typedef struct _GstXvImageSink GstXvImageSink;
|
typedef struct _GstXvImageSink GstXvImageSink;
|
||||||
typedef struct _GstXvImageSinkClass GstXvImageSinkClass;
|
typedef struct _GstXvImageSinkClass GstXvImageSinkClass;
|
||||||
|
@ -127,7 +127,7 @@ struct _GstXvImageSinkClass
|
||||||
GstVideoSinkClass parent_class;
|
GstVideoSinkClass parent_class;
|
||||||
};
|
};
|
||||||
|
|
||||||
GType gst_xvimagesink_get_type (void);
|
GType gst_xv_image_sink_get_type (void);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
#endif /* __GST_XVIMAGESINK_H__ */
|
#endif /* __GST_XV_IMAGE_SINK_H__ */
|
||||||
|
|
Loading…
Reference in a new issue