2014-12-18 06:00:30 +00:00
|
|
|
/*
|
|
|
|
* GStreamer
|
|
|
|
* Copyright (C) 2015 Matthew Waters <matthew@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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* SECTION:gtkgstsink
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
|
|
|
|
2015-07-16 20:00:37 +00:00
|
|
|
#include "gtkgstwidget.h"
|
2014-12-18 06:00:30 +00:00
|
|
|
#include "gstgtksink.h"
|
|
|
|
|
2015-06-15 18:39:59 +00:00
|
|
|
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
|
2015-06-15 18:45:11 +00:00
|
|
|
#define FORMATS "{ BGRx, BGRA }"
|
2015-06-15 18:39:59 +00:00
|
|
|
#else
|
2015-06-15 18:45:11 +00:00
|
|
|
#define FORMATS "{ xRGB, ARGB }"
|
2015-06-15 18:39:59 +00:00
|
|
|
#endif
|
|
|
|
|
2014-12-18 06:00:30 +00:00
|
|
|
static GstStaticPadTemplate gst_gtk_sink_template =
|
|
|
|
GST_STATIC_PAD_TEMPLATE ("sink",
|
|
|
|
GST_PAD_SINK,
|
|
|
|
GST_PAD_ALWAYS,
|
2015-06-15 18:39:59 +00:00
|
|
|
GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE (FORMATS))
|
2014-12-18 06:00:30 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
#define gst_gtk_sink_parent_class parent_class
|
2015-07-16 20:00:37 +00:00
|
|
|
G_DEFINE_TYPE (GstGtkSink, gst_gtk_sink, GST_TYPE_GTK_BASE_SINK);
|
2014-12-18 06:00:30 +00:00
|
|
|
|
|
|
|
static void
|
|
|
|
gst_gtk_sink_class_init (GstGtkSinkClass * klass)
|
|
|
|
{
|
|
|
|
GstElementClass *gstelement_class;
|
2015-07-16 20:00:37 +00:00
|
|
|
GstGtkBaseSinkClass *base_class;
|
2014-12-18 06:00:30 +00:00
|
|
|
|
|
|
|
gstelement_class = (GstElementClass *) klass;
|
2015-07-16 20:00:37 +00:00
|
|
|
base_class = (GstGtkBaseSinkClass *) klass;
|
2014-12-18 06:00:30 +00:00
|
|
|
|
2015-07-16 20:00:37 +00:00
|
|
|
base_class->create_widget = gtk_gst_widget_new;
|
|
|
|
base_class->window_title = "Gtk+ Cairo renderer";
|
2014-12-18 06:00:30 +00:00
|
|
|
|
|
|
|
gst_element_class_set_metadata (gstelement_class, "Gtk Video Sink",
|
2015-06-12 02:40:50 +00:00
|
|
|
"Sink/Video", "A video sink that renders to a GtkWidget",
|
2014-12-18 06:00:30 +00:00
|
|
|
"Matthew Waters <matthew@centricular.com>");
|
|
|
|
|
|
|
|
gst_element_class_add_pad_template (gstelement_class,
|
|
|
|
gst_static_pad_template_get (&gst_gtk_sink_template));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_gtk_sink_init (GstGtkSink * gtk_sink)
|
|
|
|
{
|
|
|
|
}
|