d3d11videosink: Use staging buffer pool for non-d3d11 upstream
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1643>
This commit is contained in:
parent
9518f15309
commit
499c89c729
@ -864,19 +864,13 @@ gst_d3d11_video_sink_propose_allocation (GstBaseSink * sink, GstQuery * query)
|
|||||||
pool = gst_d3d11_buffer_pool_new (self->device);
|
pool = gst_d3d11_buffer_pool_new (self->device);
|
||||||
is_d3d11 = true;
|
is_d3d11 = true;
|
||||||
} else {
|
} else {
|
||||||
pool = gst_video_buffer_pool_new ();
|
pool = gst_d3d11_staging_buffer_pool_new (self->device);
|
||||||
}
|
}
|
||||||
|
|
||||||
config = gst_buffer_pool_get_config (pool);
|
config = gst_buffer_pool_get_config (pool);
|
||||||
gst_buffer_pool_config_add_option (config,
|
gst_buffer_pool_config_add_option (config,
|
||||||
GST_BUFFER_POOL_OPTION_VIDEO_META);
|
GST_BUFFER_POOL_OPTION_VIDEO_META);
|
||||||
|
|
||||||
/* d3d11 pool does not support video alignment */
|
|
||||||
if (!is_d3d11) {
|
|
||||||
gst_buffer_pool_config_add_option (config,
|
|
||||||
GST_BUFFER_POOL_OPTION_VIDEO_ALIGNMENT);
|
|
||||||
}
|
|
||||||
|
|
||||||
size = GST_VIDEO_INFO_SIZE (&info);
|
size = GST_VIDEO_INFO_SIZE (&info);
|
||||||
if (is_d3d11) {
|
if (is_d3d11) {
|
||||||
GstD3D11AllocationParams *d3d11_params;
|
GstD3D11AllocationParams *d3d11_params;
|
||||||
@ -898,7 +892,6 @@ gst_d3d11_video_sink_propose_allocation (GstBaseSink * sink, GstQuery * query)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_d3d11) {
|
|
||||||
/* d3d11 buffer pool will update buffer size based on allocated texture,
|
/* d3d11 buffer pool will update buffer size based on allocated texture,
|
||||||
* get size from config again */
|
* get size from config again */
|
||||||
config = gst_buffer_pool_get_config (pool);
|
config = gst_buffer_pool_get_config (pool);
|
||||||
@ -906,6 +899,7 @@ gst_d3d11_video_sink_propose_allocation (GstBaseSink * sink, GstQuery * query)
|
|||||||
nullptr);
|
nullptr);
|
||||||
gst_structure_free (config);
|
gst_structure_free (config);
|
||||||
|
|
||||||
|
if (is_d3d11) {
|
||||||
/* In case of system memory, we will upload video frame to GPU memory,
|
/* In case of system memory, we will upload video frame to GPU memory,
|
||||||
* (which is copy in any case), so crop meta support for system memory
|
* (which is copy in any case), so crop meta support for system memory
|
||||||
* is almost pointless */
|
* is almost pointless */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user