[xiph-commits] r10268 - in branches/oggdsf_new_demux/src/lib: codecs/vorbis/filters/dsfVorbisDecoder core/directshow/dsfOggDemux2

illiminable at svn.xiph.org illiminable at svn.xiph.org
Sun Oct 23 04:31:12 PDT 2005


Author: illiminable
Date: 2005-10-23 04:31:02 -0700 (Sun, 23 Oct 2005)
New Revision: 10268

Modified:
   branches/oggdsf_new_demux/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/VorbisDecodeInputPin.cpp
   branches/oggdsf_new_demux/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/VorbisDecodeInputPin.h
   branches/oggdsf_new_demux/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/dsfVorbisDecoder.vcproj
   branches/oggdsf_new_demux/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/stdafx.h
   branches/oggdsf_new_demux/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/vorbisdecoderdllstuff.h
   branches/oggdsf_new_demux/src/lib/core/directshow/dsfOggDemux2/IOggDecoder.h
Log:
* Implement IOggDecoder on vorbis decode filter

Modified: branches/oggdsf_new_demux/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/VorbisDecodeInputPin.cpp
===================================================================
--- branches/oggdsf_new_demux/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/VorbisDecodeInputPin.cpp	2005-10-23 11:06:59 UTC (rev 10267)
+++ branches/oggdsf_new_demux/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/VorbisDecodeInputPin.cpp	2005-10-23 11:31:02 UTC (rev 10268)
@@ -53,6 +53,7 @@
 	,	mFrameSize(0)
 	,	mSampleRate(0)
 	,	mUptoFrame(0)
+	,	mSetupState(VSS_SEEN_NOTHING)
 		
 {
 	//debugLog.open("g:\\logs\\vorbislog.log", ios_base::out);
@@ -264,3 +265,56 @@
 	return S_OK;
 }
 
+LOOG_INT64 VorbisDecodeInputPin::convertGranuleToTime(LOOG_INT64 inGranule)
+{
+	if (mBegun) {	
+		return (inGranule * UNITS) / mSampleRate;
+	} else {
+		return -1;
+	}
+}
+IOggDecoder::eAcceptHeaderResult VorbisDecodeInputPin::showHeaderPacket(OggPacket* inCodecHeaderPacket)
+{
+	switch (mSetupState) {
+		case VSS_SEEN_NOTHING:
+			if (strncmp((char*)inCodecHeaderPacket->packetData(), "\001vorbis", 7) == 0) {
+				//TODO::: Possibly verify version
+				mSetupState = VSS_SEEN_BOS;
+				return IOggDecoder::AHR_MORE_HEADERS_TO_COME;
+			} else {
+				return IOggDecoder::AHR_INVALID_HEADER;
+			}
+			break;
+		case VSS_SEEN_BOS:
+			if (strncmp((char*)inCodecHeaderPacket->packetData(), "\003vorbis", 7) == 0) {
+				
+				mSetupState = VSS_SEEN_COMMENT;
+				return IOggDecoder::AHR_MORE_HEADERS_TO_COME;
+			} else {
+				return IOggDecoder::AHR_INVALID_HEADER;
+			}
+			break;
+		case VSS_SEEN_COMMENT:
+			if (strncmp((char*)inCodecHeaderPacket->packetData(), "\005vorbis", 7) == 0) {
+				
+				mSetupState = VSS_ALL_HEADERS_SEEN;
+				return IOggDecoder::AHR_ALL_HEADERS_RECEIVED;
+			} else {
+				return IOggDecoder::AHR_INVALID_HEADER;
+			}
+			break;
+		case VSS_ALL_HEADERS_SEEN:
+		case VSS_ERROR:
+		default:
+			return IOggDecoder::AHR_UNEXPECTED;
+	}
+}
+string VorbisDecodeInputPin::getCodecShortName()
+{
+	return "vorbis";
+}
+string VorbisDecodeInputPin::getCodecIdentString()
+{
+	//TODO:::
+	return "vorbis";
+}
\ No newline at end of file

Modified: branches/oggdsf_new_demux/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/VorbisDecodeInputPin.h
===================================================================
--- branches/oggdsf_new_demux/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/VorbisDecodeInputPin.h	2005-10-23 11:06:59 UTC (rev 10267)
+++ branches/oggdsf_new_demux/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/VorbisDecodeInputPin.h	2005-10-23 11:31:02 UTC (rev 10268)
@@ -34,6 +34,10 @@
 #include <fstream>
 using namespace std;
 #include "vorbisdecoderdllstuff.h"
