Updated all decoders to the changed codec API (from meta_descriptions to
BMediaFormats based detection). git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6248 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -82,6 +82,15 @@ mp3Decoder::~mp3Decoder()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
mp3Decoder::GetCodecInfo(media_codec_info &info)
|
||||||
|
{
|
||||||
|
strcpy(info.short_name, "mp3");
|
||||||
|
strcpy(info.pretty_name, "MPEG 1/2.5 audio layer 1/2/3 decoder, based on mpeg123 mpglib");
|
||||||
|
// ToDo: could alter the above string depending on the real format
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
mp3Decoder::Setup(media_format *ioEncodedFormat,
|
mp3Decoder::Setup(media_format *ioEncodedFormat,
|
||||||
const void *infoBuffer, int32 infoSize)
|
const void *infoBuffer, int32 infoSize)
|
||||||
@@ -334,18 +343,32 @@ mp3DecoderPlugin::NewDecoder()
|
|||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
mp3DecoderPlugin::RegisterPlugin()
|
mp3DecoderPlugin::RegisterDecoder()
|
||||||
{
|
{
|
||||||
PublishDecoder("audiocodec/mpeg1layer1", "mp3", "MPEG 1 audio layer 1 decoder, based on mpeg123 mpglib");
|
const mpeg_id ids[] = {
|
||||||
PublishDecoder("audiocodec/mpeg1layer2", "mp3", "MPEG 1 audio layer 2 decoder, based on mpeg123 mpglib");
|
B_MPEG_1_AUDIO_LAYER_1,
|
||||||
PublishDecoder("audiocodec/mpeg1layer3", "mp3", "MPEG 1 audio layer 3 decoder, based on mpeg123 mpglib");
|
B_MPEG_1_AUDIO_LAYER_2,
|
||||||
PublishDecoder("audiocodec/mpeg2layer1", "mp3", "MPEG 2 audio layer 1 decoder, based on mpeg123 mpglib");
|
B_MPEG_1_AUDIO_LAYER_3, // "MP3"
|
||||||
PublishDecoder("audiocodec/mpeg2layer2", "mp3", "MPEG 2 audio layer 2 decoder, based on mpeg123 mpglib");
|
B_MPEG_2_AUDIO_LAYER_1,
|
||||||
PublishDecoder("audiocodec/mpeg2layer3", "mp3", "MPEG 2 audio layer 3 decoder, based on mpeg123 mpglib");
|
B_MPEG_2_AUDIO_LAYER_2,
|
||||||
PublishDecoder("audiocodec/mpeg2.5layer1", "mp3", "MPEG 2.5 audio layer 1 decoder, based on mpeg123 mpglib");
|
B_MPEG_2_AUDIO_LAYER_3,
|
||||||
PublishDecoder("audiocodec/mpeg2.5layer2", "mp3", "MPEG 2.5 audio layer 2 decoder, based on mpeg123 mpglib");
|
B_MPEG_2_5_AUDIO_LAYER_1,
|
||||||
PublishDecoder("audiocodec/mpeg2.5layer3", "mp3", "MPEG 2.5 audio layer 3 decoder, based on mpeg123 mpglib");
|
B_MPEG_2_5_AUDIO_LAYER_2,
|
||||||
return B_OK;
|
B_MPEG_2_5_AUDIO_LAYER_3,
|
||||||
|
};
|
||||||
|
const size_t numIDs = sizeof(ids) / sizeof(mpeg_id);
|
||||||
|
|
||||||
|
media_format_description descriptions[numIDs];
|
||||||
|
for (size_t i = 0; i < numIDs; i++) {
|
||||||
|
descriptions[i].family = B_MPEG_FORMAT_FAMILY;
|
||||||
|
descriptions[i].u.mpeg.id = ids[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
media_format format;
|
||||||
|
format.type = B_MEDIA_ENCODED_AUDIO;
|
||||||
|
format.u.encoded_audio = media_encoded_audio_format::wildcard;
|
||||||
|
|
||||||
|
return BMediaFormats().MakeFormatFor(descriptions, numIDs, &format);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ public:
|
|||||||
mp3Decoder();
|
mp3Decoder();
|
||||||
~mp3Decoder();
|
~mp3Decoder();
|
||||||
|
|
||||||
|
void GetCodecInfo(media_codec_info &codecInfo);
|
||||||
|
|
||||||
status_t Setup(media_format *ioEncodedFormat,
|
status_t Setup(media_format *ioEncodedFormat,
|
||||||
const void *infoBuffer, int32 infoSize);
|
const void *infoBuffer, int32 infoSize);
|
||||||
|
|
||||||
@@ -45,5 +47,5 @@ class mp3DecoderPlugin : public DecoderPlugin
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Decoder * NewDecoder();
|
Decoder * NewDecoder();
|
||||||
status_t RegisterPlugin();
|
status_t RegisterDecoder();
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -22,10 +22,19 @@ MusePackPlugin::NewDecoder()
|
|||||||
}
|
}
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
MusePackPlugin::RegisterPlugin()
|
MusePackPlugin::RegisterDecoder()
|
||||||
{
|
{
|
||||||
PublishDecoder("audiocodec/musepack", "musepack", "musepack decoder");
|
media_format_description description;
|
||||||
return B_OK;
|
description.family = B_MISC_FORMAT_FAMILY;
|
||||||
|
description.u.misc.file_format = 'mpc ';
|
||||||
|
description.u.misc.codec = 'MPC7';
|
||||||
|
// 7 is the most recent stream version
|
||||||
|
|
||||||
|
media_format format;
|
||||||
|
format.type = B_MEDIA_ENCODED_AUDIO;
|
||||||
|
format.u.encoded_audio = media_encoded_audio_format::wildcard;
|
||||||
|
|
||||||
|
return BMediaFormats().MakeFormatFor(&description, 1, &format);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class MusePackPlugin : public ReaderPlugin, public DecoderPlugin {
|
|||||||
Reader *NewReader();
|
Reader *NewReader();
|
||||||
|
|
||||||
Decoder *NewDecoder();
|
Decoder *NewDecoder();
|
||||||
status_t RegisterPlugin();
|
status_t RegisterDecoder();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* MUSEPACK_PLUGIN_H */
|
#endif /* MUSEPACK_PLUGIN_H */
|
||||||
|
|||||||
@@ -21,6 +21,14 @@ MusePackDecoder::~MusePackDecoder()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
MusePackDecoder::GetCodecInfo(media_codec_info &info)
|
||||||
|
{
|
||||||
|
strcpy(info.short_name, "musepack");
|
||||||
|
strcpy(info.pretty_name, "MusePack audio codec based on mpcdec by Andree Buschmann");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
MusePackDecoder::Setup(media_format *ioEncodedFormat, const void *infoBuffer, int32 infoSize)
|
MusePackDecoder::Setup(media_format *ioEncodedFormat, const void *infoBuffer, int32 infoSize)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -17,6 +17,8 @@ class MusePackDecoder : public Decoder {
|
|||||||
MusePackDecoder();
|
MusePackDecoder();
|
||||||
~MusePackDecoder();
|
~MusePackDecoder();
|
||||||
|
|
||||||
|
void GetCodecInfo(media_codec_info &info);
|
||||||
|
|
||||||
status_t Setup(media_format *ioEncodedFormat,
|
status_t Setup(media_format *ioEncodedFormat,
|
||||||
const void *infoBuffer, int32 infoSize);
|
const void *infoBuffer, int32 infoSize);
|
||||||
|
|
||||||
|
|||||||
@@ -41,11 +41,12 @@ MusePackReader::Sniff(int32 *_streamCount)
|
|||||||
int error = fInfo.ReadStreamInfo(file);
|
int error = fInfo.ReadStreamInfo(file);
|
||||||
if (error > B_OK) {
|
if (error > B_OK) {
|
||||||
// error came from engine
|
// error came from engine
|
||||||
printf("MusePack: ReadStreamInfo() engine error %d\n", error);
|
printf("MusePackReader: ReadStreamInfo() engine error %d\n", error);
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
} else if (error < B_OK)
|
} else if (error < B_OK)
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
|
printf("MusePackReader: recognized MPC file\n");
|
||||||
*_streamCount = 1;
|
*_streamCount = 1;
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
@@ -87,10 +88,13 @@ MusePackReader::GetStreamInfo(void *cookie, int64 *_frameCount, bigtime_t *_dura
|
|||||||
|
|
||||||
media_format_description description;
|
media_format_description description;
|
||||||
description.family = B_MISC_FORMAT_FAMILY;
|
description.family = B_MISC_FORMAT_FAMILY;
|
||||||
|
description.u.misc.file_format = 'mpc ';
|
||||||
description.u.misc.codec = 'MPC7';
|
description.u.misc.codec = 'MPC7';
|
||||||
// ToDo: does this make any sense? BTW '7' is the most recent stream version...
|
// 7 is the most recent stream version
|
||||||
BMediaFormats formats;
|
|
||||||
formats.GetFormatFor(description, format);
|
status_t status = BMediaFormats().GetFormatFor(description, format);
|
||||||
|
if (status < B_OK)
|
||||||
|
return status;
|
||||||
|
|
||||||
// allocate and initialize internal decoder
|
// allocate and initialize internal decoder
|
||||||
MPC_decoder *decoder = new MPC_decoder(static_cast<BPositionIO *>(Source()));
|
MPC_decoder *decoder = new MPC_decoder(static_cast<BPositionIO *>(Source()));
|
||||||
|
|||||||
@@ -123,8 +123,9 @@ GetVorbisCodecStreamInfo(std::vector<ogg_packet> * packets,
|
|||||||
format->type = B_MEDIA_ENCODED_AUDIO;
|
format->type = B_MEDIA_ENCODED_AUDIO;
|
||||||
format->user_data_type = B_CODEC_TYPE_INFO;
|
format->user_data_type = B_CODEC_TYPE_INFO;
|
||||||
strncpy((char*)format->user_data, "vorb", 4);
|
strncpy((char*)format->user_data, "vorb", 4);
|
||||||
format->u.encoded_audio.encoding
|
// ToDo: that won't work any longer
|
||||||
= (media_encoded_audio_format::audio_encoding)'vorb';
|
//format->u.encoded_audio.encoding
|
||||||
|
// = (media_encoded_audio_format::audio_encoding)'vorb';
|
||||||
if (info.bitrate_nominal > 0) {
|
if (info.bitrate_nominal > 0) {
|
||||||
format->u.encoded_audio.bit_rate = info.bitrate_nominal;
|
format->u.encoded_audio.bit_rate = info.bitrate_nominal;
|
||||||
} else if (info.bitrate_upper > 0) {
|
} else if (info.bitrate_upper > 0) {
|
||||||
@@ -205,8 +206,9 @@ GetSpeexCodecStreamInfo(std::vector<ogg_packet> * packets,
|
|||||||
format->type = B_MEDIA_ENCODED_AUDIO;
|
format->type = B_MEDIA_ENCODED_AUDIO;
|
||||||
format->user_data_type = B_CODEC_TYPE_INFO;
|
format->user_data_type = B_CODEC_TYPE_INFO;
|
||||||
strncpy((char*)format->user_data,"Spee",4);
|
strncpy((char*)format->user_data,"Spee",4);
|
||||||
format->u.encoded_audio.encoding
|
// ToDo: that won't work any longer
|
||||||
= (media_encoded_audio_format::audio_encoding)'Spee';
|
//format->u.encoded_audio.encoding
|
||||||
|
// = (media_encoded_audio_format::audio_encoding)'Spee';
|
||||||
if (header->bitrate > 0) {
|
if (header->bitrate > 0) {
|
||||||
format->u.encoded_audio.bit_rate = header->bitrate;
|
format->u.encoded_audio.bit_rate = header->bitrate;
|
||||||
} else {
|
} else {
|
||||||
@@ -301,10 +303,11 @@ GetTobiasCodecStreamInfo(std::vector<ogg_packet> * packets,
|
|||||||
format->type = B_MEDIA_ENCODED_VIDEO;
|
format->type = B_MEDIA_ENCODED_VIDEO;
|
||||||
format->user_data_type = B_CODEC_TYPE_INFO;
|
format->user_data_type = B_CODEC_TYPE_INFO;
|
||||||
strncpy((char*)format->user_data,header->subtype,4);
|
strncpy((char*)format->user_data,header->subtype,4);
|
||||||
int32 encoding = header->subtype[0] << 24 | header->subtype[1] << 16
|
//int32 encoding = header->subtype[0] << 24 | header->subtype[1] << 16
|
||||||
| header->subtype[2] << 8 | header->subtype[3];
|
// | header->subtype[2] << 8 | header->subtype[3];
|
||||||
format->u.encoded_video.encoding
|
// ToDo: that won't work any longer
|
||||||
= (media_encoded_video_format::video_encoding)encoding;
|
//format->u.encoded_video.encoding
|
||||||
|
// = (media_encoded_video_format::video_encoding)encoding;
|
||||||
format->u.encoded_video.frame_size
|
format->u.encoded_video.frame_size
|
||||||
= header->video.width * header->video.height;
|
= header->video.width * header->video.height;
|
||||||
format->u.encoded_video.output.display.line_width = header->video.width;
|
format->u.encoded_video.output.display.line_width = header->video.width;
|
||||||
|
|||||||
@@ -20,6 +20,19 @@ AudioBufferSize(int32 channel_count, uint32 sample_format, float frame_rate, big
|
|||||||
return (sample_format & 0xf) * channel_count * (size_t)((frame_rate * buffer_duration) / 1000000.0);
|
return (sample_format & 0xf) * channel_count * (size_t)((frame_rate * buffer_duration) / 1000000.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
RawDecoder::GetCodecInfo(media_codec_info &info)
|
||||||
|
{
|
||||||
|
strcpy(info.short_name, "raw");
|
||||||
|
|
||||||
|
if (fInputFormat.IsAudio())
|
||||||
|
strcpy(info.pretty_name, "Raw audio decoder");
|
||||||
|
else
|
||||||
|
strcpy(info.pretty_name, "Raw video decoder");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
RawDecoder::Setup(media_format *ioEncodedFormat,
|
RawDecoder::Setup(media_format *ioEncodedFormat,
|
||||||
const void *infoBuffer, int32 infoSize)
|
const void *infoBuffer, int32 infoSize)
|
||||||
@@ -471,11 +484,30 @@ RawDecoderPlugin::NewDecoder()
|
|||||||
}
|
}
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
RawDecoderPlugin::RegisterPlugin()
|
RawDecoderPlugin::RegisterDecoder()
|
||||||
{
|
{
|
||||||
PublishDecoder("audiocodec/raw", "raw", "RAW audio decoder");
|
BMediaFormats formats;
|
||||||
PublishDecoder("videocodec/raw", "raw", "RAW video decoder");
|
media_format_description description;
|
||||||
return B_OK;
|
media_format format;
|
||||||
|
|
||||||
|
// audio decoder
|
||||||
|
|
||||||
|
description.family = B_MISC_FORMAT_FAMILY;
|
||||||
|
description.u.beos.format = B_BEOS_FORMAT_RAW_AUDIO;
|
||||||
|
format.type = B_MEDIA_ENCODED_AUDIO;
|
||||||
|
format.u.encoded_audio = media_encoded_audio_format::wildcard;
|
||||||
|
|
||||||
|
status_t status = formats.MakeFormatFor(&description, 1, &format);
|
||||||
|
if (status < B_OK)
|
||||||
|
return status;
|
||||||
|
|
||||||
|
// video decoder
|
||||||
|
|
||||||
|
description.u.beos.format = B_BEOS_FORMAT_RAW_VIDEO;
|
||||||
|
format.type = B_MEDIA_ENCODED_VIDEO;
|
||||||
|
format.u.encoded_video = media_encoded_video_format::wildcard;
|
||||||
|
|
||||||
|
return formats.MakeFormatFor(&description, 1, &format);
|
||||||
}
|
}
|
||||||
|
|
||||||
MediaPlugin *instantiate_plugin()
|
MediaPlugin *instantiate_plugin()
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
class RawDecoder : public Decoder
|
class RawDecoder : public Decoder
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
void GetCodecInfo(media_codec_info &info);
|
||||||
|
|
||||||
status_t Setup(media_format *ioEncodedFormat,
|
status_t Setup(media_format *ioEncodedFormat,
|
||||||
const void *infoBuffer, int32 infoSize);
|
const void *infoBuffer, int32 infoSize);
|
||||||
|
|
||||||
@@ -43,5 +45,5 @@ class RawDecoderPlugin : public DecoderPlugin
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Decoder * NewDecoder();
|
Decoder * NewDecoder();
|
||||||
status_t RegisterPlugin();
|
status_t RegisterDecoder();
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -42,6 +42,14 @@ speexDecoder::~speexDecoder()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
speexDecoder::GetCodecInfo(media_codec_info &info)
|
||||||
|
{
|
||||||
|
strcpy(info.short_name, "speex");
|
||||||
|
strcpy(info.pretty_name, "speex decoder, based on libspeex");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
speexDecoder::Setup(media_format *inputFormat,
|
speexDecoder::Setup(media_format *inputFormat,
|
||||||
const void *infoBuffer, int32 infoSize)
|
const void *infoBuffer, int32 infoSize)
|
||||||
@@ -225,7 +233,7 @@ speexDecoder::Seek(uint32 seekTo,
|
|||||||
bigtime_t seekTime, bigtime_t *time)
|
bigtime_t seekTime, bigtime_t *time)
|
||||||
{
|
{
|
||||||
TRACE("speexDecoder::Seek\n");
|
TRACE("speexDecoder::Seek\n");
|
||||||
int ignore = 0;
|
// int ignore = 0;
|
||||||
// speex_decoder_ctl(fDecoderState, SPEEX_RESET_STATE, &ignore);
|
// speex_decoder_ctl(fDecoderState, SPEEX_RESET_STATE, &ignore);
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
@@ -309,10 +317,19 @@ speexDecoderPlugin::NewDecoder()
|
|||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
speexDecoderPlugin::RegisterPlugin()
|
speexDecoderPlugin::RegisterDecoder()
|
||||||
{
|
{
|
||||||
PublishDecoder("audiocodec/speex", "speex", "speex decoder, based on libspeex");
|
// ToDo: what about B_OGG_FORMAT_FAMILY?
|
||||||
return B_OK;
|
media_format_description description;
|
||||||
|
description.family = B_MISC_FORMAT_FAMILY;
|
||||||
|
description.u.misc.file_format = 'ogg ';
|
||||||
|
description.u.misc.codec = 'spee';
|
||||||
|
|
||||||
|
media_format format;
|
||||||
|
format.type = B_MEDIA_ENCODED_AUDIO;
|
||||||
|
format.u.encoded_audio = media_encoded_audio_format::wildcard;
|
||||||
|
|
||||||
|
return BMediaFormats().MakeFormatFor(&description, 1, &format);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ public:
|
|||||||
speexDecoder();
|
speexDecoder();
|
||||||
~speexDecoder();
|
~speexDecoder();
|
||||||
|
|
||||||
|
void GetCodecInfo(media_codec_info &info);
|
||||||
status_t Setup(media_format *inputFormat,
|
status_t Setup(media_format *inputFormat,
|
||||||
const void *infoBuffer, int32 infoSize);
|
const void *infoBuffer, int32 infoSize);
|
||||||
|
|
||||||
@@ -44,5 +45,5 @@ class speexDecoderPlugin : public DecoderPlugin
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Decoder * NewDecoder();
|
Decoder * NewDecoder();
|
||||||
status_t RegisterPlugin();
|
status_t RegisterDecoder();
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -41,6 +41,14 @@ vorbisDecoder::~vorbisDecoder()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
vorbisDecoder::GetCodecInfo(media_codec_info &info)
|
||||||
|
{
|
||||||
|
strcpy(info.short_name, "vorbis");
|
||||||
|
strcpy(info.pretty_name, "vorbis decoder, based on libvorbis");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
vorbisDecoder::Setup(media_format *inputFormat,
|
vorbisDecoder::Setup(media_format *inputFormat,
|
||||||
const void *infoBuffer, int32 infoSize)
|
const void *infoBuffer, int32 infoSize)
|
||||||
@@ -87,8 +95,9 @@ vorbisDecoder::Setup(media_format *inputFormat,
|
|||||||
|
|
||||||
void vorbisDecoder::CopyInfoToEncodedFormat(media_format * format) {
|
void vorbisDecoder::CopyInfoToEncodedFormat(media_format * format) {
|
||||||
format->type = B_MEDIA_ENCODED_AUDIO;
|
format->type = B_MEDIA_ENCODED_AUDIO;
|
||||||
format->u.encoded_audio.encoding
|
// ToDo: this won't work any longer
|
||||||
= (media_encoded_audio_format::audio_encoding)'vorb';
|
// format->u.encoded_audio.encoding
|
||||||
|
// = (media_encoded_audio_format::audio_encoding)'vorb';
|
||||||
if (fInfo.bitrate_nominal > 0) {
|
if (fInfo.bitrate_nominal > 0) {
|
||||||
format->u.encoded_audio.bit_rate = fInfo.bitrate_nominal;
|
format->u.encoded_audio.bit_rate = fInfo.bitrate_nominal;
|
||||||
} else if (fInfo.bitrate_upper > 0) {
|
} else if (fInfo.bitrate_upper > 0) {
|
||||||
@@ -224,10 +233,19 @@ vorbisDecoderPlugin::NewDecoder()
|
|||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
vorbisDecoderPlugin::RegisterPlugin()
|
vorbisDecoderPlugin::RegisterDecoder()
|
||||||
{
|
{
|
||||||
PublishDecoder("audiocodec/vorbis", "vorbis", "vorbis decoder, based on libvorbis");
|
media_format_description description;
|
||||||
return B_OK;
|
// ToDo: what about B_OGG_FORMAT_FAMILY?
|
||||||
|
description.family = B_MISC_FORMAT_FAMILY;
|
||||||
|
description.u.misc.file_format = 'ogg ';
|
||||||
|
description.u.misc.codec = 'vorb';
|
||||||
|
|
||||||
|
media_format format;
|
||||||
|
format.type = B_MEDIA_ENCODED_AUDIO;
|
||||||
|
format.u.encoded_audio = media_encoded_audio_format::wildcard;
|
||||||
|
|
||||||
|
return BMediaFormats().MakeFormatFor(&description, 1, &format);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ public:
|
|||||||
vorbisDecoder();
|
vorbisDecoder();
|
||||||
~vorbisDecoder();
|
~vorbisDecoder();
|
||||||
|
|
||||||
|
void GetCodecInfo(media_codec_info &info);
|
||||||
status_t Setup(media_format *inputFormat,
|
status_t Setup(media_format *inputFormat,
|
||||||
const void *infoBuffer, int32 infoSize);
|
const void *infoBuffer, int32 infoSize);
|
||||||
|
|
||||||
@@ -39,5 +40,5 @@ class vorbisDecoderPlugin : public DecoderPlugin
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Decoder * NewDecoder();
|
Decoder * NewDecoder();
|
||||||
status_t RegisterPlugin();
|
status_t RegisterDecoder();
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user