Split theora::VideoStream into OggDemuxer and TheoraVideoStream

This makes the internal API more modular, but the split also forces a cleaner
implementation. It also means the OggDemuxer is now responsible for the
ogg-specific stuff like seeking and (ogg-specific) type detection.

Backported from the love.video-vpx branch of love-experiments

--HG--
branch : minor
This commit is contained in:
Bart van Strien
2017-10-12 14:23:58 +02:00
parent 95adf7e347
commit 0e9f71b29a
7 changed files with 369 additions and 200 deletions
+3 -3
View File
@@ -46,7 +46,7 @@ Video::~Video()
VideoStream *Video::newVideoStream(love::filesystem::File *file)
{
VideoStream *stream = new VideoStream(file);
TheoraVideoStream *stream = new TheoraVideoStream(file);
workerThread->addStream(stream);
return stream;
}
@@ -67,7 +67,7 @@ Worker::~Worker()
stop();
}
void Worker::addStream(VideoStream *stream)
void Worker::addStream(TheoraVideoStream *stream)
{
love::thread::Lock l(mutex);
streams.push_back(stream);
@@ -110,7 +110,7 @@ void Worker::threadFunction()
for (auto it = streams.begin(); it != streams.end(); ++it)
{
VideoStream *stream = *it;
TheoraVideoStream *stream = *it;
if (stream->getReferenceCount() == 1)
{
// We're the only ones left