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:
Stefan Sauer 2015-07-03 21:48:52 +02:00
parent fb68b71165
commit 923d72d399
11 changed files with 326 additions and 319 deletions

View file

@ -941,17 +941,17 @@ gst_vorbis_tag_get_type
GstXImageSink
<SUBSECTION Standard>
GstXImageSinkClass
GST_XIMAGESINK
GST_IS_XIMAGESINK
GST_XIMAGESINK_CLASS
GST_IS_XIMAGESINK_CLASS
GST_TYPE_XIMAGESINK
GST_X_IMAGE_SINK
GST_IS_X_IMAGE_SINK
GST_X_IMAGE_SINK_CLASS
GST_IS_X_IMAGE_SINK_CLASS
GST_TYPE_X_IMAGE_SINK
GstXImageBuffer
GstXImageBufferClass
GstXContext
GstXWindow
<SUBSECTION Private>
gst_ximage_sink_get_type
gst_x_image_sink_get_type
</SECTION>
<SECTION>
@ -960,14 +960,14 @@ gst_ximage_sink_get_type
GstXvImageSink
<SUBSECTION Standard>
GstXvImageSinkClass
GST_XVIMAGESINK
GST_IS_XVIMAGESINK
GST_XVIMAGESINK_CLASS
GST_IS_XVIMAGESINK_CLASS
GST_TYPE_XVIMAGESINK
GST_XV_IMAGE_SINK
GST_IS_XV_IMAGE_SINK
GST_XV_IMAGE_SINK_CLASS
GST_IS_XV_IMAGE_SINK_CLASS
GST_TYPE_XV_IMAGE_SINK
GstXvImageBuffer
GstXvImageBufferClass
GstXvImageFormat
<SUBSECTION Private>
gst_xvimage_sink_get_type
gst_xv_image_sink_get_type
</SECTION>

View file

