gst_query_parse_nth_allocation_pool (query, 0, &pool, &size, &min, &max);
/* create our own pool */
- if (pool && !GST_IS_D3D11_BUFFER_POOL (pool)) {
- gst_object_unref (pool);
- pool = NULL;
+ if (pool) {
+ if (!GST_IS_D3D11_BUFFER_POOL (pool)) {
+ gst_clear_object (&pool);
+ } else {
+ GstD3D11BufferPool *dpool = GST_D3D11_BUFFER_POOL (pool);
+ if (dpool->device != self->device)
+ gst_clear_object (&pool);
+ }
}
if (!pool) {
n_pools = gst_query_get_n_allocation_pools (query);
for (i = 0; i < n_pools; i++) {
gst_query_parse_nth_allocation_pool (query, i, &pool, NULL, NULL, NULL);
- if (!GST_IS_D3D11_BUFFER_POOL (pool)) {
- gst_object_unref (pool);
- pool = NULL;
+ if (pool) {
+ if (!GST_IS_D3D11_BUFFER_POOL (pool)) {
+ gst_clear_object (&pool);
+ } else {
+ GstD3D11BufferPool *dpool = GST_D3D11_BUFFER_POOL (pool);
+ if (dpool->device != filter->device)
+ gst_clear_object (&pool);
+ }
}
}
if (gst_query_get_n_allocation_pools (query) > 0) {
gst_query_parse_nth_allocation_pool (query, 0, &pool, &size, &min, &max);
- if (pool && !GST_IS_D3D11_BUFFER_POOL (pool)) {
- gst_object_unref (pool);
- pool = NULL;
+ if (pool) {
+ if (!GST_IS_D3D11_BUFFER_POOL (pool)) {
+ gst_clear_object (&pool);
+ } else {
+ GstD3D11BufferPool *dpool = GST_D3D11_BUFFER_POOL (pool);
+ if (dpool->device != filter->device)
+ gst_clear_object (&pool);
+ }
}
update_pool = TRUE;
n_pools = gst_query_get_n_allocation_pools (query);
for (i = 0; i < n_pools; i++) {
gst_query_parse_nth_allocation_pool (query, i, &pool, NULL, NULL, NULL);
- if (!GST_IS_D3D11_BUFFER_POOL (pool)) {
- gst_object_unref (pool);
- pool = NULL;
+ if (pool) {
+ if (!GST_IS_D3D11_BUFFER_POOL (pool)) {
+ gst_clear_object (&pool);
+ } else {
+ GstD3D11BufferPool *dpool = GST_D3D11_BUFFER_POOL (pool);
+ if (dpool->device != self->device)
+ gst_clear_object (&pool);
+ }
}
}
if (gst_query_get_n_allocation_pools (query) > 0) {
gst_query_parse_nth_allocation_pool (query, 0, &pool, &size, &min, &max);
- if (pool && !GST_IS_D3D11_BUFFER_POOL (pool)) {
- gst_object_unref (pool);
- pool = NULL;
+ if (pool) {
+ if (!GST_IS_D3D11_BUFFER_POOL (pool)) {
+ gst_clear_object (&pool);
+ } else {
+ GstD3D11BufferPool *dpool = GST_D3D11_BUFFER_POOL (pool);
+ if (dpool->device != self->device)
+ gst_clear_object (&pool);
+ }
}
update_pool = TRUE;
update_pool = FALSE;
}
- if (!pool || !GST_IS_D3D11_BUFFER_POOL (pool)) {
- gst_clear_object (&pool);
- pool = gst_d3d11_buffer_pool_new (self->device);
+ if (pool) {
+ if (!GST_IS_D3D11_BUFFER_POOL (pool)) {
+ gst_clear_object (&pool);
+ } else {
+ GstD3D11BufferPool *dpool = GST_D3D11_BUFFER_POOL (pool);
+ if (dpool->device != self->device)
+ gst_clear_object (&pool);
+ }
}
+ if (!pool)
+ pool = gst_d3d11_buffer_pool_new (self->device);
+
config = gst_buffer_pool_get_config (pool);
gst_buffer_pool_config_set_params (config, caps, size, min, max);
if (gst_query_get_n_allocation_pools (query) > 0) {
gst_query_parse_nth_allocation_pool (query, 0, &pool, &size, &min, &max);
- if (pool && !GST_IS_D3D11_BUFFER_POOL (pool)) {
- gst_object_unref (pool);
- pool = NULL;
+ if (pool) {
+ if (!GST_IS_D3D11_BUFFER_POOL (pool)) {
+ gst_clear_object (&pool);
+ } else {
+ GstD3D11BufferPool *dpool = GST_D3D11_BUFFER_POOL (pool);
+ if (dpool->device != filter->device)
+ gst_clear_object (&pool);
+ }
}
update_pool = TRUE;