GstCaps *incaps;
GstCaps *outcaps;
+ GstCaps *alloccaps;
GstVideoInfo in_info;
GstVideoInfo out_info;
gboolean negotiated;
gst_clear_caps (&self->incaps);
gst_clear_caps (&self->outcaps);
+ gst_clear_caps (&self->alloccaps);
gst_clear_object (&self->filter);
gst_clear_object (&self->display);
GstCaps *caps;
guint size;
+ gst_clear_caps (&self->alloccaps);
+
if (!GST_BASE_TRANSFORM_CLASS (parent_class)->propose_allocation (trans,
decide_query, query))
return FALSE;
- /* passthrough, we're done */
- if (decide_query == NULL)
- return TRUE;
-
gst_query_parse_allocation (query, &caps, NULL);
-
if (caps == NULL)
return FALSE;
-
if (!gst_video_info_from_caps (&info, caps))
return FALSE;
+ self->alloccaps = gst_caps_ref (caps);
+
+ /* passthrough, we're done */
+ if (decide_query == NULL)
+ return TRUE;
+
size = GST_VIDEO_INFO_SIZE (&info);
if (gst_query_get_n_allocation_pools (query) == 0) {
{
GstAllocator *allocator;
GstAllocationParams params;
- GstVideoInfo alloc_info;
+ GstCaps *caps;
+ GstVideoInfo alloc_info, in_info;
guint size, usage_hint = VA_SURFACE_ATTRIB_USAGE_HINT_VPP_READ;
if (self->sinkpad_pool)
gst_allocation_params_init (¶ms);
- size = GST_VIDEO_INFO_SIZE (&self->in_info);
+ if (self->alloccaps) {
+ caps = self->alloccaps;
+ gst_video_info_from_caps (&in_info, caps);
+ } else {
+ caps = self->incaps;
+ in_info = self->in_info;
+ }
+
+ size = GST_VIDEO_INFO_SIZE (&in_info);
- allocator = _create_allocator (self, self->incaps, usage_hint);
+ allocator = _create_allocator (self, caps, usage_hint);
- self->sinkpad_pool = _create_sinkpad_bufferpool (self->incaps, size, 1, 0,
- usage_hint, allocator, ¶ms);
+ self->sinkpad_pool = _create_sinkpad_bufferpool (caps, size, 1, 0, usage_hint,
+ allocator, ¶ms);
if (GST_IS_VA_DMABUF_ALLOCATOR (allocator)) {
if (!gst_va_dmabuf_allocator_get_format (allocator, &alloc_info, NULL))
- alloc_info = self->in_info;
+ alloc_info = in_info;
} else if (GST_IS_VA_ALLOCATOR (allocator)) {
if (!gst_va_allocator_get_format (allocator, &alloc_info, NULL))
- alloc_info = self->in_info;
+ alloc_info = in_info;
}
gst_object_unref (allocator);