mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 06:46:38 +00:00
d3d12: Add d3d12deinterlace element
Adding D3D12 compute shader based deinterlace element with YADIF filtering Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8140>
This commit is contained in:
parent
e3348ea402
commit
eac069b46d
8 changed files with 3270 additions and 0 deletions
|
@ -100,6 +100,9 @@ HRESULT gst_d3d12_device_get_sampler_state (GstD3D12Device * device,
|
||||||
GST_D3D12_API
|
GST_D3D12_API
|
||||||
gboolean gst_d3d12_device_non_zeroed_supported (GstD3D12Device * device);
|
gboolean gst_d3d12_device_non_zeroed_supported (GstD3D12Device * device);
|
||||||
|
|
||||||
|
GST_D3D12_API
|
||||||
|
gboolean gst_d3d12_device_is_uma (GstD3D12Device * device);
|
||||||
|
|
||||||
GST_D3D12_API
|
GST_D3D12_API
|
||||||
HRESULT gst_d3d12_device_get_converter_resources (GstD3D12Device * device,
|
HRESULT gst_d3d12_device_get_converter_resources (GstD3D12Device * device,
|
||||||
ID3D12Resource * index_buf,
|
ID3D12Resource * index_buf,
|
||||||
|
|
|
@ -2253,6 +2253,14 @@ gst_d3d12_device_non_zeroed_supported (GstD3D12Device * device)
|
||||||
return device->priv->inner->non_zeroed_supported;
|
return device->priv->inner->non_zeroed_supported;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
gst_d3d12_device_is_uma (GstD3D12Device * device)
|
||||||
|
{
|
||||||
|
g_return_val_if_fail (GST_IS_D3D12_DEVICE (device), FALSE);
|
||||||
|
|
||||||
|
return device->priv->inner->feature_support.UMA ();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gst_d3d12_flush_all_devices:
|
* gst_d3d12_flush_all_devices:
|
||||||
*
|
*
|
||||||
|
|
1101
subprojects/gst-plugins-bad/sys/d3d12/gstd3d12deinterlace.cpp
Normal file
1101
subprojects/gst-plugins-bad/sys/d3d12/gstd3d12deinterlace.cpp
Normal file
File diff suppressed because it is too large
Load diff
31
subprojects/gst-plugins-bad/sys/d3d12/gstd3d12deinterlace.h
Normal file
31
subprojects/gst-plugins-bad/sys/d3d12/gstd3d12deinterlace.h
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
/* GStreamer
|
||||||
|
* Copyright (C) 2024 Seungha Yang <seungha@centricular.com>
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Library General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Library General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Library General Public
|
||||||
|
* License along with this library; if not, write to the
|
||||||
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||||
|
* Boston, MA 02110-1301, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <gst/gst.h>
|
||||||
|
#include "gstd3d12basefilter.h"
|
||||||
|
|
||||||
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
|
#define GST_TYPE_D3D12_DEINTERLACE (gst_d3d12_deinterlace_get_type())
|
||||||
|
G_DECLARE_FINAL_TYPE (GstD3D12Deinterlace, gst_d3d12_deinterlace,
|
||||||
|
GST, D3D12_DEINTERLACE, GstD3D12BaseFilter)
|
||||||
|
|
||||||
|
G_END_DECLS
|
2061
subprojects/gst-plugins-bad/sys/d3d12/gstd3d12yadif.cpp
Normal file
2061
subprojects/gst-plugins-bad/sys/d3d12/gstd3d12yadif.cpp
Normal file
File diff suppressed because it is too large
Load diff
61
subprojects/gst-plugins-bad/sys/d3d12/gstd3d12yadif.h
Normal file
61
subprojects/gst-plugins-bad/sys/d3d12/gstd3d12yadif.h
Normal file
|
@ -0,0 +1,61 @@
|
||||||
|
/* GStreamer
|
||||||
|
* Copyright (C) 2024 Seungha Yang <seungha@centricular.com>
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Library General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Library General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Library General Public
|
||||||
|
* License along with this library; if not, write to the
|
||||||
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||||
|
* Boston, MA 02110-1301, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <gst/gst.h>
|
||||||
|
#include <gst/video/video.h>
|
||||||
|
#include <gst/d3d12/gstd3d12.h>
|
||||||
|
|
||||||
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
|
#define GST_TYPE_D3D12_YADIF (gst_d3d12_yadif_get_type())
|
||||||
|
G_DECLARE_FINAL_TYPE (GstD3D12Yadif, gst_d3d12_yadif,
|
||||||
|
GST, D3D12_YADIF, GstObject)
|
||||||
|
|
||||||
|
#define GST_D3D12_YADIF_FLOW_NEED_DATA GST_FLOW_CUSTOM_SUCCESS
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
GST_D3D12_YADIF_FIELDS_ALL,
|
||||||
|
GST_D3D12_YADIF_FIELDS_TOP,
|
||||||
|
GST_D3D12_YADIF_FIELDS_BOTTOM,
|
||||||
|
} GstD3D12YadifFields;
|
||||||
|
|
||||||
|
GstD3D12Yadif * gst_d3d12_yadif_new (GstD3D12Device * device,
|
||||||
|
const GstVideoInfo * info,
|
||||||
|
gboolean use_compute);
|
||||||
|
|
||||||
|
void gst_d3d12_yadif_set_fields (GstD3D12Yadif * yadif,
|
||||||
|
GstD3D12YadifFields fields);
|
||||||
|
|
||||||
|
void gst_d3d12_yadif_set_direction (GstD3D12Yadif * yadif,
|
||||||
|
gboolean is_forward);
|
||||||
|
|
||||||
|
GstFlowReturn gst_d3d12_yadif_push (GstD3D12Yadif * yadif,
|
||||||
|
GstBuffer * buffer);
|
||||||
|
|
||||||
|
GstFlowReturn gst_d3d12_yadif_pop (GstD3D12Yadif * yadif,
|
||||||
|
GstBuffer ** buffer);
|
||||||
|
|
||||||
|
GstFlowReturn gst_d3d12_yadif_drain (GstD3D12Yadif * yadif);
|
||||||
|
|
||||||
|
void gst_d3d12_yadif_flush (GstD3D12Yadif * yadif);
|
||||||
|
|
||||||
|
G_END_DECLS
|
|
@ -5,6 +5,8 @@ d3d12_sources = [
|
||||||
'gstd3d12convert.cpp',
|
'gstd3d12convert.cpp',
|
||||||
'gstd3d12decoder.cpp',
|
'gstd3d12decoder.cpp',
|
||||||
'gstd3d12decodercpbpool.cpp',
|
'gstd3d12decodercpbpool.cpp',
|
||||||
|
'gstd3d12deinterlace.cpp',
|
||||||
|
'gstd3d12yadif.cpp',
|
||||||
'gstd3d12dpbstorage.cpp',
|
'gstd3d12dpbstorage.cpp',
|
||||||
'gstd3d12dxgicapture.cpp',
|
'gstd3d12dxgicapture.cpp',
|
||||||
'gstd3d12encoder.cpp',
|
'gstd3d12encoder.cpp',
|
||||||
|
|
|
@ -50,6 +50,7 @@
|
||||||
#include "gstd3d12ipcsink.h"
|
#include "gstd3d12ipcsink.h"
|
||||||
#include "gstd3d12swapchainsink.h"
|
#include "gstd3d12swapchainsink.h"
|
||||||
#include "gstd3d12mipmapping.h"
|
#include "gstd3d12mipmapping.h"
|
||||||
|
#include "gstd3d12deinterlace.h"
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <versionhelpers.h>
|
#include <versionhelpers.h>
|
||||||
#include <wrl.h>
|
#include <wrl.h>
|
||||||
|
@ -189,6 +190,8 @@ plugin_init (GstPlugin * plugin)
|
||||||
"d3d12swapchainsink", GST_RANK_NONE, GST_TYPE_D3D12_SWAPCHAIN_SINK);
|
"d3d12swapchainsink", GST_RANK_NONE, GST_TYPE_D3D12_SWAPCHAIN_SINK);
|
||||||
gst_element_register (plugin,
|
gst_element_register (plugin,
|
||||||
"d3d12mipmapping", GST_RANK_NONE, GST_TYPE_D3D12_MIP_MAPPING);
|
"d3d12mipmapping", GST_RANK_NONE, GST_TYPE_D3D12_MIP_MAPPING);
|
||||||
|
gst_element_register (plugin,
|
||||||
|
"d3d12deinterlace", GST_RANK_NONE, GST_TYPE_D3D12_DEINTERLACE);
|
||||||
|
|
||||||
g_object_set_data_full (G_OBJECT (plugin),
|
g_object_set_data_full (G_OBJECT (plugin),
|
||||||
"plugin-d3d12-shutdown", (gpointer) "shutdown-data",
|
"plugin-d3d12-shutdown", (gpointer) "shutdown-data",
|
||||||
|
|
Loading…
Reference in a new issue