summaryrefslogtreecommitdiffstats
path: root/ext/audiofile
diff options
context:
space:
mode:
authorRonald S. Bultje <rbultje@ronald.bitfreak.net>2003-07-06 20:49:52 +0000
committerRonald S. Bultje <rbultje@ronald.bitfreak.net>2003-07-06 20:49:52 +0000
commit95011fd7e8eb3a2ec3a87ff9dad523d18005db42 (patch)
tree6e75f9139c6520126f9344e15e1dea2a49f70f9c /ext/audiofile
parent85a8dd7ecb04d043be8192e27e3c89ef8ccebe55 (diff)
downloadgst-plugins-bad-95011fd7e8eb3a2ec3a87ff9dad523d18005db42.tar.gz
gst-plugins-bad-95011fd7e8eb3a2ec3a87ff9dad523d18005db42.tar.bz2
gst-plugins-bad-95011fd7e8eb3a2ec3a87ff9dad523d18005db42.zip
New mimetypes gone into effect today - this commit changes all old mimetypes over to the new mimetypes spec as descri...
Original commit message from CVS: New mimetypes gone into effect today - this commit changes all old mimetypes over to the new mimetypes spec as described in the previous commit's document. Note: some plugins will break, some pipelines will break, expect HEAD to be broken or at least not 100% working for a few days, but don't forget to report bugs
Diffstat (limited to 'ext/audiofile')
-rw-r--r--ext/audiofile/gstafparse.c56
-rw-r--r--ext/audiofile/gstafsink.c4
-rw-r--r--ext/audiofile/gstafsrc.c8
3 files changed, 28 insertions, 40 deletions
diff --git a/ext/audiofile/gstafparse.c b/ext/audiofile/gstafparse.c
index 2ceb4ee7..255247e8 100644
--- a/ext/audiofile/gstafparse.c
+++ b/ext/audiofile/gstafparse.c
@@ -59,9 +59,7 @@ GST_PAD_TEMPLATE_FACTORY (afparse_src_factory,
GST_PAD_ALWAYS,
GST_CAPS_NEW (
"audiofile_src",
- "audio/raw",
- "format", GST_PROPS_STRING ("int"),
- "law", GST_PROPS_INT (0),
+ "audio/x-raw-int",
"endianness", GST_PROPS_INT (G_BYTE_ORDER),
"signed", GST_PROPS_LIST (GST_PROPS_BOOLEAN (TRUE), GST_PROPS_BOOLEAN (FALSE)),
"width", GST_PROPS_INT_RANGE (8, 16),
@@ -87,7 +85,7 @@ GST_PAD_TEMPLATE_FACTORY (afparse_sink_factory,
),
GST_CAPS_NEW (
"afparse_sink_snd",
- "audio/basic",
+ "audio/x-au",
NULL
)
)
@@ -215,7 +213,7 @@ gst_afparse_loop(GstElement *element)
}
if (bypass_afread){
- g_print("will bypass afReadFrames\n");
+ GST_DEBUG("will bypass afReadFrames\n");
}
frames_to_bytes = afparse->channels * afparse->width / 8;
@@ -352,7 +350,7 @@ gst_afparse_open_file (GstAFParse *afparse)
/* open the file */
- g_print("opening vfile %p\n", afparse->vfile);
+ GST_DEBUG("opening vfile %p\n", afparse->vfile);
afparse->file = afOpenVirtualFile (afparse->vfile, "r", AF_NULL_FILESETUP);
if (afparse->file == AF_NULL_FILEHANDLE)
{
@@ -361,7 +359,7 @@ gst_afparse_open_file (GstAFParse *afparse)
return FALSE;
}
- g_print("vfile opened\n");
+ GST_DEBUG("vfile opened\n");
/* get the audiofile audio parameters */
{
int sampleFormat, sampleWidth;
@@ -393,9 +391,7 @@ gst_afparse_open_file (GstAFParse *afparse)
gst_pad_try_set_caps (afparse->srcpad,
GST_CAPS_NEW (
"af_src",
- "audio/raw",
- "format", GST_PROPS_STRING ("int"),
- "law", GST_PROPS_INT (0), /*FIXME */
+ "audio/x-raw-int",
"endianness", GST_PROPS_INT (G_BYTE_ORDER), /*FIXME */
"signed", GST_PROPS_BOOLEAN (afparse->is_signed),
"width", GST_PROPS_INT (afparse->width),
@@ -444,22 +440,19 @@ gst_afparse_vf_read (AFvirtualfile *vfile, void *data, size_t nbytes)
/*g_print("no event found with %u bytes\n", got_bytes);*/
return 0;
}
- if (event){
- g_print("got event\n");
- if (GST_EVENT_TYPE(event) == GST_EVENT_EOS){
+ switch (GST_EVENT_TYPE(event)) {
+ case GST_EVENT_EOS:
return 0;
- }
- else if (GST_EVENT_TYPE(event) == GST_EVENT_FLUSH){
- g_print("flush\n");
- }
- else if (GST_EVENT_TYPE(event) == GST_EVENT_DISCONTINUOUS){
- g_print("seek done\n");
+ case GST_EVENT_FLUSH:
+ GST_DEBUG("flush");
+ break;
+ case GST_EVENT_DISCONTINUOUS:
+ GST_DEBUG("seek done");
got_bytes = gst_bytestream_peek_bytes(bs, &bytes, nbytes);
- }
- else {
- g_print("unknown event %d", GST_EVENT_TYPE(event));
+ break;
+ default:
+ g_warning("unknown event %d", GST_EVENT_TYPE(event));
got_bytes = gst_bytestream_peek_bytes(bs, &bytes, nbytes);
- }
}
}
@@ -493,7 +486,7 @@ gst_afparse_vf_seek (AFvirtualfile *vfile, long offset, int is_relative)
}
if (gst_bytestream_seek(bs, (gint64)offset, method)){
- g_print("doing seek to %d\n", (gint)offset);
+ GST_DEBUG("doing seek to %d", (gint)offset);
return offset;
}
return 0;
@@ -502,11 +495,12 @@ gst_afparse_vf_seek (AFvirtualfile *vfile, long offset, int is_relative)
static long
gst_afparse_vf_length (AFvirtualfile *vfile)
{
- /*GstByteStream *bs = (GstByteStream*)vfile->closure;*/
- /* FIXME there is currently no practical way to do this.
- * wait for the events rewrite to drop */
- g_warning("cannot get length at the moment");
- return G_MAXLONG;
+ GstByteStream *bs = (GstByteStream*)vfile->closure;
+ guint64 length;
+
+ length = gst_bytestream_length(bs);
+ GST_DEBUG("doing length: %" G_GUINT64_FORMAT, length);
+ return length;
}
static ssize_t
@@ -522,7 +516,7 @@ gst_afparse_vf_destroy(AFvirtualfile *vfile)
{
/* GstByteStream *bs = (GstByteStream*)vfile->closure;*/
- g_print("doing destroy\n");
+ GST_DEBUG("doing destroy");
}
static long
@@ -532,7 +526,7 @@ gst_afparse_vf_tell (AFvirtualfile *vfile)
guint64 offset;
offset = gst_bytestream_tell(bs);
- g_print("doing tell: %" G_GUINT64_FORMAT "\n", offset);
+ GST_DEBUG("doing tell: %" G_GUINT64_FORMAT, offset);
return offset;
}
diff --git a/ext/audiofile/gstafsink.c b/ext/audiofile/gstafsink.c
index e9783ac2..3392717c 100644
--- a/ext/audiofile/gstafsink.c
+++ b/ext/audiofile/gstafsink.c
@@ -61,9 +61,7 @@ GST_PAD_TEMPLATE_FACTORY (afsink_sink_factory,
GST_PAD_ALWAYS,
GST_CAPS_NEW (
"audiofile_sink",
- "audio/raw",
- "format", GST_PROPS_STRING ("int"),
- "law", GST_PROPS_INT (0),
+ "audio/x-raw-int",
"endianness", GST_PROPS_INT (G_BYTE_ORDER),
"signed", GST_PROPS_LIST (
GST_PROPS_BOOLEAN (TRUE),
diff --git a/ext/audiofile/gstafsrc.c b/ext/audiofile/gstafsrc.c
index cf2ebb56..2b817310 100644
--- a/ext/audiofile/gstafsrc.c
+++ b/ext/audiofile/gstafsrc.c
@@ -60,9 +60,7 @@ GST_PAD_TEMPLATE_FACTORY (afsrc_src_factory,
GST_PAD_ALWAYS,
GST_CAPS_NEW (
"audiofile_src",
- "audio/raw",
- "format", GST_PROPS_STRING ("int"),
- "law", GST_PROPS_INT (0),
+ "audio/x-raw-int",
"endianness", GST_PROPS_INT (G_BYTE_ORDER),
"signed", GST_PROPS_LIST (
GST_PROPS_BOOLEAN (TRUE),
@@ -345,9 +343,7 @@ gst_afsrc_open_file (GstAFSrc *src)
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 */
+ "audio/x-raw-int",
"endianness", GST_PROPS_INT (G_BYTE_ORDER), /*FIXME */
"signed", GST_PROPS_BOOLEAN (src->is_signed),
"width", GST_PROPS_INT (src->width),