[xiph-commits] r6885 - in trunk/oggdsf/src/lib:

illiminable at dactyl.lonelymoon.com illiminable
Sat Jun 26 07:20:56 PDT 2004


codecs/flac/filters/dsfFLACDecoder core/directshow/dsfOggDemux
Message-ID: <20040626142056.8E2AC9AAAB at dactyl.lonelymoon.com>

Author: illiminable
Date: Sat Jun 26 07:20:56 2004
New Revision: 6885

Added:
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FilterFileSource.cpp
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FilterFileSource.h
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/IFilterDataSource.cpp
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/IFilterDataSource.h
Modified:
trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACDecoder/FLACDecodeInputPin.cpp
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourceFilter.cpp
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourceFilter.h
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/dsfOggDemux.vcproj
Log:
* Added interface to precurse networking code.

Modified: trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACDecoder/FLACDecodeInputPin.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACDecoder/FLACDecodeInputPin.cpp	2004-06-26 11:20:46 UTC (rev 6884)
+++ trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACDecoder/FLACDecodeInputPin.cpp	2004-06-26 14:20:54 UTC (rev 6885)
@@ -183,6 +183,8 @@
//FIX:::Take out the unnescessary variable.
tempLong = inBuffer[j][i];
//Convert 32 bit to 16 bit
+
+				//FIX::: Why on earth are you dividing by 2 ? It does not make sense !
tempInt = (signed short)(tempLong/2);

*locShortBuffer = tempInt;

Added: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FilterFileSource.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FilterFileSource.cpp	2004-06-26 11:20:46 UTC (rev 6884)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FilterFileSource.cpp	2004-06-26 14:20:54 UTC (rev 6885)
@@ -0,0 +1,32 @@
+#include "StdAfx.h"
+#include "filterfilesource.h"
+
+FilterFileSource::FilterFileSource(void)
+{
+}
+
+FilterFileSource::~FilterFileSource(void)
+{
+}
+
+unsigned long FilterFileSource::seek(unsigned long inPos) {
+	mSourceFile.seekg(inPos, ios_base::beg);
+	return mSourceFile.tellg();
+}
+void FilterFileSource::close() {
+	mSourceFile.close();
+}
+bool FilterFileSource::open(string inSourceLocation) {
+	mSourceFile.open(inSourceLocation.c_str(), ios_base::in|ios_base::binary);
+	return mSourceFile.is_open();
+}
+void FilterFileSource::clear() {
+	mSourceFile.clear();
+}
+bool FilterFileSource::isEOF() {
+	return mSourceFile.eof();
+}
+unsigned long FilterFileSource::read(char* outBuffer, unsigned long inNumBytes) {
+	mSourceFile.read(outBuffer, inNumBytes);
+	return mSourceFile.gcount();
+}

Added: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FilterFileSource.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FilterFileSource.h	2004-06-26 11:20:46 UTC (rev 6884)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FilterFileSource.h	2004-06-26 14:20:54 UTC (rev 6885)
@@ -0,0 +1,25 @@
+#pragma once
+
+#include <fstream>
+
+using namespace std;
+#include "IFilterDataSource.h"
+class FilterFileSource
+	:	public IFilterDataSource
+{
+public:
+	FilterFileSource(void);
+	~FilterFileSource(void);
+
+	//IFilterDataSource Interface
+	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);
+	//
+
+protected:
+	fstream mSourceFile;
+};

Added: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/IFilterDataSource.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/IFilterDataSource.cpp	2004-06-26 11:20:46 UTC (rev 6884)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/IFilterDataSource.cpp	2004-06-26 14:20:54 UTC (rev 6885)
@@ -0,0 +1,3 @@
+#include "StdAfx.h"
+#include "ifilterdatasource.h"
+

