mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 14:56:36 +00:00
ximagesink: Add caps with the current window geometry to the top in getcaps
This commit is contained in:
parent
213050e53c
commit
092438200c
1 changed files with 21 additions and 2 deletions
|
@ -974,8 +974,27 @@ gst_ximagesink_getcaps (GstBaseSink * bsink)
|
|||
|
||||
ximagesink = GST_XIMAGESINK (bsink);
|
||||
|
||||
if (ximagesink->xcontext)
|
||||
return gst_caps_ref (ximagesink->xcontext->caps);
|
||||
g_mutex_lock (ximagesink->x_lock);
|
||||
if (ximagesink->xcontext) {
|
||||
if (ximagesink->xwindow && ximagesink->xwindow->width) {
|
||||
GstStructure *s0, *s1;
|
||||
|
||||
caps = gst_caps_copy (ximagesink->xcontext->caps);
|
||||
|
||||
s1 = gst_structure_copy (gst_caps_get_structure (caps, 0));
|
||||
s0 = gst_caps_get_structure (caps, 0);
|
||||
gst_structure_set (s0, "width", G_TYPE_INT, ximagesink->xwindow->width,
|
||||
"height", G_TYPE_INT, ximagesink->xwindow->height, NULL);
|
||||
gst_caps_append_structure (caps, s1);
|
||||
g_mutex_unlock (ximagesink->x_lock);
|
||||
return caps;
|
||||
} else {
|
||||
caps = gst_caps_ref (ximagesink->xcontext->caps);
|
||||
g_mutex_unlock (ximagesink->x_lock);
|
||||
return caps;
|
||||
}
|
||||
}
|
||||
g_mutex_unlock (ximagesink->x_lock);
|
||||
|
||||
/* get a template copy and add the pixel aspect ratio */
|
||||
caps =
|
||||
|
|
Loading…
Reference in a new issue