#include "gstvideosink.h"
+G_DEFINE_TYPE (GstVideoSink, gst_video_sink, GST_TYPE_BASE_SINK);
+
enum
{
PROP_SHOW_PREROLL_FRAME = 1
gboolean show_preroll_frame; /* ATOMIC */
};
-GST_DEBUG_CATEGORY_STATIC (video_sink_debug);
-#define GST_CAT_DEFAULT video_sink_debug
+#ifndef GST_DISABLE_GST_DEBUG
+#define GST_CAT_DEFAULT gst_video_sink_ensure_debug_category()
+
+static GstDebugCategory *
+gst_video_sink_ensure_debug_category (void)
+{
+ static gsize cat_gonce = 0;
+
+ if (g_once_init_enter (&cat_gonce)) {
+ GstDebugCategory *cat = NULL;
+
+ GST_DEBUG_CATEGORY_INIT (cat, "videosink", 0, "GstVideoSink");
+
+ g_once_init_leave (&cat_gonce, (gsize) cat);
+ }
+
+ return (GstDebugCategory *) cat_gonce;
+}
+#endif /* GST_DISABLE_GST_DEBUG */
static GstBaseSinkClass *parent_class = NULL;
g_type_class_add_private (klass, sizeof (GstVideoSinkPrivate));
}
-static void
-gst_video_sink_base_init (gpointer g_class)
-{
- GST_DEBUG_CATEGORY_INIT (video_sink_debug, "videosink", 0, "GstVideoSink");
-}
-
static GstFlowReturn
gst_video_sink_show_preroll_frame (GstBaseSink * bsink, GstBuffer * buf)
{
break;
}
}
-
-/* Public methods */
-
-GType
-gst_video_sink_get_type (void)
-{
- static GType videosink_type = 0;
-
- if (!videosink_type) {
- static const GTypeInfo videosink_info = {
- sizeof (GstVideoSinkClass),
- gst_video_sink_base_init,
- NULL,
- (GClassInitFunc) gst_video_sink_class_init,
- NULL,
- NULL,
- sizeof (GstVideoSink),
- 0,
- (GInstanceInitFunc) gst_video_sink_init,
- };
-
- videosink_type = g_type_register_static (GST_TYPE_BASE_SINK,
- "GstVideoSink", &videosink_info, 0);
- }
-
- return videosink_type;
-}