summaryrefslogtreecommitdiff
path: root/include/gst/transcoder
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2022-08-03 21:02:36 +0300
committerGeorge Hazan <ghazan@miranda.im>2022-08-03 21:02:36 +0300
commit5323a782c4e8c42781f22ce2f488962a18f82554 (patch)
treef71537197b16f0f8fd0d6937f7120d018d220814 /include/gst/transcoder
parent50acf9d37183f86f6f623aad410003392b0af41f (diff)
Jabber: initial version of Jingle support
Diffstat (limited to 'include/gst/transcoder')
-rw-r--r--include/gst/transcoder/gsttranscoder-signal-adapter.h55
-rw-r--r--include/gst/transcoder/gsttranscoder.h178
-rw-r--r--include/gst/transcoder/transcoder-enumtypes.h28
-rw-r--r--include/gst/transcoder/transcoder-prelude.h38
4 files changed, 299 insertions, 0 deletions
diff --git a/include/gst/transcoder/gsttranscoder-signal-adapter.h b/include/gst/transcoder/gsttranscoder-signal-adapter.h
new file mode 100644
index 0000000000..198efe073a
--- /dev/null
+++ b/include/gst/transcoder/gsttranscoder-signal-adapter.h
@@ -0,0 +1,55 @@
+/* GStreamer
+ *
+ * Copyright (C) 2019-2020 Stephan Hesse <stephan@emliri.com>
+ * Copyright (C) 2020 Thibault Saunier <tsaunier@igalia.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 <gst/gst.h>
+#include <gst/transcoder/gsttranscoder.h>
+
+G_BEGIN_DECLS
+
+/**
+ * GstTranscoderSignalAdapter:
+ *
+ * Transforms #GstTranscoder bus messages to signals from the adapter object.
+ *
+ * Since: 1.20
+ */
+
+/**
+ * GST_TYPE_TRANSCODER_SIGNAL_ADAPTER:
+ *
+ * Since: 1.20
+ */
+#define GST_TYPE_TRANSCODER_SIGNAL_ADAPTER (gst_transcoder_signal_adapter_get_type ())
+GST_TRANSCODER_API
+
+/**
+ * GstTranscoderSignalAdapterClass:
+ *
+ * Since: 1.20
+ */
+G_DECLARE_FINAL_TYPE(GstTranscoderSignalAdapter, gst_transcoder_signal_adapter, GST, TRANSCODER_SIGNAL_ADAPTER, GObject)
+
+GST_TRANSCODER_API
+GstTranscoder * gst_transcoder_signal_adapter_get_transcoder (GstTranscoderSignalAdapter * self);
+
+
+G_END_DECLS
diff --git a/include/gst/transcoder/gsttranscoder.h b/include/gst/transcoder/gsttranscoder.h
new file mode 100644
index 0000000000..97aea3ab92
--- /dev/null
+++ b/include/gst/transcoder/gsttranscoder.h
@@ -0,0 +1,178 @@
+#ifndef __GST_TRANSCODER_H
+#define __GST_TRANSCODER_H
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <gst/gst.h>
+#include <gst/pbutils/pbutils.h>
+#include <gst/transcoder/transcoder-prelude.h>
+#include <gst/transcoder/transcoder-enumtypes.h>
+
+G_BEGIN_DECLS
+
+/*********** Error definitions ************/
+#define GST_TRANSCODER_ERROR (gst_transcoder_error_quark ())
+
+/**
+ * GstTranscoderError:
+ * @GST_TRANSCODER_ERROR_FAILED: generic error.
+ */
+typedef enum {
+ GST_TRANSCODER_ERROR_FAILED = 0
+} GstTranscoderError;
+
+GST_TRANSCODER_API
+GQuark gst_transcoder_error_quark (void);
+GST_TRANSCODER_API
+const gchar * gst_transcoder_error_get_name (GstTranscoderError error);
+
+/*********** State definition ************/
+
+/**
+ * GstTranscoderState:
+ * @GST_TRANSCODER_STATE_STOPPED: the transcoder is stopped.
+ * @GST_TRANSCODER_STATE_PAUSED: the transcoder is paused.
+ * @GST_TRANSCODER_STATE_PLAYING: the transcoder is currently transcoding a
+ * stream.
+ *
+ * High level representation of the transcoder pipeline state.
+ *
+ * Since: 1.20
+ */
+typedef enum {
+ GST_TRANSCODER_STATE_STOPPED,
+ GST_TRANSCODER_STATE_PAUSED,
+ GST_TRANSCODER_STATE_PLAYING
+} GstTranscoderState;
+
+GST_TRANSCODER_API
+const gchar * gst_transcoder_state_get_name (GstTranscoderState state);
+
+/*********** Messages types definitions ************/
+
+/**
+ * GstTranscoderMessage:
+ * @GST_TRANSCODER_MESSAGE_POSITION_UPDATED: Sink position changed
+ * @GST_TRANSCODER_MESSAGE_DURATION_CHANGED: Duration of stream changed
+ * @GST_TRANSCODER_MESSAGE_STATE_CHANGED: Pipeline state changed
+ * @GST_TRANSCODER_MESSAGE_DONE: Transcoding is done
+ * @GST_TRANSCODER_MESSAGE_ERROR: Message contains an error
+ * @GST_TRANSCODER_MESSAGE_WARNING: Message contains an error
+ *
+ * Types of messages that will be posted on the transcoder API bus.
+ *
+ * See also #gst_transcoder_get_message_bus()
+ *
+ * Since: 1.20
+ */
+typedef enum
+{
+ GST_TRANSCODER_MESSAGE_POSITION_UPDATED,
+ GST_TRANSCODER_MESSAGE_DURATION_CHANGED,
+ GST_TRANSCODER_MESSAGE_STATE_CHANGED,
+ GST_TRANSCODER_MESSAGE_DONE,
+ GST_TRANSCODER_MESSAGE_ERROR,
+ GST_TRANSCODER_MESSAGE_WARNING,
+} GstTranscoderMessage;
+
+GST_TRANSCODER_API
+gboolean gst_transcoder_is_transcoder_message (GstMessage * msg);
+
+GST_TRANSCODER_API
+const gchar * gst_transcoder_message_get_name (GstTranscoderMessage message);
+
+GST_TRANSCODER_API
+void gst_transcoder_message_parse_position (GstMessage * msg, GstClockTime * position);
+
+GST_TRANSCODER_API
+void gst_transcoder_message_parse_duration (GstMessage * msg, GstClockTime * duration);
+
+GST_TRANSCODER_API
+void gst_transcoder_message_parse_state (GstMessage * msg, GstTranscoderState * state);
+
+GST_TRANSCODER_API
+void gst_transcoder_message_parse_error (GstMessage * msg, GError * error, GstStructure ** details);
+
+GST_TRANSCODER_API
+void gst_transcoder_message_parse_warning (GstMessage * msg, GError * error, GstStructure ** details);
+
+
+
+/*********** GstTranscoder definition ************/
+#define GST_TYPE_TRANSCODER (gst_transcoder_get_type ())
+
+/**
+ * GstTranscoderClass.parent_class:
+ *
+ * Since: 1.20
+ */
+GST_TRANSCODER_API
+G_DECLARE_FINAL_TYPE (GstTranscoder, gst_transcoder, GST, TRANSCODER, GstObject)
+
+GST_TRANSCODER_API
+GstTranscoder * gst_transcoder_new (const gchar * source_uri,
+ const gchar * dest_uri,
+ const gchar * encoding_profile);
+
+GST_TRANSCODER_API
+GstTranscoder * gst_transcoder_new_full (const gchar * source_uri,
+ const gchar * dest_uri,
+ GstEncodingProfile * profile);
+
+GST_TRANSCODER_API
+gboolean gst_transcoder_run (GstTranscoder * self,
+ GError ** error);
+
+GST_TRANSCODER_API
+GstBus * gst_transcoder_get_message_bus (GstTranscoder * transcoder);
+
+GST_TRANSCODER_API
+void gst_transcoder_set_cpu_usage (GstTranscoder * self,
+ gint cpu_usage);
+
+GST_TRANSCODER_API
+void gst_transcoder_run_async (GstTranscoder * self);
+
+GST_TRANSCODER_API
+void gst_transcoder_set_position_update_interval (GstTranscoder * self,
+ guint interval);
+
+GST_TRANSCODER_API
+gchar * gst_transcoder_get_source_uri (GstTranscoder * self);
+
+GST_TRANSCODER_API
+gchar * gst_transcoder_get_dest_uri (GstTranscoder * self);
+
+GST_TRANSCODER_API
+guint gst_transcoder_get_position_update_interval (GstTranscoder * self);
+
+GST_TRANSCODER_API
+GstClockTime gst_transcoder_get_position (GstTranscoder * self);
+
+GST_TRANSCODER_API
+GstClockTime gst_transcoder_get_duration (GstTranscoder * self);
+
+GST_TRANSCODER_API
+GstElement * gst_transcoder_get_pipeline (GstTranscoder * self);
+
+GST_TRANSCODER_API
+gboolean gst_transcoder_get_avoid_reencoding (GstTranscoder * self);
+GST_TRANSCODER_API
+void gst_transcoder_set_avoid_reencoding (GstTranscoder * self,
+ gboolean avoid_reencoding);
+
+#include "gsttranscoder-signal-adapter.h"
+
+GST_TRANSCODER_API
+GstTranscoderSignalAdapter*
+gst_transcoder_get_signal_adapter (GstTranscoder * self,
+ GMainContext *context);
+GST_TRANSCODER_API
+GstTranscoderSignalAdapter*
+gst_transcoder_get_sync_signal_adapter (GstTranscoder * self);
+
+G_END_DECLS
+
+#endif
diff --git a/include/gst/transcoder/transcoder-enumtypes.h b/include/gst/transcoder/transcoder-enumtypes.h
new file mode 100644
index 0000000000..88f6fc0eff
--- /dev/null
+++ b/include/gst/transcoder/transcoder-enumtypes.h
@@ -0,0 +1,28 @@
+
+/* This file is generated by glib-mkenums, do not modify it. This code is licensed under the same license as the containing project. Note that it links to GLib, so must comply with the LGPL linking clauses. */
+
+#pragma once
+
+ #include <glib-object.h>
+ #include <gst/transcoder/transcoder-prelude.h>
+
+ G_BEGIN_DECLS
+
+/* enumerations from "gsttranscoder.h" */
+
+GST_TRANSCODER_API
+GType gst_transcoder_error_get_type (void);
+#define GST_TYPE_TRANSCODER_ERROR (gst_transcoder_error_get_type())
+
+GST_TRANSCODER_API
+GType gst_transcoder_state_get_type (void);
+#define GST_TYPE_TRANSCODER_STATE (gst_transcoder_state_get_type())
+
+GST_TRANSCODER_API
+GType gst_transcoder_message_get_type (void);
+#define GST_TYPE_TRANSCODER_MESSAGE (gst_transcoder_message_get_type())
+
+G_END_DECLS
+
+/* Generated data ends here */
+
diff --git a/include/gst/transcoder/transcoder-prelude.h b/include/gst/transcoder/transcoder-prelude.h
new file mode 100644
index 0000000000..4745db5044
--- /dev/null
+++ b/include/gst/transcoder/transcoder-prelude.h
@@ -0,0 +1,38 @@
+/* GStreamer Transcoder Library
+ *
+ * Copyright (C) 2019 Thibault Saunier <tsaunier@igalia.com>
+ *
+ * transcoder-prelude.h: prelude include header for the gst-transcoder library
+ *
+ * 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.
+ */
+
+#ifndef __GST_TRANSCODER_PRELUDE_H__
+#define __GST_TRANSCODER_PRELUDE_H__
+
+#include <gst/gst.h>
+
+#ifndef GST_TRANSCODER_API
+# ifdef BUILDING_GST_TRANSCODER
+# define GST_TRANSCODER_API GST_API_EXPORT /* from config.h */
+# else
+# define GST_TRANSCODER_API GST_API_IMPORT
+# endif
+#endif
+
+#include <gst/transcoder/transcoder-enumtypes.h>
+
+#endif /* __GST_TRANSCODER_PRELUDE_H__ */