diff options
author | Carlos Rafael Giani <dv@pseudoterminal.org> | 2017-04-26 20:56:16 +0200 |
---|---|---|
committer | Rob Clark <robdclark@gmail.com> | 2017-04-29 10:23:41 -0400 |
commit | a07e4dabed604bbc7ff9fa6eea58eb009af24197 (patch) | |
tree | cc8f0cea36c4361acf4c4f3bfe30d0d89369d6cf /gst-decoder.c | |
parent | 1ac23b18c987d37449812ec022f2f52ec14424fb (diff) | |
download | kmscube-a07e4dabed604bbc7ff9fa6eea58eb009af24197.tar.gz |
gst-decoder.c: look at the caps event instead of the allocation query
Signed-off-by: Carlos Rafael Giani <dv@pseudoterminal.org>
Diffstat (limited to 'gst-decoder.c')
-rw-r--r-- | gst-decoder.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/gst-decoder.c b/gst-decoder.c index fd28201..51304a2 100644 --- a/gst-decoder.c +++ b/gst-decoder.c @@ -63,24 +63,23 @@ static GstPadProbeReturn pad_probe(GstPad *pad, GstPadProbeInfo *info, gpointer user_data) { struct decoder *dec = user_data; - GstQuery *query = GST_PAD_PROBE_INFO_QUERY(info); - gboolean need_pool; + GstEvent *event = GST_PAD_PROBE_INFO_EVENT(info); GstCaps *caps; (void)pad; - if (GST_QUERY_TYPE(query) != GST_QUERY_ALLOCATION) + if (GST_EVENT_TYPE(event) != GST_EVENT_CAPS) return GST_PAD_PROBE_OK; - gst_query_parse_allocation(query, &caps, &need_pool); + gst_event_parse_caps(event, &caps); if (!caps) { - GST_ERROR("allocation query without caps"); + GST_ERROR("caps event without caps"); return GST_PAD_PROBE_OK; } if (!gst_video_info_from_caps(&dec->info, caps)) { - GST_ERROR("allocation query with invalid caps"); + GST_ERROR("caps event with invalid video caps"); return GST_PAD_PROBE_OK; } @@ -156,7 +155,7 @@ video_init(const struct egl *egl, const struct gbm *gbm, const char *filename) g_object_set(G_OBJECT(dec->sink), "max-buffers", 2, NULL); gst_pad_add_probe(gst_element_get_static_pad(dec->sink, "sink"), - GST_PAD_PROBE_TYPE_QUERY_DOWNSTREAM, + GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM, pad_probe, dec, NULL); /* hack to make sure we get dmabuf's from v4l2video0dec.. */ |