mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-23 07:38:16 +00:00
gst-indent c++ files
Original commit message from CVS: gst-indent c++ files
This commit is contained in:
parent
908defa2c4
commit
ed1ef1fc34
1 changed files with 203 additions and 203 deletions
|
@ -28,14 +28,16 @@
|
|||
#include "gstsiddec.h"
|
||||
|
||||
/* Sidec signals and args */
|
||||
enum {
|
||||
enum
|
||||
{
|
||||
/* FILL ME */
|
||||
LAST_SIGNAL
|
||||
};
|
||||
|
||||
#define DEFAULT_BLOCKSIZE 4096
|
||||
|
||||
enum {
|
||||
enum
|
||||
{
|
||||
ARG_0,
|
||||
ARG_TUNE,
|
||||
ARG_CLOCK,
|
||||
|
@ -49,17 +51,13 @@ enum {
|
|||
/* FILL ME */
|
||||
};
|
||||
|
||||
static GstStaticPadTemplate sink_templ =
|
||||
GST_STATIC_PAD_TEMPLATE (
|
||||
"sink",
|
||||
static GstStaticPadTemplate sink_templ = GST_STATIC_PAD_TEMPLATE ("sink",
|
||||
GST_PAD_SINK,
|
||||
GST_PAD_ALWAYS,
|
||||
GST_STATIC_CAPS ("audio/x-sid")
|
||||
);
|
||||
|
||||
static GstStaticPadTemplate src_templ =
|
||||
GST_STATIC_PAD_TEMPLATE (
|
||||
"src",
|
||||
static GstStaticPadTemplate src_templ = GST_STATIC_PAD_TEMPLATE ("src",
|
||||
GST_PAD_SRC,
|
||||
GST_PAD_ALWAYS,
|
||||
GST_STATIC_CAPS ("audio/x-raw-int, "
|
||||
|
@ -67,12 +65,11 @@ GST_STATIC_PAD_TEMPLATE (
|
|||
"signed = (boolean) { true, false }, "
|
||||
"width = (int) { 8, 16 }, "
|
||||
"depth = (int) { 8, 16 }, "
|
||||
"rate = (int) [ 8000, 48000 ], "
|
||||
"channels = (int) [ 1, 2 ]"
|
||||
)
|
||||
"rate = (int) [ 8000, 48000 ], " "channels = (int) [ 1, 2 ]")
|
||||
);
|
||||
|
||||
enum {
|
||||
enum
|
||||
{
|
||||
SID_STATE_NEED_TUNE = 1,
|
||||
SID_STATE_LOAD_TUNE = 2,
|
||||
SID_STATE_PLAY_TUNE = 3,
|
||||
|
@ -117,8 +114,8 @@ static void gst_siddec_init (GstSidDec *siddec);
|
|||
|
||||
static void gst_siddec_loop (GstElement * element);
|
||||
|
||||
static gboolean gst_siddec_src_convert (GstPad *pad, GstFormat src_format, gint64 src_value,
|
||||
GstFormat *dest_format, gint64 *dest_value);
|
||||
static gboolean gst_siddec_src_convert (GstPad * pad, GstFormat src_format,
|
||||
gint64 src_value, GstFormat * dest_format, gint64 * dest_value);
|
||||
static gboolean gst_siddec_src_query (GstPad * pad, GstQueryType type,
|
||||
GstFormat * format, gint64 * value);
|
||||
|
||||
|
@ -128,6 +125,7 @@ static void gst_siddec_set_property (GObject *object, guint prop_id,
|
|||
const GValue * value, GParamSpec * pspec);
|
||||
|
||||
static GstElementClass *parent_class = NULL;
|
||||
|
||||
//static guint gst_siddec_signals[LAST_SIGNAL] = { 0 };
|
||||
|
||||
GType
|
||||
|
@ -148,7 +146,9 @@ gst_siddec_get_type (void)
|
|||
(GInstanceInitFunc) gst_siddec_init,
|
||||
NULL
|
||||
};
|
||||
siddec_type = g_type_register_static (GST_TYPE_ELEMENT, "GstSidDec", &siddec_info, (GTypeFlags)0);
|
||||
siddec_type =
|
||||
g_type_register_static (GST_TYPE_ELEMENT, "GstSidDec", &siddec_info,
|
||||
(GTypeFlags) 0);
|
||||
}
|
||||
|
||||
return siddec_type;
|
||||
|
@ -157,12 +157,11 @@ gst_siddec_get_type (void)
|
|||
static void
|
||||
gst_siddec_base_init (gpointer g_class)
|
||||
{
|
||||
static GstElementDetails gst_siddec_details = GST_ELEMENT_DETAILS (
|
||||
"Sid decoder",
|
||||
static GstElementDetails gst_siddec_details =
|
||||
GST_ELEMENT_DETAILS ("Sid decoder",
|
||||
"Codec/Audio/Decoder",
|
||||
"Use sidplay to decode SID audio tunes",
|
||||
"Wim Taymans <wim.taymans@chello.be> "
|
||||
);
|
||||
"Wim Taymans <wim.taymans@chello.be> ");
|
||||
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
|
||||
|
||||
gst_element_class_set_details (element_class, &gst_siddec_details);
|
||||
|
@ -190,28 +189,30 @@ gst_siddec_class_init (GstSidDec *klass)
|
|||
1, 100, 1, (GParamFlags) G_PARAM_READWRITE));
|
||||
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_CLOCK,
|
||||
g_param_spec_enum ("clock", "clock", "clock",
|
||||
GST_TYPE_SID_CLOCK, SIDTUNE_CLOCK_PAL, (GParamFlags)G_PARAM_READWRITE));
|
||||
GST_TYPE_SID_CLOCK, SIDTUNE_CLOCK_PAL,
|
||||
(GParamFlags) G_PARAM_READWRITE));
|
||||
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_MEMORY,
|
||||
g_param_spec_enum ("memory", "memory", "memory",
|
||||
GST_TYPE_SID_MEMORY, MPU_PLAYSID_ENVIRONMENT, (GParamFlags)G_PARAM_READWRITE));
|
||||
g_param_spec_enum ("memory", "memory", "memory", GST_TYPE_SID_MEMORY,
|
||||
MPU_PLAYSID_ENVIRONMENT, (GParamFlags) G_PARAM_READWRITE));
|
||||
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_FILTER,
|
||||
g_param_spec_boolean ("filter", "filter", "filter",
|
||||
TRUE, (GParamFlags)G_PARAM_READWRITE));
|
||||
g_param_spec_boolean ("filter", "filter", "filter", TRUE,
|
||||
(GParamFlags) G_PARAM_READWRITE));
|
||||
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_MEASURED_VOLUME,
|
||||
g_param_spec_boolean ("measured_volume", "measured_volume", "measured_volume",
|
||||
TRUE, (GParamFlags)G_PARAM_READWRITE));
|
||||
g_param_spec_boolean ("measured_volume", "measured_volume",
|
||||
"measured_volume", TRUE, (GParamFlags) G_PARAM_READWRITE));
|
||||
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_MOS8580,
|
||||
g_param_spec_boolean ("mos8580", "mos8580", "mos8580",
|
||||
TRUE, (GParamFlags)G_PARAM_READWRITE));
|
||||
g_param_spec_boolean ("mos8580", "mos8580", "mos8580", TRUE,
|
||||
(GParamFlags) G_PARAM_READWRITE));
|
||||
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_FORCE_SPEED,
|
||||
g_param_spec_boolean ("force_speed", "force_speed", "force_speed",
|
||||
TRUE, (GParamFlags)G_PARAM_READWRITE));
|
||||
g_param_spec_boolean ("force_speed", "force_speed", "force_speed", TRUE,
|
||||
(GParamFlags) G_PARAM_READWRITE));
|
||||
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_BLOCKSIZE,
|
||||
g_param_spec_ulong ("blocksize", "Block size", "Size in bytes to output per buffer",
|
||||
1, G_MAXULONG, DEFAULT_BLOCKSIZE, (GParamFlags)G_PARAM_READWRITE));
|
||||
g_param_spec_ulong ("blocksize", "Block size",
|
||||
"Size in bytes to output per buffer", 1, G_MAXULONG,
|
||||
DEFAULT_BLOCKSIZE, (GParamFlags) G_PARAM_READWRITE));
|
||||
g_object_class_install_property (gobject_class, ARG_METADATA,
|
||||
g_param_spec_boxed ("metadata", "Metadata", "Metadata",
|
||||
GST_TYPE_CAPS, (GParamFlags)G_PARAM_READABLE));
|
||||
g_param_spec_boxed ("metadata", "Metadata", "Metadata", GST_TYPE_CAPS,
|
||||
(GParamFlags) G_PARAM_READABLE));
|
||||
|
||||
gobject_class->set_property = gst_siddec_set_property;
|
||||
gobject_class->get_property = gst_siddec_get_property;
|
||||
|
@ -220,14 +221,16 @@ gst_siddec_class_init (GstSidDec *klass)
|
|||
static void
|
||||
gst_siddec_init (GstSidDec * siddec)
|
||||
{
|
||||
siddec->sinkpad = gst_pad_new_from_template (
|
||||
gst_static_pad_template_get (&sink_templ), "sink");
|
||||
siddec->sinkpad =
|
||||
gst_pad_new_from_template (gst_static_pad_template_get (&sink_templ),
|
||||
"sink");
|
||||
gst_element_add_pad (GST_ELEMENT (siddec), siddec->sinkpad);
|
||||
gst_pad_set_query_function (siddec->sinkpad, NULL);
|
||||
gst_pad_set_convert_function (siddec->sinkpad, NULL);
|
||||
|
||||
siddec->srcpad = gst_pad_new_from_template (
|
||||
gst_static_pad_template_get (&src_templ), "src");
|
||||
siddec->srcpad =
|
||||
gst_pad_new_from_template (gst_static_pad_template_get (&src_templ),
|
||||
"src");
|
||||
gst_pad_set_event_function (siddec->srcpad, NULL);
|
||||
gst_pad_set_convert_function (siddec->srcpad, gst_siddec_src_convert);
|
||||
gst_pad_set_query_function (siddec->srcpad, gst_siddec_src_query);
|
||||
|
@ -285,17 +288,19 @@ update_metadata (GstSidDec *siddec)
|
|||
gst_props_add_entry (props, entry);
|
||||
}
|
||||
if (info.authorString) {
|
||||
entry = gst_props_entry_new ("Composer", G_TYPE_STRING (info.authorString));
|
||||
entry =
|
||||
gst_props_entry_new ("Composer", G_TYPE_STRING (info.authorString));
|
||||
gst_props_add_entry (props, entry);
|
||||
}
|
||||
if (info.copyrightString) {
|
||||
entry = gst_props_entry_new ("Copyright", G_TYPE_STRING (info.copyrightString));
|
||||
entry =
|
||||
gst_props_entry_new ("Copyright",
|
||||
G_TYPE_STRING (info.copyrightString));
|
||||
gst_props_add_entry (props, entry);
|
||||
}
|
||||
|
||||
siddec->metadata = gst_caps_new ("sid_metadata",
|
||||
"application/x-gst-metadata",
|
||||
props);
|
||||
"application/x-gst-metadata", props);
|
||||
|
||||
g_object_notify (G_OBJECT (siddec), "metadata");
|
||||
}
|
||||
|
@ -347,7 +352,8 @@ siddec_negotiate (GstSidDec *siddec)
|
|||
gst_structure_get_int (structure, "channels", &channels);
|
||||
siddec->config->channels = channels;
|
||||
|
||||
siddec->config->sampleFormat = (sign ? SIDEMU_SIGNED_PCM : SIDEMU_UNSIGNED_PCM);
|
||||
siddec->config->sampleFormat =
|
||||
(sign ? SIDEMU_SIGNED_PCM : SIDEMU_UNSIGNED_PCM);
|
||||
|
||||
if (!GST_PAD_CAPS (siddec->srcpad)) {
|
||||
if (!gst_pad_try_set_caps (siddec->srcpad,
|
||||
|
@ -357,9 +363,7 @@ siddec_negotiate (GstSidDec *siddec)
|
|||
"width", G_TYPE_INT, siddec->config->bitsPerSample,
|
||||
"depth", G_TYPE_INT, siddec->config->bitsPerSample,
|
||||
"rate", G_TYPE_INT, siddec->config->frequency,
|
||||
"channels", G_TYPE_INT, siddec->config->channels,
|
||||
NULL)))
|
||||
{
|
||||
"channels", G_TYPE_INT, siddec->config->channels, NULL))) {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
@ -398,11 +402,11 @@ gst_siddec_loop (GstElement *element)
|
|||
return;
|
||||
}
|
||||
gst_event_unref (event);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
GstBuffer *buf = GST_BUFFER (data);
|
||||
|
||||
memcpy (siddec->tune_buffer+siddec->tune_len, GST_BUFFER_DATA (buf), GST_BUFFER_SIZE (buf));
|
||||
memcpy (siddec->tune_buffer + siddec->tune_len, GST_BUFFER_DATA (buf),
|
||||
GST_BUFFER_SIZE (buf));
|
||||
siddec->tune_len += GST_BUFFER_SIZE (buf);
|
||||
|
||||
gst_buffer_unref (buf);
|
||||
|
@ -413,7 +417,6 @@ gst_siddec_loop (GstElement *element)
|
|||
GST_ELEMENT_ERROR (siddec, LIBRARY, TOO_LAZY, (NULL), (NULL));
|
||||
return;
|
||||
}
|
||||
|
||||
//update_metadata (siddec);
|
||||
|
||||
if (!siddec_negotiate (siddec)) {
|
||||
|
@ -421,7 +424,8 @@ gst_siddec_loop (GstElement *element)
|
|||
return;
|
||||
}
|
||||
|
||||
if (!sidEmuInitializeSong (*siddec->engine, *siddec->tune, siddec->tune_number)) {
|
||||
if (!sidEmuInitializeSong (*siddec->engine, *siddec->tune,
|
||||
siddec->tune_number)) {
|
||||
GST_ELEMENT_ERROR (siddec, LIBRARY, TOO_LAZY, (NULL), (NULL));
|
||||
return;
|
||||
}
|
||||
|
@ -469,7 +473,8 @@ gst_siddec_src_convert (GstPad *pad, GstFormat src_format, gint64 src_value,
|
|||
|
||||
siddec = GST_SIDDEC (gst_pad_get_parent (pad));
|
||||
|
||||
bytes_per_sample = (siddec->config->bitsPerSample>>3) * siddec->config->channels;
|
||||
bytes_per_sample =
|
||||
(siddec->config->bitsPerSample >> 3) * siddec->config->channels;
|
||||
|
||||
switch (src_format) {
|
||||
case GST_FORMAT_BYTES:
|
||||
|
@ -512,7 +517,8 @@ gst_siddec_src_convert (GstPad *pad, GstFormat src_format, gint64 src_value,
|
|||
scale = bytes_per_sample;
|
||||
/* fallthrough */
|
||||
case GST_FORMAT_DEFAULT:
|
||||
*dest_value = src_value * scale * siddec->config->frequency / GST_SECOND;
|
||||
*dest_value =
|
||||
src_value * scale * siddec->config->frequency / GST_SECOND;
|
||||
break;
|
||||
default:
|
||||
res = FALSE;
|
||||
|
@ -538,8 +544,7 @@ gst_siddec_src_query (GstPad *pad, GstQueryType type,
|
|||
case GST_QUERY_POSITION:
|
||||
/* we only know about our bytes, convert to requested format */
|
||||
res &= gst_pad_convert (pad,
|
||||
GST_FORMAT_BYTES, siddec->total_bytes,
|
||||
format, value);
|
||||
GST_FORMAT_BYTES, siddec->total_bytes, format, value);
|
||||
break;
|
||||
default:
|
||||
res = FALSE;
|
||||
|
@ -549,7 +554,8 @@ gst_siddec_src_query (GstPad *pad, GstQueryType type,
|
|||
}
|
||||
|
||||
static void
|
||||
gst_siddec_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
|
||||
gst_siddec_set_property (GObject * object, guint prop_id, const GValue * value,
|
||||
GParamSpec * pspec)
|
||||
{
|
||||
GstSidDec *siddec;
|
||||
|
||||
|
@ -590,7 +596,8 @@ gst_siddec_set_property (GObject *object, guint prop_id, const GValue *value, GP
|
|||
}
|
||||
|
||||
static void
|
||||
gst_siddec_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
|
||||
gst_siddec_get_property (GObject * object, guint prop_id, GValue * value,
|
||||
GParamSpec * pspec)
|
||||
{
|
||||
GstSidDec *siddec;
|
||||
|
||||
|
@ -639,15 +646,8 @@ plugin_init (GstPlugin *plugin)
|
|||
GST_TYPE_SIDDEC);
|
||||
}
|
||||
|
||||
GST_PLUGIN_DEFINE (
|
||||
GST_VERSION_MAJOR,
|
||||
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
|
||||
GST_VERSION_MINOR,
|
||||
"siddec",
|
||||
"Uses libsid to decode .sid files",
|
||||
plugin_init,
|
||||
VERSION,
|
||||
"GPL",
|
||||
GST_PACKAGE,
|
||||
GST_ORIGIN
|
||||
)
|
||||
|
||||
plugin_init, VERSION, "GPL", GST_PACKAGE, GST_ORIGIN)
|
||||
|
|
Loading…
Reference in a new issue