mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 18:05:37 +00:00
use correct mime type for the types supported by audiofile
Original commit message from CVS: use correct mime type for the types supported by audiofile
This commit is contained in:
parent
7f0aaf6647
commit
0f0b1f647d
2 changed files with 36 additions and 4 deletions
|
@ -72,8 +72,18 @@ GST_PAD_TEMPLATE_FACTORY (afparse_sink_factory,
|
||||||
GST_PAD_SINK,
|
GST_PAD_SINK,
|
||||||
GST_PAD_ALWAYS,
|
GST_PAD_ALWAYS,
|
||||||
GST_CAPS_NEW (
|
GST_CAPS_NEW (
|
||||||
"afparse_sink",
|
"afparse_sink_aiff",
|
||||||
"audio/audiofile",
|
"audio/x-aiff",
|
||||||
|
NULL
|
||||||
|
),
|
||||||
|
GST_CAPS_NEW (
|
||||||
|
"afparse_sink_wav",
|
||||||
|
"audio/x-wav",
|
||||||
|
NULL
|
||||||
|
),
|
||||||
|
GST_CAPS_NEW (
|
||||||
|
"afparse_sink_snd",
|
||||||
|
"audio/basic",
|
||||||
NULL
|
NULL
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
|
@ -36,7 +36,9 @@ static long gst_aftypes_vf_tell (AFvirtualfile *vfile);
|
||||||
static GstCaps* gst_aftypes_type_find(GstBuffer *buf, gpointer private);
|
static GstCaps* gst_aftypes_type_find(GstBuffer *buf, gpointer private);
|
||||||
|
|
||||||
static GstTypeDefinition aftype_definitions[] = {
|
static GstTypeDefinition aftype_definitions[] = {
|
||||||
{ "aftypes audio/audiofile", "audio/audiofile", ".wav .aiff .aif .aifc", gst_aftypes_type_find },
|
{ "aftypes audio/x-aiff", "audio/x-aiff", ".aiff .aif .aifc", gst_aftypes_type_find },
|
||||||
|
{ "aftypes audio/x-wav", "audio/x-wav", ".wav", gst_aftypes_type_find },
|
||||||
|
{ "aftypes audio/basic", "audio/basic", ".au .snd", gst_aftypes_type_find },
|
||||||
{ NULL, NULL, NULL, NULL },
|
{ NULL, NULL, NULL, NULL },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -54,6 +56,7 @@ gst_aftypes_type_find(GstBuffer *buf, gpointer private)
|
||||||
AFvirtualfile *vfile;
|
AFvirtualfile *vfile;
|
||||||
AFfilehandle file;
|
AFfilehandle file;
|
||||||
int file_format, format_version;
|
int file_format, format_version;
|
||||||
|
gchar *type;
|
||||||
|
|
||||||
g_print("calling gst_aftypes_type_find\n");
|
g_print("calling gst_aftypes_type_find\n");
|
||||||
|
|
||||||
|
@ -80,8 +83,27 @@ gst_aftypes_type_find(GstBuffer *buf, gpointer private)
|
||||||
file_format == AF_FILE_RAWDATA){
|
file_format == AF_FILE_RAWDATA){
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
switch (file_format){
|
||||||
|
case AF_FILE_AIFF:
|
||||||
|
case AF_FILE_AIFFC:
|
||||||
|
type = "audio/x-aiff";
|
||||||
|
break;
|
||||||
|
case AF_FILE_WAVE:
|
||||||
|
type = "audio/x-wav";
|
||||||
|
break;
|
||||||
|
case AF_FILE_NEXTSND:
|
||||||
|
type = "audio/basic";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
type=NULL;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type != NULL){
|
||||||
|
return gst_caps_new ("audiofile_type_find", type, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
return gst_caps_new ("audiofile_type_find", "audio/audiofile", NULL);
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
|
Loading…
Reference in a new issue