@ -23,20 +23,20 @@
#include "ximagesink.h"
GST_DEBUG_CATEGORY (gst_debug_ximagepool);
GST_DEBUG_CATEGORY (gst_debug_ximagesink);
GST_DEBUG_CATEGORY (gst_debug_x_image_pool);
GST_DEBUG_CATEGORY (gst_debug_x_image_sink);
GST_DEBUG_CATEGORY_STATIC (GST_CAT_PERFORMANCE);
static gboolean
plugin_init (GstPlugin * plugin)
{
if (!gst_element_register (plugin, "ximagesink",
GST_RANK_SECONDARY, GST_TYPE_XIMAGESINK))
GST_RANK_SECONDARY, GST_TYPE_X_IMAGE_SINK))
return FALSE;
GST_DEBUG_CATEGORY_INIT (gst_debug_ximagesink, "ximagesink", 0,
GST_DEBUG_CATEGORY_INIT (gst_debug_x_image_sink, "ximagesink", 0,
"ximagesink element");
GST_DEBUG_CATEGORY_INIT (gst_debug_ximagepool, "ximagepool", 0,
GST_DEBUG_CATEGORY_INIT (gst_debug_x_image_pool, "ximagepool", 0,
"ximagepool object");
GST_DEBUG_CATEGORY_GET (GST_CAT_PERFORMANCE, "GST_PERFORMANCE");

View file

@ -32,8 +32,8 @@
#include <gst/video/gstvideometa.h>
#include <gst/video/gstvideopool.h>
GST_DEBUG_CATEGORY_EXTERN (gst_debug_ximagepool);
#define GST_CAT_DEFAULT gst_debug_ximagepool
GST_DEBUG_CATEGORY_EXTERN (gst_debug_x_image_pool);
#define GST_CAT_DEFAULT gst_debug_x_image_pool
/* X11 stuff */
static gboolean error_caught = FALSE;
@ -419,7 +419,7 @@ xattach_failed:
/* This function checks that it is actually really possible to create an image
using XShm */
gboolean
gst_ximagesink_check_xshm_calls (GstXImageSink * ximagesink,
gst_x_image_sink_check_xshm_calls (GstXImageSink * ximagesink,
GstXContext * xcontext)
{
XImage *ximage;
@ -672,7 +672,7 @@ gst_ximage_buffer_pool_new (GstXImageSink * ximagesink)
{
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->sink = gst_object_ref (ximagesink);

View file

@ -105,7 +105,7 @@ GType gst_ximage_buffer_pool_get_type (void);
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);
G_END_DECLS

View file

@ -118,9 +118,9 @@
/* for XkbKeycodeToKeysym */
#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);
#define GST_CAT_DEFAULT gst_debug_ximagesink
#define GST_CAT_DEFAULT gst_debug_x_image_sink
typedef struct
{
@ -134,11 +134,12 @@ MotifWmHints, MwmHints;
#define MWM_HINTS_DECORATIONS (1L << 1)
static void gst_ximagesink_reset (GstXImageSink * ximagesink);
static void gst_ximagesink_xwindow_update_geometry (GstXImageSink * ximagesink);
static void gst_ximagesink_expose (GstVideoOverlay * overlay);
static void gst_x_image_sink_reset (GstXImageSink * ximagesink);
static void gst_x_image_sink_xwindow_update_geometry (GstXImageSink *
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_PAD_SINK,
GST_PAD_ALWAYS,
@ -171,14 +172,15 @@ enum
/* Object typing & Creation */
/* */
/* =========================================== */
static void gst_ximagesink_navigation_init (GstNavigationInterface * iface);
static void gst_ximagesink_video_overlay_init (GstVideoOverlayInterface *
static void gst_x_image_sink_navigation_init (GstNavigationInterface * iface);
static void gst_x_image_sink_video_overlay_init (GstVideoOverlayInterface *
iface);
#define gst_ximagesink_parent_class parent_class
G_DEFINE_TYPE_WITH_CODE (GstXImageSink, gst_ximagesink, GST_TYPE_VIDEO_SINK,
G_IMPLEMENT_INTERFACE (GST_TYPE_NAVIGATION, gst_ximagesink_navigation_init);
#define gst_x_image_sink_parent_class parent_class
G_DEFINE_TYPE_WITH_CODE (GstXImageSink, gst_x_image_sink, GST_TYPE_VIDEO_SINK,
G_IMPLEMENT_INTERFACE (GST_TYPE_NAVIGATION,
gst_x_image_sink_navigation_init);
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 */
static void
gst_ximagesink_xwindow_draw_borders (GstXImageSink * ximagesink,
gst_x_image_sink_xwindow_draw_borders (GstXImageSink * ximagesink,
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);
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 */
static gboolean
gst_ximagesink_ximage_put (GstXImageSink * ximagesink, GstBuffer * ximage)
gst_x_image_sink_ximage_put (GstXImageSink * ximagesink, GstBuffer * ximage)
{
GstXImageMemory *mem;
GstVideoCropMeta *crop;
@ -295,7 +297,7 @@ gst_ximagesink_ximage_put (GstXImageSink * ximagesink, GstBuffer * ximage)
g_mutex_lock (&ximagesink->x_lock);
if (draw_border) {
gst_ximagesink_xwindow_draw_borders (ximagesink, ximagesink->xwindow,
gst_x_image_sink_xwindow_draw_borders (ximagesink, ximagesink->xwindow,
result);
ximagesink->draw_border = FALSE;
}
@ -330,13 +332,13 @@ gst_ximagesink_ximage_put (GstXImageSink * ximagesink, GstBuffer * ximage)
}
static gboolean
gst_ximagesink_xwindow_decorate (GstXImageSink * ximagesink,
gst_x_image_sink_xwindow_decorate (GstXImageSink * ximagesink,
GstXWindow * window)
{
Atom hints_atom = None;
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_mutex_lock (&ximagesink->x_lock);
@ -367,7 +369,7 @@ gst_ximagesink_xwindow_decorate (GstXImageSink * ximagesink,
}
static void
gst_ximagesink_xwindow_set_title (GstXImageSink * ximagesink,
gst_x_image_sink_xwindow_set_title (GstXImageSink * ximagesink,
GstXWindow * xwindow, const gchar * media_title)
{
if (media_title) {
@ -417,12 +419,13 @@ gst_ximagesink_xwindow_set_title (GstXImageSink * ximagesink,
/* This function handles a GstXWindow creation */
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;
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);
@ -441,7 +444,7 @@ gst_ximagesink_xwindow_new (GstXImageSink * ximagesink, gint width, gint height)
XSetWindowBackgroundPixmap (ximagesink->xcontext->disp, xwindow->win, None);
/* 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) {
Atom wm_delete;
@ -467,7 +470,7 @@ gst_ximagesink_xwindow_new (GstXImageSink * ximagesink, gint width, gint height)
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),
xwindow->win);
@ -477,11 +480,11 @@ gst_ximagesink_xwindow_new (GstXImageSink * ximagesink, gint width, gint height)
/* This function destroys a GstXWindow */
static void
gst_ximagesink_xwindow_destroy (GstXImageSink * ximagesink,
gst_x_image_sink_xwindow_destroy (GstXImageSink * ximagesink,
GstXWindow * xwindow)
{
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);
@ -501,12 +504,12 @@ gst_ximagesink_xwindow_destroy (GstXImageSink * ximagesink,
}
static void
gst_ximagesink_xwindow_update_geometry (GstXImageSink * ximagesink)
gst_x_image_sink_xwindow_update_geometry (GstXImageSink * ximagesink)
{
XWindowAttributes attr;
gboolean reconfigure;
g_return_if_fail (GST_IS_XIMAGESINK (ximagesink));
g_return_if_fail (GST_IS_X_IMAGE_SINK (ximagesink));
/* Update the window geometry */
g_mutex_lock (&ximagesink->x_lock);
@ -532,10 +535,11 @@ gst_ximagesink_xwindow_update_geometry (GstXImageSink * ximagesink)
}
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 (GST_IS_XIMAGESINK (ximagesink));
g_return_if_fail (GST_IS_X_IMAGE_SINK (ximagesink));
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
and navigation.*/
static void
gst_ximagesink_handle_xevents (GstXImageSink * ximagesink)
gst_x_image_sink_handle_xevents (GstXImageSink * ximagesink)
{
XEvent e;
guint pointer_x = 0, pointer_y = 0;
gboolean pointer_moved = 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
interesting. */
@ -661,7 +665,7 @@ gst_ximagesink_handle_xevents (GstXImageSink * ximagesink)
break;
case ConfigureNotify:
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);
configured = TRUE;
break;
@ -674,7 +678,7 @@ gst_ximagesink_handle_xevents (GstXImageSink * ximagesink)
g_mutex_unlock (&ximagesink->x_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->x_lock);
@ -696,7 +700,7 @@ gst_ximagesink_handle_xevents (GstXImageSink * ximagesink)
("Output window was closed"), (NULL));
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;
g_mutex_lock (&ximagesink->x_lock);
}
@ -712,16 +716,16 @@ gst_ximagesink_handle_xevents (GstXImageSink * ximagesink)
}
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);
while (ximagesink->running) {
GST_OBJECT_UNLOCK (ximagesink);
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? */
g_usleep (G_USEC_PER_SEC / 20);
@ -734,7 +738,7 @@ gst_ximagesink_event_thread (GstXImageSink * ximagesink)
}
static void
gst_ximagesink_manage_event_thread (GstXImageSink * ximagesink)
gst_x_image_sink_manage_event_thread (GstXImageSink * ximagesink)
{
GThread *thread = NULL;
@ -751,7 +755,7 @@ gst_ximagesink_manage_event_thread (GstXImageSink * ximagesink)
ximagesink->handle_expose, ximagesink->handle_events);
ximagesink->running = TRUE;
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 {
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
* in the xcontext structure and stores it there. */
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] = {
{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
image creation */
static GstXContext *
gst_ximagesink_xcontext_get (GstXImageSink * ximagesink)
gst_x_image_sink_xcontext_get (GstXImageSink * ximagesink)
{
GstXContext *xcontext = NULL;
XPixmapFormatValues *px_formats = NULL;
@ -844,7 +848,7 @@ gst_ximagesink_xcontext_get (GstXImageSink * ximagesink)
GstVideoFormat vformat;
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);
@ -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",
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 */
px_formats = XListPixmapFormats (xcontext->disp, &nb_formats);
@ -905,7 +909,7 @@ gst_ximagesink_xcontext_get (GstXImageSink * ximagesink)
/* Search for XShm extension support */
#ifdef HAVE_XSHM
if (XShmQueryExtension (xcontext->disp) &&
gst_ximagesink_check_xshm_calls (ximagesink, xcontext)) {
gst_x_image_sink_check_xshm_calls (ximagesink, xcontext)) {
xcontext->use_xshm = TRUE;
GST_DEBUG ("ximagesink is using XShm extension");
} else
@ -966,11 +970,11 @@ unknown_format:
/* This function cleans the X context. Closing the Display and unrefing the
caps for supported formats. */
static void
gst_ximagesink_xcontext_clear (GstXImageSink * ximagesink)
gst_x_image_sink_xcontext_clear (GstXImageSink * ximagesink)
{
GstXContext *xcontext;
g_return_if_fail (GST_IS_XIMAGESINK (ximagesink));
g_return_if_fail (GST_IS_X_IMAGE_SINK (ximagesink));
GST_OBJECT_LOCK (ximagesink);
if (ximagesink->xcontext == NULL) {
@ -1006,13 +1010,13 @@ gst_ximagesink_xcontext_clear (GstXImageSink * ximagesink)
/* Element stuff */
static GstCaps *
gst_ximagesink_getcaps (GstBaseSink * bsink, GstCaps * filter)
gst_x_image_sink_getcaps (GstBaseSink * bsink, GstCaps * filter)
{
GstXImageSink *ximagesink;
GstCaps *caps;
int i;
ximagesink = GST_XIMAGESINK (bsink);
ximagesink = GST_X_IMAGE_SINK (bsink);
g_mutex_lock (&ximagesink->x_lock);
if (ximagesink->xcontext) {
@ -1094,7 +1098,7 @@ gst_ximagesink_getcaps (GstBaseSink * bsink, GstCaps * filter)
}
static GstBufferPool *
gst_ximagesink_create_pool (GstXImageSink * ximagesink, GstCaps * caps,
gst_x_image_sink_create_pool (GstXImageSink * ximagesink, GstCaps * caps,
gsize size, gint min)
{
static GstAllocationParams params = { 0, 15, 0, 0, };
@ -1122,7 +1126,7 @@ config_failed:
}
static gboolean
gst_ximagesink_setcaps (GstBaseSink * bsink, GstCaps * caps)
gst_x_image_sink_setcaps (GstBaseSink * bsink, GstCaps * caps)
{
GstXImageSink *ximagesink;
GstStructure *structure;
@ -1130,7 +1134,7 @@ gst_ximagesink_setcaps (GstBaseSink * bsink, GstCaps * caps)
GstBufferPool *newpool, *oldpool;
const GValue *par;
ximagesink = GST_XIMAGESINK (bsink);
ximagesink = GST_X_IMAGE_SINK (bsink);
if (!ximagesink->xcontext)
return FALSE;
@ -1183,7 +1187,7 @@ gst_ximagesink_setcaps (GstBaseSink * bsink, GstCaps * caps)
g_mutex_lock (&ximagesink->flow_lock);
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));
}
@ -1193,7 +1197,7 @@ gst_ximagesink_setcaps (GstBaseSink * bsink, GstCaps * caps)
ximagesink->draw_border = TRUE;
/* 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 */
oldpool = ximagesink->pool;
@ -1233,19 +1237,19 @@ invalid_size:
}
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;
GstXImageSink *ximagesink;
GstXContext *xcontext = NULL;
ximagesink = GST_XIMAGESINK (element);
ximagesink = GST_X_IMAGE_SINK (element);
switch (transition) {
case GST_STATE_CHANGE_NULL_TO_READY:
/* Initializing the XContext */
if (ximagesink->xcontext == NULL) {
xcontext = gst_ximagesink_xcontext_get (ximagesink);
xcontext = gst_x_image_sink_xcontext_get (ximagesink);
if (xcontext == NULL) {
ret = GST_STATE_CHANGE_FAILURE;
goto beach;
@ -1262,12 +1266,12 @@ gst_ximagesink_change_state (GstElement * element, GstStateChange transition)
g_mutex_lock (&ximagesink->x_lock);
XSynchronize (ximagesink->xcontext->disp, ximagesink->synchronous);
g_mutex_unlock (&ximagesink->x_lock);
gst_ximagesink_manage_event_thread (ximagesink);
gst_x_image_sink_manage_event_thread (ximagesink);
break;
case GST_STATE_CHANGE_READY_TO_PAUSED:
g_mutex_lock (&ximagesink->flow_lock);
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);
break;
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);
break;
case GST_STATE_CHANGE_READY_TO_NULL:
gst_ximagesink_reset (ximagesink);
gst_x_image_sink_reset (ximagesink);
break;
default:
break;
@ -1303,12 +1307,12 @@ beach:
}
static void
gst_ximagesink_get_times (GstBaseSink * bsink, GstBuffer * buf,
gst_x_image_sink_get_times (GstBaseSink * bsink, GstBuffer * buf,
GstClockTime * start, GstClockTime * end)
{
GstXImageSink *ximagesink;
ximagesink = GST_XIMAGESINK (bsink);
ximagesink = GST_X_IMAGE_SINK (bsink);
if (GST_BUFFER_TIMESTAMP_IS_VALID (buf)) {
*start = GST_BUFFER_TIMESTAMP (buf);
@ -1325,14 +1329,14 @@ gst_ximagesink_get_times (GstBaseSink * bsink, GstBuffer * buf,
}
static GstFlowReturn
gst_ximagesink_show_frame (GstVideoSink * vsink, GstBuffer * buf)
gst_x_image_sink_show_frame (GstVideoSink * vsink, GstBuffer * buf)
{
GstFlowReturn res;
GstXImageSink *ximagesink;
GstXImageMemory *mem;
GstBuffer *to_put = NULL;
ximagesink = GST_XIMAGESINK (vsink);
ximagesink = GST_X_IMAGE_SINK (vsink);
if (gst_buffer_n_memory (buf) == 1
&& (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);
}
if (!gst_ximagesink_ximage_put (ximagesink, to_put))
if (!gst_x_image_sink_ximage_put (ximagesink, to_put))
goto no_window;
done:
@ -1429,9 +1433,9 @@ activate_failed:
}
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)) {
case GST_EVENT_TAG:{
@ -1443,7 +1447,7 @@ gst_ximagesink_event (GstBaseSink * sink, GstEvent * event)
if (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);
g_free (title);
@ -1457,9 +1461,9 @@ gst_ximagesink_event (GstBaseSink * sink, GstEvent * event)
}
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;
GstCaps *caps;
guint size;
@ -1476,7 +1480,7 @@ gst_ximagesink_propose_allocation (GstBaseSink * bsink, GstQuery * query)
if (!gst_video_info_from_caps (&info, 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 */
size = info.size;
@ -1517,10 +1521,10 @@ no_pool:
/* Interfaces stuff */
static void
gst_ximagesink_navigation_send_event (GstNavigation * navigation,
gst_x_image_sink_navigation_send_event (GstNavigation * navigation,
GstStructure * structure)
{
GstXImageSink *ximagesink = GST_XIMAGESINK (navigation);
GstXImageSink *ximagesink = GST_X_IMAGE_SINK (navigation);
GstEvent *event;
gint x_offset, y_offset;
gdouble x, y;
@ -1566,16 +1570,16 @@ gst_ximagesink_navigation_send_event (GstNavigation * navigation,
}
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
gst_ximagesink_set_window_handle (GstVideoOverlay * overlay, guintptr id)
gst_x_image_sink_set_window_handle (GstVideoOverlay * overlay, guintptr id)
{
XID xwindow_id = id;
GstXImageSink *ximagesink = GST_XIMAGESINK (overlay);
GstXImageSink *ximagesink = GST_X_IMAGE_SINK (overlay);
GstXWindow *xwindow = NULL;
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 (!ximagesink->xcontext &&
!(ximagesink->xcontext = gst_ximagesink_xcontext_get (ximagesink))) {
!(ximagesink->xcontext = gst_x_image_sink_xcontext_get (ximagesink))) {
g_mutex_unlock (&ximagesink->flow_lock);
/* we have thrown a GST_ELEMENT_ERROR now */
return;
@ -1600,7 +1604,7 @@ gst_ximagesink_set_window_handle (GstVideoOverlay * overlay, guintptr id)
/* If a window is there already we destroy it */
if (ximagesink->xwindow) {
gst_ximagesink_xwindow_destroy (ximagesink, ximagesink->xwindow);
gst_x_image_sink_xwindow_destroy (ximagesink, ximagesink->xwindow);
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
during caps nego then */
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_HEIGHT (ximagesink));
}
@ -1642,19 +1646,19 @@ gst_ximagesink_set_window_handle (GstVideoOverlay * overlay, guintptr id)
}
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_ximagesink_ximage_put (ximagesink, NULL);
gst_x_image_sink_xwindow_update_geometry (ximagesink);
gst_x_image_sink_ximage_put (ximagesink, NULL);
}
static void
gst_ximagesink_set_event_handling (GstVideoOverlay * overlay,
gst_x_image_sink_set_event_handling (GstVideoOverlay * overlay,
gboolean handle_events)
{
GstXImageSink *ximagesink = GST_XIMAGESINK (overlay);
GstXImageSink *ximagesink = GST_X_IMAGE_SINK (overlay);
ximagesink->handle_events = handle_events;
@ -1687,11 +1691,11 @@ gst_ximagesink_set_event_handling (GstVideoOverlay * overlay,
}
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->expose = gst_ximagesink_expose;
iface->handle_events = gst_ximagesink_set_event_handling;
iface->set_window_handle = gst_x_image_sink_set_window_handle;
iface->expose = gst_x_image_sink_expose;
iface->handle_events = gst_x_image_sink_set_event_handling;
}
/* =========================================== */
@ -1701,14 +1705,14 @@ gst_ximagesink_video_overlay_init (GstVideoOverlayInterface * iface)
/* =========================================== */
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)
{
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) {
case PROP_DISPLAY:
@ -1748,13 +1752,13 @@ gst_ximagesink_set_property (GObject * object, guint prop_id,
}
break;
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));
gst_ximagesink_manage_event_thread (ximagesink);
gst_x_image_sink_manage_event_thread (ximagesink);
break;
case PROP_HANDLE_EXPOSE:
ximagesink->handle_expose = g_value_get_boolean (value);
gst_ximagesink_manage_event_thread (ximagesink);
gst_x_image_sink_manage_event_thread (ximagesink);
break;
default:
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
gst_ximagesink_get_property (GObject * object, guint prop_id,
gst_x_image_sink_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec)
{
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) {
case PROP_DISPLAY:
@ -1811,7 +1815,7 @@ gst_ximagesink_get_property (GObject * object, guint prop_id,
}
static void
gst_ximagesink_reset (GstXImageSink * ximagesink)
gst_x_image_sink_reset (GstXImageSink * ximagesink)
{
GThread *thread;
@ -1839,23 +1843,23 @@ gst_ximagesink_reset (GstXImageSink * ximagesink)
}
if (ximagesink->xwindow) {
gst_ximagesink_xwindow_clear (ximagesink, ximagesink->xwindow);
gst_ximagesink_xwindow_destroy (ximagesink, ximagesink->xwindow);
gst_x_image_sink_xwindow_clear (ximagesink, ximagesink->xwindow);
gst_x_image_sink_xwindow_destroy (ximagesink, ximagesink->xwindow);
ximagesink->xwindow = NULL;
}
g_mutex_unlock (&ximagesink->flow_lock);
gst_ximagesink_xcontext_clear (ximagesink);
gst_x_image_sink_xcontext_clear (ximagesink);
}
static void
gst_ximagesink_finalize (GObject * object)
gst_x_image_sink_finalize (GObject * object)
{
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) {
g_free (ximagesink->display_name);
@ -1874,7 +1878,7 @@ gst_ximagesink_finalize (GObject * object)
}
static void
gst_ximagesink_init (GstXImageSink * ximagesink)
gst_x_image_sink_init (GstXImageSink * ximagesink)
{
ximagesink->display_name = NULL;
ximagesink->xcontext = NULL;
@ -1901,7 +1905,7 @@ gst_ximagesink_init (GstXImageSink * ximagesink)
}
static void
gst_ximagesink_class_init (GstXImageSinkClass * klass)
gst_x_image_sink_class_init (GstXImageSinkClass * klass)
{
GObjectClass *gobject_class;
GstElementClass *gstelement_class;
@ -1913,9 +1917,9 @@ gst_ximagesink_class_init (GstXImageSinkClass * klass)
gstbasesink_class = (GstBaseSinkClass *) klass;
videosink_class = (GstVideoSinkClass *) klass;
gobject_class->finalize = gst_ximagesink_finalize;
gobject_class->set_property = gst_ximagesink_set_property;
gobject_class->get_property = gst_ximagesink_get_property;
gobject_class->finalize = gst_x_image_sink_finalize;
gobject_class->set_property = gst_x_image_sink_set_property;
gobject_class->get_property = gst_x_image_sink_get_property;
g_object_class_install_property (gobject_class, PROP_DISPLAY,
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>");
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->set_caps = GST_DEBUG_FUNCPTR (gst_ximagesink_setcaps);
gstbasesink_class->get_times = GST_DEBUG_FUNCPTR (gst_ximagesink_get_times);
gstbasesink_class->get_caps = GST_DEBUG_FUNCPTR (gst_x_image_sink_getcaps);
gstbasesink_class->set_caps = GST_DEBUG_FUNCPTR (gst_x_image_sink_setcaps);
gstbasesink_class->get_times = GST_DEBUG_FUNCPTR (gst_x_image_sink_get_times);
gstbasesink_class->propose_allocation =
GST_DEBUG_FUNCPTR (gst_ximagesink_propose_allocation);
gstbasesink_class->event = GST_DEBUG_FUNCPTR (gst_ximagesink_event);
GST_DEBUG_FUNCPTR (gst_x_image_sink_propose_allocation);
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);
}

View file

@ -17,8 +17,8 @@
* Boston, MA 02110-1301, USA.
*/
#ifndef __GST_XIMAGESINK_H__
#define __GST_XIMAGESINK_H__
#ifndef __GST_X_IMAGE_SINK_H__
#define __GST_X_IMAGE_SINK_H__
#include <gst/video/gstvideosink.h>
@ -42,16 +42,16 @@
#include <gst/video/video.h>
G_BEGIN_DECLS
#define GST_TYPE_XIMAGESINK \
(gst_ximagesink_get_type())
#define GST_XIMAGESINK(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_XIMAGESINK, GstXImageSink))
#define GST_XIMAGESINK_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_XIMAGESINK, GstXImageSinkClass))
#define GST_IS_XIMAGESINK(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_XIMAGESINK))
#define GST_IS_XIMAGESINK_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_XIMAGESINK))
#define GST_TYPE_X_IMAGE_SINK \
(gst_x_image_sink_get_type())
#define GST_X_IMAGE_SINK(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_X_IMAGE_SINK, GstXImageSink))
#define GST_X_IMAGE_SINK_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_X_IMAGE_SINK, GstXImageSinkClass))
#define GST_IS_X_IMAGE_SINK(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_X_IMAGE_SINK))
#define GST_IS_X_IMAGE_SINK_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_X_IMAGE_SINK))
typedef struct _GstXContext GstXContext;
typedef struct _GstXWindow GstXWindow;
@ -204,7 +204,7 @@ struct _GstXImageSinkClass
GstVideoSinkClass parent_class;
};
GType gst_ximagesink_get_type (void);
GType gst_x_image_sink_get_type (void);
G_END_DECLS
#endif /* __GST_XIMAGESINK_H__ */
#endif /* __GST_X_IMAGE_SINK_H__ */

View file

@ -33,9 +33,9 @@
/* for XkbKeycodeToKeysym */
#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);
#define GST_CAT_DEFAULT gst_debug_xvcontext
#define GST_CAT_DEFAULT gst_debug_xv_context
void
gst_xvcontext_config_clear (GstXvContextConfig * config)

View file

@ -23,23 +23,23 @@
#include "xvimagesink.h"
GST_DEBUG_CATEGORY (gst_debug_xvcontext);
GST_DEBUG_CATEGORY (gst_debug_xvimagepool);
GST_DEBUG_CATEGORY (gst_debug_xvimagesink);
GST_DEBUG_CATEGORY (gst_debug_xv_context);
GST_DEBUG_CATEGORY (gst_debug_xv_image_pool);
GST_DEBUG_CATEGORY (gst_debug_xv_image_sink);
GST_DEBUG_CATEGORY_STATIC (GST_CAT_PERFORMANCE);
static gboolean
plugin_init (GstPlugin * plugin)
{
if (!gst_element_register (plugin, "xvimagesink",
GST_RANK_PRIMARY, GST_TYPE_XVIMAGESINK))
GST_RANK_PRIMARY, GST_TYPE_XV_IMAGE_SINK))
return FALSE;
GST_DEBUG_CATEGORY_INIT (gst_debug_xvcontext, "xcontext", 0,
GST_DEBUG_CATEGORY_INIT (gst_debug_xv_context, "xcontext", 0,
"xcontext miniobject");
GST_DEBUG_CATEGORY_INIT (gst_debug_xvimagesink, "xvimagesink", 0,
GST_DEBUG_CATEGORY_INIT (gst_debug_xv_image_sink, "xvimagesink", 0,
"xvimagesink element");
GST_DEBUG_CATEGORY_INIT (gst_debug_xvimagepool, "xvimagepool", 0,
GST_DEBUG_CATEGORY_INIT (gst_debug_xv_image_pool, "xvimagepool", 0,
"xvimagepool object");
GST_DEBUG_CATEGORY_GET (GST_CAT_PERFORMANCE, "GST_PERFORMANCE");

View file

@ -34,8 +34,8 @@
#include <gst/video/gstvideopool.h>
GST_DEBUG_CATEGORY_EXTERN (gst_debug_xvimagepool);
#define GST_CAT_DEFAULT gst_debug_xvimagepool
GST_DEBUG_CATEGORY_EXTERN (gst_debug_xv_image_pool);
#define GST_CAT_DEFAULT gst_debug_xv_image_pool
/* bufferpool */
static void gst_xvimage_buffer_pool_finalize (GObject * object);

View file

@ -133,9 +133,9 @@
/* for XkbKeycodeToKeysym */
#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);
#define GST_CAT_DEFAULT gst_debug_xvimagesink
#define GST_CAT_DEFAULT gst_debug_xv_image_sink
typedef struct
{
@ -149,15 +149,15 @@ MotifWmHints, MwmHints;
#define MWM_HINTS_DECORATIONS (1L << 1)
static gboolean gst_xvimagesink_open (GstXvImageSink * xvimagesink);
static void gst_xvimagesink_close (GstXvImageSink * xvimagesink);
static void gst_xvimagesink_xwindow_update_geometry (GstXvImageSink *
static gboolean gst_xv_image_sink_open (GstXvImageSink * xvimagesink);
static void gst_xv_image_sink_close (GstXvImageSink * xvimagesink);
static void gst_xv_image_sink_xwindow_update_geometry (GstXvImageSink *
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
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_PAD_SINK,
GST_PAD_ALWAYS,
@ -200,19 +200,19 @@ enum
/* Object typing & Creation */
/* */
/* =========================================== */
static void gst_xvimagesink_navigation_init (GstNavigationInterface * iface);
static void gst_xvimagesink_video_overlay_init (GstVideoOverlayInterface *
static void gst_xv_image_sink_navigation_init (GstNavigationInterface * iface);
static void gst_xv_image_sink_video_overlay_init (GstVideoOverlayInterface *
iface);
static void gst_xvimagesink_colorbalance_init (GstColorBalanceInterface *
static void gst_xv_image_sink_colorbalance_init (GstColorBalanceInterface *
iface);
#define gst_xvimagesink_parent_class parent_class
G_DEFINE_TYPE_WITH_CODE (GstXvImageSink, gst_xvimagesink, GST_TYPE_VIDEO_SINK,
#define gst_xv_image_sink_parent_class parent_class
G_DEFINE_TYPE_WITH_CODE (GstXvImageSink, gst_xv_image_sink, GST_TYPE_VIDEO_SINK,
G_IMPLEMENT_INTERFACE (GST_TYPE_NAVIGATION,
gst_xvimagesink_navigation_init);
gst_xv_image_sink_navigation_init);
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,
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
* if no window was available */
static gboolean
gst_xvimagesink_xvimage_put (GstXvImageSink * xvimagesink, GstBuffer * xvimage)
gst_xv_image_sink_xvimage_put (GstXvImageSink * xvimagesink,
GstBuffer * xvimage)
{
GstXvImageMemory *mem;
GstVideoCropMeta *crop;
@ -315,7 +316,7 @@ gst_xvimagesink_xvimage_put (GstXvImageSink * xvimagesink, GstBuffer * xvimage)
}
static void
gst_xvimagesink_xwindow_set_title (GstXvImageSink * xvimagesink,
gst_xv_image_sink_xwindow_set_title (GstXvImageSink * xvimagesink,
GstXWindow * xwindow, const gchar * media_title)
{
if (media_title) {
@ -348,20 +349,20 @@ gst_xvimagesink_xwindow_set_title (GstXvImageSink * xvimagesink,
/* This function handles a GstXWindow creation
* The width and height are the actual pixel size on the display */
static GstXWindow *
gst_xvimagesink_xwindow_new (GstXvImageSink * xvimagesink,
gst_xv_image_sink_xwindow_new (GstXvImageSink * xvimagesink,
gint width, gint height)
{
GstXWindow *xwindow = NULL;
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;
xwindow = gst_xvcontext_create_xwindow (context, width, height);
/* 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);
@ -372,9 +373,9 @@ gst_xvimagesink_xwindow_new (GstXvImageSink * xvimagesink,
}
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 */
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
port. If the context is not initialized yet it simply returns */
static void
gst_xvimagesink_update_colorbalance (GstXvImageSink * xvimagesink)
gst_xv_image_sink_update_colorbalance (GstXvImageSink * xvimagesink)
{
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 ((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
trigger caps renegotiation so on the fly software scaling can work. */
static void
gst_xvimagesink_handle_xevents (GstXvImageSink * xvimagesink)
gst_xv_image_sink_handle_xevents (GstXvImageSink * xvimagesink)
{
XEvent e;
guint pointer_x = 0, pointer_y = 0;
gboolean pointer_moved = 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 */
@ -517,7 +518,7 @@ gst_xvimagesink_handle_xevents (GstXvImageSink * xvimagesink)
g_mutex_unlock (&xvimagesink->context->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->context->lock);
@ -532,7 +533,7 @@ gst_xvimagesink_handle_xevents (GstXvImageSink * xvimagesink)
g_mutex_unlock (&xvimagesink->context->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->context->lock);
@ -570,16 +571,16 @@ gst_xvimagesink_handle_xevents (GstXvImageSink * xvimagesink)
}
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);
while (xvimagesink->running) {
GST_OBJECT_UNLOCK (xvimagesink);
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? */
g_usleep (G_USEC_PER_SEC / 20);
@ -592,7 +593,7 @@ gst_xvimagesink_event_thread (GstXvImageSink * xvimagesink)
}
static void
gst_xvimagesink_manage_event_thread (GstXvImageSink * xvimagesink)
gst_xv_image_sink_manage_event_thread (GstXvImageSink * xvimagesink)
{
GThread *thread = NULL;
@ -609,7 +610,7 @@ gst_xvimagesink_manage_event_thread (GstXvImageSink * xvimagesink)
xvimagesink->handle_expose, xvimagesink->handle_events);
xvimagesink->running = TRUE;
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 {
if (xvimagesink->event_thread) {
@ -632,12 +633,12 @@ gst_xvimagesink_manage_event_thread (GstXvImageSink * xvimagesink)
/* Element stuff */
static GstCaps *
gst_xvimagesink_getcaps (GstBaseSink * bsink, GstCaps * filter)
gst_xv_image_sink_getcaps (GstBaseSink * bsink, GstCaps * filter)
{
GstXvImageSink *xvimagesink;
GstCaps *caps;
xvimagesink = GST_XVIMAGESINK (bsink);
xvimagesink = GST_XV_IMAGE_SINK (bsink);
if (xvimagesink->context) {
if (filter)
@ -660,7 +661,7 @@ gst_xvimagesink_getcaps (GstBaseSink * bsink, GstCaps * filter)
}
static GstBufferPool *
gst_xvimagesink_create_pool (GstXvImageSink * xvimagesink, GstCaps * caps,
gst_xv_image_sink_create_pool (GstXvImageSink * xvimagesink, GstCaps * caps,
gsize size, gint min)
{
GstBufferPool *pool;
@ -685,7 +686,7 @@ config_failed:
}
static gboolean
gst_xvimagesink_setcaps (GstBaseSink * bsink, GstCaps * caps)
gst_xv_image_sink_setcaps (GstBaseSink * bsink, GstCaps * caps)
{
GstXvImageSink *xvimagesink;
GstXvContext *context;
@ -696,7 +697,7 @@ gst_xvimagesink_setcaps (GstBaseSink * bsink, GstCaps * caps)
gint display_par_n, display_par_d; /* display's PAR */
guint num, den;
xvimagesink = GST_XVIMAGESINK (bsink);
xvimagesink = GST_XV_IMAGE_SINK (bsink);
context = xvimagesink->context;
GST_DEBUG_OBJECT (xvimagesink,
@ -787,7 +788,7 @@ gst_xvimagesink_setcaps (GstBaseSink * bsink, GstCaps * caps)
g_mutex_lock (&xvimagesink->flow_lock);
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_HEIGHT (xvimagesink));
}
@ -799,7 +800,7 @@ gst_xvimagesink_setcaps (GstBaseSink * bsink, GstCaps * caps)
xvimagesink->redraw_border = TRUE;
/* 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 */
oldpool = xvimagesink->pool;
@ -841,16 +842,16 @@ no_display_size:
}
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;
GstXvImageSink *xvimagesink;
xvimagesink = GST_XVIMAGESINK (element);
xvimagesink = GST_XV_IMAGE_SINK (element);
switch (transition) {
case GST_STATE_CHANGE_NULL_TO_READY:
if (!gst_xvimagesink_open (xvimagesink))
if (!gst_xv_image_sink_open (xvimagesink))
goto error;
break;
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);
break;
case GST_STATE_CHANGE_READY_TO_NULL:
gst_xvimagesink_close (xvimagesink);
gst_xv_image_sink_close (xvimagesink);
break;
default:
break;
@ -893,12 +894,12 @@ error:
}
static void
gst_xvimagesink_get_times (GstBaseSink * bsink, GstBuffer * buf,
gst_xv_image_sink_get_times (GstBaseSink * bsink, GstBuffer * buf,
GstClockTime * start, GstClockTime * end)
{
GstXvImageSink *xvimagesink;
xvimagesink = GST_XVIMAGESINK (bsink);
xvimagesink = GST_XV_IMAGE_SINK (bsink);
if (GST_BUFFER_TIMESTAMP_IS_VALID (buf)) {
*start = GST_BUFFER_TIMESTAMP (buf);
@ -915,14 +916,14 @@ gst_xvimagesink_get_times (GstBaseSink * bsink, GstBuffer * buf,
}
static GstFlowReturn
gst_xvimagesink_show_frame (GstVideoSink * vsink, GstBuffer * buf)
gst_xv_image_sink_show_frame (GstVideoSink * vsink, GstBuffer * buf)
{
GstFlowReturn res;
GstXvImageSink *xvimagesink;
GstBuffer *to_put = NULL;
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))
&& 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);
}
if (!gst_xvimagesink_xvimage_put (xvimagesink, to_put))
if (!gst_xv_image_sink_xvimage_put (xvimagesink, to_put))
goto no_window;
done:
@ -1018,9 +1019,9 @@ activate_failed:
}
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)) {
case GST_EVENT_TAG:{
@ -1032,7 +1033,7 @@ gst_xvimagesink_event (GstBaseSink * sink, GstEvent * event)
if (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);
g_free (title);
@ -1046,9 +1047,9 @@ gst_xvimagesink_event (GstBaseSink * sink, GstEvent * event)
}
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;
GstCaps *caps;
guint size;
@ -1066,7 +1067,7 @@ gst_xvimagesink_propose_allocation (GstBaseSink * bsink, GstQuery * query)
goto invalid_caps;
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 */
size = info.size;
@ -1107,10 +1108,10 @@ no_pool:
/* Interfaces stuff */
static void
gst_xvimagesink_navigation_send_event (GstNavigation * navigation,
gst_xv_image_sink_navigation_send_event (GstNavigation * navigation,
GstStructure * structure)
{
GstXvImageSink *xvimagesink = GST_XVIMAGESINK (navigation);
GstXvImageSink *xvimagesink = GST_XV_IMAGE_SINK (navigation);
GstPad *peer;
gboolean handled = FALSE;
GstEvent *event = NULL;
@ -1182,20 +1183,20 @@ gst_xvimagesink_navigation_send_event (GstNavigation * navigation,
}
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
gst_xvimagesink_set_window_handle (GstVideoOverlay * overlay, guintptr id)
gst_xv_image_sink_set_window_handle (GstVideoOverlay * overlay, guintptr id)
{
XID xwindow_id = id;
GstXvImageSink *xvimagesink = GST_XVIMAGESINK (overlay);
GstXvImageSink *xvimagesink = GST_XV_IMAGE_SINK (overlay);
GstXWindow *xwindow = NULL;
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);
@ -1216,7 +1217,7 @@ gst_xvimagesink_set_window_handle (GstVideoOverlay * overlay, guintptr id)
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 (xvimagesink->xwindow) {
@ -1231,7 +1232,7 @@ gst_xvimagesink_set_window_handle (GstVideoOverlay * overlay, guintptr id)
if (GST_VIDEO_SINK_WIDTH (xvimagesink)
&& GST_VIDEO_SINK_HEIGHT (xvimagesink)) {
xwindow =
gst_xvimagesink_xwindow_new (xvimagesink,
gst_xv_image_sink_xwindow_new (xvimagesink,
GST_VIDEO_SINK_WIDTH (xvimagesink),
GST_VIDEO_SINK_HEIGHT (xvimagesink));
}
@ -1247,20 +1248,20 @@ gst_xvimagesink_set_window_handle (GstVideoOverlay * overlay, guintptr id)
}
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_xvimagesink_xwindow_update_geometry (xvimagesink);
gst_xvimagesink_xvimage_put (xvimagesink, NULL);
gst_xv_image_sink_xwindow_update_geometry (xvimagesink);
gst_xv_image_sink_xvimage_put (xvimagesink, NULL);
}
static void
gst_xvimagesink_set_event_handling (GstVideoOverlay * overlay,
gst_xv_image_sink_set_event_handling (GstVideoOverlay * overlay,
gboolean handle_events)
{
GstXvImageSink *xvimagesink = GST_XVIMAGESINK (overlay);
GstXvImageSink *xvimagesink = GST_XV_IMAGE_SINK (overlay);
g_mutex_lock (&xvimagesink->flow_lock);
xvimagesink->handle_events = handle_events;
@ -1270,10 +1271,10 @@ gst_xvimagesink_set_event_handling (GstVideoOverlay * overlay,
}
static void
gst_xvimagesink_set_render_rectangle (GstVideoOverlay * overlay, gint x, gint y,
gint width, gint height)
gst_xv_image_sink_set_render_rectangle (GstVideoOverlay * overlay, gint x,
gint y, gint width, gint height)
{
GstXvImageSink *xvimagesink = GST_XVIMAGESINK (overlay);
GstXvImageSink *xvimagesink = GST_XV_IMAGE_SINK (overlay);
g_mutex_lock (&xvimagesink->flow_lock);
if (G_LIKELY (xvimagesink->xwindow))
@ -1283,20 +1284,20 @@ gst_xvimagesink_set_render_rectangle (GstVideoOverlay * overlay, gint x, gint y,
}
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->expose = gst_xvimagesink_expose;
iface->handle_events = gst_xvimagesink_set_event_handling;
iface->set_render_rectangle = gst_xvimagesink_set_render_rectangle;
iface->set_window_handle = gst_xv_image_sink_set_window_handle;
iface->expose = gst_xv_image_sink_expose;
iface->handle_events = gst_xv_image_sink_set_event_handling;
iface->set_render_rectangle = gst_xv_image_sink_set_render_rectangle;
}
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)
return xvimagesink->context->channels_list;
@ -1305,12 +1306,12 @@ gst_xvimagesink_colorbalance_list_channels (GstColorBalance * balance)
}
static void
gst_xvimagesink_colorbalance_set_value (GstColorBalance * balance,
gst_xv_image_sink_colorbalance_set_value (GstColorBalance * balance,
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);
xvimagesink->config.cb_changed = TRUE;
@ -1332,17 +1333,17 @@ gst_xvimagesink_colorbalance_set_value (GstColorBalance * balance,
return;
}
gst_xvimagesink_update_colorbalance (xvimagesink);
gst_xv_image_sink_update_colorbalance (xvimagesink);
}
static gint
gst_xvimagesink_colorbalance_get_value (GstColorBalance * balance,
gst_xv_image_sink_colorbalance_get_value (GstColorBalance * balance,
GstColorBalanceChannel * channel)
{
GstXvImageSink *xvimagesink = GST_XVIMAGESINK (balance);
GstXvImageSink *xvimagesink = GST_XV_IMAGE_SINK (balance);
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);
if (g_ascii_strcasecmp (channel->label, "XV_HUE") == 0) {
@ -1365,23 +1366,23 @@ gst_xvimagesink_colorbalance_get_value (GstColorBalance * balance,
}
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;
}
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->set_value = gst_xvimagesink_colorbalance_set_value;
iface->get_value = gst_xvimagesink_colorbalance_get_value;
iface->get_balance_type = gst_xvimagesink_colorbalance_get_balance_type;
iface->list_channels = gst_xv_image_sink_colorbalance_list_channels;
iface->set_value = gst_xv_image_sink_colorbalance_set_value;
iface->get_value = gst_xv_image_sink_colorbalance_get_value;
iface->get_balance_type = gst_xv_image_sink_colorbalance_get_balance_type;
}
#if 0
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);
static GList *list = NULL;
@ -1402,10 +1403,10 @@ gst_xvimagesink_probe_get_properties (GstPropertyProbe * probe)
}
static void
gst_xvimagesink_probe_probe_property (GstPropertyProbe * probe,
gst_xv_image_sink_probe_probe_property (GstPropertyProbe * probe,
guint prop_id, const GParamSpec * pspec)
{
GstXvImageSink *xvimagesink = GST_XVIMAGESINK (probe);
GstXvImageSink *xvimagesink = GST_XV_IMAGE_SINK (probe);
switch (prop_id) {
case PROP_DEVICE:
@ -1416,7 +1417,7 @@ gst_xvimagesink_probe_probe_property (GstPropertyProbe * probe,
"probing device list and get capabilities");
if (!xvimagesink->context) {
GST_DEBUG_OBJECT (xvimagesink, "generating context");
xvimagesink->context = gst_xvimagesink_context_get (xvimagesink);
xvimagesink->context = gst_xv_image_sink_context_get (xvimagesink);
}
break;
default:
@ -1426,10 +1427,10 @@ gst_xvimagesink_probe_probe_property (GstPropertyProbe * probe,
}
static gboolean
gst_xvimagesink_probe_needs_probe (GstPropertyProbe * probe,
gst_xv_image_sink_probe_needs_probe (GstPropertyProbe * probe,
guint prop_id, const GParamSpec * pspec)
{
GstXvImageSink *xvimagesink = GST_XVIMAGESINK (probe);
GstXvImageSink *xvimagesink = GST_XV_IMAGE_SINK (probe);
gboolean ret = FALSE;
switch (prop_id) {
@ -1452,10 +1453,10 @@ gst_xvimagesink_probe_needs_probe (GstPropertyProbe * probe,
}
static GValueArray *
gst_xvimagesink_probe_get_values (GstPropertyProbe * probe,
gst_xv_image_sink_probe_get_values (GstPropertyProbe * probe,
guint prop_id, const GParamSpec * pspec)
{
GstXvImageSink *xvimagesink = GST_XVIMAGESINK (probe);
GstXvImageSink *xvimagesink = GST_XV_IMAGE_SINK (probe);
GValueArray *array = NULL;
if (G_UNLIKELY (!xvimagesink->context)) {
@ -1530,13 +1531,13 @@ beach:
}
static void
gst_xvimagesink_property_probe_interface_init (GstPropertyProbeInterface *
gst_xv_image_sink_property_probe_interface_init (GstPropertyProbeInterface *
iface)
{
iface->get_properties = gst_xvimagesink_probe_get_properties;
iface->probe_property = gst_xvimagesink_probe_probe_property;
iface->needs_probe = gst_xvimagesink_probe_needs_probe;
iface->get_values = gst_xvimagesink_probe_get_values;
iface->get_properties = gst_xv_image_sink_probe_get_properties;
iface->probe_property = gst_xv_image_sink_probe_probe_property;
iface->needs_probe = gst_xv_image_sink_probe_needs_probe;
iface->get_values = gst_xv_image_sink_probe_get_values;
}
#endif
@ -1547,35 +1548,35 @@ gst_xvimagesink_property_probe_interface_init (GstPropertyProbeInterface *
/* =========================================== */
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)
{
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) {
case PROP_HUE:
xvimagesink->config.hue = g_value_get_int (value);
xvimagesink->config.cb_changed = TRUE;
gst_xvimagesink_update_colorbalance (xvimagesink);
gst_xv_image_sink_update_colorbalance (xvimagesink);
break;
case PROP_CONTRAST:
xvimagesink->config.contrast = g_value_get_int (value);
xvimagesink->config.cb_changed = TRUE;
gst_xvimagesink_update_colorbalance (xvimagesink);
gst_xv_image_sink_update_colorbalance (xvimagesink);
break;
case PROP_BRIGHTNESS:
xvimagesink->config.brightness = g_value_get_int (value);
xvimagesink->config.cb_changed = TRUE;
gst_xvimagesink_update_colorbalance (xvimagesink);
gst_xv_image_sink_update_colorbalance (xvimagesink);
break;
case PROP_SATURATION:
xvimagesink->config.saturation = g_value_get_int (value);
xvimagesink->config.cb_changed = TRUE;
gst_xvimagesink_update_colorbalance (xvimagesink);
gst_xv_image_sink_update_colorbalance (xvimagesink);
break;
case PROP_DISPLAY:
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);
break;
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));
gst_xvimagesink_manage_event_thread (xvimagesink);
gst_xv_image_sink_manage_event_thread (xvimagesink);
break;
case PROP_DEVICE:
xvimagesink->config.adaptor_nr = atoi (g_value_get_string (value));
break;
case PROP_HANDLE_EXPOSE:
xvimagesink->handle_expose = g_value_get_boolean (value);
gst_xvimagesink_manage_event_thread (xvimagesink);
gst_xv_image_sink_manage_event_thread (xvimagesink);
break;
case PROP_DOUBLE_BUFFER:
xvimagesink->double_buffer = g_value_get_boolean (value);
@ -1634,14 +1635,14 @@ gst_xvimagesink_set_property (GObject * object, guint prop_id,
}
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)
{
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) {
case PROP_HUE:
@ -1723,7 +1724,7 @@ gst_xvimagesink_get_property (GObject * object, guint prop_id,
}
static gboolean
gst_xvimagesink_open (GstXvImageSink * xvimagesink)
gst_xv_image_sink_open (GstXvImageSink * xvimagesink)
{
GError *error = NULL;
@ -1750,8 +1751,8 @@ gst_xvimagesink_open (GstXvImageSink * xvimagesink)
/* call XSynchronize with the current value of synchronous */
gst_xvcontext_set_synchronous (xvimagesink->context,
xvimagesink->synchronous);
gst_xvimagesink_update_colorbalance (xvimagesink);
gst_xvimagesink_manage_event_thread (xvimagesink);
gst_xv_image_sink_update_colorbalance (xvimagesink);
gst_xv_image_sink_manage_event_thread (xvimagesink);
return TRUE;
@ -1765,7 +1766,7 @@ no_context:
}
static void
gst_xvimagesink_close (GstXvImageSink * xvimagesink)
gst_xv_image_sink_close (GstXvImageSink * xvimagesink)
{
GThread *thread;
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
* as a finalize. */
static void
gst_xvimagesink_finalize (GObject * object)
gst_xv_image_sink_finalize (GObject * object)
{
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);
@ -1840,7 +1841,7 @@ gst_xvimagesink_finalize (GObject * object)
}
static void
gst_xvimagesink_init (GstXvImageSink * xvimagesink)
gst_xv_image_sink_init (GstXvImageSink * xvimagesink)
{
xvimagesink->config.display_name = NULL;
xvimagesink->config.adaptor_nr = 0;
@ -1878,7 +1879,7 @@ gst_xvimagesink_init (GstXvImageSink * xvimagesink)
}
static void
gst_xvimagesink_class_init (GstXvImageSinkClass * klass)
gst_xv_image_sink_class_init (GstXvImageSinkClass * klass)
{
GObjectClass *gobject_class;
GstElementClass *gstelement_class;
@ -1892,8 +1893,8 @@ gst_xvimagesink_class_init (GstXvImageSinkClass * klass)
parent_class = g_type_class_peek_parent (klass);
gobject_class->set_property = gst_xvimagesink_set_property;
gobject_class->get_property = gst_xvimagesink_get_property;
gobject_class->set_property = gst_xv_image_sink_set_property;
gobject_class->get_property = gst_xv_image_sink_get_property;
g_object_class_install_property (gobject_class, PROP_CONTRAST,
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,
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,
"Video sink", "Sink/Video",
"A Xv based videosink", "Julien Moutte <julien@moutte.net>");
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 =
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->set_caps = GST_DEBUG_FUNCPTR (gst_xvimagesink_setcaps);
gstbasesink_class->get_times = GST_DEBUG_FUNCPTR (gst_xvimagesink_get_times);
gstbasesink_class->get_caps = GST_DEBUG_FUNCPTR (gst_xv_image_sink_getcaps);
gstbasesink_class->set_caps = GST_DEBUG_FUNCPTR (gst_xv_image_sink_setcaps);
gstbasesink_class->get_times =
GST_DEBUG_FUNCPTR (gst_xv_image_sink_get_times);
gstbasesink_class->propose_allocation =
GST_DEBUG_FUNCPTR (gst_xvimagesink_propose_allocation);
gstbasesink_class->event = GST_DEBUG_FUNCPTR (gst_xvimagesink_event);
GST_DEBUG_FUNCPTR (gst_xv_image_sink_propose_allocation);
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);
}

View file

@ -17,8 +17,8 @@
* Boston, MA 02110-1301, USA.
*/
#ifndef __GST_XVIMAGESINK_H__
#define __GST_XVIMAGESINK_H__
#ifndef __GST_XV_IMAGE_SINK_H__
#define __GST_XV_IMAGE_SINK_H__
#include <gst/video/gstvideosink.h>
@ -26,16 +26,16 @@
#include <gst/video/video.h>
G_BEGIN_DECLS
#define GST_TYPE_XVIMAGESINK \
(gst_xvimagesink_get_type())
#define GST_XVIMAGESINK(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_XVIMAGESINK, GstXvImageSink))
#define GST_XVIMAGESINK_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_XVIMAGESINK, GstXvImageSinkClass))
#define GST_IS_XVIMAGESINK(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_XVIMAGESINK))
#define GST_IS_XVIMAGESINK_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_XVIMAGESINK))
#define GST_TYPE_XV_IMAGE_SINK \
(gst_xv_image_sink_get_type())
#define GST_XV_IMAGE_SINK(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_XV_IMAGE_SINK, GstXvImageSink))
#define GST_XV_IMAGE_SINK_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_XV_IMAGE_SINK, GstXvImageSinkClass))
#define GST_IS_XV_IMAGE_SINK(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_XV_IMAGE_SINK))
#define GST_IS_XV_IMAGE_SINK_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_XV_IMAGE_SINK))
typedef struct _GstXvImageSink GstXvImageSink;
typedef struct _GstXvImageSinkClass GstXvImageSinkClass;
@ -127,7 +127,7 @@ struct _GstXvImageSinkClass
GstVideoSinkClass parent_class;
};
GType gst_xvimagesink_get_type (void);
GType gst_xv_image_sink_get_type (void);
G_END_DECLS
#endif /* __GST_XVIMAGESINK_H__ */
#endif /* __GST_XV_IMAGE_SINK_H__ */