d3d11: Move to G_DECLARE_FINAL_TYPE

... and remove unnecessary forward declaration.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1627>
This commit is contained in:
Seungha Yang 2020-09-26 03:27:39 +09:00 committed by GStreamer Merge Bot
parent 666eedc215
commit 899f9978f5
13 changed files with 100 additions and 185 deletions

View file

@ -71,22 +71,6 @@ typedef struct _GstD3D11BufferPoolPrivate GstD3D11BufferPoolPrivate;
typedef struct _GstD3D11Format GstD3D11Format;
typedef struct _GstD3D11BaseFilter GstD3D11BaseFilter;
typedef struct _GstD3D11BaseFilterClass GstD3D11BaseFilterClass;
typedef struct _GstD3D11Upload GstD3D11Upload;
typedef struct _GstD3D11UploadClass GstD3D11UploadClass;
typedef struct _GstD3D11Download GstD3D11Download;
typedef struct _GstD3D11DownloadClass GstD3D11DownloadClass;
typedef struct _GstD3D11ColorConvert GstD3D11ColorConvert;
typedef struct _GstD3D11ColorConvertClass GstD3D11ColorConvertClass;
typedef struct _GstD3D11Decoder GstD3D11Decoder;
typedef struct _GstD3D11DecoderClass GstD3D11DecoderClass;
typedef struct _GstD3D11DecoderPrivate GstD3D11DecoderPrivate;
G_END_DECLS
#endif /* __GST_D3D11_FWD_H__ */

View file

@ -36,6 +36,9 @@ G_BEGIN_DECLS
#define GST_IS_D3D11_BASE_FILTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_D3D11_BASE_FILTER))
#define GST_D3D11_BASE_FILTER_CAST(obj) ((GstD3D11BaseFilter*)(obj))
typedef struct _GstD3D11BaseFilter GstD3D11BaseFilter;
typedef struct _GstD3D11BaseFilterClass GstD3D11BaseFilterClass;
struct _GstD3D11BaseFilter
{
GstBaseTransform parent;
@ -60,6 +63,8 @@ struct _GstD3D11BaseFilterClass
GType gst_d3d11_base_filter_get_type (void);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstD3D11BaseFilter, gst_object_unref)
G_END_DECLS
#endif /* __GST_D3D11_BASE_FILTER_H__ */

View file

@ -48,6 +48,7 @@
#endif
#include "gstd3d11colorconvert.h"
#include "gstd3d11colorconverter.h"
#include "gstd3d11utils.h"
#include "gstd3d11memory.h"
#include "gstd3d11device.h"
@ -78,6 +79,28 @@ static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src",
GST_D3D11_SRC_FORMATS))
);
struct _GstD3D11ColorConvert
{
GstD3D11BaseFilter parent;
const GstD3D11Format *in_d3d11_format;
const GstD3D11Format *out_d3d11_format;
ID3D11Texture2D *in_texture[GST_VIDEO_MAX_PLANES];
ID3D11ShaderResourceView *shader_resource_view[GST_VIDEO_MAX_PLANES];
guint num_input_view;
ID3D11Texture2D *out_texture[GST_VIDEO_MAX_PLANES];
ID3D11RenderTargetView *render_target_view[GST_VIDEO_MAX_PLANES];
guint num_output_view;
GstD3D11ColorConverter *converter;
/* used for fallback texture copy */
D3D11_BOX in_src_box;
D3D11_BOX out_src_box;
};
#define gst_d3d11_color_convert_parent_class parent_class
G_DEFINE_TYPE (GstD3D11ColorConvert,
gst_d3d11_color_convert, GST_TYPE_D3D11_BASE_FILTER);

View file

@ -23,45 +23,12 @@
#include <gst/gst.h>
#include "gstd3d11basefilter.h"
#include "gstd3d11colorconverter.h"
G_BEGIN_DECLS
#define GST_TYPE_D3D11_COLOR_CONVERT (gst_d3d11_color_convert_get_type())
#define GST_D3D11_COLOR_CONVERT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_D3D11_COLOR_CONVERT,GstD3D11ColorConvert))
#define GST_D3D11_COLOR_CONVERT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_D3D11_COLOR_CONVERT,GstD3D11ColorConvertClass))
#define GST_D3D11_COLOR_CONVERT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GST_TYPE_D3D11_COLOR_CONVERT,GstD3D11ColorConvertClass))
#define GST_IS_D3D11_COLOR_CONVERT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_D3D11_COLOR_CONVERT))
#define GST_IS_D3D11_COLOR_CONVERT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_D3D11_COLOR_CONVERT))
struct _GstD3D11ColorConvert
{
GstD3D11BaseFilter parent;
const GstD3D11Format *in_d3d11_format;
const GstD3D11Format *out_d3d11_format;
ID3D11Texture2D *in_texture[GST_VIDEO_MAX_PLANES];
ID3D11ShaderResourceView *shader_resource_view[GST_VIDEO_MAX_PLANES];
guint num_input_view;
ID3D11Texture2D *out_texture[GST_VIDEO_MAX_PLANES];
ID3D11RenderTargetView *render_target_view[GST_VIDEO_MAX_PLANES];
guint num_output_view;
GstD3D11ColorConverter *converter;
/* used for fallback texture copy */
D3D11_BOX in_src_box;
D3D11_BOX out_src_box;
};
struct _GstD3D11ColorConvertClass
{
GstD3D11BaseFilterClass parent_class;
};
GType gst_d3d11_color_convert_get_type (void);
#define GST_TYPE_D3D11_COLOR_CONVERT (gst_d3d11_color_convert_get_type())
G_DECLARE_FINAL_TYPE (GstD3D11ColorConvert,
gst_d3d11_color_convert, GST, D3D11_COLOR_CONVERT, GstD3D11BaseFilter);
G_END_DECLS

View file

@ -28,19 +28,11 @@
G_BEGIN_DECLS
#define GST_TYPE_D3D11_DECODER \
(gst_d3d11_decoder_get_type())
#define GST_D3D11_DECODER(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_D3D11_DECODER,GstD3D11Decoder))
#define GST_D3D11_DECODER_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_D3D11_DECODER,GstD3D11DecoderClass))
#define GST_D3D11_DECODER_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS((obj),GST_TYPE_D3D11_DECODER,GstD3D11DecoderClass))
#define GST_IS_D3D11_DECODER(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_D3D11_DECODER))
#define GST_IS_D3D11_DECODER_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_D3D11_DECODER))
#define GST_TYPE_D3D11_DECODER (gst_d3d11_decoder_get_type())
G_DECLARE_FINAL_TYPE (GstD3D11Decoder,
gst_d3d11_decoder, GST, D3D11_DECODER, GstObject);
typedef struct _GstD3D11DecoderPrivate GstD3D11DecoderPrivate;
typedef struct _GstD3D11DecoderOutputView GstD3D11DecoderOutputView;
struct _GstD3D11DecoderOutputView
@ -84,13 +76,6 @@ struct _GstD3D11Decoder
gpointer padding[GST_PADDING_LARGE];
};
struct _GstD3D11DecoderClass
{
GstObjectClass parent_class;
};
GType gst_d3d11_decoder_get_type (void);
GstD3D11Decoder * gst_d3d11_decoder_new (GstD3D11Device * device);
gboolean gst_d3d11_decoder_open (GstD3D11Decoder * decoder,

View file

@ -62,6 +62,11 @@ static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src",
GST_D3D11_ALL_FORMATS)
));
struct _GstD3D11Download
{
GstD3D11BaseFilter parent;
};
#define gst_d3d11_download_parent_class parent_class
G_DEFINE_TYPE (GstD3D11Download, gst_d3d11_download,
GST_TYPE_D3D11_BASE_FILTER);

View file

@ -24,24 +24,9 @@
G_BEGIN_DECLS
#define GST_TYPE_D3D11_DOWNLOAD (gst_d3d11_download_get_type())
#define GST_D3D11_DOWNLOAD(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_D3D11_DOWNLOAD,GstD3D11Download))
#define GST_D3D11_DOWNLOAD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_D3D11_DOWNLOAD,GstD3D11DownloadClass))
#define GST_D3D11_DOWNLOAD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GST_TYPE_D3D11_DOWNLOAD,GstD3D11DownloadClass))
#define GST_IS_D3D11_DOWNLOAD(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_D3D11_DOWNLOAD))
#define GST_IS_D3D11_DOWNLOAD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_D3D11_DOWNLOAD))
struct _GstD3D11Download
{
GstD3D11BaseFilter parent;
};
struct _GstD3D11DownloadClass
{
GstD3D11BaseFilterClass parent_class;
};
GType gst_d3d11_download_get_type (void);
#define GST_TYPE_D3D11_DOWNLOAD (gst_d3d11_download_get_type())
G_DECLARE_FINAL_TYPE (GstD3D11Download,
gst_d3d11_download, GST, D3D11_DOWNLOAD, GstD3D11BaseFilter);
G_END_DECLS

View file

@ -57,6 +57,11 @@ static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src",
GST_CAPS_FEATURE_META_GST_VIDEO_OVERLAY_COMPOSITION,
GST_D3D11_ALL_FORMATS)));
struct _GstD3D11Upload
{
GstD3D11BaseFilter parent;
};
#define gst_d3d11_upload_parent_class parent_class
G_DEFINE_TYPE (GstD3D11Upload, gst_d3d11_upload, GST_TYPE_D3D11_BASE_FILTER);

View file

@ -24,24 +24,9 @@
G_BEGIN_DECLS
#define GST_TYPE_D3D11_UPLOAD (gst_d3d11_upload_get_type())
#define GST_D3D11_UPLOAD(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_D3D11_UPLOAD,GstD3D11Upload))
#define GST_D3D11_UPLOAD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_D3D11_UPLOAD,GstD3D11UploadClass))
#define GST_D3D11_UPLOAD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GST_TYPE_D3D11_UPLOAD,GstD3D11UploadClass))
#define GST_IS_D3D11_UPLOAD(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_D3D11_UPLOAD))
#define GST_IS_D3D11_UPLOAD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_D3D11_UPLOAD))
struct _GstD3D11Upload
{
GstD3D11BaseFilter parent;
};
struct _GstD3D11UploadClass
{
GstD3D11BaseFilterClass parent_class;
};
GType gst_d3d11_upload_get_type (void);
#define GST_TYPE_D3D11_UPLOAD (gst_d3d11_upload_get_type())
G_DECLARE_FINAL_TYPE (GstD3D11Upload,
gst_d3d11_upload, GST, D3D11_UPLOAD, GstD3D11BaseFilter);
G_END_DECLS

View file

