MediaStreamer: Extend API to support DVD navigation
* This is a general review of the code and includes a rework of the sniffing API.
This commit is contained in:
@@ -44,7 +44,7 @@ public:
|
||||
static void ReleaseEncoder(BEncoder* encoder);
|
||||
|
||||
static status_t InstantiateStreamer(BStreamer** streamer,
|
||||
BUrl url, BDataIO** source);
|
||||
BUrl url);
|
||||
static void ReleaseStreamer(BStreamer* streamer);
|
||||
|
||||
static status_t GetDecoderInfo(BDecoder* decoder,
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
|
||||
#include <Decoder.h>
|
||||
#include <MediaStreamer.h>
|
||||
#include <Reader.h>
|
||||
|
||||
|
||||
@@ -23,6 +24,8 @@ struct stream_info;
|
||||
class BMediaExtractor {
|
||||
public:
|
||||
BMediaExtractor(BDataIO* source, int32 flags);
|
||||
// TODO
|
||||
//BMediaExtractor(BMediaStreamer* streamer);
|
||||
~BMediaExtractor();
|
||||
|
||||
status_t InitCheck();
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#define _MEDIA_STREAMER_H
|
||||
|
||||
|
||||
#include <MediaIO.h>
|
||||
#include <Streamer.h>
|
||||
#include <Url.h>
|
||||
|
||||
@@ -18,11 +19,34 @@ public:
|
||||
BMediaStreamer(BUrl url);
|
||||
~BMediaStreamer();
|
||||
|
||||
status_t CreateAdapter(BDataIO** adapter);
|
||||
status_t InitCheck() const;
|
||||
|
||||
// TODO: So, it seems since this API was not public,
|
||||
// the memory ownership is leaved to class users.
|
||||
// See if this fits our plans, and eventually, move
|
||||
// this memory management from BMediaFile to BMediaExtractor,
|
||||
// BMediaWriter and BMediaStreamer.
|
||||
BMediaIO* Adapter() const;
|
||||
|
||||
// TODO: Don't we need an open in the extractor and writer?
|
||||
status_t Open();
|
||||
void Close();
|
||||
bool IsOpened() const;
|
||||
|
||||
//uint32 Capabilities() const;
|
||||
//status_t GetMetaData(BMetaData* data) const;
|
||||
//status_t SetHandler(BHandler* handler);
|
||||
//BHandler* Handler() const;
|
||||
|
||||
void MouseMoved(uint32 x, uint32 y);
|
||||
void MouseDown(uint32 x, uint32 y);
|
||||
|
||||
private:
|
||||
BUrl fUrl;
|
||||
BStreamer* fStreamer;
|
||||
status_t fInitCheck;
|
||||
|
||||
bool fOpened;
|
||||
|
||||
// No virtual padding needed. Looks like a design decision.
|
||||
// Let's respect that, for now.
|
||||
|
||||
@@ -20,7 +20,12 @@ namespace BPrivate {
|
||||
|
||||
class BStreamer {
|
||||
public:
|
||||
virtual status_t Sniff(const BUrl& url, BDataIO** source) = 0;
|
||||
virtual status_t Sniff(const BUrl& url) = 0;
|
||||
virtual BMediaIO* Adapter() const = 0;
|
||||
|
||||
// Base impl does nothing
|
||||
virtual void MouseMoved(uint32 x, uint32 y);
|
||||
virtual void MouseDown(uint32 x, uint32 y);
|
||||
|
||||
protected:
|
||||
BStreamer();
|
||||
|
||||
Reference in New Issue
Block a user