mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
// to /* */ fixes
Original commit message from CVS: // to /* */ fixes
This commit is contained in:
parent
fac29d09ff
commit
909b204b26
4 changed files with 43 additions and 43 deletions
|
@ -67,7 +67,7 @@ GST_PADTEMPLATE_FACTORY (afsink_sink_factory,
|
|||
),
|
||||
"width", GST_PROPS_INT_RANGE (8, 16),
|
||||
"depth", GST_PROPS_INT_RANGE (8, 16),
|
||||
"rate", GST_PROPS_INT_RANGE (4000, 48000), //FIXME
|
||||
"rate", GST_PROPS_INT_RANGE (4000, 48000), /*FIXME*/
|
||||
"channels", GST_PROPS_INT_RANGE (1, 2)
|
||||
)
|
||||
);
|
||||
|
@ -155,10 +155,10 @@ gst_afsink_class_init (GstAFSinkClass *klass)
|
|||
|
||||
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_TYPE,
|
||||
g_param_spec_enum("type","type","type",
|
||||
GST_TYPE_AFSINK_TYPES,0,G_PARAM_READWRITE)); // CHECKME!
|
||||
GST_TYPE_AFSINK_TYPES,0,G_PARAM_READWRITE)); /* CHECKME! */
|
||||
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_OUTPUT_ENDIANNESS,
|
||||
g_param_spec_int("endianness","endianness","endianness",
|
||||
G_MININT,G_MAXINT,0,G_PARAM_READWRITE)); // CHECKME
|
||||
G_MININT,G_MAXINT,0,G_PARAM_READWRITE)); /* CHECKME */
|
||||
|
||||
gst_afsink_signals[SIGNAL_HANDOFF] =
|
||||
g_signal_new ("handoff", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST,
|
||||
|
@ -175,7 +175,7 @@ gst_afsink_class_init (GstAFSinkClass *klass)
|
|||
static void
|
||||
gst_afsink_init (GstAFSink *afsink)
|
||||
{
|
||||
// GstPad *pad; this is now done in the struct
|
||||
/* GstPad *pad; this is now done in the struct */
|
||||
|
||||
afsink->sinkpad = gst_pad_new_from_template (
|
||||
GST_PADTEMPLATE_GET (afsink_sink_factory), "sink");
|
||||
|
@ -306,7 +306,7 @@ gst_afsink_open_file (GstAFSink *sink)
|
|||
|
||||
if (caps == NULL)
|
||||
{
|
||||
// FIXME : Please change this to a better warning method !
|
||||
/* FIXME : Please change this to a better warning method ! */
|
||||
printf ("WARNING: gstafsink chain : Could not get caps of pad !\n");
|
||||
}
|
||||
else
|
||||
|
@ -327,7 +327,7 @@ gst_afsink_open_file (GstAFSink *sink)
|
|||
sample_format = AF_SAMPFMT_TWOSCOMP;
|
||||
else
|
||||
sample_format = AF_SAMPFMT_UNSIGNED;
|
||||
// FIXME : this check didn't seem to work, so let the output endianness be set */
|
||||
/* FIXME : this check didn't seem to work, so let the output endianness be set */
|
||||
/*
|
||||
if (sink->endianness_data == sink->endianness_wanted)
|
||||
byte_order = AF_BYTEORDER_LITTLEENDIAN;
|
||||
|
@ -356,7 +356,7 @@ gst_afsink_open_file (GstAFSink *sink)
|
|||
}
|
||||
|
||||
afFreeFileSetup (outfilesetup);
|
||||
// afSetVirtualByteOrder (sink->file, AF_DEFAULT_TRACK, byte_order);
|
||||
/* afSetVirtualByteOrder (sink->file, AF_DEFAULT_TRACK, byte_order); */
|
||||
|
||||
GST_FLAG_SET (sink, GST_AFSINK_OPEN);
|
||||
|
||||
|
@ -366,10 +366,10 @@ gst_afsink_open_file (GstAFSink *sink)
|
|||
static void
|
||||
gst_afsink_close_file (GstAFSink *sink)
|
||||
{
|
||||
// g_print ("DEBUG: closing sinkfile...\n");
|
||||
/* g_print ("DEBUG: closing sinkfile...\n"); */
|
||||
g_return_if_fail (GST_FLAG_IS_SET (sink, GST_AFSINK_OPEN));
|
||||
// g_print ("DEBUG: past flag test\n");
|
||||
// if (fclose (sink->file) != 0)
|
||||
/* g_print ("DEBUG: past flag test\n"); */
|
||||
/* if (fclose (sink->file) != 0) */
|
||||
if (afCloseFile (sink->file) != 0)
|
||||
{
|
||||
g_print ("WARNING: afsink: oops, error closing !\n");
|
||||
|
@ -416,7 +416,7 @@ gst_afsink_chain (GstPad *pad, GstBuffer *buf)
|
|||
/* it's not open yet, open it */
|
||||
if (!gst_afsink_open_file (afsink))
|
||||
g_print ("WARNING: gstafsink: can't open file !\n");
|
||||
// return FALSE; Can't return value
|
||||
/* return FALSE; Can't return value */
|
||||
}
|
||||
|
||||
if (GST_FLAG_IS_SET (afsink, GST_AFSINK_OPEN))
|
||||
|
@ -424,7 +424,7 @@ gst_afsink_chain (GstPad *pad, GstBuffer *buf)
|
|||
int frameCount = 0;
|
||||
|
||||
frameCount = GST_BUFFER_SIZE (buf) / ((afsink->width / 8) * afsink->channels);
|
||||
// g_print ("DEBUG: writing %d frames ", frameCount);
|
||||
/* g_print ("DEBUG: writing %d frames ", frameCount); */
|
||||
ret = afWriteFrames (afsink->file, AF_DEFAULT_TRACK,
|
||||
GST_BUFFER_DATA (buf), frameCount);
|
||||
if (ret == AF_BAD_WRITE || ret == AF_BAD_LSEEK)
|
||||
|
@ -446,26 +446,26 @@ gst_afsink_change_state (GstElement *element)
|
|||
/* if going to NULL? then close the file */
|
||||
if (GST_STATE_PENDING (element) == GST_STATE_NULL)
|
||||
{
|
||||
// printf ("DEBUG: afsink state change: null pending\n");
|
||||
/* printf ("DEBUG: afsink state change: null pending\n"); */
|
||||
if (GST_FLAG_IS_SET (element, GST_AFSINK_OPEN))
|
||||
{
|
||||
// g_print ("DEBUG: trying to close the sink file\n");
|
||||
/* g_print ("DEBUG: trying to close the sink file\n"); */
|
||||
gst_afsink_close_file (GST_AFSINK (element));
|
||||
}
|
||||
}
|
||||
/*
|
||||
|
||||
else
|
||||
// this has been moved to the chain function, since it's only then that
|
||||
// the caps are set and can be known
|
||||
/* this has been moved to the chain function, since it's only then that */
|
||||
/* the caps are set and can be known */
|
||||
{
|
||||
// g_print ("DEBUG: it's not going to null\n");
|
||||
/* g_print ("DEBUG: it's not going to null\n"); */
|
||||
if (!GST_FLAG_IS_SET (element, GST_AFSINK_OPEN))
|
||||
{
|
||||
// g_print ("DEBUG: GST_AFSINK_OPEN not set\n");
|
||||
/* g_print ("DEBUG: GST_AFSINK_OPEN not set\n"); */
|
||||
if (!gst_afsink_open_file (GST_AFSINK (element)))
|
||||
{
|
||||
// g_print ("DEBUG: element tries to open file\n");
|
||||
/* g_print ("DEBUG: element tries to open file\n"); */
|
||||
return GST_STATE_FAILURE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ extern "C" {
|
|||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
//GstElementDetails gst_afsink_details;
|
||||
/*GstElementDetails gst_afsink_details;*/
|
||||
|
||||
|
||||
#define GST_TYPE_AFSINK \
|
||||
|
@ -63,9 +63,9 @@ struct _GstAFSink {
|
|||
GstPad *sinkpad;
|
||||
|
||||
gchar *filename;
|
||||
// FILE *file;
|
||||
/* FILE *file; */
|
||||
|
||||
// AFfilesetup outfilesetup;
|
||||
/* AFfilesetup outfilesetup; */
|
||||
AFfilehandle file;
|
||||
int format;
|
||||
int channels;
|
||||
|
@ -75,7 +75,7 @@ struct _GstAFSink {
|
|||
int type; /* type of output, compare to audiofile.h
|
||||
* RAW, AIFF, AIFFC, NEXTSND, WAVE
|
||||
*/
|
||||
// FIXME : endianness is a little cryptic at this point
|
||||
/* FIXME : endianness is a little cryptic at this point */
|
||||
int endianness_data; /* 4321 or 1234 */
|
||||
int endianness_wanted; /* same thing, but what the output format wants */
|
||||
int endianness_output; /* what the output endianness will be */
|
||||
|
@ -89,7 +89,7 @@ struct _GstAFSinkClass {
|
|||
};
|
||||
|
||||
GType gst_afsink_get_type(void);
|
||||
//gboolean gst_afsink_factory_init (GstElementFactory *factory);
|
||||
/*gboolean gst_afsink_factory_init (GstElementFactory *factory); */
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -66,7 +66,7 @@ GST_PADTEMPLATE_FACTORY (afsrc_src_factory,
|
|||
),
|
||||
"width", GST_PROPS_INT_RANGE (8, 16),
|
||||
"depth", GST_PROPS_INT_RANGE (8, 16),
|
||||
"rate", GST_PROPS_INT_RANGE (4000, 48000), //FIXME
|
||||
"rate", GST_PROPS_INT_RANGE (4000, 48000), /*FIXME*/
|
||||
"channels", GST_PROPS_INT_RANGE (1, 2)
|
||||
)
|
||||
);
|
||||
|
@ -208,7 +208,7 @@ gst_afsrc_get (GstPad *pad)
|
|||
/* calculate frameCount to read based on file info */
|
||||
|
||||
frameCount = src->bytes_per_read / (src->channels * src->width / 8);
|
||||
// g_print ("DEBUG: gstafsrc: going to read %ld frames\n", frameCount);
|
||||
/* g_print ("DEBUG: gstafsrc: going to read %ld frames\n", frameCount); */
|
||||
readframes = afReadFrames (src->file, AF_DEFAULT_TRACK, GST_BUFFER_DATA (buf),
|
||||
frameCount);
|
||||
readbytes = readframes * (src->channels * src->width / 8);
|
||||
|
@ -228,7 +228,7 @@ gst_afsrc_get (GstPad *pad)
|
|||
printf ("DEBUG: afsrc: timestamp set on output buffer: %f sec\n",
|
||||
GST_BUFFER_TIMESTAMP (buf) / 1E9);
|
||||
|
||||
// g_print("DEBUG: gstafsrc: pushed buffer of %ld bytes\n", readbytes);
|
||||
/* g_print("DEBUG: gstafsrc: pushed buffer of %ld bytes\n", readbytes); */
|
||||
return buf;
|
||||
}
|
||||
|
||||
|
@ -347,14 +347,14 @@ gst_afsrc_open_file (GstAFSrc *src)
|
|||
}
|
||||
|
||||
/* set caps on src */
|
||||
//FIXME: add all the possible formats, especially float ! */
|
||||
/*FIXME: add all the possible formats, especially float ! */
|
||||
gst_pad_try_set_caps (src->srcpad,
|
||||
GST_CAPS_NEW (
|
||||
"af_src",
|
||||
"audio/raw",
|
||||
"format", GST_PROPS_STRING ("int"),
|
||||
"law", GST_PROPS_INT (0), //FIXME
|
||||
"endianness", GST_PROPS_INT (G_BYTE_ORDER), //FIXME
|
||||
"law", GST_PROPS_INT (0), /*FIXME */
|
||||
"endianness", GST_PROPS_INT (G_BYTE_ORDER), /*FIXME */
|
||||
"signed", GST_PROPS_BOOLEAN (src->is_signed),
|
||||
"width", GST_PROPS_INT (src->width),
|
||||
"depth", GST_PROPS_INT (src->width),
|
||||
|
@ -371,10 +371,10 @@ gst_afsrc_open_file (GstAFSrc *src)
|
|||
static void
|
||||
gst_afsrc_close_file (GstAFSrc *src)
|
||||
{
|
||||
// g_print ("DEBUG: closing srcfile...\n");
|
||||
/* g_print ("DEBUG: closing srcfile...\n"); */
|
||||
g_return_if_fail (GST_FLAG_IS_SET (src, GST_AFSRC_OPEN));
|
||||
// g_print ("DEBUG: past flag test\n");
|
||||
// if (fclose (src->file) != 0)
|
||||
/* g_print ("DEBUG: past flag test\n"); */
|
||||
/* if (fclose (src->file) != 0) */
|
||||
if (afCloseFile (src->file) != 0)
|
||||
{
|
||||
g_print ("WARNING: afsrc: oops, error closing !\n");
|
||||
|
@ -394,22 +394,22 @@ gst_afsrc_change_state (GstElement *element)
|
|||
/* if going to NULL then close the file */
|
||||
if (GST_STATE_PENDING (element) == GST_STATE_NULL)
|
||||
{
|
||||
// printf ("DEBUG: afsrc state change: null pending\n");
|
||||
/* printf ("DEBUG: afsrc state change: null pending\n"); */
|
||||
if (GST_FLAG_IS_SET (element, GST_AFSRC_OPEN))
|
||||
{
|
||||
// g_print ("DEBUG: trying to close the src file\n");
|
||||
/* g_print ("DEBUG: trying to close the src file\n"); */
|
||||
gst_afsrc_close_file (GST_AFSRC (element));
|
||||
}
|
||||
}
|
||||
else if (GST_STATE_PENDING (element) == GST_STATE_READY)
|
||||
{
|
||||
// g_print ("DEBUG: afsrc: ready state pending. This shouldn't happen at the *end* of a stream\n");
|
||||
/* g_print ("DEBUG: afsrc: ready state pending. This shouldn't happen at the *end* of a stream\n"); */
|
||||
if (!GST_FLAG_IS_SET (element, GST_AFSRC_OPEN))
|
||||
{
|
||||
// g_print ("DEBUG: GST_AFSRC_OPEN not set\n");
|
||||
/* g_print ("DEBUG: GST_AFSRC_OPEN not set\n"); */
|
||||
if (!gst_afsrc_open_file (GST_AFSRC (element)))
|
||||
{
|
||||
// g_print ("DEBUG: element tries to open file\n");
|
||||
/* g_print ("DEBUG: element tries to open file\n"); */
|
||||
return GST_STATE_FAILURE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ extern "C" {
|
|||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
//GstElementDetails gst_afsrc_details;
|
||||
/*GstElementDetails gst_afsrc_details;*/
|
||||
|
||||
|
||||
#define GST_TYPE_AFSRC \
|
||||
|
@ -63,9 +63,9 @@ struct _GstAFSrc {
|
|||
GstPad *srcpad;
|
||||
|
||||
gchar *filename;
|
||||
// FILE *file;
|
||||
/* FILE *file; */
|
||||
|
||||
// AFfilesetup outfilesetup;
|
||||
/* AFfilesetup outfilesetup; */
|
||||
AFfilehandle file;
|
||||
int format;
|
||||
int channels;
|
||||
|
@ -81,7 +81,7 @@ struct _GstAFSrc {
|
|||
|
||||
gulong seq;
|
||||
guint64 framestamp;
|
||||
// FIXME : endianness is a little cryptic at this point
|
||||
/* FIXME : endianness is a little cryptic at this point */
|
||||
int endianness_data; /* 4321 or 1234 */
|
||||
int endianness_wanted; /* same thing, but what the output format wants */
|
||||
int endianness_output; /* what the output endianness will be */
|
||||
|
@ -95,7 +95,7 @@ struct _GstAFSrcClass {
|
|||
};
|
||||
|
||||
GType gst_afsrc_get_type(void);
|
||||
//gboolean gst_afsrc_factory_init (GstElementFactory *factory);
|
||||
/*gboolean gst_afsrc_factory_init (GstElementFactory *factory);*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
Loading…
Reference in a new issue