Codebase list kmscube / a07e4da
gst-decoder.c: look at the caps event instead of the allocation query Signed-off-by: Carlos Rafael Giani <dv@pseudoterminal.org> Carlos Rafael Giani authored 7 years ago Rob Clark committed 7 years ago
1 changed file(s) with 6 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
6262 pad_probe(GstPad *pad, GstPadProbeInfo *info, gpointer user_data)
6363 {
6464 struct decoder *dec = user_data;
65 GstQuery *query = GST_PAD_PROBE_INFO_QUERY(info);
66 gboolean need_pool;
65 GstEvent *event = GST_PAD_PROBE_INFO_EVENT(info);
6766 GstCaps *caps;
6867
6968 (void)pad;
7069
71 if (GST_QUERY_TYPE(query) != GST_QUERY_ALLOCATION)
70 if (GST_EVENT_TYPE(event) != GST_EVENT_CAPS)
7271 return GST_PAD_PROBE_OK;
7372
74 gst_query_parse_allocation(query, &caps, &need_pool);
73 gst_event_parse_caps(event, &caps);
7574
7675 if (!caps) {
77 GST_ERROR("allocation query without caps");
76 GST_ERROR("caps event without caps");
7877 return GST_PAD_PROBE_OK;
7978 }
8079
8180 if (!gst_video_info_from_caps(&dec->info, caps)) {
82 GST_ERROR("allocation query with invalid caps");
81 GST_ERROR("caps event with invalid video caps");
8382 return GST_PAD_PROBE_OK;
8483 }
8584
155154 g_object_set(G_OBJECT(dec->sink), "max-buffers", 2, NULL);
156155
157156 gst_pad_add_probe(gst_element_get_static_pad(dec->sink, "sink"),
158 GST_PAD_PROBE_TYPE_QUERY_DOWNSTREAM,
157 GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM,
159158 pad_probe, dec, NULL);
160159
161160 /* hack to make sure we get dmabuf's from v4l2video0dec.. */