Skip to content

Commit 21efccf

Browse files
committed
Merge branch 'hotfix/caps-negotiation'
2 parents 0868270 + edca54f commit 21efccf

File tree

3 files changed

+22
-16
lines changed

3 files changed

+22
-16
lines changed

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ dnl please read gstreamer/docs/random/autotools before changing this file
66
dnl initialize autoconf
77
dnl releases only do -Wall, git and prerelease does -Werror too
88
dnl use a three digit version number for releases, and four for git/pre
9-
AC_INIT([GstInterpipe],[1.1.9],
9+
AC_INIT([GstInterpipe],[1.1.10],
1010
[http://www.github.com/RidgeRun/gst-interpipe-1.0],
1111
[gst-interpipe],
1212
[http://developer.ridgerun.com/wiki/index.php?title=GstInterpipe])

gst/interpipe/gstinterpipesink.c

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -332,8 +332,7 @@ gst_inter_pipe_sink_update_listener_caps (gpointer key, gpointer data,
332332
GST_LOG_OBJECT (appsink, "Setting caps %" GST_PTR_FORMAT " to %s",
333333
caps, listener_name);
334334

335-
gst_inter_pipe_ilistener_set_caps (listener,
336-
GST_INTER_PIPE_SINK (appsink)->caps);
335+
gst_inter_pipe_ilistener_set_caps (listener, caps);
337336
}
338337

339338

@@ -413,6 +412,7 @@ gst_inter_pipe_sink_get_caps (GstBaseSink * base, GstCaps * filter)
413412
GstInterPipeIListener *listener;
414413
GHashTable *listeners;
415414
GstCaps *pre_filter;
415+
GstCaps *intercept_caps;
416416
GList *listeners_list = NULL;
417417
GList *l = NULL;
418418

@@ -439,22 +439,24 @@ gst_inter_pipe_sink_get_caps (GstBaseSink * base, GstCaps * filter)
439439
goto nointersection;
440440
}
441441

442+
GST_INFO_OBJECT (sink, "Caps negotiated: %" GST_PTR_FORMAT,
443+
sink->caps_negotiated);
444+
442445
/* Take into account upsream caps suggestion */
443446
pre_filter = sink->caps_negotiated;
444-
sink->caps_negotiated =
447+
intercept_caps =
445448
gst_inter_pipe_sink_caps_intersect (pre_filter, filter);
446-
gst_caps_unref (pre_filter);
447449

448-
GST_INFO_OBJECT (sink, "Caps negotiated: %" GST_PTR_FORMAT,
449-
sink->caps_negotiated);
450+
GST_INFO_OBJECT (sink, "Filtered caps: %" GST_PTR_FORMAT,
451+
intercept_caps);
450452

451-
if (!sink->caps_negotiated || gst_caps_is_empty (sink->caps_negotiated)) {
453+
if (!intercept_caps || gst_caps_is_empty (intercept_caps)) {
452454
GST_ERROR_OBJECT (sink,
453455
"Failed to obtain an intersection between upstream elements and listeners");
454456
goto nointersection;
455457
}
456458

457-
return gst_caps_ref (sink->caps_negotiated);
459+
return intercept_caps;
458460

459461
nolisteners:
460462
{
@@ -498,12 +500,10 @@ gst_inter_pipe_sink_set_caps (GstBaseSink * base, GstCaps * caps)
498500
GST_INFO_OBJECT (sink, "Negotiated Caps: %" GST_PTR_FORMAT,
499501
sink->caps_negotiated);
500502

501-
gst_caps_replace (&sink->caps, caps);
502-
gst_app_sink_set_caps (GST_APP_SINK (sink), caps);
503-
504503
/* No one is listening to me I can accept caps */
505-
if (0 == g_hash_table_size (listeners))
506-
return TRUE;
504+
if (0 == g_hash_table_size (listeners)) {
505+
goto out;
506+
}
507507

508508
g_mutex_lock (&sink->listeners_mutex);
509509
if (sink->caps_negotiated
@@ -524,8 +524,14 @@ gst_inter_pipe_sink_set_caps (GstBaseSink * base, GstCaps * caps)
524524
}
525525

526526
g_mutex_unlock (&sink->listeners_mutex);
527-
return ret;
528527

528+
out:
529+
if (ret) {
530+
gst_caps_replace (&sink->caps, caps);
531+
gst_app_sink_set_caps (GST_APP_SINK (sink), caps);
532+
}
533+
534+
return ret;
529535
}
530536

531537
static void

meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
project('gst-interpipes', 'c',
2-
version : '1.1.9',
2+
version : '1.1.10',
33
meson_version : '>= 0.50',)
44

55
gst_interpipes_version = meson.project_version()

0 commit comments

Comments
 (0)