mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 11:41:09 +00:00
d3d12: Remove notify_com and notify_mini_object helper methods
Use private macros instead of exposing multiple APIs for the same thing Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7057>
This commit is contained in:
parent
6942868bda
commit
289bc1d440
17 changed files with 86 additions and 123 deletions
|
@ -112,4 +112,17 @@ private:
|
|||
GstD3D12Device *device_;
|
||||
};
|
||||
|
||||
static inline void
|
||||
gst_d3d12_com_release (IUnknown * unknown)
|
||||
{
|
||||
if (unknown)
|
||||
unknown->Release ();
|
||||
}
|
||||
|
||||
#define FENCE_NOTIFY_COM(obj) \
|
||||
((gpointer) (obj)), ((GDestroyNotify) gst_d3d12_com_release)
|
||||
|
||||
#define FENCE_NOTIFY_MINI_OBJECT(obj) \
|
||||
((gpointer) (obj)), ((GDestroyNotify) gst_mini_object_unref)
|
||||
|
||||
#endif /* __cplusplus */
|
||||
|
|
|
@ -1959,7 +1959,7 @@ gst_d3d12_converter_execute (GstD3D12Converter * self, GstD3D12Frame * in_frame,
|
|||
}
|
||||
|
||||
auto srv_heap = gst_d3d12_descriptor_get_handle (descriptor);
|
||||
gst_d3d12_fence_data_add_notify_mini_object (fence_data, descriptor);
|
||||
gst_d3d12_fence_data_push (fence_data, FENCE_NOTIFY_MINI_OBJECT (descriptor));
|
||||
|
||||
auto cpu_handle =
|
||||
CD3DX12_CPU_DESCRIPTOR_HANDLE (GetCPUDescriptorHandleForHeapStart
|
||||
|
@ -2014,7 +2014,7 @@ gst_d3d12_converter_execute (GstD3D12Converter * self, GstD3D12Frame * in_frame,
|
|||
cl->DrawIndexedInstanced (6, 1, 0, 0, 0);
|
||||
|
||||
pso->AddRef ();
|
||||
gst_d3d12_fence_data_add_notify_com (fence_data, pso);
|
||||
gst_d3d12_fence_data_push (fence_data, FENCE_NOTIFY_COM (pso));
|
||||
|
||||
auto offset = priv->quad_data[0].num_rtv;
|
||||
if (priv->quad_data.size () == 2) {
|
||||
|
@ -2029,13 +2029,13 @@ gst_d3d12_converter_execute (GstD3D12Converter * self, GstD3D12Frame * in_frame,
|
|||
cl->DrawIndexedInstanced (6, 1, 0, 0, 0);
|
||||
|
||||
pso->AddRef ();
|
||||
gst_d3d12_fence_data_add_notify_com (fence_data, pso);
|
||||
gst_d3d12_fence_data_push (fence_data, FENCE_NOTIFY_COM (pso));
|
||||
}
|
||||
|
||||
gst_d3d12_fence_data_add_notify_mini_object (fence_data,
|
||||
gst_buffer_ref (in_frame->buffer));
|
||||
gst_d3d12_fence_data_push (fence_data,
|
||||
FENCE_NOTIFY_MINI_OBJECT (gst_buffer_ref (in_frame->buffer)));
|
||||
if (priv->upload_data) {
|
||||
gst_d3d12_fence_data_add_notify (fence_data,
|
||||
gst_d3d12_fence_data_push (fence_data,
|
||||
priv->upload_data, (GDestroyNotify) converter_upload_data_free);
|
||||
}
|
||||
priv->upload_data = nullptr;
|
||||
|
|
|
@ -1419,7 +1419,7 @@ gst_d3d12_device_get_completed_value (GstD3D12Device * device,
|
|||
}
|
||||
|
||||
/**
|
||||
* gst_d3d12_device_get_completed_value:
|
||||
* gst_d3d12_device_set_fence_notify:
|
||||
* @device: a #GstD3D12Device
|
||||
* @queue_type: a D3D12_COMMAND_LIST_TYPE
|
||||
* @fence_value: target fence value
|
||||
|
@ -1436,7 +1436,7 @@ gst_d3d12_device_get_completed_value (GstD3D12Device * device,
|
|||
gboolean
|
||||
gst_d3d12_device_set_fence_notify (GstD3D12Device * device,
|
||||
D3D12_COMMAND_LIST_TYPE queue_type, guint64 fence_value,
|
||||
GstD3D12FenceData * fence_data)
|
||||
gpointer fence_data, GDestroyNotify notify)
|
||||
{
|
||||
g_return_val_if_fail (GST_IS_D3D12_DEVICE (device), FALSE);
|
||||
g_return_val_if_fail (fence_data, FALSE);
|
||||
|
@ -1456,8 +1456,7 @@ gst_d3d12_device_set_fence_notify (GstD3D12Device * device,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
gst_d3d12_command_queue_set_notify (queue, fence_value, fence_data,
|
||||
(GDestroyNotify) gst_d3d12_fence_data_unref);
|
||||
gst_d3d12_command_queue_set_notify (queue, fence_value, fence_data, notify);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -1549,7 +1548,7 @@ gst_d3d12_device_copy_texture_region (GstD3D12Device * device,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
gst_d3d12_fence_data_add_notify_mini_object (fence_data, gst_ca);
|
||||
gst_d3d12_fence_data_push (fence_data, FENCE_NOTIFY_MINI_OBJECT (gst_ca));
|
||||
|
||||
auto ca = gst_d3d12_command_allocator_get_handle (gst_ca);
|
||||
gst_d3d12_command_list_pool_acquire (cl_pool, ca, &gst_cl);
|
||||
|
|
|
@ -108,7 +108,8 @@ GST_D3D12_API
|
|||
gboolean gst_d3d12_device_set_fence_notify (GstD3D12Device * device,
|
||||
D3D12_COMMAND_LIST_TYPE queue_type,
|
||||
guint64 fence_value,
|
||||
GstD3D12FenceData * fence_data);
|
||||
gpointer fence_data,
|
||||
GDestroyNotify notify);
|
||||
|
||||
GST_D3D12_API
|
||||
HRESULT gst_d3d12_device_fence_wait (GstD3D12Device * device,
|
||||
|
|
|
@ -220,20 +220,8 @@ gst_d3d12_fence_data_pool_acquire (GstD3D12FenceDataPool * pool,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
static inline void
|
||||
gst_d3d12_fence_data_add_notify_internal (GstD3D12FenceData * data,
|
||||
gpointer user_data, GDestroyNotify notify)
|
||||
{
|
||||
NotifyData notify_data;
|
||||
|
||||
notify_data.user_data = user_data;
|
||||
notify_data.notify = notify;
|
||||
|
||||
gst_vec_deque_push_tail_struct (data->queue, ¬ify_data);
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_d3d12_fence_data_add_notify:
|
||||
* gst_d3d12_fence_data_push:
|
||||
* @data: a #GstD3D12FenceData
|
||||
* @user_data: private data
|
||||
* @notify: a #GDestroyNotify
|
||||
|
@ -243,56 +231,17 @@ gst_d3d12_fence_data_add_notify_internal (GstD3D12FenceData * data,
|
|||
* Since: 1.26
|
||||
*/
|
||||
void
|
||||
gst_d3d12_fence_data_add_notify (GstD3D12FenceData * data, gpointer user_data,
|
||||
gst_d3d12_fence_data_push (GstD3D12FenceData * data, gpointer user_data,
|
||||
GDestroyNotify notify)
|
||||
{
|
||||
g_return_if_fail (data);
|
||||
|
||||
gst_d3d12_fence_data_add_notify_internal (data, user_data, notify);
|
||||
}
|
||||
NotifyData notify_data;
|
||||
|
||||
static void
|
||||
com_free_func (IUnknown * unknown)
|
||||
{
|
||||
if (unknown)
|
||||
unknown->Release ();
|
||||
}
|
||||
notify_data.user_data = user_data;
|
||||
notify_data.notify = notify;
|
||||
|
||||
/**
|
||||
* gst_d3d12_fence_data_add_notify_com:
|
||||
* @data: a #GstD3D12FenceData
|
||||
* @unknown: (transfer full): IUnknown COM pointer
|
||||
*
|
||||
* Schedules IUnknown::Release() notify for @unknown
|
||||
*
|
||||
* Since: 1.26
|
||||
*/
|
||||
void
|
||||
gst_d3d12_fence_data_add_notify_com (GstD3D12FenceData * data, gpointer unknown)
|
||||
{
|
||||
g_return_if_fail (data);
|
||||
|
||||
gst_d3d12_fence_data_add_notify_internal (data,
|
||||
unknown, (GDestroyNotify) com_free_func);
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_d3d12_fence_data_add_notify_mini_object:
|
||||
* @data: a #GstD3D12FenceData
|
||||
* @object: (transfer full): #GstMiniObject
|
||||
*
|
||||
* Schedules gst_mini_object_unref() notify for @object
|
||||
*
|
||||
* Since: 1.26
|
||||
*/
|
||||
void
|
||||
gst_d3d12_fence_data_add_notify_mini_object (GstD3D12FenceData * data,
|
||||
gpointer object)
|
||||
{
|
||||
g_return_if_fail (data);
|
||||
|
||||
gst_d3d12_fence_data_add_notify_internal (data,
|
||||
object, (GDestroyNotify) gst_mini_object_unref);
|
||||
gst_vec_deque_push_tail_struct (data->queue, ¬ify_data);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -78,17 +78,9 @@ gboolean gst_d3d12_fence_data_pool_acquire (GstD3D12FenceDataPool
|
|||
GstD3D12FenceData ** data);
|
||||
|
||||
GST_D3D12_API
|
||||
void gst_d3d12_fence_data_add_notify (GstD3D12FenceData * data,
|
||||
gpointer user_data,
|
||||
GDestroyNotify notify);
|
||||
|
||||
GST_D3D12_API
|
||||
void gst_d3d12_fence_data_add_notify_com (GstD3D12FenceData * data,
|
||||
gpointer unknown);
|
||||
|
||||
GST_D3D12_API
|
||||
void gst_d3d12_fence_data_add_notify_mini_object (GstD3D12FenceData * data,
|
||||
gpointer object);
|
||||
void gst_d3d12_fence_data_push (GstD3D12FenceData * data,
|
||||
gpointer user_data,
|
||||
GDestroyNotify notify);
|
||||
|
||||
GST_D3D12_API
|
||||
GstD3D12FenceData * gst_d3d12_fence_data_ref (GstD3D12FenceData * data);
|
||||
|
|
|
@ -348,8 +348,8 @@ gst_d3d12_frame_copy (GstD3D12Frame * dest, const GstD3D12Frame * src,
|
|||
|
||||
GstD3D12FenceData *fence_data;
|
||||
gst_d3d12_device_acquire_fence_data (dest->device, &fence_data);
|
||||
gst_d3d12_fence_data_add_notify_mini_object (fence_data,
|
||||
gst_buffer_ref (src->buffer));
|
||||
gst_d3d12_fence_data_push (fence_data,
|
||||
FENCE_NOTIFY_MINI_OBJECT (gst_buffer_ref (src->buffer)));
|
||||
|
||||
auto cq = gst_d3d12_device_get_command_queue (src->device,
|
||||
D3D12_COMMAND_LIST_TYPE_DIRECT);
|
||||
|
@ -400,8 +400,8 @@ gst_d3d12_frame_copy_plane (GstD3D12Frame * dest, const GstD3D12Frame * src,
|
|||
|
||||
GstD3D12FenceData *fence_data;
|
||||
gst_d3d12_device_acquire_fence_data (dest->device, &fence_data);
|
||||
gst_d3d12_fence_data_add_notify_mini_object (fence_data,
|
||||
gst_buffer_ref (src->buffer));
|
||||
gst_d3d12_fence_data_push (fence_data,
|
||||
FENCE_NOTIFY_MINI_OBJECT (gst_buffer_ref (src->buffer)));
|
||||
|
||||
auto cq = gst_d3d12_device_get_command_queue (src->device,
|
||||
D3D12_COMMAND_LIST_TYPE_DIRECT);
|
||||
|
|
|
@ -1194,8 +1194,8 @@ gst_d3d12_memory_copy (GstMemory * mem, gssize offset, gssize size)
|
|||
|
||||
GstD3D12FenceData *fence_data;
|
||||
gst_d3d12_device_acquire_fence_data (dmem->device, &fence_data);
|
||||
gst_d3d12_fence_data_add_notify_mini_object (fence_data,
|
||||
gst_memory_ref (mem));
|
||||
gst_d3d12_fence_data_push (fence_data,
|
||||
FENCE_NOTIFY_MINI_OBJECT (gst_memory_ref (mem)));
|
||||
|
||||
ID3D12Fence *fences_to_wait[] = { fence_to_wait.Get () };
|
||||
guint num_fences_to_wait = 0;
|
||||
|
|
|
@ -1127,7 +1127,7 @@ gst_d3d12_compositor_preprare_func (GstVideoAggregatorPad * pad,
|
|||
|
||||
GstD3D12FenceData *fence_data;
|
||||
gst_d3d12_fence_data_pool_acquire (self->priv->fence_data_pool, &fence_data);
|
||||
gst_d3d12_fence_data_add_notify_mini_object (fence_data, gst_ca);
|
||||
gst_d3d12_fence_data_push (fence_data, FENCE_NOTIFY_MINI_OBJECT (gst_ca));
|
||||
|
||||
auto ca = gst_d3d12_command_allocator_get_handle (gst_ca);
|
||||
|
||||
|
@ -1221,7 +1221,7 @@ gst_d3d12_compositor_pad_clean_frame (GstVideoAggregatorPad * pad,
|
|||
if (priv->ctx && priv->ctx->fence_data) {
|
||||
gst_d3d12_device_set_fence_notify (priv->ctx->device,
|
||||
D3D12_COMMAND_LIST_TYPE_DIRECT, priv->ctx->fence_val,
|
||||
priv->ctx->fence_data);
|
||||
FENCE_NOTIFY_MINI_OBJECT (priv->ctx->fence_data));
|
||||
priv->ctx->fence_data = nullptr;
|
||||
}
|
||||
}
|
||||
|
@ -2233,7 +2233,7 @@ gst_d3d12_compositor_draw_background (GstD3D12Compositor * self)
|
|||
|
||||
GstD3D12FenceData *fence_data;
|
||||
gst_d3d12_fence_data_pool_acquire (priv->fence_data_pool, &fence_data);
|
||||
gst_d3d12_fence_data_add_notify_mini_object (fence_data, gst_ca);
|
||||
gst_d3d12_fence_data_push (fence_data, FENCE_NOTIFY_MINI_OBJECT (gst_ca));
|
||||
|
||||
auto ca = gst_d3d12_command_allocator_get_handle (gst_ca);
|
||||
|
||||
|
@ -2333,12 +2333,13 @@ gst_d3d12_compositor_draw_background (GstD3D12Compositor * self)
|
|||
bg_render->fence_val);
|
||||
|
||||
if (bg_render->vertex_index_upload) {
|
||||
gst_d3d12_fence_data_add_notify_com (fence_data,
|
||||
bg_render->vertex_index_upload.Detach ());
|
||||
gst_d3d12_fence_data_push (fence_data,
|
||||
FENCE_NOTIFY_COM (bg_render->vertex_index_upload.Detach ()));
|
||||
}
|
||||
|
||||
gst_d3d12_device_set_fence_notify (self->device,
|
||||
D3D12_COMMAND_LIST_TYPE_DIRECT, priv->bg_render->fence_val, fence_data);
|
||||
D3D12_COMMAND_LIST_TYPE_DIRECT, priv->bg_render->fence_val,
|
||||
FENCE_NOTIFY_MINI_OBJECT (fence_data));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -2008,7 +2008,7 @@ gst_d3d12_convert_transform (GstBaseTransform * trans, GstBuffer * inbuf,
|
|||
|
||||
GstD3D12FenceData *fence_data;
|
||||
gst_d3d12_fence_data_pool_acquire (priv->fence_data_pool, &fence_data);
|
||||
gst_d3d12_fence_data_add_notify_mini_object (fence_data, gst_ca);
|
||||
gst_d3d12_fence_data_push (fence_data, FENCE_NOTIFY_MINI_OBJECT (gst_ca));
|
||||
|
||||
auto cq = gst_d3d12_device_get_command_queue (priv->ctx->device,
|
||||
D3D12_COMMAND_LIST_TYPE_DIRECT);
|
||||
|
@ -2041,7 +2041,8 @@ gst_d3d12_convert_transform (GstBaseTransform * trans, GstBuffer * inbuf,
|
|||
gst_d3d12_buffer_after_write (outbuf, priv->ctx->fence_val);
|
||||
|
||||
gst_d3d12_device_set_fence_notify (priv->ctx->device,
|
||||
D3D12_COMMAND_LIST_TYPE_DIRECT, priv->ctx->fence_val, fence_data);
|
||||
D3D12_COMMAND_LIST_TYPE_DIRECT, priv->ctx->fence_val,
|
||||
FENCE_NOTIFY_MINI_OBJECT (fence_data));
|
||||
|
||||
priv->ctx->scheduled.push (priv->ctx->fence_val);
|
||||
|
||||
|
|
|
@ -1311,14 +1311,14 @@ gst_d3d12_decoder_end_picture (GstD3D12Decoder * decoder,
|
|||
|
||||
GstD3D12FenceData *fence_data;
|
||||
gst_d3d12_fence_data_pool_acquire (priv->fence_data_pool, &fence_data);
|
||||
gst_d3d12_fence_data_add_notify_mini_object (fence_data,
|
||||
gst_mini_object_ref (decoder_pic));
|
||||
gst_d3d12_fence_data_push (fence_data,
|
||||
FENCE_NOTIFY_MINI_OBJECT (gst_mini_object_ref (decoder_pic)));
|
||||
for (guint i = 0; i < ref_pics->len; i++) {
|
||||
auto ref_pic = (GstCodecPicture *) g_ptr_array_index (ref_pics, i);
|
||||
gst_d3d12_fence_data_add_notify_mini_object (fence_data,
|
||||
gst_codec_picture_ref (ref_pic));
|
||||
gst_d3d12_fence_data_push (fence_data,
|
||||
FENCE_NOTIFY_MINI_OBJECT (gst_codec_picture_ref (ref_pic)));
|
||||
}
|
||||
gst_d3d12_fence_data_add_notify_mini_object (fence_data, gst_ca);
|
||||
gst_d3d12_fence_data_push (fence_data, FENCE_NOTIFY_MINI_OBJECT (gst_ca));
|
||||
|
||||
gst_d3d12_command_queue_set_notify (priv->cmd->queue, priv->cmd->fence_val,
|
||||
fence_data, (GDestroyNotify) gst_d3d12_fence_data_unref);
|
||||
|
@ -1534,8 +1534,8 @@ gst_d3d12_decoder_process_output (GstD3D12Decoder * self,
|
|||
if (out_resource) {
|
||||
queue_type = D3D12_COMMAND_LIST_TYPE_DIRECT;
|
||||
gst_d3d12_fence_data_pool_acquire (priv->fence_data_pool, &fence_data);
|
||||
gst_d3d12_fence_data_add_notify_mini_object (fence_data,
|
||||
gst_buffer_ref (buffer));
|
||||
gst_d3d12_fence_data_push (fence_data,
|
||||
FENCE_NOTIFY_MINI_OBJECT (gst_buffer_ref (buffer)));
|
||||
}
|
||||
|
||||
gst_d3d12_device_copy_texture_region (self->device, copy_args.size (),
|
||||
|
|
|
@ -1355,7 +1355,7 @@ gst_d3d12_dxgi_capture_draw_mouse (GstD3D12DxgiCapture * self,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
gst_d3d12_fence_data_add_notify_mini_object (fence_data, gst_ca);
|
||||
gst_d3d12_fence_data_push (fence_data, FENCE_NOTIFY_MINI_OBJECT (gst_ca));
|
||||
|
||||
auto ca = gst_d3d12_command_allocator_get_handle (gst_ca);
|
||||
hr = ca->Reset ();
|
||||
|
|
|
@ -872,7 +872,7 @@ gst_d3d12_encoder_build_command (GstD3D12Encoder * self,
|
|||
auto ref_pic =
|
||||
in_args->PictureControlDesc.ReferenceFrames.ppTexture2Ds[i];
|
||||
ref_pic->AddRef ();
|
||||
gst_d3d12_fence_data_add_notify_com (fence_data, ref_pic);
|
||||
gst_d3d12_fence_data_push (fence_data, FENCE_NOTIFY_COM (ref_pic));
|
||||
pre_enc_barrier.push_back (CD3DX12_RESOURCE_BARRIER::
|
||||
Transition (ref_pic, D3D12_RESOURCE_STATE_COMMON,
|
||||
D3D12_RESOURCE_STATE_VIDEO_ENCODE_READ));
|
||||
|
@ -884,7 +884,7 @@ gst_d3d12_encoder_build_command (GstD3D12Encoder * self,
|
|||
auto ref_pic =
|
||||
in_args->PictureControlDesc.ReferenceFrames.ppTexture2Ds[0];
|
||||
ref_pic->AddRef ();
|
||||
gst_d3d12_fence_data_add_notify_com (fence_data, ref_pic);
|
||||
gst_d3d12_fence_data_push (fence_data, FENCE_NOTIFY_COM (ref_pic));
|
||||
auto ref_pic_desc = GetDesc (ref_pic);
|
||||
|
||||
for (UINT i = 0;
|
||||
|
@ -913,8 +913,9 @@ gst_d3d12_encoder_build_command (GstD3D12Encoder * self,
|
|||
/* Reconstructed picture barries */
|
||||
if (out_args->ReconstructedPicture.pReconstructedPicture) {
|
||||
out_args->ReconstructedPicture.pReconstructedPicture->AddRef ();
|
||||
gst_d3d12_fence_data_add_notify_com (fence_data,
|
||||
out_args->ReconstructedPicture.pReconstructedPicture);
|
||||
gst_d3d12_fence_data_push (fence_data,
|
||||
FENCE_NOTIFY_COM (out_args->
|
||||
ReconstructedPicture.pReconstructedPicture));
|
||||
|
||||
if (array_of_textures) {
|
||||
pre_enc_barrier.push_back (CD3DX12_RESOURCE_BARRIER::
|
||||
|
@ -971,8 +972,8 @@ gst_d3d12_encoder_build_command (GstD3D12Encoder * self,
|
|||
auto heap = priv->session->heap;
|
||||
|
||||
command_list->EncodeFrame (encoder.Get (), heap.Get (), in_args, out_args);
|
||||
gst_d3d12_fence_data_add_notify_com (fence_data, encoder.Detach ());
|
||||
gst_d3d12_fence_data_add_notify_com (fence_data, heap.Detach ());
|
||||
gst_d3d12_fence_data_push (fence_data, FENCE_NOTIFY_COM (encoder.Detach ()));
|
||||
gst_d3d12_fence_data_push (fence_data, FENCE_NOTIFY_COM (heap.Detach ()));
|
||||
|
||||
post_enc_barrier.
|
||||
push_back (CD3DX12_RESOURCE_BARRIER::Transition (out_args->Bitstream.
|
||||
|
@ -1255,7 +1256,7 @@ gst_d3d12_encoder_handle_frame (GstVideoEncoder * encoder,
|
|||
|
||||
GstD3D12FenceData *fence_data;
|
||||
gst_d3d12_fence_data_pool_acquire (priv->fence_data_pool, &fence_data);
|
||||
gst_d3d12_fence_data_add_notify_mini_object (fence_data, upload);
|
||||
gst_d3d12_fence_data_push (fence_data, FENCE_NOTIFY_MINI_OBJECT (upload));
|
||||
|
||||
GstD3D12CommandAllocator *gst_ca;
|
||||
if (!gst_d3d12_command_allocator_pool_acquire (priv->cmd->ca_pool, &gst_ca)) {
|
||||
|
@ -1265,7 +1266,7 @@ gst_d3d12_encoder_handle_frame (GstVideoEncoder * encoder,
|
|||
return GST_FLOW_ERROR;
|
||||
}
|
||||
|
||||
gst_d3d12_fence_data_add_notify_mini_object (fence_data, gst_ca);
|
||||
gst_d3d12_fence_data_push (fence_data, FENCE_NOTIFY_MINI_OBJECT (gst_ca));
|
||||
|
||||
auto ca = gst_d3d12_command_allocator_get_handle (gst_ca);
|
||||
auto hr = ca->Reset ();
|
||||
|
@ -1390,7 +1391,8 @@ gst_d3d12_encoder_handle_frame (GstVideoEncoder * encoder,
|
|||
}
|
||||
GST_VIDEO_ENCODER_STREAM_LOCK (self);
|
||||
|
||||
gst_d3d12_fence_data_add_notify_mini_object (fence_data, encoder_buf);
|
||||
gst_d3d12_fence_data_push (fence_data,
|
||||
FENCE_NOTIFY_MINI_OBJECT (encoder_buf));
|
||||
|
||||
ComPtr < ID3D12Resource > metadata;
|
||||
ComPtr < ID3D12Resource > resolved_metadata;
|
||||
|
|
|
@ -795,18 +795,19 @@ gst_d3d12_overlay_compositor_execute (GstD3D12OverlayCompositor * self,
|
|||
|
||||
cl->DrawIndexedInstanced (6, 1, 0, 0, 0);
|
||||
|
||||
gst_d3d12_fence_data_add_notify_mini_object (fence_data,
|
||||
gst_mini_object_ref (rect));
|
||||
gst_d3d12_fence_data_push (fence_data,
|
||||
FENCE_NOTIFY_MINI_OBJECT (gst_mini_object_ref (rect)));
|
||||
|
||||
prev_pso = nullptr;
|
||||
prev_pso = pso;
|
||||
}
|
||||
|
||||
priv->pso->AddRef ();
|
||||
gst_d3d12_fence_data_add_notify_com (fence_data, priv->pso.Get ());
|
||||
gst_d3d12_fence_data_push (fence_data, FENCE_NOTIFY_COM (priv->pso.Get ()));
|
||||
|
||||
priv->pso_premul->AddRef ();
|
||||
gst_d3d12_fence_data_add_notify_com (fence_data, priv->pso_premul.Get ());
|
||||
gst_d3d12_fence_data_push (fence_data,
|
||||
FENCE_NOTIFY_COM (priv->pso_premul.Get ()));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -2197,7 +2197,7 @@ gst_d3d12_test_src_create (GstBaseSrc * bsrc, guint64 offset,
|
|||
auto cl = priv->ctx->cl;
|
||||
GstD3D12FenceData *fence_data;
|
||||
gst_d3d12_fence_data_pool_acquire (priv->fence_data_pool, &fence_data);
|
||||
gst_d3d12_fence_data_add_notify_mini_object (fence_data, gst_ca);
|
||||
gst_d3d12_fence_data_push (fence_data, FENCE_NOTIFY_MINI_OBJECT (gst_ca));
|
||||
|
||||
pts = priv->accum_rtime + priv->running_time;
|
||||
gst_d3d12_test_src_draw_pattern (self, pts, cl.Get ());
|
||||
|
@ -2233,7 +2233,8 @@ gst_d3d12_test_src_create (GstBaseSrc * bsrc, guint64 offset,
|
|||
gst_d3d12_buffer_after_write (convert_buffer, priv->ctx->fence_val);
|
||||
|
||||
gst_d3d12_device_set_fence_notify (self->device,
|
||||
D3D12_COMMAND_LIST_TYPE_DIRECT, priv->ctx->fence_val, fence_data);
|
||||
D3D12_COMMAND_LIST_TYPE_DIRECT, priv->ctx->fence_val,
|
||||
FENCE_NOTIFY_MINI_OBJECT (fence_data));
|
||||
|
||||
priv->ctx->scheduled.push (priv->ctx->fence_val);
|
||||
|
||||
|
|
|
@ -535,7 +535,7 @@ gst_d3d12_window_render (GstD3D12Window * self, SwapChainResource * resource,
|
|||
|
||||
GstD3D12FenceData *fence_data;
|
||||
gst_d3d12_fence_data_pool_acquire (priv->fence_data_pool, &fence_data);
|
||||
gst_d3d12_fence_data_add_notify_mini_object (fence_data, gst_ca);
|
||||
gst_d3d12_fence_data_push (fence_data, FENCE_NOTIFY_MINI_OBJECT (gst_ca));
|
||||
|
||||
auto mem = (GstD3D12Memory *) gst_buffer_peek_memory (swapbuf->backbuf, 0);
|
||||
auto backbuf_texture = gst_d3d12_memory_get_resource_handle (mem);
|
||||
|
@ -693,7 +693,7 @@ gst_d3d12_window_render (GstD3D12Window * self, SwapChainResource * resource,
|
|||
}
|
||||
|
||||
gst_d3d12_fence_data_pool_acquire (priv->fence_data_pool, &fence_data);
|
||||
gst_d3d12_fence_data_add_notify_mini_object (fence_data, gst_ca);
|
||||
gst_d3d12_fence_data_push (fence_data, FENCE_NOTIFY_MINI_OBJECT (gst_ca));
|
||||
|
||||
D3D12_RESOURCE_BARRIER barrier =
|
||||
CD3DX12_RESOURCE_BARRIER::Transition (backbuf_texture,
|
||||
|
|
|
@ -368,8 +368,10 @@ gst_dwrite_d3d12_render_draw_layout (GstDWriteRender * render,
|
|||
auto resource_clone = priv->layout_resource;
|
||||
auto wrapped_clone = priv->wrapped_texture;
|
||||
|
||||
gst_d3d12_fence_data_add_notify_com (fence_data, resource_clone.Detach ());
|
||||
gst_d3d12_fence_data_add_notify_com (fence_data, wrapped_clone.Detach ());
|
||||
gst_d3d12_fence_data_push (fence_data,
|
||||
FENCE_NOTIFY_COM (resource_clone.Detach ()));
|
||||
gst_d3d12_fence_data_push (fence_data,
|
||||
FENCE_NOTIFY_COM (wrapped_clone.Detach ()));
|
||||
|
||||
gst_d3d12_device_copy_texture_region (priv->device,
|
||||
1, &args, fence_data, 0, nullptr, nullptr, D3D12_COMMAND_LIST_TYPE_DIRECT,
|
||||
|
@ -445,7 +447,7 @@ gst_dwrite_d3d12_render_blend (GstDWriteRender * render, GstBuffer * layout_buf,
|
|||
|
||||
GstD3D12FenceData *fence_data;
|
||||
gst_d3d12_fence_data_pool_acquire (priv->fence_data_pool, &fence_data);
|
||||
gst_d3d12_fence_data_add_notify_mini_object (fence_data, gst_ca);
|
||||
gst_d3d12_fence_data_push (fence_data, FENCE_NOTIFY_MINI_OBJECT (gst_ca));
|
||||
|
||||
g_object_set (priv->blend_conv, "src-width", priv->layout_info.width,
|
||||
"src-height", priv->layout_info.height,
|
||||
|
@ -540,7 +542,8 @@ gst_dwrite_d3d12_render_blend (GstDWriteRender * render, GstBuffer * layout_buf,
|
|||
|
||||
if (ret) {
|
||||
gst_d3d12_device_set_fence_notify (priv->device,
|
||||
D3D12_COMMAND_LIST_TYPE_DIRECT, priv->fence_val, fence_data);
|
||||
D3D12_COMMAND_LIST_TYPE_DIRECT, priv->fence_val,
|
||||
FENCE_NOTIFY_MINI_OBJECT (fence_data));
|
||||
|
||||
priv->scheduled.push (priv->fence_val);
|
||||
|
||||
|
|
Loading…
Reference in a new issue