[xiph-commits] r8378 - in trunk/oggdsf: docs src/lib/core/directshow/dsfOggDemux src/lib/core/ogg/libOOOggSeek

illiminable at motherfish-iii.xiph.org illiminable at motherfish-iii.xiph.org
Mon Dec 13 04:02:32 PST 2004


Author: illiminable
Date: 2004-12-13 04:02:31 -0800 (Mon, 13 Dec 2004)
New Revision: 8378

Added:
   trunk/oggdsf/docs/ogg_network_seek.txt
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/CachedHTTPFileSource.cpp
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/CachedHTTPFileSource.h
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/CachedHTTPMediaFile.cpp
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/CachedHTTPMediaFile.h
   trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/IOggSeeker.h
   trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggBinarySeeker.cpp
   trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggBinarySeeker.h
Modified:
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/dsfOggDemux.vcproj
   trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/libOOOggSeek.vcproj
Log:
* Start of support for a segmented cache and http seeking by binary search.

Added: trunk/oggdsf/docs/ogg_network_seek.txt
===================================================================
--- trunk/oggdsf/docs/ogg_network_seek.txt	2004-12-12 23:15:33 UTC (rev 8377)
+++ trunk/oggdsf/docs/ogg_network_seek.txt	2004-12-13 12:02:31 UTC (rev 8378)
@@ -0,0 +1,24 @@
+The Plan !!
+-----------
+
+Have a cached file source object which implements the IFilterDataSource interface to present the file
+on a remote server to the filter as if it was a local file.
+
+Maintain a list of byte offsets in the cache.
+
+Each byte offset is locally stored as it's own file.
+
+Periodically these pieces will be consolidated into larger pieces.
+
+When playing back, if a seek falls into a range which is already cached... start playing in that range.
+
+When ever we are playing the http thread should be looking forward through the list of byte offsets and try to find
+holes to plug.
+
+If a seek falls outside the cached range, the http thread starts pulling down from that position, starting a new cache segment.
+
+Should a new segment reach a pointthat is already cahced then the http thread should stop downloading, and
+look ahead to where the next "hole" is consolidating the files as it goes.
+
+For now the byte ranges will just be stored in memory and only be persistent for the current session,
+ but ideally they will be written out with the url etc, in order to be cached across sessions.
\ No newline at end of file

Added: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/CachedHTTPFileSource.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/CachedHTTPFileSource.cpp	2004-12-12 23:15:33 UTC (rev 8377)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/CachedHTTPFileSource.cpp	2004-12-13 12:02:31 UTC (rev 8378)
@@ -0,0 +1,10 @@
+#include "StdAfx.h"
+#include ".\cachedhttpfilesource.h"
+
+CachedHTTPFileSource::CachedHTTPFileSource(void)
+{
+}
+
+CachedHTTPFileSource::~CachedHTTPFileSource(void)
+{
+}

Added: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/CachedHTTPFileSource.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/CachedHTTPFileSource.h	2004-12-12 23:15:33 UTC (rev 8377)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/CachedHTTPFileSource.h	2004-12-13 12:02:31 UTC (rev 8378)
@@ -0,0 +1,33 @@
+#pragma once
+
+class CachedHTTPFileSource
+	:	public IFilterDataSource
+	,	public CAMThread
+	,	protected HTTPSocket
+{
+public:
+	CachedHTTPFileSource(void);
+	virtual ~CachedHTTPFileSource(void);
+
+	//Thread commands
+	static const int THREAD_RUN = 0;
+	static const int THREAD_EXIT = 1;
+	//
+
+	//IFilterDataSource
+	virtual unsigned long seek(unsigned long inPos);
+	virtual void close();
+	virtual bool open(string inSourceLocation);
+	virtual void clear();
+	virtual bool isEOF();
+	virtual unsigned long read(char* outBuffer, unsigned long inNumBytes);
+
+	//CAMThread pure virtuals
+	DWORD ThreadProc();
+protected:
+
+	bool startThread();
+	void DataProcessLoop();
+	CCritSec* mBufferLock;
+
+};

Added: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/CachedHTTPMediaFile.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/CachedHTTPMediaFile.cpp	2004-12-12 23:15:33 UTC (rev 8377)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/CachedHTTPMediaFile.cpp	2004-12-13 12:02:31 UTC (rev 8378)
@@ -0,0 +1,10 @@
+#include "StdAfx.h"
+#include ".\cachedhttpmediafile.h"
+
+CachedHTTPMediaFile::CachedHTTPMediaFile(void)
+{
+}
+
+CachedHTTPMediaFile::~CachedHTTPMediaFile(void)
+{
+}

