update to the codec api, docoder assignment is now handled in the server
multiple reader add-ons are probed to recognize a media file FormatManager does the translation from media_format to media_description git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5667 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -599,6 +599,7 @@ typedef enum {
|
||||
B_WAV_FORMAT_FAMILY = 6,
|
||||
B_AIFF_FORMAT_FAMILY = 7,
|
||||
B_AVR_FORMAT_FAMILY = 8,
|
||||
B_OGG_FORMAT_FAMILY = 9,
|
||||
B_MISC_FORMAT_FAMILY = 99999,
|
||||
B_META_FORMAT_FAMILY = 100000
|
||||
} media_format_family;
|
||||
|
||||
@@ -106,7 +106,9 @@ enum {
|
||||
SERVER_REMOVEREFFOR,
|
||||
SERVER_REMOVEITEM,
|
||||
SERVER_GET_FORMAT_FOR_DESCRIPTION,
|
||||
SERVER_GET_META_DESCRIPTION_FOR_FORMAT,
|
||||
SERVER_GET_DESCRIPTION_FOR_FORMAT,
|
||||
SERVER_GET_READERS,
|
||||
SERVER_GET_DECODER_FOR_FORMAT,
|
||||
SERVER_MESSAGE_END,
|
||||
NODE_MESSAGE_START = 0x200,
|
||||
|
||||
@@ -206,7 +208,7 @@ public:
|
||||
private:
|
||||
dev_t device;
|
||||
ino_t directory;
|
||||
char name[B_FILE_NAME_LENGTH];
|
||||
char name[B_FILE_NAME_LENGTH]; // == 256 bytes
|
||||
};
|
||||
|
||||
|
||||
@@ -243,6 +245,12 @@ enum
|
||||
MAX_NODE_ID = 4000,
|
||||
};
|
||||
|
||||
// used by SERVER_GET_READERS
|
||||
enum
|
||||
{
|
||||
MAX_READERS = 40,
|
||||
};
|
||||
|
||||
struct addonserver_instantiate_dormant_node_request : public request_data
|
||||
{
|
||||
media_addon_id addonid;
|
||||
@@ -889,14 +897,35 @@ struct server_get_format_for_description_reply : public reply_data
|
||||
media_format format;
|
||||
};
|
||||
|
||||
struct server_get_meta_description_for_format_request : public request_data
|
||||
struct server_get_description_for_format_request : public request_data
|
||||
{
|
||||
media_format format;
|
||||
media_format_family family;
|
||||
};
|
||||
|
||||
struct server_get_description_for_format_reply : public reply_data
|
||||
{
|
||||
media_format_description description;
|
||||
};
|
||||
|
||||
struct server_get_decoder_for_format_request : public request_data
|
||||
{
|
||||
media_format format;
|
||||
};
|
||||
|
||||
struct server_get_meta_description_for_format_reply : public reply_data
|
||||
struct server_get_decoder_for_format_reply : public reply_data
|
||||
{
|
||||
media_format_description description;
|
||||
xfer_entry_ref ref; // a ref to the decoder
|
||||
};
|
||||
|
||||
struct server_get_readers_request : public request_data
|
||||
{
|
||||
};
|
||||
|
||||
struct server_get_readers_reply : public reply_data
|
||||
{
|
||||
xfer_entry_ref ref[MAX_READERS]; // a list of refs to the reader
|
||||
int32 count;
|
||||
};
|
||||
|
||||
struct node_request_completed_command : public command_data
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
#include "MediaPlugin.h"
|
||||
#include "MediaExtractor.h"
|
||||
|
||||
class AddOnManager;
|
||||
|
||||
namespace BPrivate { namespace media {
|
||||
|
||||
class Decoder
|
||||
@@ -41,11 +43,19 @@ private:
|
||||
class DecoderPlugin : public MediaPlugin
|
||||
{
|
||||
public:
|
||||
DecoderPlugin();
|
||||
DecoderPlugin();
|
||||
|
||||
virtual Decoder *NewDecoder() = 0;
|
||||
virtual Decoder * NewDecoder() = 0;
|
||||
|
||||
status_t PublishDecoder(const char *meta_description, const char *short_name, const char *pretty_name, const char *default_mapping = 0);
|
||||
status_t PublishDecoder(const char *meta_description,
|
||||
const char *short_name,
|
||||
const char *pretty_name,
|
||||
const char *default_mapping = 0);
|
||||
|
||||
private:
|
||||
friend class AddOnManager;
|
||||
void Setup(void *publish_hook);
|
||||
void * fPublishHook;
|
||||
};
|
||||
|
||||
} } // namespace BPrivate::media
|
||||
|
||||
@@ -24,11 +24,11 @@ public:
|
||||
PluginManager();
|
||||
~PluginManager();
|
||||
|
||||
MediaPlugin * GetPlugin(const char *name);
|
||||
MediaPlugin * GetPlugin(const entry_ref &ref);
|
||||
void PutPlugin(MediaPlugin *plugin);
|
||||
|
||||
private:
|
||||
bool LoadPlugin(const char *name, MediaPlugin **plugin, image_id *image);
|
||||
bool LoadPlugin(const entry_ref &ref, MediaPlugin **plugin, image_id *image);
|
||||
|
||||
struct plugin_info
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user