@ -66,6 +66,34 @@ static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink",
GST_DEBUG_CATEGORY (d3d11_video_sink_debug);
#define GST_CAT_DEFAULT d3d11_video_sink_debug
struct _GstD3D11VideoSink
{
GstVideoSink parent;
GstD3D11Device *device;
GstD3D11Window *window;
gint video_width;
gint video_height;
GstVideoInfo info;
guintptr window_id;
/* properties */
gint adapter;
gboolean force_aspect_ratio;
gboolean enable_navigation_events;
GstD3D11WindowFullscreenToggleMode fullscreen_toggle_mode;
gboolean fullscreen;
/* saved render rectangle until we have a window */
GstVideoRectangle render_rect;
gboolean pending_render_rect;
GstBufferPool *fallback_pool;
gboolean can_convert;
gboolean have_video_processor;
};
static void gst_d3d11_videosink_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec);
static void gst_d3d11_videosink_get_property (GObject * object, guint prop_id,

View file

@ -31,52 +31,10 @@
G_BEGIN_DECLS
#define GST_TYPE_D3D11_VIDEO_SINK (gst_d3d11_video_sink_get_type())
#define GST_D3D11_VIDEO_SINK(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_D3D11_VIDEO_SINK,GstD3D11VideoSink))
#define GST_D3D11_VIDEO_SINK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_D3D11_VIDEO_SINK,GstD3D11VideoSinkClass))
#define GST_D3D11_VIDEO_SINK_GET_CLASS(obj) (GST_D3D11_VIDEO_SINK_CLASS(G_OBJECT_GET_CLASS(obj)))
#define GST_IS_D3D11_VIDEO_SINK(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_D3D11_VIDEO_SINK))
#define GST_IS_D3D11_VIDEO_SINK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_D3D11_VIDEO_SINK))
typedef struct _GstD3D11VideoSink GstD3D11VideoSink;
typedef struct _GstD3D11VideoSinkClass GstD3D11VideoSinkClass;
struct _GstD3D11VideoSink
{
GstVideoSink sink;
GstD3D11Device *device;
GstD3D11Window *window;
gint video_width;
gint video_height;
GstVideoInfo info;
guintptr window_id;
/* properties */
gint adapter;
gboolean force_aspect_ratio;
gboolean enable_navigation_events;
GstD3D11WindowFullscreenToggleMode fullscreen_toggle_mode;
gboolean fullscreen;
/* saved render rectangle until we have a window */
GstVideoRectangle render_rect;
gboolean pending_render_rect;
GstBufferPool *fallback_pool;
gboolean can_convert;
gboolean have_video_processor;
};
struct _GstD3D11VideoSinkClass
{
GstVideoSinkClass parent_class;
};
GType gst_d3d11_video_sink_get_type (void);
#define GST_TYPE_D3D11_VIDEO_SINK (gst_d3d11_video_sink_get_type())
G_DECLARE_FINAL_TYPE (GstD3D11VideoSink,
gst_d3d11_video_sink, GST, D3D11_VIDEO_SINK, GstVideoSink);
G_END_DECLS
#endif /* __GST_D3D11_VIDEO_SINK_H__ */

View file

@ -21,6 +21,11 @@
#include "config.h"
#endif
#include <gst/video/video.h>
#include <gst/video/gstvideosink.h>
#include <gst/video/videooverlay.h>
#include <gst/video/navigation.h>
#include "gstd3d11videosinkbin.h"
#include "gstd3d11videosink.h"
#include "gstd3d11upload.h"
@ -100,6 +105,16 @@ static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink",
GST_DEBUG_CATEGORY (d3d11_video_sink_bin_debug);
#define GST_CAT_DEFAULT d3d11_video_sink_bin_debug
struct _GstD3D11VideoSinkBin
{
GstBin parent;
GstPad *sinkpad;
GstElement *upload;
GstElement *sink;
};
static void gst_d3d11_video_sink_bin_set_property (GObject * object,
guint prop_id, const GValue * value, GParamSpec * pspec);
static void gst_d3d11_video_sink_bin_get_property (GObject * object,

View file

@ -21,43 +21,13 @@
#define __GST_D3D11_VIDEO_SINK_BIN_H__
#include <gst/gst.h>
#include <gst/video/video.h>
#include <gst/video/gstvideosink.h>
#include <gst/video/videooverlay.h>
#include <gst/video/navigation.h>
#include "gstd3d11_fwd.h"
G_BEGIN_DECLS
#define GST_TYPE_D3D11_VIDEO_SINK_BIN (gst_d3d11_video_sink_bin_get_type())
#define GST_D3D11_VIDEO_SINK_BIN(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_D3D11_VIDEO_SINK_BIN,GstD3D11VideoSinkBin))
#define GST_D3D11_VIDEO_SINK_BIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_D3D11_VIDEO_SINK_BIN,GstD3D11VideoSinkBinClass))
#define GST_D3D11_VIDEO_SINK_BIN_GET_CLASS(obj) (GST_D3D11_VIDEO_SINK_BIN_CLASS(G_OBJECT_GET_CLASS(obj)))
#define GST_IS_D3D11_VIDEO_SINK_BIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_D3D11_VIDEO_SINK_BIN))
#define GST_IS_D3D11_VIDEO_SINK_BIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_D3D11_VIDEO_SINK_BIN))
typedef struct _GstD3D11VideoSinkBin GstD3D11VideoSinkBin;
typedef struct _GstD3D11VideoSinkBinClass GstD3D11VideoSinkBinClass;
struct _GstD3D11VideoSinkBin
{
GstBin parent;
GstPad *sinkpad;
GstElement *upload;
GstElement *sink;
};
struct _GstD3D11VideoSinkBinClass
{
GstBinClass parent_class;
};
GType gst_d3d11_video_sink_bin_get_type (void);
#define GST_TYPE_D3D11_VIDEO_SINK_BIN (gst_d3d11_video_sink_bin_get_type())
G_DECLARE_FINAL_TYPE (GstD3D11VideoSinkBin,
gst_d3d11_video_sink_bin, GST, D3D11_VIDEO_SINK_BIN, GstBin);
G_END_DECLS
#endif /* __GST_D3D11_VIDEO_SINK_BIN_H__ */