Added: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/CachedHTTPMediaFile.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/CachedHTTPMediaFile.h	2004-12-12 23:15:33 UTC (rev 8377)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/CachedHTTPMediaFile.h	2004-12-13 12:02:31 UTC (rev 8378)
@@ -0,0 +1,8 @@
+#pragma once
+
+class CachedHTTPMediaFile
+{
+public:
+	CachedHTTPMediaFile(void);
+	~CachedHTTPMediaFile(void);
+};

Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/dsfOggDemux.vcproj
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/dsfOggDemux.vcproj	2004-12-12 23:15:33 UTC (rev 8377)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/dsfOggDemux.vcproj	2004-12-13 12:02:31 UTC (rev 8378)
@@ -277,6 +277,12 @@
 			Name="Source Files"
 			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
 			<File
+				RelativePath=".\CachedHTTPFileSource.cpp">
+			</File>
+			<File
+				RelativePath=".\CachedHTTPMediaFile.cpp">
+			</File>
+			<File
 				RelativePath="DataSourceFactory.cpp">
 			</File>
 			<File
@@ -371,6 +377,12 @@
 			Name="Header Files"
 			Filter="h;hpp;hxx;hm;inl;inc">
 			<File
+				RelativePath=".\CachedHTTPFileSource.h">
+			</File>
+			<File
+				RelativePath=".\CachedHTTPMediaFile.h">
+			</File>
+			<File
 				RelativePath="DataSourceFactory.h">
 			</File>
 			<File

Added: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/IOggSeeker.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/IOggSeeker.h	2004-12-12 23:15:33 UTC (rev 8377)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/IOggSeeker.h	2004-12-13 12:02:31 UTC (rev 8378)
@@ -0,0 +1,17 @@
+class IOggSeeker {
+
+	IOggSeeker();
+	virtual ~IOggSeeker();
+
+	typedef pair<__int64, unsigned long> tSeekPair;
+	virtual bool buildTable();
+
+	//IOggCallback interface
+	virtual bool acceptOggPage(OggPage* inOggPage);
+
+	__int64 fileDuration();
+
+	bool addSeekPoint(__int64 inTime, unsigned long mStartPos);
+	tSeekPair getStartPos(__int64 inTime);
+	bool enabled();
+};
\ No newline at end of file

Added: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggBinarySeeker.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggBinarySeeker.cpp	2004-12-12 23:15:33 UTC (rev 8377)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggBinarySeeker.cpp	2004-12-13 12:02:31 UTC (rev 8378)
@@ -0,0 +1,16 @@
+#include "StdAfx.h"
+#include ".\oggbinaryseeker.h"
+
+OggBinarySeeker::OggBinarySeeker(void)
+{
+}
+
+OggBinarySeeker::~OggBinarySeeker(void)
+{
+}
+
+OggSeekTable::tSeekPair OggBinarySeeker::getStartPos(__int64 inTime) {
+
+
+
+}
\ No newline at end of file

Added: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggBinarySeeker.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggBinarySeeker.h	2004-12-12 23:15:33 UTC (rev 8377)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggBinarySeeker.h	2004-12-13 12:02:31 UTC (rev 8378)
@@ -0,0 +1,12 @@
+#pragma once
+#include "oggseektable.h"
+
+class OggBinarySeeker :
+	public OggSeekTable
+{
+public:
+	OggBinarySeeker(void);
+	virtual ~OggBinarySeeker(void);
+
+	tSeekPair getStartPos(__int64 inTime);
+};

Modified: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/libOOOggSeek.vcproj
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/libOOOggSeek.vcproj	2004-12-12 23:15:33 UTC (rev 8377)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/libOOOggSeek.vcproj	2004-12-13 12:02:31 UTC (rev 8378)
@@ -260,6 +260,9 @@
 				RelativePath="libOOOggSeek.cpp">
 			</File>
 			<File
+				RelativePath=".\OggBinarySeeker.cpp">
+			</File>
+			<File
 				RelativePath="OggSeekPoint.cpp">
 			</File>
 			<File
@@ -303,9 +306,15 @@
 				RelativePath="AutoOggSeekTable.h">
 			</File>
 			<File
+				RelativePath=".\IOggSeeker.h">
+			</File>
+			<File
 				RelativePath="libOOOggSeek.h">
 			</File>
 			<File
+				RelativePath=".\OggBinarySeeker.h">
+			</File>
+			<File
 				RelativePath="OggSeekPoint.h">
 			</File>
 			<File



More information about the commits mailing list