mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 14:56:36 +00:00
ximagsink: Add read-only properties window-width and window-height
This commit is contained in:
parent
a13720fc55
commit
2ad9966163
1 changed files with 23 additions and 1 deletions
|
@ -151,7 +151,9 @@ enum
|
|||
PROP_PIXEL_ASPECT_RATIO,
|
||||
PROP_FORCE_ASPECT_RATIO,
|
||||
PROP_HANDLE_EVENTS,
|
||||
PROP_HANDLE_EXPOSE
|
||||
PROP_HANDLE_EXPOSE,
|
||||
PROP_WINDOW_WIDTH,
|
||||
PROP_WINDOW_HEIGHT
|
||||
};
|
||||
|
||||
static GstVideoSinkClass *parent_class = NULL;
|
||||
|
@ -2228,6 +2230,18 @@ gst_ximagesink_get_property (GObject * object, guint prop_id,
|
|||
case PROP_HANDLE_EXPOSE:
|
||||
g_value_set_boolean (value, ximagesink->handle_expose);
|
||||
break;
|
||||
case PROP_WINDOW_WIDTH:
|
||||
if (ximagesink->xwindow)
|
||||
g_value_set_uint64 (value, ximagesink->xwindow->width);
|
||||
else
|
||||
g_value_set_uint64 (value, 0);
|
||||
break;
|
||||
case PROP_WINDOW_HEIGHT:
|
||||
if (ximagesink->xwindow)
|
||||
g_value_set_uint64 (value, ximagesink->xwindow->height);
|
||||
else
|
||||
g_value_set_uint64 (value, 0);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
|
@ -2393,6 +2407,14 @@ gst_ximagesink_class_init (GstXImageSinkClass * klass)
|
|||
"When enabled, "
|
||||
"the current frame will always be drawn in response to X Expose "
|
||||
"events", TRUE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||
g_object_class_install_property (gobject_class, PROP_WINDOW_WIDTH,
|
||||
g_param_spec_uint64 ("window-width", "window-width",
|
||||
"Width of the screen", 0, G_MAXUINT64, 0,
|
||||
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
|
||||
g_object_class_install_property (gobject_class, PROP_WINDOW_HEIGHT,
|
||||
g_param_spec_uint64 ("window-height", "window-height",
|
||||
"Height of the screen", 0, G_MAXUINT64, 0,
|
||||
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
|
||||
|
||||
gstelement_class->change_state = gst_ximagesink_change_state;
|
||||
|
||||
|
|
Loading…
Reference in a new issue