MediaExtractor: Adapt to new BUrl functionality
This commit is contained in:
@@ -10,7 +10,10 @@
|
||||
#define _MEDIA_EXTRACTOR_H
|
||||
|
||||
|
||||
#include <Url.h>
|
||||
|
||||
#include "ReaderPlugin.h"
|
||||
#include "StreamerPlugin.h"
|
||||
#include "DecoderPlugin.h"
|
||||
|
||||
|
||||
@@ -37,10 +40,14 @@ struct stream_info {
|
||||
class MediaExtractor {
|
||||
public:
|
||||
MediaExtractor(BDataIO* source, int32 flags);
|
||||
MediaExtractor(BUrl* url, int32 flags);
|
||||
|
||||
~MediaExtractor();
|
||||
|
||||
status_t InitCheck();
|
||||
|
||||
BDataIO* Source() const;
|
||||
|
||||
void GetFileFormatInfo(
|
||||
media_file_format* fileFormat) const;
|
||||
status_t GetMetaData(BMessage* _data) const;
|
||||
@@ -70,6 +77,8 @@ public:
|
||||
BMessage* _data) const;
|
||||
|
||||
private:
|
||||
void _Init(BDataIO* source, int32 flags);
|
||||
|
||||
void _RecycleLastChunk(stream_info& info);
|
||||
static int32 _ExtractorEntry(void* arg);
|
||||
void _ExtractorThread();
|
||||
@@ -82,6 +91,7 @@ private:
|
||||
|
||||
BDataIO* fSource;
|
||||
Reader* fReader;
|
||||
Streamer* fStreamer;
|
||||
|
||||
stream_info* fStreamInfo;
|
||||
int32 fStreamCount;
|
||||
|
||||
@@ -55,13 +55,39 @@ private:
|
||||
MediaExtractor::MediaExtractor(BDataIO* source, int32 flags)
|
||||
:
|
||||
fExtractorThread(-1),
|
||||
fSource(source),
|
||||
fReader(NULL),
|
||||
fStreamer(NULL),
|
||||
fStreamInfo(NULL),
|
||||
fStreamCount(0)
|
||||
{
|
||||
_Init(source, flags);
|
||||
}
|
||||
|
||||
|
||||
MediaExtractor::MediaExtractor(BUrl* url, int32 flags)
|
||||
:
|
||||
fExtractorThread(-1),
|
||||
fReader(NULL),
|
||||
fStreamer(NULL),
|
||||
fStreamInfo(NULL),
|
||||
fStreamCount(0)
|
||||
{
|
||||
BDataIO* source = NULL;
|
||||
fInitStatus = gPluginManager.CreateStreamer(&fStreamer, url, &source);
|
||||
if (fInitStatus != B_OK)
|
||||
return;
|
||||
|
||||
_Init(source, flags);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
MediaExtractor::_Init(BDataIO* source, int32 flags)
|
||||
{
|
||||
CALLED();
|
||||
|
||||
fSource = source;
|
||||
|
||||
#if !DISABLE_CHUNK_CACHE
|
||||
// start extractor thread
|
||||
fExtractorWaitSem = create_sem(1, "media extractor thread sem");
|
||||
@@ -171,6 +197,13 @@ MediaExtractor::InitCheck()
|
||||
}
|
||||
|
||||
|
||||
BDataIO*
|
||||
MediaExtractor::Source() const
|
||||
{
|
||||
return fSource;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
MediaExtractor::GetFileFormatInfo(media_file_format* fileFormat) const
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user