mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-30 11:08:34 +00:00
Revert "basetextoverlay: remove dead code"
This reverts commit e863e5f8a9
.
This commit is contained in:
parent
e863e5f8a9
commit
828f0291bf
1 changed files with 34 additions and 26 deletions
|
@ -698,13 +698,13 @@ gst_base_text_overlay_setcaps_txt (GstBaseTextOverlay * overlay, GstCaps * caps)
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_base_text_overlay_negotiate (GstBaseTextOverlay * overlay, GstCaps * caps)
|
gst_base_text_overlay_negotiate (GstBaseTextOverlay * overlay, GstCaps * caps)
|
||||||
{
|
{
|
||||||
|
gboolean upstream_has_meta = FALSE;
|
||||||
gboolean caps_has_meta = FALSE;
|
gboolean caps_has_meta = FALSE;
|
||||||
gboolean alloc_has_meta = FALSE;
|
gboolean alloc_has_meta = FALSE;
|
||||||
gboolean attach = FALSE;
|
gboolean attach = FALSE;
|
||||||
gboolean ret = TRUE;
|
gboolean ret = TRUE;
|
||||||
GstCapsFeatures *f;
|
GstCapsFeatures *f;
|
||||||
GstCaps *overlay_caps;
|
GstCaps *overlay_caps;
|
||||||
GstQuery *query;
|
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (overlay, "performing negotiation");
|
GST_DEBUG_OBJECT (overlay, "performing negotiation");
|
||||||
|
|
||||||
|
@ -722,6 +722,11 @@ gst_base_text_overlay_negotiate (GstBaseTextOverlay * overlay, GstCaps * caps)
|
||||||
GST_CAPS_FEATURE_META_GST_VIDEO_OVERLAY_COMPOSITION);
|
GST_CAPS_FEATURE_META_GST_VIDEO_OVERLAY_COMPOSITION);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (upstream_has_meta) {
|
||||||
|
overlay_caps = gst_caps_ref (caps);
|
||||||
|
} else {
|
||||||
|
GstQuery *query;
|
||||||
|
|
||||||
/* First check if the allocation meta has compositon */
|
/* First check if the allocation meta has compositon */
|
||||||
query = gst_query_new_allocation (caps, FALSE);
|
query = gst_query_new_allocation (caps, FALSE);
|
||||||
|
|
||||||
|
@ -749,13 +754,16 @@ gst_base_text_overlay_negotiate (GstBaseTextOverlay * overlay, GstCaps * caps)
|
||||||
|
|
||||||
caps_has_meta = gst_pad_peer_query_accept_caps (overlay->srcpad,
|
caps_has_meta = gst_pad_peer_query_accept_caps (overlay->srcpad,
|
||||||
overlay_caps);
|
overlay_caps);
|
||||||
|
}
|
||||||
|
|
||||||
/* For backward compatbility, we will prefer bliting if downstream
|
/* For backward compatbility, we will prefer bliting if downstream
|
||||||
* allocation does not support the meta. In other case we will prefer
|
* allocation does not support the meta. In other case we will prefer
|
||||||
* attaching, and will fail the negotiation in the unlikely case we are
|
* attaching, and will fail the negotiation in the unlikely case we are
|
||||||
* force to blit, but format isn't supported. */
|
* force to blit, but format isn't supported. */
|
||||||
|
|
||||||
if (caps_has_meta) {
|
if (upstream_has_meta) {
|
||||||
|
attach = TRUE;
|
||||||
|
} else if (caps_has_meta) {
|
||||||
if (alloc_has_meta) {
|
if (alloc_has_meta) {
|
||||||
attach = TRUE;
|
attach = TRUE;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue