AddOnManager: Initial support for streamer addons

This commit is contained in:
Dario Casalinuovo
2016-03-25 22:17:13 +01:00
parent 63e1708eee
commit b1ccc05864
2 changed files with 31 additions and 0 deletions
+23
View File
@@ -354,6 +354,10 @@ AddOnManager::_RegisterAddOn(const entry_ref& ref)
if (encoder != NULL)
_RegisterEncoder(encoder, ref);
StreamerPlugin* streamer = dynamic_cast<StreamerPlugin*>(plugin);
if (streamer != NULL)
_RegisterStreamer(streamer, ref);
delete plugin;
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
AddOnManager::_FindDecoder(const media_format& format, const BPath& path,
entry_ref* _decoderRef)
+8
View File
@@ -22,6 +22,7 @@
#include "DecoderPlugin.h"
#include "EncoderPlugin.h"
#include "ReaderPlugin.h"
#include "StreamerPlugin.h"
#include "WriterPlugin.h"
@@ -73,6 +74,9 @@ private:
void _RegisterEncoder(EncoderPlugin* encoder,
const entry_ref& ref);
void _RegisterStreamer(StreamerPlugin* streamer,
const entry_ref& ref);
bool _FindDecoder(const media_format& format,
const BPath& path,
entry_ref* _decoderRef);
@@ -105,12 +109,16 @@ private:
media_format intputFormat;
media_format outputFormat;
};
struct streamer_info {
entry_ref ref;
};
BLocker fLock;
List<reader_info> fReaderList;
List<writer_info> fWriterList;
List<decoder_info> fDecoderList;
List<encoder_info> fEncoderList;
List<streamer_info> fStreamerList;
List<media_file_format> fWriterFileFormats;