some support for aLaw and muLaw audio decompression
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6542 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
3914c20b70
commit
94261db3a6
@ -119,7 +119,7 @@ avCodec::Setup(media_format *input_format, const void *in_info, int32 in_size)
|
||||
media_format_description descr;
|
||||
for (int32 i = 0; gCodecTable[i].id; i++) {
|
||||
ffcodec_index_in_table = i;
|
||||
uint32 cid;
|
||||
uint64 cid;
|
||||
|
||||
if(BMediaFormats().GetCodeFor(*input_format,gCodecTable[i].family,&descr) == B_OK
|
||||
&& gCodecTable[i].type == input_format->type)
|
||||
@ -132,6 +132,9 @@ avCodec::Setup(media_format *input_format, const void *in_info, int32 in_size)
|
||||
case B_WAV_FORMAT_FAMILY:
|
||||
cid = descr.u.wav.codec;
|
||||
break;
|
||||
case B_AIFF_FORMAT_FAMILY:
|
||||
cid = descr.u.aiff.codec;
|
||||
break;
|
||||
case B_AVI_FORMAT_FAMILY:
|
||||
cid = descr.u.avi.codec;
|
||||
break;
|
||||
@ -141,6 +144,9 @@ avCodec::Setup(media_format *input_format, const void *in_info, int32 in_size)
|
||||
case B_QUICKTIME_FORMAT_FAMILY:
|
||||
cid = descr.u.quicktime.codec;
|
||||
break;
|
||||
case B_MISC_FORMAT_FAMILY:
|
||||
cid = (((uint64)descr.u.misc.file_format) << 32) | descr.u.misc.codec;
|
||||
break;
|
||||
default:
|
||||
puts("ERR family");
|
||||
return B_ERROR;
|
||||
@ -484,6 +490,9 @@ avCodecPlugin::GetSupportedFormats(media_format ** formats, size_t * count)
|
||||
case B_WAV_FORMAT_FAMILY:
|
||||
description.u.wav.codec = gCodecTable[i].fourcc;
|
||||
break;
|
||||
case B_AIFF_FORMAT_FAMILY:
|
||||
description.u.aiff.codec = gCodecTable[i].fourcc;
|
||||
break;
|
||||
case B_AVI_FORMAT_FAMILY:
|
||||
description.u.avi.codec = gCodecTable[i].fourcc;
|
||||
break;
|
||||
@ -493,6 +502,10 @@ avCodecPlugin::GetSupportedFormats(media_format ** formats, size_t * count)
|
||||
case B_QUICKTIME_FORMAT_FAMILY:
|
||||
description.u.quicktime.codec = gCodecTable[i].fourcc;
|
||||
break;
|
||||
case B_MISC_FORMAT_FAMILY:
|
||||
description.u.misc.file_format = (uint32) (gCodecTable[i].fourcc >> 32);
|
||||
description.u.misc.codec = (uint32) gCodecTable[i].fourcc;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -22,7 +22,7 @@
|
||||
|
||||
#include "video_util.h"
|
||||
|
||||
struct codec_table { CodecID id; media_type type; media_format_family family; uint32 fourcc; const char *prettyname;};
|
||||
struct codec_table { CodecID id; media_type type; media_format_family family; uint64 fourcc; const char *prettyname;};
|
||||
|
||||
extern const struct codec_table gCodecTable[];
|
||||
extern const int num_codecs;
|
||||
|
@ -28,10 +28,18 @@
|
||||
|
||||
const struct codec_table gCodecTable[] = {
|
||||
|
||||
{CODEC_ID_PCM_ALAW, B_MEDIA_ENCODED_AUDIO, B_WAV_FORMAT_FAMILY, 0x06, "aLaw"},
|
||||
{CODEC_ID_PCM_ALAW, B_MEDIA_ENCODED_AUDIO, B_AIFF_FORMAT_FAMILY, 'alaw' , "aLaw"},
|
||||
{CODEC_ID_PCM_ALAW, B_MEDIA_ENCODED_AUDIO, B_AIFF_FORMAT_FAMILY, 'ALAW' , "aLaw"},
|
||||
{CODEC_ID_PCM_ALAW, B_MEDIA_ENCODED_AUDIO, B_MISC_FORMAT_FAMILY, (uint64('au') << 32) | 27, "aLaw"},
|
||||
/*
|
||||
{CODEC_ID_PCM_MULAW, B_MEDIA_ENCODED_AUDIO, B_QUICKTIME_FORMAT_FAMILY, 'ulaw', "µLaw"},
|
||||
{CODEC_ID_PCM_MULAW, B_MEDIA_ENCODED_AUDIO, B_WAV_FORMAT_FAMILY, 0x07, "µLaw"},
|
||||
*/
|
||||
{CODEC_ID_PCM_MULAW, B_MEDIA_ENCODED_AUDIO, B_WAV_FORMAT_FAMILY, 0x07, "µLaw"},
|
||||
{CODEC_ID_PCM_MULAW, B_MEDIA_ENCODED_AUDIO, B_AIFF_FORMAT_FAMILY, 'ulaw', "µLaw"},
|
||||
{CODEC_ID_PCM_MULAW, B_MEDIA_ENCODED_AUDIO, B_AIFF_FORMAT_FAMILY, 'ULAW', "µLaw"},
|
||||
{CODEC_ID_PCM_MULAW, B_MEDIA_ENCODED_AUDIO, B_MISC_FORMAT_FAMILY, (uint64('au') << 32) | 1, "µLaw"},
|
||||
|
||||
#ifdef HAS_MACE_AUDIO
|
||||
{CODEC_ID_MACE3, B_MEDIA_ENCODED_AUDIO, B_QUICKTIME_FORMAT_FAMILY, 'MAC3', "MACE 3:1"},
|
||||
{CODEC_ID_MACE6, B_MEDIA_ENCODED_AUDIO, B_QUICKTIME_FORMAT_FAMILY, 'MAC6', "MACE 6:1"},
|
||||
|
Loading…
x
Reference in New Issue
Block a user