* Added DataExchange message constants and server communication structs for
retrieving WriterPlugins and EncoderPlugins from the media_addon_server. * Enabled respective code in PluginManager (and fixed the copy&paste bugs), the server side is still missing, though... git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31924 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
f3d79634e6
commit
57bb0b9fcd
@ -131,6 +131,8 @@ enum {
|
||||
SERVER_GET_DESCRIPTION_FOR_FORMAT,
|
||||
SERVER_GET_READERS,
|
||||
SERVER_GET_DECODER_FOR_FORMAT,
|
||||
SERVER_GET_ENCODER_FOR_FORMAT,
|
||||
SERVER_GET_WRITER_FOR_FORMAT_FAMILY,
|
||||
SERVER_MESSAGE_END,
|
||||
NODE_MESSAGE_START = 0x200,
|
||||
|
||||
@ -805,6 +807,15 @@ struct server_get_decoder_for_format_reply : reply_data {
|
||||
// a ref to the decoder
|
||||
};
|
||||
|
||||
struct server_get_encoder_for_format_request : request_data {
|
||||
media_format format;
|
||||
};
|
||||
|
||||
struct server_get_encoder_for_format_reply : reply_data {
|
||||
xfer_entry_ref ref;
|
||||
// a ref to the encoder
|
||||
};
|
||||
|
||||
struct server_get_readers_request : request_data {
|
||||
};
|
||||
|
||||
@ -814,6 +825,15 @@ struct server_get_readers_reply : reply_data {
|
||||
int32 count;
|
||||
};
|
||||
|
||||
struct server_get_writer_request : request_data {
|
||||
media_file_format file_format;
|
||||
};
|
||||
|
||||
struct server_get_writer_reply : reply_data {
|
||||
xfer_entry_ref ref;
|
||||
// a ref to the writer
|
||||
};
|
||||
|
||||
struct node_request_completed_command : command_data {
|
||||
media_request_info info;
|
||||
};
|
||||
|
@ -130,6 +130,8 @@ PluginManager::CreateDecoder(Decoder** _decoder, const media_format& format)
|
||||
return B_ERROR;
|
||||
}
|
||||
|
||||
// TODO: In theory, one DecoderPlugin could support multiple Decoders,
|
||||
// but this is not yet handled (passing "0" as index/ID).
|
||||
*_decoder = decoderPlugin->NewDecoder(0);
|
||||
if (*_decoder == NULL) {
|
||||
printf("PluginManager::CreateDecoder: NewDecoder() failed\n");
|
||||
@ -188,12 +190,11 @@ PluginManager::DestroyDecoder(Decoder* decoder)
|
||||
|
||||
|
||||
status_t
|
||||
PluginManager::CreateWriter(Writer** reader, const media_file_format& mff,
|
||||
PluginManager::CreateWriter(Writer** writer, const media_file_format& mff,
|
||||
BDataIO* target)
|
||||
{
|
||||
TRACE("PluginManager::CreateWriter enter\n");
|
||||
|
||||
#if 0
|
||||
// get list of available readers from the server
|
||||
server_get_writer_request request;
|
||||
request.file_format = mff;
|
||||
@ -231,10 +232,6 @@ PluginManager::CreateWriter(Writer** reader, const media_file_format& mff,
|
||||
|
||||
TRACE("PluginManager::CreateWriter leave\n");
|
||||
return B_OK;
|
||||
#else
|
||||
TRACE("PluginManager::CreateWriter leave\n");
|
||||
return B_MEDIA_NO_HANDLER;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@ -257,7 +254,6 @@ PluginManager::DestroyWriter(Writer* writer)
|
||||
status_t
|
||||
PluginManager::CreateEncoder(Encoder** _encoder, const media_format& format)
|
||||
{
|
||||
#if 0
|
||||
TRACE("PluginManager::CreateEncoder enter\n");
|
||||
|
||||
// get decoder for this format from the server
|
||||
@ -284,9 +280,11 @@ PluginManager::CreateEncoder(Encoder** _encoder, const media_format& format)
|
||||
PutPlugin(plugin);
|
||||
return B_ERROR;
|
||||
}
|
||||
|
||||
|
||||
// TODO: In theory, one EncoderPlugin could support multiple Encoders,
|
||||
// but this is not yet handled (passing "0" as index/ID).
|
||||
*_encoder = encoderPlugin->NewEncoder(0);
|
||||
if (*_decoder == NULL) {
|
||||
if (*_encoder == NULL) {
|
||||
printf("PluginManager::CreateEncoder: NewEncoder() failed\n");
|
||||
PutPlugin(plugin);
|
||||
return B_ERROR;
|
||||
@ -297,9 +295,6 @@ PluginManager::CreateEncoder(Encoder** _encoder, const media_format& format)
|
||||
TRACE("PluginManager::CreateEncoder leave\n");
|
||||
|
||||
return B_OK;
|
||||
#else
|
||||
return B_NOT_SUPPORTED;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user