sink->video_width = video_width;
sink->video_height = video_height;
- if (gst_structure_has_name(structure, "video/x-raw-yuv"))
+ if (gst_structure_has_name(structure, "video/x-raw-yuv")) {
sink->use_video_raw = TRUE;
+ // in case _buffer_alloc is not called before
+ if (!gst_vaapi_uploader_ensure_display(sink->uploader, sink->display))
+ return GST_FLOW_NOT_SUPPORTED;
+ if (!gst_vaapi_uploader_ensure_caps(sink->uploader, caps, NULL))
+ return GST_FLOW_NOT_SUPPORTED;
+ }
gst_video_parse_caps_pixel_aspect_ratio(caps, &video_par_n, &video_par_d);
sink->video_par_n = video_par_n;