Run C code through gst-indent

This commit is contained in:
Sebastian Dröge 2016-07-20 11:29:27 +03:00
parent 31fd26b982
commit 8b313a752a
2 changed files with 55 additions and 45 deletions

View file

@ -22,7 +22,8 @@
#include <string.h>
#include <stdint.h>
typedef struct {
typedef struct
{
gchar *name;
gchar *long_name;
gchar *description;
@ -70,7 +71,8 @@ static void gst_rs_sink_get_property (GObject * object, guint prop_id,
static gboolean gst_rs_sink_start (GstBaseSink * basesink);
static gboolean gst_rs_sink_stop (GstBaseSink * basesink);
static GstFlowReturn gst_rs_sink_render (GstBaseSink * sink, GstBuffer * buffer);
static GstFlowReturn gst_rs_sink_render (GstBaseSink * sink,
GstBuffer * buffer);
static GObjectClass *parent_class;
@ -80,7 +82,8 @@ gst_rs_sink_class_init (GstRsSinkClass * klass)
GObjectClass *gobject_class;
GstElementClass *gstelement_class;
GstBaseSinkClass *gstbasesink_class;
ElementData * data = g_hash_table_lookup (sinks, GSIZE_TO_POINTER (G_TYPE_FROM_CLASS (klass)));
ElementData *data =
g_hash_table_lookup (sinks, GSIZE_TO_POINTER (G_TYPE_FROM_CLASS (klass)));
g_assert (data != NULL);
gobject_class = G_OBJECT_CLASS (klass);
@ -98,10 +101,7 @@ gst_rs_sink_class_init (GstRsSinkClass * klass)
GST_PARAM_MUTABLE_READY));
gst_element_class_set_static_metadata (gstelement_class,
data->long_name,
data->classification,
data->description,
data->author);
data->long_name, data->classification, data->description, data->author);
gst_element_class_add_static_pad_template (gstelement_class, &sink_template);
gstbasesink_class->start = GST_DEBUG_FUNCPTR (gst_rs_sink_start);
@ -112,7 +112,8 @@ gst_rs_sink_class_init (GstRsSinkClass * klass)
static void
gst_rs_sink_init (GstRsSink * sink, GstRsSinkClass * klass)
{
ElementData * data = g_hash_table_lookup (sinks, GSIZE_TO_POINTER (G_TYPE_FROM_CLASS (klass)));
ElementData *data =
g_hash_table_lookup (sinks, GSIZE_TO_POINTER (G_TYPE_FROM_CLASS (klass)));
g_assert (data != NULL);
gst_base_sink_set_sync (GST_BASE_SINK (sink), FALSE);
@ -259,7 +260,10 @@ gst_rs_sink_plugin_init (GstPlugin * plugin)
}
gboolean
gst_rs_sink_register (GstPlugin * plugin, const gchar *name, const gchar * long_name, const gchar * description, const gchar * classification, const gchar * author, GstRank rank, void * (*create_instance) (void), const gchar *protocols)
gst_rs_sink_register (GstPlugin * plugin, const gchar * name,
const gchar * long_name, const gchar * description,
const gchar * classification, const gchar * author, GstRank rank,
void *(*create_instance) (void), const gchar * protocols)
{
GTypeInfo type_info = {
sizeof (GstRsSinkClass),

View file

@ -21,7 +21,8 @@
#include <string.h>
#include <stdint.h>
typedef struct {
typedef struct
{
gchar *long_name;
gchar *description;
gchar *classification;
@ -34,7 +35,8 @@ static GHashTable *sources;
/* Declarations for Rust code */
extern gboolean sources_register (void *plugin);
extern void source_drop (void *source);
extern GstFlowReturn source_fill (void * source, uint64_t offset, void * data, size_t * data_len);
extern GstFlowReturn source_fill (void *source, uint64_t offset, void *data,
size_t * data_len);
extern gboolean source_do_seek (void *source, uint64_t start, uint64_t stop);
extern gboolean source_set_uri (void *source, const char *uri);
extern char *source_get_uri (void *source);
@ -59,8 +61,7 @@ enum
PROP_URI
};
static void gst_rs_src_uri_handler_init (gpointer g_iface,
gpointer iface_data);
static void gst_rs_src_uri_handler_init (gpointer g_iface, gpointer iface_data);
static void gst_rs_src_finalize (GObject * object);
@ -86,7 +87,8 @@ gst_rs_src_class_init (GstRsSrcClass * klass)
GObjectClass *gobject_class;
GstElementClass *gstelement_class;
GstBaseSrcClass *gstbasesrc_class;
ElementData * data = g_hash_table_lookup (sources, GSIZE_TO_POINTER (G_TYPE_FROM_CLASS (klass)));
ElementData *data = g_hash_table_lookup (sources,
GSIZE_TO_POINTER (G_TYPE_FROM_CLASS (klass)));
g_assert (data != NULL);
gobject_class = G_OBJECT_CLASS (klass);
@ -105,10 +107,7 @@ gst_rs_src_class_init (GstRsSrcClass * klass)
gobject_class->finalize = gst_rs_src_finalize;
gst_element_class_set_static_metadata (gstelement_class,
data->long_name,
data->classification,
data->description,
data->author);
data->long_name, data->classification, data->description, data->author);
gst_element_class_add_static_pad_template (gstelement_class, &src_template);
gstbasesrc_class->start = GST_DEBUG_FUNCPTR (gst_rs_src_start);
@ -122,7 +121,8 @@ gst_rs_src_class_init (GstRsSrcClass * klass)
static void
gst_rs_src_init (GstRsSrc * src, GstRsSrcClass * klass)
{
ElementData * data = g_hash_table_lookup (sources, GSIZE_TO_POINTER (G_TYPE_FROM_CLASS (klass)));
ElementData *data = g_hash_table_lookup (sources,
GSIZE_TO_POINTER (G_TYPE_FROM_CLASS (klass)));
g_assert (data != NULL);
gst_base_src_set_blocksize (GST_BASE_SRC (src), 4096);
@ -305,7 +305,11 @@ gst_rs_source_plugin_init (GstPlugin * plugin)
}
gboolean
gst_rs_source_register (GstPlugin * plugin, const gchar *name, const gchar * long_name, const gchar * description, const gchar * classification, const gchar * author, GstRank rank, void * (*create_instance) (void), const gchar *protocols, gboolean push_only)
gst_rs_source_register (GstPlugin * plugin, const gchar * name,
const gchar * long_name, const gchar * description,
const gchar * classification, const gchar * author, GstRank rank,
void *(*create_instance) (void), const gchar * protocols,
gboolean push_only)
{
GTypeInfo type_info = {
sizeof (GstRsSrcClass),
@ -336,7 +340,9 @@ gst_rs_source_register (GstPlugin * plugin, const gchar *name, const gchar * lon
data->protocols = g_strsplit (protocols, ":", -1);
type_name = g_strconcat ("RsSrc-", name, NULL);
type = g_type_register_static (push_only ? GST_TYPE_PUSH_SRC : GST_TYPE_BASE_SRC, type_name, &type_info, 0);
type =
g_type_register_static (push_only ? GST_TYPE_PUSH_SRC : GST_TYPE_BASE_SRC,
type_name, &type_info, 0);
g_free (type_name);
g_type_add_interface_static (type, GST_TYPE_URI_HANDLER, &iface_info);