+
+
+
+#include "IOggDecoder.h"
 #include "AbstractTransformInputPin.h"
 #include "VorbisDecodeInputPin.h"
 
@@ -48,6 +52,7 @@
 
 class VorbisDecodeInputPin 
 	:	public AbstractTransformInputPin
+	,	public IOggDecoder
 {
 public:
 
@@ -65,9 +70,27 @@
 	virtual STDMETHODIMP GetAllocatorRequirements(ALLOCATOR_PROPERTIES *outRequestedProps);
 
 
+	//IOggDecoder Interface
+	virtual LOOG_INT64 convertGranuleToTime(LOOG_INT64 inGranule);
+	virtual IOggDecoder::eAcceptHeaderResult showHeaderPacket(OggPacket* inCodecHeaderPacket);
+	virtual string getCodecShortName();
+	virtual string getCodecIdentString();
+
+
+
 protected:
 	//fstream debugLog;
 
+	enum eVorbisSetupState {
+		VSS_SEEN_NOTHING,
+		VSS_SEEN_BOS,
+		VSS_SEEN_COMMENT,
+		VSS_ALL_HEADERS_SEEN,
+		VSS_ERROR
+	};
+
+	eVorbisSetupState mSetupState;
+
 	static const unsigned long VORBIS_IDENT_HEADER_SIZE = 30;
 	static const unsigned long VORBIS_NUM_BUFFERS = 75;
 	static const unsigned long VORBIS_BUFFER_SIZE = 65536;

Modified: branches/oggdsf_new_demux/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/dsfVorbisDecoder.vcproj
===================================================================
--- branches/oggdsf_new_demux/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/dsfVorbisDecoder.vcproj	2005-10-23 11:06:59 UTC (rev 10267)
+++ branches/oggdsf_new_demux/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/dsfVorbisDecoder.vcproj	2005-10-23 11:31:02 UTC (rev 10268)
@@ -19,7 +19,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories="&quot;C:\DXSDK\Samples\C++\DirectShow\BaseClasses&quot;;C:\DXSDK\Include;..\..\..\..\core\directshow\libDirectshowAbstracts;..\..\..\..\core\ogg;..\..\..\helper\libfishsound\include;..\..\..\..\core\directshow\dsfSeeking;..\..\..\..\helper"
+				AdditionalIncludeDirectories="&quot;C:\DXSDK\Samples\C++\DirectShow\BaseClasses&quot;;C:\DXSDK\Include;..\..\..\..\core\directshow\libDirectshowAbstracts;..\..\..\..\core\ogg;..\..\..\helper\libfishsound\include;..\..\..\..\core\directshow\dsfSeeking;..\..\..\..\helper;..\..\..\..\core\directshow\dsfOggDemux2"
 				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;DSFVORBISDECODER_EXPORTS"
 				MinimalRebuild="TRUE"
 				BasicRuntimeChecks="3"
@@ -80,7 +80,7 @@
 				FavorSizeOrSpeed="1"
 				OmitFramePointers="TRUE"
 				OptimizeForProcessor="3"
-				AdditionalIncludeDirectories="&quot;C:\DXSDK\Samples\C++\DirectShow\BaseClasses&quot;;C:\DXSDK\Include;..\..\..\..\core\directshow\libDirectshowAbstracts;..\..\..\..\core\ogg;..\..\..\helper\libfishsound\include;..\..\..\..\core\directshow\dsfSeeking;..\..\..\..\helper"
+				AdditionalIncludeDirectories="&quot;C:\DXSDK\Samples\C++\DirectShow\BaseClasses&quot;;C:\DXSDK\Include;..\..\..\..\core\directshow\libDirectshowAbstracts;..\..\..\..\core\ogg;..\..\..\helper\libfishsound\include;..\..\..\..\core\directshow\dsfSeeking;..\..\..\..\helper;..\..\..\..\core\directshow\dsfOggDemux2"
 				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;DSFVORBISDECODER_EXPORTS"
 				StringPooling="TRUE"
 				RuntimeLibrary="2"
@@ -143,7 +143,7 @@
 				FavorSizeOrSpeed="1"
 				OmitFramePointers="TRUE"
 				OptimizeForProcessor="3"
-				AdditionalIncludeDirectories="&quot;C:\DXSDK\Samples\C++\DirectShow\BaseClasses&quot;;C:\DXSDK\Include;..\..\..\..\core\directshow\libDirectshowAbstracts;..\..\..\..\core\ogg;..\..\..\helper\libfishsound\include;..\..\..\..\core\directshow\dsfSeeking;..\..\..\..\helper"
+				AdditionalIncludeDirectories="&quot;C:\DXSDK\Samples\C++\DirectShow\BaseClasses&quot;;C:\DXSDK\Include;..\..\..\..\core\directshow\libDirectshowAbstracts;..\..\..\..\core\ogg;..\..\..\helper\libfishsound\include;..\..\..\..\core\directshow\dsfSeeking;..\..\..\..\helper;..\..\..\..\core\directshow\dsfOggDemux2"
 				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;DSFVORBISDECODER_EXPORTS"
 				StringPooling="TRUE"
 				RuntimeLibrary="2"
@@ -207,7 +207,7 @@
 				FavorSizeOrSpeed="1"
 				OmitFramePointers="TRUE"
 				OptimizeForProcessor="3"
-				AdditionalIncludeDirectories="&quot;C:\DXSDK\Samples\C++\DirectShow\BaseClasses&quot;;C:\DXSDK\Include;..\..\..\..\core\directshow\libDirectshowAbstracts;..\..\..\..\core\ogg;..\..\..\helper\libfishsound\include;..\..\..\..\core\directshow\dsfSeeking;..\..\..\..\helper"
+				AdditionalIncludeDirectories="&quot;C:\DXSDK\Samples\C++\DirectShow\BaseClasses&quot;;C:\DXSDK\Include;..\..\..\..\core\directshow\libDirectshowAbstracts;..\..\..\..\core\ogg;..\..\..\helper\libfishsound\include;..\..\..\..\core\directshow\dsfSeeking;..\..\..\..\helper;..\..\..\..\core\directshow\dsfOggDemux2"
 				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;DSFVORBISDECODER_EXPORTS"
 				StringPooling="TRUE"
 				RuntimeLibrary="2"

Modified: branches/oggdsf_new_demux/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/stdafx.h
===================================================================
--- branches/oggdsf_new_demux/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/stdafx.h	2005-10-23 11:06:59 UTC (rev 10267)
+++ branches/oggdsf_new_demux/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/stdafx.h	2005-10-23 11:31:02 UTC (rev 10268)
@@ -40,4 +40,6 @@
 // Windows Header Files:
 #include <windows.h>
 
+#include <libOOOgg/libOOOgg.h>
+
 // TODO: reference additional headers your program requires here

Modified: branches/oggdsf_new_demux/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/vorbisdecoderdllstuff.h
===================================================================
--- branches/oggdsf_new_demux/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/vorbisdecoderdllstuff.h	2005-10-23 11:06:59 UTC (rev 10267)
+++ branches/oggdsf_new_demux/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/vorbisdecoderdllstuff.h	2005-10-23 11:31:02 UTC (rev 10268)
@@ -40,8 +40,18 @@
 #include "VorbisDecodeOutputPin.h"
 #include "VorbisDecodeFilter.h"
 
+
 #include "libilliCore/iLE_Math.h"
+#include "libOOOgg/OggPacket.h"
 
+#ifndef LOOG_INT64
+# ifdef WIN32
+#  define LOOG_INT64 signed __int64
+# else  /* assume POSIX */
+#  define LOOG_INT64 int64_t
+# endif
+#endif
+
 #ifdef LIBOOOGG_EXPORTS
 #define LIBOOOGG_API __declspec(dllexport)
 #else

Modified: branches/oggdsf_new_demux/src/lib/core/directshow/dsfOggDemux2/IOggDecoder.h
===================================================================
--- branches/oggdsf_new_demux/src/lib/core/directshow/dsfOggDemux2/IOggDecoder.h	2005-10-23 11:06:59 UTC (rev 10267)
+++ branches/oggdsf_new_demux/src/lib/core/directshow/dsfOggDemux2/IOggDecoder.h	2005-10-23 11:31:02 UTC (rev 10268)
@@ -1,4 +1,17 @@
 #pragma once
+//
+//#ifndef LOOG_INT64
+//# ifdef WIN32
+//#  define LOOG_INT64 signed __int64
+//# else  /* assume POSIX */
+//#  define LOOG_INT64 int64_t
+//# endif
+//#endif
+//
+
+#include <libOOOgg/libOOOgg.h>
+#include <string>
+using namespace std;
 class IOggDecoder 
 {
 public:



More information about the commits mailing list