AddOnManager: Initial support for streamer addons
This commit is contained in:
@@ -354,6 +354,10 @@ AddOnManager::_RegisterAddOn(const entry_ref& ref)
|
|||||||
if (encoder != NULL)
|
if (encoder != NULL)
|
||||||
_RegisterEncoder(encoder, ref);
|
_RegisterEncoder(encoder, ref);
|
||||||
|
|
||||||
|
StreamerPlugin* streamer = dynamic_cast<StreamerPlugin*>(plugin);
|
||||||
|
if (streamer != NULL)
|
||||||
|
_RegisterStreamer(streamer, ref);
|
||||||
|
|
||||||
delete plugin;
|
delete plugin;
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
@@ -549,6 +553,25 @@ AddOnManager::_RegisterEncoder(EncoderPlugin* plugin, const entry_ref& ref)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
AddOnManager::_RegisterStreamer(StreamerPlugin* streamer, const entry_ref& ref)
|
||||||
|
{
|
||||||
|
BAutolock locker(fLock);
|
||||||
|
|
||||||
|
streamer_info* pInfo;
|
||||||
|
for (fStreamerList.Rewind(); fStreamerList.GetNext(&pInfo);) {
|
||||||
|
if (!strcmp(pInfo->ref.name, ref.name)) {
|
||||||
|
// We already know this streamer
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
streamer_info info;
|
||||||
|
info.ref = ref;
|
||||||
|
fStreamerList.Insert(info);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
AddOnManager::_FindDecoder(const media_format& format, const BPath& path,
|
AddOnManager::_FindDecoder(const media_format& format, const BPath& path,
|
||||||
entry_ref* _decoderRef)
|
entry_ref* _decoderRef)
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
#include "DecoderPlugin.h"
|
#include "DecoderPlugin.h"
|
||||||
#include "EncoderPlugin.h"
|
#include "EncoderPlugin.h"
|
||||||
#include "ReaderPlugin.h"
|
#include "ReaderPlugin.h"
|
||||||
|
#include "StreamerPlugin.h"
|
||||||
#include "WriterPlugin.h"
|
#include "WriterPlugin.h"
|
||||||
|
|
||||||
|
|
||||||
@@ -73,6 +74,9 @@ private:
|
|||||||
void _RegisterEncoder(EncoderPlugin* encoder,
|
void _RegisterEncoder(EncoderPlugin* encoder,
|
||||||
const entry_ref& ref);
|
const entry_ref& ref);
|
||||||
|
|
||||||
|
void _RegisterStreamer(StreamerPlugin* streamer,
|
||||||
|
const entry_ref& ref);
|
||||||
|
|
||||||
bool _FindDecoder(const media_format& format,
|
bool _FindDecoder(const media_format& format,
|
||||||
const BPath& path,
|
const BPath& path,
|
||||||
entry_ref* _decoderRef);
|
entry_ref* _decoderRef);
|
||||||
@@ -105,12 +109,16 @@ private:
|
|||||||
media_format intputFormat;
|
media_format intputFormat;
|
||||||
media_format outputFormat;
|
media_format outputFormat;
|
||||||
};
|
};
|
||||||
|
struct streamer_info {
|
||||||
|
entry_ref ref;
|
||||||
|
};
|
||||||
|
|
||||||
BLocker fLock;
|
BLocker fLock;
|
||||||
List<reader_info> fReaderList;
|
List<reader_info> fReaderList;
|
||||||
List<writer_info> fWriterList;
|
List<writer_info> fWriterList;
|
||||||
List<decoder_info> fDecoderList;
|
List<decoder_info> fDecoderList;
|
||||||
List<encoder_info> fEncoderList;
|
List<encoder_info> fEncoderList;
|
||||||
|
List<streamer_info> fStreamerList;
|
||||||
|
|
||||||
List<media_file_format> fWriterFileFormats;
|
List<media_file_format> fWriterFileFormats;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user