dvd_streamer: API Update
This commit is contained in:
@@ -216,7 +216,7 @@ DVDMediaIO::HandleDVDEvent(int event, int len)
|
|||||||
}
|
}
|
||||||
|
|
||||||
case DVDNAV_NAV_PACKET:
|
case DVDNAV_NAV_PACKET:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DVDNAV_HOP_CHANNEL:
|
case DVDNAV_HOP_CHANNEL:
|
||||||
break;
|
break;
|
||||||
@@ -242,12 +242,17 @@ DVDMediaIO::SeekRequested(off_t position)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//void
|
void
|
||||||
//DVDMediaIO::MouseMoved()
|
DVDMediaIO::MouseMoved(uint32 x, uint32 y)
|
||||||
//{
|
{
|
||||||
// if Mouse moved
|
pci_t* pci = dvdnav_get_current_nav_pci(fDvdNav);
|
||||||
// dvdnav_mouse_select(fDvdNav, pci, x, y);
|
dvdnav_mouse_select(fDvdNav, pci, x, y);
|
||||||
// else button pressed
|
}
|
||||||
// update button
|
|
||||||
// dvdnav_mouse_activate(fDvdNav, pci, x, y);
|
|
||||||
//}
|
void
|
||||||
|
DVDMediaIO::MouseDown(uint32 x, uint32 y)
|
||||||
|
{
|
||||||
|
pci_t* pci = dvdnav_get_current_nav_pci(fDvdNav);
|
||||||
|
dvdnav_mouse_activate(fDvdNav, pci, x, y);
|
||||||
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#include <AdapterIO.h>
|
#include <AdapterIO.h>
|
||||||
|
#include <String.h>
|
||||||
#include <Url.h>
|
#include <Url.h>
|
||||||
|
|
||||||
#include <dvdnav/dvdnav.h>
|
#include <dvdnav/dvdnav.h>
|
||||||
@@ -36,16 +37,18 @@ public:
|
|||||||
|
|
||||||
void HandleDVDEvent(int event, int len);
|
void HandleDVDEvent(int event, int len);
|
||||||
|
|
||||||
|
void MouseMoved(uint32 x, uint32 y);
|
||||||
|
void MouseDown(uint32 x, uint32 y);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static int32 _LoopThread(void* data);
|
static int32 _LoopThread(void* data);
|
||||||
|
|
||||||
const char* fPath;
|
|
||||||
|
|
||||||
thread_id fLoopThread;
|
thread_id fLoopThread;
|
||||||
bool fExit;
|
bool fExit;
|
||||||
|
|
||||||
BInputAdapter* fInputAdapter;
|
BInputAdapter* fInputAdapter;
|
||||||
|
|
||||||
|
const char* fPath;
|
||||||
dvdnav_t* fDvdNav;
|
dvdnav_t* fDvdNav;
|
||||||
uint8_t* fBuffer;
|
uint8_t* fBuffer;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -3,9 +3,8 @@
|
|||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "DVDStreamerPlugin.h"
|
|
||||||
|
|
||||||
#include "DVDMediaIO.h"
|
#include "DVDStreamerPlugin.h"
|
||||||
|
|
||||||
|
|
||||||
B_DECLARE_CODEC_KIT_PLUGIN(
|
B_DECLARE_CODEC_KIT_PLUGIN(
|
||||||
@@ -17,7 +16,8 @@ B_DECLARE_CODEC_KIT_PLUGIN(
|
|||||||
|
|
||||||
DVDStreamer::DVDStreamer()
|
DVDStreamer::DVDStreamer()
|
||||||
:
|
:
|
||||||
BStreamer()
|
BStreamer(),
|
||||||
|
fAdapter(NULL)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -28,28 +28,49 @@ DVDStreamer::~DVDStreamer()
|
|||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
DVDStreamer::Sniff(const BUrl& url, BDataIO** source)
|
DVDStreamer::Sniff(const BUrl& url)
|
||||||
{
|
{
|
||||||
BString path = url.UrlString();
|
BString path = url.UrlString();
|
||||||
BString protocol = url.Protocol();
|
BString protocol = url.Protocol();
|
||||||
if (protocol == "dvd") {
|
if (protocol == "dvd") {
|
||||||
path = path.RemoveFirst("dvd://");
|
path = path.RemoveFirst("dvd://");
|
||||||
} else if(protocol == "file") {
|
} else if (protocol == "file") {
|
||||||
path = path.RemoveFirst("file://");
|
path = path.RemoveFirst("file://");
|
||||||
} else
|
} else
|
||||||
return B_UNSUPPORTED;
|
return B_UNSUPPORTED;
|
||||||
|
|
||||||
DVDMediaIO* outSource = new DVDMediaIO(path);
|
DVDMediaIO* adapter = new DVDMediaIO(path);
|
||||||
status_t ret = outSource->Open();
|
status_t ret = adapter->Open();
|
||||||
if (ret == B_OK) {
|
if (ret == B_OK) {
|
||||||
*source = outSource;
|
fAdapter = adapter;
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
delete outSource;
|
delete adapter;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BMediaIO*
|
||||||
|
DVDStreamer::Adapter() const
|
||||||
|
{
|
||||||
|
return fAdapter;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
DVDStreamer::MouseMoved(uint32 x, uint32 y)
|
||||||
|
{
|
||||||
|
fAdapter->MouseMoved(x, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
DVDStreamer::MouseDown(uint32 x, uint32 y)
|
||||||
|
{
|
||||||
|
fAdapter->MouseDown(x, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
BStreamer*
|
BStreamer*
|
||||||
DVDStreamerPlugin::NewStreamer()
|
DVDStreamerPlugin::NewStreamer()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,13 +2,15 @@
|
|||||||
* Copyright 2019, Dario Casalinuovo. All rights reserved.
|
* Copyright 2019, Dario Casalinuovo. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _DVD_STREAMER_PLUGIN_H
|
#ifndef _DVD_STREAMER_PLUGIN_H
|
||||||
#define _DVD_STREAMER_PLUGIN_H
|
#define _DVD_STREAMER_PLUGIN_H
|
||||||
|
|
||||||
|
|
||||||
#include <Streamer.h>
|
#include <Streamer.h>
|
||||||
|
|
||||||
|
#include "DVDMediaIO.h"
|
||||||
|
|
||||||
|
using BCodecKit::BMediaIO;
|
||||||
using BCodecKit::BStreamer;
|
using BCodecKit::BStreamer;
|
||||||
using BCodecKit::BStreamerPlugin;
|
using BCodecKit::BStreamerPlugin;
|
||||||
|
|
||||||
@@ -19,7 +21,14 @@ public:
|
|||||||
DVDStreamer();
|
DVDStreamer();
|
||||||
virtual ~DVDStreamer();
|
virtual ~DVDStreamer();
|
||||||
|
|
||||||
virtual status_t Sniff(const BUrl& url, BDataIO** source);
|
virtual status_t Sniff(const BUrl& url);
|
||||||
|
virtual BMediaIO* Adapter() const;
|
||||||
|
|
||||||
|
virtual void MouseMoved(uint32 x, uint32 y);
|
||||||
|
virtual void MouseDown(uint32 x, uint32 y);
|
||||||
|
|
||||||
|
private:
|
||||||
|
DVDMediaIO* fAdapter;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user