Added: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/IFilterDataSource.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/IFilterDataSource.h	2004-06-26 11:20:46 UTC (rev 6884)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/IFilterDataSource.h	2004-06-26 14:20:54 UTC (rev 6885)
@@ -0,0 +1,12 @@
+#pragma once
+
+class IFilterDataSource
+{
+public:
+	virtual unsigned long seek(unsigned long inPos) = 0;
+	virtual void close()  = 0;
+	virtual bool open(string inSourceLocation) = 0;
+	virtual void clear() = 0;
+	virtual bool isEOF() = 0;
+	virtual unsigned long read(char* outBuffer, unsigned long inNumBytes) = 0;
+};

Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourceFilter.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourceFilter.cpp	2004-06-26 11:20:46 UTC (rev 6884)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourceFilter.cpp	2004-06-26 14:20:54 UTC (rev 6885)
@@ -283,6 +283,8 @@
//debugLog<<"       : End flush Delviered."<<endl;
DeliverNewSegment(*pCurrent, *pCurrent + mSeekTable->fileDuration(), 1.0);
}
+
+		//SOURCE ABSTRACTION::: seek
mSourceFile.seekg(mSeekTable->getStartPos(*pCurrent), ios_base::beg);
*pCurrent = mSeekTable->getRealStartPos();

@@ -413,8 +415,11 @@

CAutoLock locSourceLock(mSourceFileLock);
CAutoLock locDemuxLock(mDemuxLock);
+
+		//SOURCE ABSTRACTION::: clear, close, open, seek
mSourceFile.clear();
mSourceFile.close();
+
mOggBuffer.clearData();
mSourceFile.open(StringHelper::toNarrowStr(mFileName).c_str(), ios_base::in|ios_base::binary);

@@ -481,6 +486,7 @@
bool locIsEOF = true;
{
CAutoLock locSourceLock(mSourceFileLock);
+		//SOURCE ABSTRACTION::: is EOF
locIsEOF = mSourceFile.eof();
}
while (!locIsEOF && locKeepGoing) {
@@ -492,6 +498,8 @@
{
CAutoLock locSourceLock(mSourceFileLock);
//debugLog << "DataProcessLoop : Getpointer = "<<mSourceFile.tellg()<<endl;
+
+			//SOURCE ABSTRACTION::: read, numbytes read
mSourceFile.read(locBuff, 4096);
locBytesRead = mSourceFile.gcount();
}
@@ -505,6 +513,7 @@
}
{
CAutoLock locSourceLock(mSourceFileLock);
+			//SOURCE ABSTRACTION::: is EOF
locIsEOF = mSourceFile.eof();
}
if (locIsEOF) {
@@ -528,6 +537,8 @@

CAutoLock locSourceLock(mSourceFileLock);
CAutoLock locDemuxLock(mDemuxLock);
+
+	//SOURCE ABSTRACTION::: open
mSourceFile.open(StringHelper::toNarrowStr(mFileName).c_str(), ios_base::in|ios_base::binary);

//Error check
@@ -539,6 +550,7 @@

//Feed the data in until we have seen all BOS pages.
while(!mStreamMapper->isReady()) {
+		//SOURCE ABSTRACTION::: read
mSourceFile.read(locBuff, RAW_BUFFER_SIZE);
mOggBuffer.feed(locBuff, RAW_BUFFER_SIZE);


Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourceFilter.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourceFilter.h	2004-06-26 11:20:46 UTC (rev 6884)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourceFilter.h	2004-06-26 14:20:54 UTC (rev 6885)
@@ -130,6 +130,8 @@
wstring mFileName;

OggDataBuffer mOggBuffer;
+
+	//SOURCE ABSTRACTION::: declaration
fstream mSourceFile;

OggStreamMapper* mStreamMapper;

Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/dsfOggDemux.vcproj
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/dsfOggDemux.vcproj	2004-06-26 11:20:46 UTC (rev 6884)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/dsfOggDemux.vcproj	2004-06-26 14:20:54 UTC (rev 6885)
@@ -135,6 +135,9 @@
RelativePath="FLACStream.cpp">
</File>
<File
+				RelativePath="FilterFileSource.cpp">
+			</File>
+			<File
RelativePath="OggDemux.def">
</File>
<File
@@ -193,6 +196,12 @@
RelativePath="FLACStream.h">
</File>
<File
+				RelativePath="FilterFileSource.h">
+			</File>
+			<File
+				RelativePath="IFilterDataSource.h">
+			</File>
+			<File
RelativePath="OggDemuxSourceFilter.h">
</File>
<File



More information about the commits mailing list