Use G_DEFINE_TYPE_WITH_PRIVATE if applicable

This gets rid of the strange `do_init` macro and makes the intent a bit
more clear.
This commit is contained in:
Niels De Graef 2018-12-03 13:56:52 +01:00
parent 2b016fdde9
commit e73e69a480
3 changed files with 6 additions and 15 deletions

View file

@ -41,11 +41,8 @@
#define DEBUG_VAAPI_DISPLAY 1
#include "gstvaapidebug.h"
#define _do_init \
G_ADD_PRIVATE (GstVaapiDisplayDRM);
G_DEFINE_TYPE_WITH_CODE (GstVaapiDisplayDRM, gst_vaapi_display_drm,
GST_TYPE_VAAPI_DISPLAY, _do_init);
G_DEFINE_TYPE_WITH_PRIVATE (GstVaapiDisplayDRM, gst_vaapi_display_drm,
GST_TYPE_VAAPI_DISPLAY);
typedef enum
{

View file

@ -35,11 +35,8 @@
#define DEBUG_VAAPI_DISPLAY 1
#include "gstvaapidebug.h"
#define _do_init \
G_ADD_PRIVATE (GstVaapiDisplayWayland);
G_DEFINE_TYPE_WITH_CODE (GstVaapiDisplayWayland, gst_vaapi_display_wayland,
GST_TYPE_VAAPI_DISPLAY, _do_init);
G_DEFINE_TYPE_WITH_PRIVATE (GstVaapiDisplayWayland, gst_vaapi_display_wayland,
GST_TYPE_VAAPI_DISPLAY);
static inline const gchar *
get_default_display_name (void)

View file

@ -45,11 +45,8 @@
#define DEBUG_VAAPI_DISPLAY 1
#include "gstvaapidebug.h"
#define _do_init \
G_ADD_PRIVATE (GstVaapiDisplayX11);
G_DEFINE_TYPE_WITH_CODE (GstVaapiDisplayX11, gst_vaapi_display_x11,
GST_TYPE_VAAPI_DISPLAY, _do_init);
G_DEFINE_TYPE_WITH_PRIVATE (GstVaapiDisplayX11, gst_vaapi_display_x11,
GST_TYPE_VAAPI_DISPLAY);
static inline const gchar *
get_default_display_name (void)