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:
Barrett17
2019-02-21 16:39:58 +01:00
parent d18fe1c54c
commit 662583b300
9 changed files with 111 additions and 20 deletions
+1 -1
View File
@@ -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,
+3
View File
@@ -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();
+25 -1
View File
@@ -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.
+6 -1
View File
@@ -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();