mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-30 16:02:00 +02:00
Add new GStreamer plugin with custom video sink for Clapper video player. The main difference is that unlike the old one, this does not operate using `GtkGLArea` anymore, but processes and displays `GdkTextures` directly through `GtkPicture` widget. Also this one is installed like any other GStreamer plugin, thus can be used via `gst-launch-1.0` binary or even by other GTK4 apps if they wish to integrate it. In order to not depend on GL stuff at build time, this plugin uses seperate GModules called "importers" in order to import different kind of memories into GdkTexture. This allows expanding its capabilities further then we were able to do before.
79 lines
2.6 KiB
C
Vendored
79 lines
2.6 KiB
C
Vendored
/*
|
|
* Copyright (C) 2022 Rafał Dzięgiel <rafostar.github@gmail.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 <gtk/gtk.h>
|
|
#include <gst/gst.h>
|
|
#include <gst/video/video.h>
|
|
|
|
#include "gstclapperimporter.h"
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
#define GST_TYPE_CLAPPER_PAINTABLE (gst_clapper_paintable_get_type())
|
|
G_DECLARE_FINAL_TYPE (GstClapperPaintable, gst_clapper_paintable, GST, CLAPPER_PAINTABLE, GObject)
|
|
|
|
#define GST_CLAPPER_PAINTABLE_CAST(obj) ((GstClapperPaintable *)(obj))
|
|
|
|
#define GST_CLAPPER_PAINTABLE_GET_LOCK(obj) (&GST_CLAPPER_PAINTABLE_CAST(obj)->lock)
|
|
#define GST_CLAPPER_PAINTABLE_LOCK(obj) g_mutex_lock (GST_CLAPPER_PAINTABLE_GET_LOCK(obj))
|
|
#define GST_CLAPPER_PAINTABLE_UNLOCK(obj) g_mutex_unlock (GST_CLAPPER_PAINTABLE_GET_LOCK(obj))
|
|
|
|
struct _GstClapperPaintable
|
|
{
|
|
GObject parent;
|
|
|
|
GMutex lock;
|
|
|
|
GstVideoInfo v_info;
|
|
|
|
GdkRGBA bg;
|
|
|
|
GWeakRef widget, importer;
|
|
|
|
/* Sink properties */
|
|
gint par_n, par_d;
|
|
|
|
/* For drawing overlays */
|
|
gdouble pixel_aspect;
|
|
|
|
/* Resize */
|
|
gboolean pending_resize;
|
|
guint display_ratio_num;
|
|
guint display_ratio_den;
|
|
|
|
/* GdkPaintableInterface */
|
|
gint display_width;
|
|
gint display_height;
|
|
gdouble display_aspect_ratio;
|
|
|
|
/* Pending draw signal id */
|
|
guint draw_id;
|
|
};
|
|
|
|
GstClapperPaintable * gst_clapper_paintable_new (void);
|
|
void gst_clapper_paintable_queue_draw (GstClapperPaintable *paintable);
|
|
void gst_clapper_paintable_set_widget (GstClapperPaintable *paintable, GtkWidget *widget);
|
|
void gst_clapper_paintable_set_importer (GstClapperPaintable *paintable, GstClapperImporter *importer);
|
|
gboolean gst_clapper_paintable_set_video_info (GstClapperPaintable *paintable, const GstVideoInfo *v_info);
|
|
void gst_clapper_paintable_set_pixel_aspect_ratio (GstClapperPaintable *paintable, gint par_n, gint par_d);
|
|
|
|
G_END_DECLS
|