Skip to content

Commit

Permalink
plugin: enable direct upload if raw video
Browse files Browse the repository at this point in the history
Enable the direct upload with linear surfaces if the negotiated sink caps are
video/x-raw without features.
  • Loading branch information
ceyusa committed Oct 21, 2016
1 parent ad6fd96 commit 7bb4a12
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions gst/vaapi/gstvaapipluginbase.c
Expand Up @@ -529,9 +529,19 @@ ensure_sinkpad_allocator (GstVaapiPluginBase * plugin, GstVideoInfo * vinfo)
gst_vaapi_dmabuf_allocator_new (plugin->display, vinfo,
GST_VAAPI_SURFACE_ALLOC_FLAG_LINEAR_STORAGE);
} else {
GstVaapiImageUsageFlags usage_flag =
GST_VAAPI_IMAGE_USAGE_FLAG_NATIVE_FORMATS;
guint alloc_flag = 0;

if (gst_caps_is_video_raw (plugin->sinkpad_caps)) {
usage_flag = GST_VAAPI_IMAGE_USAGE_FLAG_DIRECT_UPLOAD;
alloc_flag = GST_VAAPI_SURFACE_ALLOC_FLAG_LINEAR_STORAGE;
GST_INFO_OBJECT (plugin, "enabling direct upload in sink allocator");
}

plugin->sinkpad_allocator =
gst_vaapi_video_allocator_new (plugin->display, vinfo, 0,
GST_VAAPI_IMAGE_USAGE_FLAG_NATIVE_FORMATS);
gst_vaapi_video_allocator_new (plugin->display, vinfo, alloc_flag,
usage_flag);
}
return plugin->sinkpad_allocator != NULL;
}
Expand Down

0 comments on commit 7bb4a12

Please sign in to comment.