diff --git a/headers/os/media/MediaDefs.h b/headers/os/media/MediaDefs.h index 3554af3141..e12286b47b 100644 --- a/headers/os/media/MediaDefs.h +++ b/headers/os/media/MediaDefs.h @@ -599,8 +599,8 @@ typedef enum { B_WAV_FORMAT_FAMILY = 6, B_AIFF_FORMAT_FAMILY = 7, B_AVR_FORMAT_FAMILY = 8, - - B_MISC_FORMAT_FAMILY = 99999 + B_MISC_FORMAT_FAMILY = 99999, + B_META_FORMAT_FAMILY = 100000 } media_format_family; struct media_file_format { diff --git a/headers/os/media/MediaFormats.h b/headers/os/media/MediaFormats.h index bbc52f6ae5..a91dbc2c3e 100644 --- a/headers/os/media/MediaFormats.h +++ b/headers/os/media/MediaFormats.h @@ -118,6 +118,10 @@ typedef struct { uint32 codec; } media_misc_description; +typedef struct { + char description[48]; +} media_meta_description; + typedef struct _media_format_description { #if defined(__cplusplus) _media_format_description(); @@ -137,6 +141,7 @@ typedef struct _media_format_description { media_aiff_description aiff; media_misc_description misc; media_avr_description avr; + media_meta_description meta; uint32 _reserved_[12]; } u; } media_format_description; diff --git a/headers/private/media/DecoderPlugin.h b/headers/private/media/DecoderPlugin.h index 6e48e747c0..296d12723f 100644 --- a/headers/private/media/DecoderPlugin.h +++ b/headers/private/media/DecoderPlugin.h @@ -44,8 +44,7 @@ public: virtual Decoder *NewDecoder() = 0; - status_t PublishDecoder(const char *short_name, const char *pretty_name, const media_format_description &fmt_desc, media_type fmt_type); - status_t PublishDecoder(const char *short_name, const char *pretty_name, const media_format &fmt); + status_t PublishDecoder(const char *meta_description, const char *short_name, const char *pretty_name, const char *default_mapping = 0); }; } } // namespace BPrivate::media diff --git a/src/add-ons/media/plugins/mp3_decoder/mp3DecoderPlugin.cpp b/src/add-ons/media/plugins/mp3_decoder/mp3DecoderPlugin.cpp index c7a2015993..56c31b0916 100644 --- a/src/add-ons/media/plugins/mp3_decoder/mp3DecoderPlugin.cpp +++ b/src/add-ons/media/plugins/mp3_decoder/mp3DecoderPlugin.cpp @@ -105,27 +105,15 @@ mp3DecoderPlugin::NewDecoder() status_t mp3DecoderPlugin::RegisterPlugin() { - struct { - const char *short_name; - const char *pretty_name; - uint32 id; - } descs[] = { - { "mpeg1 audio layer1", "MPEG 1 audio layer 1 decoder, based on mpeg123 mpglib", B_MPEG_1_AUDIO_LAYER_1 }, - { "mpeg1 audio layer2", "MPEG 1 audio layer 2 decoder, based on mpeg123 mpglib", B_MPEG_1_AUDIO_LAYER_2 }, - { "mpeg1 audio layer3", "MPEG 1 audio layer 3 decoder, based on mpeg123 mpglib", B_MPEG_1_AUDIO_LAYER_3 }, - { "mpeg2 audio layer1", "MPEG 2 audio layer 1 decoder, based on mpeg123 mpglib", B_MPEG_2_AUDIO_LAYER_1 }, - { "mpeg2 audio layer2", "MPEG 2 audio layer 2 decoder, based on mpeg123 mpglib", B_MPEG_2_AUDIO_LAYER_2 }, - { "mpeg2 audio layer3", "MPEG 2 audio layer 3 decoder, based on mpeg123 mpglib", B_MPEG_2_AUDIO_LAYER_3 }, - { "mpeg2.5 audio layer1", "MPEG 2.5 audio layer 1 decoder, based on mpeg123 mpglib", B_MPEG_2_5_AUDIO_LAYER_1 }, - { "mpeg2.5 audio layer2", "MPEG 2.5 audio layer 2 decoder, based on mpeg123 mpglib", B_MPEG_2_5_AUDIO_LAYER_2 }, - { "mpeg2.5 audio layer3", "MPEG 2.5 audio layer 3 decoder, based on mpeg123 mpglib", B_MPEG_2_5_AUDIO_LAYER_3 } - }; - for (int i = 0; i < (int)(sizeof(descs) / sizeof(descs[i])); i++) { - media_format_description fmt_desc; - fmt_desc.family = B_MPEG_FORMAT_FAMILY; - fmt_desc.u.mpeg.id = descs[i].id; - PublishDecoder(descs[i].short_name, descs[i].pretty_name, fmt_desc, B_MEDIA_ENCODED_AUDIO); - } + PublishDecoder("audiocodec/mpeg1layer1", "mp3", "MPEG 1 audio layer 1 decoder, based on mpeg123 mpglib"); + PublishDecoder("audiocodec/mpeg1layer2", "mp3", "MPEG 1 audio layer 2 decoder, based on mpeg123 mpglib"); + PublishDecoder("audiocodec/mpeg1layer3", "mp3", "MPEG 1 audio layer 3 decoder, based on mpeg123 mpglib"); + PublishDecoder("audiocodec/mpeg2layer1", "mp3", "MPEG 2 audio layer 1 decoder, based on mpeg123 mpglib"); + PublishDecoder("audiocodec/mpeg2layer2", "mp3", "MPEG 2 audio layer 2 decoder, based on mpeg123 mpglib"); + PublishDecoder("audiocodec/mpeg2layer3", "mp3", "MPEG 2 audio layer 3 decoder, based on mpeg123 mpglib"); + PublishDecoder("audiocodec/mpeg2.5layer1", "mp3", "MPEG 2.5 audio layer 1 decoder, based on mpeg123 mpglib"); + PublishDecoder("audiocodec/mpeg2.5layer2", "mp3", "MPEG 2.5 audio layer 2 decoder, based on mpeg123 mpglib"); + PublishDecoder("audiocodec/mpeg2.5layer3", "mp3", "MPEG 2.5 audio layer 3 decoder, based on mpeg123 mpglib"); } diff --git a/src/add-ons/media/plugins/raw_decoder/RawDecoderPlugin.cpp b/src/add-ons/media/plugins/raw_decoder/RawDecoderPlugin.cpp index b2ee1122c9..5be2cd08e7 100644 --- a/src/add-ons/media/plugins/raw_decoder/RawDecoderPlugin.cpp +++ b/src/add-ons/media/plugins/raw_decoder/RawDecoderPlugin.cpp @@ -63,12 +63,8 @@ RawDecoderPlugin::NewDecoder() status_t RawDecoderPlugin::RegisterPlugin() { - media_format fmt; - memset(&fmt, 0, sizeof(fmt)); - fmt.type = B_MEDIA_RAW_AUDIO; - PublishDecoder("raw audio", "RAW audio decoder", fmt); - fmt.type = B_MEDIA_RAW_VIDEO; - PublishDecoder("raw video", "RAW video decoder", fmt); + PublishDecoder("audiocodec/raw", "raw", "RAW audio decoder", "{ WAV : 0x1 }, { QT : 0x20776172, 0x736f7774, 0x74776f73 }"); + PublishDecoder("videocodec/raw", "raw", "RAW video decoder"); return B_OK; } diff --git a/src/kits/media/DecoderPlugin.cpp b/src/kits/media/DecoderPlugin.cpp index ce8bd92331..eaf707f607 100644 --- a/src/kits/media/DecoderPlugin.cpp +++ b/src/kits/media/DecoderPlugin.cpp @@ -30,25 +30,23 @@ DecoderPlugin::DecoderPlugin() } status_t -DecoderPlugin::PublishDecoder(const char *short_name, const char *pretty_name, const media_format_description &fmt_desc, media_type fmt_type) +DecoderPlugin::PublishDecoder(const char *meta_description, + const char *short_name, + const char *pretty_name, + const char *default_mapping /* = 0 */) { +/* media_format fmt; memset(&fmt, 0, sizeof(fmt)); fmt.type = fmt_type; BMediaFormats formats; if (B_OK != formats.MakeFormatFor(&fmt_desc, 1, &fmt)) return B_ERROR; - return PublishDecoder(short_name, pretty_name, fmt); -} -status_t -DecoderPlugin::PublishDecoder(const char *short_name, const char *pretty_name, const media_format &fmt) -{ char s[1024]; string_for_format(fmt, s, sizeof(s)); printf("DecoderPlugin::PublishDecoder: short_name \"%s\", pretty_name \"%s\", format %s\n", short_name, pretty_name, s); - - +*/ return B_OK; } diff --git a/src/kits/media/MediaExtractor.cpp b/src/kits/media/MediaExtractor.cpp index 1a843e274e..a370f82b7d 100644 --- a/src/kits/media/MediaExtractor.cpp +++ b/src/kits/media/MediaExtractor.cpp @@ -148,7 +148,9 @@ MediaExtractor::GetNextChunk(int32 stream, media_header *mediaHeader) { // get buffered chunk - return B_OK; + + // XXX this should be done in a different thread, and double buffered for each stream + return fReader->GetNextChunk(fStreamInfo[stream].cookie, chunkBuffer, chunkSize, mediaHeader); } status_t diff --git a/src/kits/media/MediaFormats.cpp b/src/kits/media/MediaFormats.cpp index 6b51f93155..2634e20b0f 100644 --- a/src/kits/media/MediaFormats.cpp +++ b/src/kits/media/MediaFormats.cpp @@ -6,7 +6,6 @@ #include #include "debug.h" - /************************************************************* * *************************************************************/