[xiph-commits] r10394 - in branches/oggdsf_new_demux:
build/oggcodecs sln/oggdsf_all src/lib/codecs
src/lib/codecs/RawAudio
src/lib/codecs/RawAudio/dsfOggRawAudioInserter
src/lib/core/directshow/dsfOggMux
illiminable at svn.xiph.org
illiminable at svn.xiph.org
Thu Nov 17 03:39:51 PST 2005
Author: illiminable
Date: 2005-11-17 03:39:32 -0800 (Thu, 17 Nov 2005)
New Revision: 10394
Added:
branches/oggdsf_new_demux/src/lib/codecs/RawAudio/
branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioInserter/
branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioInserter/OggRawAudioInserterFilter.cpp
branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioInserter/OggRawAudioInserterFilter.h
branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioInserter/OggRawAudioInserterInputPin.cpp
branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioInserter/OggRawAudioInserterInputPin.h
branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioInserter/OggRawAudioInserterOutputPin.cpp
branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioInserter/OggRawAudioInserterOutputPin.h
branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioInserter/dsfOggRawAudioInserter.vcproj
branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioInserter/oggrawaudioinserter.def
branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioInserter/oggrawaudioinserterdllstuff.cpp
branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioInserter/oggrawaudioinserterdllstuff.h
branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioInserter/stdafx.cpp
branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioInserter/stdafx.h
Modified:
branches/oggdsf_new_demux/build/oggcodecs/oggcodecs.vdproj
branches/oggdsf_new_demux/sln/oggdsf_all/oggdsf_all.sln
branches/oggdsf_new_demux/src/lib/core/directshow/dsfOggMux/OggMuxInputPin.cpp
branches/oggdsf_new_demux/src/lib/core/directshow/dsfOggMux/oggmuxdllstuff.h
Log:
* "Encoder" for the raw audio format informally known as OggPCM2
Modified: branches/oggdsf_new_demux/build/oggcodecs/oggcodecs.vdproj
===================================================================
--- branches/oggdsf_new_demux/build/oggcodecs/oggcodecs.vdproj 2005-11-17 00:54:28 UTC (rev 10393)
+++ branches/oggdsf_new_demux/build/oggcodecs/oggcodecs.vdproj 2005-11-17 11:39:32 UTC (rev 10394)
@@ -130,7 +130,7 @@
"Entry"
{
"MsmKey" = "8:_46A378A9B03E4612A645053EDB884C20"
- "OwnerKey" = "8:_0CADC4E67409461481DE8E39EA059436"
+ "OwnerKey" = "8:_D11B66B126844E2B8ED91008BCC029FA"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
@@ -340,6 +340,12 @@
"Entry"
{
"MsmKey" = "8:_46A378A9B03E4612A645053EDB884C20"
+ "OwnerKey" = "8:_0CADC4E67409461481DE8E39EA059436"
+ "MsmSig" = "8:_UNDEFINED"
+ }
+ "Entry"
+ {
+ "MsmKey" = "8:_46A378A9B03E4612A645053EDB884C20"
"OwnerKey" = "8:_0A1E63E5852E4F759F1A27E8F097727B"
"MsmSig" = "8:_UNDEFINED"
}
@@ -412,7 +418,7 @@
"Entry"
{
"MsmKey" = "8:_655D5383153A6AB10D15352A7EABCC7A"
- "OwnerKey" = "8:_0CADC4E67409461481DE8E39EA059436"
+ "OwnerKey" = "8:_D11B66B126844E2B8ED91008BCC029FA"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
@@ -652,6 +658,12 @@
"Entry"
{
"MsmKey" = "8:_655D5383153A6AB10D15352A7EABCC7A"
+ "OwnerKey" = "8:_0CADC4E67409461481DE8E39EA059436"
+ "MsmSig" = "8:_UNDEFINED"
+ }
+ "Entry"
+ {
+ "MsmKey" = "8:_655D5383153A6AB10D15352A7EABCC7A"
"OwnerKey" = "8:_0A1E63E5852E4F759F1A27E8F097727B"
"MsmSig" = "8:_UNDEFINED"
}
@@ -753,6 +765,12 @@
}
"Entry"
{
+ "MsmKey" = "8:_D11B66B126844E2B8ED91008BCC029FA"
+ "OwnerKey" = "8:_UNDEFINED"
+ "MsmSig" = "8:_UNDEFINED"
+ }
+ "Entry"
+ {
"MsmKey" = "8:_D2048C8B212841C88E42F6ADDCA8B0A2"
"OwnerKey" = "8:_UNDEFINED"
"MsmSig" = "8:_UNDEFINED"
@@ -3881,7 +3899,7 @@
}
"{8062640A-2EEE-46E9-AB67-688E9A886E9F}:_0CADC4E67409461481DE8E39EA059436"
{
- "SourcePath" = "8:..\\..\\src\\lib\\codecs\\ogm\\filters\\dsfogmdecoder\\debug\\dsfOGMDecoder.dll"
+ "SourcePath" = "8:..\\..\\src\\lib\\codecs\\ogm\\filters\\dsfOGMDecoder\\Debug\\dsfOGMDecoder.dll"
"TargetName" = "8:"
"Tag" = "8:"
"Folder" = "8:_371AD289B6DB4693BDF7568485051F1E"
@@ -4747,6 +4765,34 @@
{
}
}
+ "{8062640A-2EEE-46E9-AB67-688E9A886E9F}:_D11B66B126844E2B8ED91008BCC029FA"
+ {
+ "SourcePath" = "8:..\\..\\src\\lib\\codecs\\rawaudio\\dsfoggrawaudioinserter\\debug\\dsfOggRawAudioInserter.dll"
+ "TargetName" = "8:"
+ "Tag" = "8:"
+ "Folder" = "8:_371AD289B6DB4693BDF7568485051F1E"
+ "Condition" = "8:"
+ "Transitive" = "11:FALSE"
+ "Vital" = "11:TRUE"
+ "ReadOnly" = "11:FALSE"
+ "Hidden" = "11:FALSE"
+ "System" = "11:FALSE"
+ "Permanent" = "11:FALSE"
+ "SharedLegacy" = "11:FALSE"
+ "PackageAs" = "3:1"
+ "Register" = "3:1"
+ "Exclude" = "11:FALSE"
+ "IsDependency" = "11:FALSE"
+ "IsolateTo" = "8:"
+ "ProjectOutputGroupRegister" = "3:4"
+ "OutputConfiguration" = "8:"
+ "OutputGroupCanonicalName" = "8:Built"
+ "OutputProjectGuid" = "8:{EEEBA51F-0499-4AD0-A25C-36C3AF2956C9}"
+ "ShowKeyOutput" = "11:TRUE"
+ "ExcludeFilters"
+ {
+ }
+ }
"{8062640A-2EEE-46E9-AB67-688E9A886E9F}:_D2048C8B212841C88E42F6ADDCA8B0A2"
{
"SourcePath" = "8:..\\..\\src\\lib\\core\\directshow\\dsfSubtitleVMR9\\Debug\\dsfSubtitleVMR9.dll"
Modified: branches/oggdsf_new_demux/sln/oggdsf_all/oggdsf_all.sln
===================================================================
--- branches/oggdsf_new_demux/sln/oggdsf_all/oggdsf_all.sln 2005-11-17 00:54:28 UTC (rev 10393)
+++ branches/oggdsf_new_demux/sln/oggdsf_all/oggdsf_all.sln 2005-11-17 11:39:32 UTC (rev 10394)
@@ -1212,6 +1212,13 @@
{2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4} = {2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4}
EndProjectSection
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dsfOggRawAudioInserter", "..\..\src\lib\codecs\RawAudio\dsfOggRawAudioInserter\dsfOggRawAudioInserter.vcproj", "{EEEBA51F-0499-4AD0-A25C-36C3AF2956C9}"
+ ProjectSection(ProjectDependencies) = postProject
+ {4CBC0173-27E6-4218-AE06-5EFDCA7B2547} = {4CBC0173-27E6-4218-AE06-5EFDCA7B2547}
+ {EA7091BB-9906-41DF-9738-F4858A136086} = {EA7091BB-9906-41DF-9738-F4858A136086}
+ {2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4} = {2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4}
+ EndProjectSection
+EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
Debug = Debug
@@ -2801,6 +2808,26 @@
{1C4F9412-B1DE-4E65-96C1-89522EF02997}.Release_SSE.Build.0 = Release|Win32
{1C4F9412-B1DE-4E65-96C1-89522EF02997}.Release_SSE2.ActiveCfg = Release|Win32
{1C4F9412-B1DE-4E65-96C1-89522EF02997}.Release_SSE2.Build.0 = Release|Win32
+ {EEEBA51F-0499-4AD0-A25C-36C3AF2956C9}.Debug.ActiveCfg = Debug|Win32
+ {EEEBA51F-0499-4AD0-A25C-36C3AF2956C9}.Debug.Build.0 = Debug|Win32
+ {EEEBA51F-0499-4AD0-A25C-36C3AF2956C9}.Debug Unicode.ActiveCfg = Debug|Win32
+ {EEEBA51F-0499-4AD0-A25C-36C3AF2956C9}.Debug Unicode.Build.0 = Debug|Win32
+ {EEEBA51F-0499-4AD0-A25C-36C3AF2956C9}.Debug__cdecl.ActiveCfg = Debug|Win32
+ {EEEBA51F-0499-4AD0-A25C-36C3AF2956C9}.Debug__cdecl.Build.0 = Debug|Win32
+ {EEEBA51F-0499-4AD0-A25C-36C3AF2956C9}.MakeFile.ActiveCfg = Release|Win32
+ {EEEBA51F-0499-4AD0-A25C-36C3AF2956C9}.MakeFile.Build.0 = Release|Win32
+ {EEEBA51F-0499-4AD0-A25C-36C3AF2956C9}.Release.ActiveCfg = Release|Win32
+ {EEEBA51F-0499-4AD0-A25C-36C3AF2956C9}.Release.Build.0 = Release|Win32
+ {EEEBA51F-0499-4AD0-A25C-36C3AF2956C9}.Release Unicode.ActiveCfg = Release|Win32
+ {EEEBA51F-0499-4AD0-A25C-36C3AF2956C9}.Release Unicode.Build.0 = Release|Win32
+ {EEEBA51F-0499-4AD0-A25C-36C3AF2956C9}.Release__cdecl.ActiveCfg = Release|Win32
+ {EEEBA51F-0499-4AD0-A25C-36C3AF2956C9}.Release__cdecl.Build.0 = Release|Win32
+ {EEEBA51F-0499-4AD0-A25C-36C3AF2956C9}.Release_NoDotNET.ActiveCfg = Release|Win32
+ {EEEBA51F-0499-4AD0-A25C-36C3AF2956C9}.Release_NoDotNET.Build.0 = Release|Win32
+ {EEEBA51F-0499-4AD0-A25C-36C3AF2956C9}.Release_SSE.ActiveCfg = Release|Win32
+ {EEEBA51F-0499-4AD0-A25C-36C3AF2956C9}.Release_SSE.Build.0 = Release|Win32
+ {EEEBA51F-0499-4AD0-A25C-36C3AF2956C9}.Release_SSE2.ActiveCfg = Release|Win32
+ {EEEBA51F-0499-4AD0-A25C-36C3AF2956C9}.Release_SSE2.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionItems) = postSolution
EndGlobalSection
Added: branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioInserter/OggRawAudioInserterFilter.cpp
===================================================================
--- branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioInserter/OggRawAudioInserterFilter.cpp 2005-11-17 00:54:28 UTC (rev 10393)
+++ branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioInserter/OggRawAudioInserterFilter.cpp 2005-11-17 11:39:32 UTC (rev 10394)
@@ -0,0 +1,106 @@
+//===========================================================================
+//Copyright (C) 2003, 2004, 2005 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "stdafx.h"
+
+
+#include "OggRawAudioInserterFilter.h"
+
+
+//COM Factory Template
+CFactoryTemplate g_Templates[] =
+{
+ {
+ L"Ogg Raw Audio Inserter Filter", // Name
+ &CLSID_OggRawAudioInserterFilter, // CLSID
+ OggRawAudioInserterFilter::CreateInstance, // Method to create an instance of MyComponent
+ NULL, // Initialization function
+ NULL // Set-up information (for filters)
+ }
+
+};
+
+// Generic way of determining the number of items in the template
+int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]);
+
+CUnknown* WINAPI OggRawAudioInserterFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr)
+{
+ //This routine is the COM implementation to create a new Filter
+ OggRawAudioInserterFilter *pNewObject = new OggRawAudioInserterFilter();
+ if (pNewObject == NULL) {
+ *pHr = E_OUTOFMEMORY;
+ }
+ return pNewObject;
+}
+
+OggRawAudioInserterFilter::OggRawAudioInserterFilter(void)
+ : AbstractTransformFilter(NAME("Ogg Raw Audio Inserter"), CLSID_OggRawAudioInserterFilter)
+{
+ bool locWasConstructed = ConstructPins();
+}
+
+OggRawAudioInserterFilter::~OggRawAudioInserterFilter(void)
+{
+}
+
+bool OggRawAudioInserterFilter::ConstructPins()
+{
+ //Inputs Audio / PCM / WaveFormatEx
+ //Outputs Audio / Speex / Speex
+
+ //Vector to hold our set of media types we want to accept.
+ vector<CMediaType*> locAcceptableTypes;
+
+ //Setup the media types for the output pin.
+ CMediaType* locAcceptMediaType = new CMediaType(&MEDIATYPE_Audio); //Deleted in pin destructor
+ locAcceptMediaType->subtype = MEDIASUBTYPE_RawOggAudio;
+ locAcceptMediaType->formattype = FORMAT_RawOggAudio;
+
+ locAcceptableTypes.push_back(locAcceptMediaType);
+
+ //Output pin must be done first because it's passed to the input pin.
+ mOutputPin = new OggRawAudioInserterOutputPin(this, m_pLock, locAcceptableTypes); //Deleted in base class destructor
+
+ //Clear out the vector, now we've already passed it to the output pin.
+ locAcceptableTypes.clear();
+
+ //Setup the media Types for the input pin.
+ locAcceptMediaType = NULL;
+ locAcceptMediaType = new CMediaType(&MEDIATYPE_Audio); //Deleted by pin
+
+ locAcceptMediaType->subtype = MEDIASUBTYPE_PCM;
+ locAcceptMediaType->formattype = FORMAT_WaveFormatEx;
+
+ locAcceptableTypes.push_back(locAcceptMediaType);
+
+ mInputPin = new OggRawAudioInserterInputPin(this, m_pLock, mOutputPin, locAcceptableTypes); //Deleted in base class filter destructor.
+ return true;
+}
\ No newline at end of file
Added: branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioInserter/OggRawAudioInserterFilter.h
===================================================================
--- branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioInserter/OggRawAudioInserterFilter.h 2005-11-17 00:54:28 UTC (rev 10393)
+++ branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioInserter/OggRawAudioInserterFilter.h 2005-11-17 11:39:32 UTC (rev 10394)
@@ -0,0 +1,69 @@
+//===========================================================================
+//Copyright (C) 2003, 2004, 2005 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+
+//Local Includes
+#include "oggrawaudioinserterdllstuff.h"
+
+//External Includes
+#include "AbstractTransformFilter.h"
+
+//Forward Declarations
+struct sOggRawAudioFormatBlock;
+class OggRawAudioInserterInputPin;
+class OggRawAudioInserterOutputPin;
+
+class OggRawAudioInserterFilter
+ //Base Classes
+ : public AbstractTransformFilter
+{
+public:
+ //Friend Classes
+ friend class OggRawAudioInserterOutputPin;
+ friend class OggRawAudioInserterInputPin;
+
+ //Constructors
+ OggRawAudioInserterFilter(void);
+ virtual ~OggRawAudioInserterFilter(void);
+
+ //COM Creator function
+ static CUnknown* WINAPI OggRawAudioInserterFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr);
+
+
+protected:
+ //Implementation of pure virtual from AbstractTransformFilter.
+ virtual bool ConstructPins();
+
+ //Member data
+ sOggRawAudioFormatBlock mOggRawAudioFormatBlock;
+
+};
Added: branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioInserter/OggRawAudioInserterInputPin.cpp
===================================================================
--- branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioInserter/OggRawAudioInserterInputPin.cpp 2005-11-17 00:54:28 UTC (rev 10393)
+++ branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioInserter/OggRawAudioInserterInputPin.cpp 2005-11-17 11:39:32 UTC (rev 10394)
@@ -0,0 +1,370 @@
+//===========================================================================
+//Copyright (C) 2003, 2004, 2005 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "stdafx.h"
+#include "OggRawAudioInserterInputPin.h"
+
+OggRawAudioInserterInputPin::OggRawAudioInserterInputPin(AbstractTransformFilter* inParentFilter, CCritSec* inFilterLock, AbstractTransformOutputPin* inOutputPin, vector<CMediaType*> inAcceptableMediaTypes)
+ : AbstractTransformInputPin(inParentFilter, inFilterLock, inOutputPin, NAME("OggRawAudioInserterInputPin"), L"PCM In", inAcceptableMediaTypes)
+ //, mWaveFormat(NULL)
+ , mUptoFrame(0)
+ , mNumBufferedBytes(0)
+ , mWorkingBuffer(NULL)
+ , mFrameByteWidth(0)
+ , mFramesPerPacket(0)
+ , mBytesPerPacket(0)
+ , mSentHeaders(false)
+{
+ //debugLog.open("C:\\temp\\speexenc.log", ios_base::out);
+ mWorkingBuffer = new unsigned char[WORKING_BUFFER_SIZE];
+}
+
+OggRawAudioInserterInputPin::~OggRawAudioInserterInputPin(void)
+{
+ //debugLog.close();
+ DestroyCodec();
+
+ delete[] mWorkingBuffer;
+}
+
+
+unsigned long OggRawAudioInserterInputPin::identifyFormat()
+{
+ switch(((OggRawAudioInserterFilter*)mParentFilter)->mOggRawAudioFormatBlock.bitsPerSample) {
+ case 8:
+ return FMT_U8;
+ case 16:
+ return FMT_S16_LE;
+ default:
+ return 0xffffffff;
+ }
+}
+bool OggRawAudioInserterInputPin::makeMainHeader(unsigned char** outBuff, unsigned long* outHeaderSize)
+{
+ const unsigned long MAIN_HEADER_SIZE = 28;
+ unsigned char* retBuff = new unsigned char[MAIN_HEADER_SIZE];
+
+ //ID
+ memcpy((void*)retBuff, "PCM ", 8);
+ //Versions
+ retBuff[8] = 0;
+ retBuff[9] = 0;
+ retBuff[10] = 0;
+ retBuff[11] = 0;
+
+ //Format
+ unsigned long locFormat = identifyFormat();
+ iBE_Math::ULongToCharArr(locFormat, &retBuff[12]);
+
+ //Sample Rate
+ iBE_Math::ULongToCharArr(((OggRawAudioInserterFilter*)mParentFilter)->mOggRawAudioFormatBlock.samplesPerSec, &retBuff[16]);
+
+ //Sig bits
+ retBuff[20] = ((OggRawAudioInserterFilter*)mParentFilter)->mOggRawAudioFormatBlock.bitsPerSample;
+
+ //Num Channels
+ retBuff[21] = ((OggRawAudioInserterFilter*)mParentFilter)->mOggRawAudioFormatBlock.numChannels;
+
+ //Frames per packet (fixed to 1024 = 0x0400)
+ retBuff[22] = (mFramesPerPacket & 0xff00) >> 8;
+ retBuff[23] = (mFramesPerPacket & 0xff);
+
+ //Extra Headers
+ retBuff[24] = 0;
+ retBuff[25] = 0;
+ retBuff[26] = 0;
+ retBuff[27] = 0;
+
+ *outBuff = retBuff;
+ *outHeaderSize = MAIN_HEADER_SIZE;
+
+ return true;
+
+}
+bool OggRawAudioInserterInputPin::makeCommentHeader(unsigned char** outBuff, unsigned long* outHeaderSize)
+{
+ char* locVendor = "oggcodecs testbuild";
+ unsigned long locVendorLength = strlen(locVendor);
+ unsigned long locPacketLength = locVendorLength + 4 + 4 + 1;
+
+ unsigned char* retBuff = new unsigned char[locPacketLength];
+ iLE_Math::ULongToCharArr(locVendorLength, retBuff);
+
+ memcpy((void*)(&retBuff[4]), (const void*)locVendor, locVendorLength);
+
+ //No user comments
+ iLE_Math::ULongToCharArr(0, &retBuff[locVendorLength + 4]);
+
+ //Framing bit
+ retBuff[locVendorLength+8] = 1;
+
+ *outBuff = retBuff;
+ *outHeaderSize = locPacketLength;
+
+ return true;
+
+
+}
+//PURE VIRTUALS
+HRESULT OggRawAudioInserterInputPin::TransformData(unsigned char* inBuf, long inNumBytes)
+{
+
+ if (!mSentHeaders) {
+ mFramesPerPacket = 1024;
+
+ unsigned char* locHeader = NULL;
+ unsigned long locHeaderLength = 0;
+ mFrameByteWidth = (((OggRawAudioInserterFilter*)mParentFilter)->mOggRawAudioFormatBlock.numChannels * ((OggRawAudioInserterFilter*)mParentFilter)->mOggRawAudioFormatBlock.bitsPerSample) >> 3;
+ mBytesPerPacket = mFramesPerPacket * mFrameByteWidth;
+
+ makeMainHeader(&locHeader, &locHeaderLength);
+
+ sendPacket(locHeader, locHeaderLength, true);
+
+ delete[] locHeader;
+ locHeader = NULL;
+ locHeaderLength = 0;
+
+ makeCommentHeader(&locHeader, &locHeaderLength);
+
+ sendPacket(locHeader, locHeaderLength, true);
+ delete[] locHeader;
+
+ mSentHeaders = true;
+ }
+
+ //assert(inNumBytes < (WORKING_BUFFER_SIZE - mNumBufferedBytes));
+ memcpy((void*)&mWorkingBuffer[mNumBufferedBytes], (const void*)inBuf, inNumBytes);
+ mNumBufferedBytes+=inNumBytes;
+
+ //How many full buffers full
+ unsigned long locBuffersWorth = mNumBufferedBytes / mBytesPerPacket;
+
+ for (int i = 0; i < locBuffersWorth; i++) {
+ sendPacket(&mWorkingBuffer[i*mBytesPerPacket], mBytesPerPacket, false);
+ }
+
+ unsigned long locLeftovers = mNumBufferedBytes % mBytesPerPacket;
+
+ //assert((locLeftovers % mFrameByteWidth) == 0);
+
+ //TODO::: This can be improved. For now it's easier to always clear out the buffer.
+ // Though overall it would be better to wait for the next lot of input, though then
+ // we have to worry about ending of stream and the data getting left here, etc.
+ sendPacket(&mWorkingBuffer[locBuffersWorth*mBytesPerPacket], locLeftovers, false);
+
+
+ mNumBufferedBytes = 0;
+
+ return S_OK;
+}
+
+HRESULT OggRawAudioInserterInputPin::sendPacket(unsigned char* inPacketData, unsigned long inNumBytes, bool inIsHeader)
+{
+ if (inIsHeader) {
+ mUptoFrame = 0;
+
+ }
+ IMediaSample* locSample;
+ REFERENCE_TIME locFrameStart = 0;
+ REFERENCE_TIME locFrameEnd = 0;
+ HRESULT locHR = mOutputPin->GetDeliveryBuffer(&locSample, &locFrameStart, &locFrameEnd, NULL);
+
+ if (FAILED(locHR)) {
+ return locHR;
+ }
+
+ BYTE* locBuffer = NULL;
+
+ //Make our pointers set to point to the samples buffer
+ locSample->GetPointer(&locBuffer);
+
+
+ if (locSample->GetSize() >= inNumBytes) {
+
+ memcpy((void*)locBuffer, (const void*)inPacketData, inNumBytes);
+ locSample->SetActualDataLength(inNumBytes);
+
+ if (!inIsHeader) {
+ //locFrameStart = (mUptoFrame * UNITS) / ((OggRawAudioInserterFilter*)mParentFilter)->mOggRawAudioFormatBlock.samplesPerSec;
+ locFrameStart = mUptoFrame;
+ mUptoFrame += (inNumBytes / mFrameByteWidth);
+
+ locFrameEnd = mUptoFrame;
+ //locFrameEnd = (mUptoFrame * UNITS) / ((OggRawAudioInserterFilter*)mParentFilter)->mOggRawAudioFormatBlock.samplesPerSec;
+ } else {
+ locFrameStart = 0;
+ locFrameEnd = 0;
+
+ }
+ locSample->SetMediaTime(&locFrameStart, &locFrameEnd);
+ locSample->SetTime(&locFrameStart, &locFrameEnd);
+
+ locSample->SetSyncPoint(TRUE);
+
+
+ {
+ CAutoLock locLock(m_pLock);
+
+ //TODO::: Need to propagate error states.
+ HRESULT locHR = ((OggRawAudioInserterOutputPin*)(mOutputPin))->mDataQueue->Receive(locSample); //->DownstreamFilter()->Receive(locSample);
+ if (locHR != S_OK) {
+ return locHR;
+ } else {
+ //locThis->debugLog<<"Sample Delivered"<<endl;
+ return S_OK;
+ }
+ }
+ } else {
+ throw 0;
+ }
+
+}
+bool OggRawAudioInserterInputPin::ConstructCodec() {
+ //mFishInfo.channels = mWaveFormat->nChannels;
+ //mFishInfo.format = FISH_SOUND_SPEEX;
+ //mFishInfo.samplerate = mWaveFormat->nSamplesPerSec;
+
+ ////Change to fill in vorbis format block so muxer can work
+ //((SpeexEncodeFilter*)mParentFilter)->mSpeexFormatBlock.numChannels = mWaveFormat->nChannels;
+ //((SpeexEncodeFilter*)mParentFilter)->mSpeexFormatBlock.samplesPerSec = mWaveFormat->nSamplesPerSec;
+ //
+ ////
+ //
+ //mFishSound = fish_sound_new (FISH_SOUND_ENCODE, &mFishInfo);
+
+ //int i = 1;
+ ////FIX::: Use new API for interleave setting
+ //fish_sound_command(mFishSound, FISH_SOUND_SET_INTERLEAVE, &i, sizeof(int));
+
+ //fish_sound_set_encoded_callback (mFishSound, SpeexEncodeInputPin::SpeexEncoded, this);
+ //FIX::: Proper return value
+ return true;
+
+}
+void OggRawAudioInserterInputPin::DestroyCodec() {
+ //fish_sound_delete(mFishSound);
+ //mFishSound = NULL;
+}
+
+
+//Encoded callback
+//int OggRawAudioInserterInputPin::SpeexEncoded (FishSound* inFishSound, unsigned char* inPacketData, long inNumBytes, void* inThisPointer)
+//{
+//
+//
+// SpeexEncodeInputPin* locThis = reinterpret_cast<SpeexEncodeInputPin*> (inThisPointer);
+// SpeexEncodeFilter* locFilter = reinterpret_cast<SpeexEncodeFilter*>(locThis->m_pFilter);
+// //locThis->debugLog << "SpeexEncoded called with "<<inNumBytes<< " byte of data"<<endl;
+//
+// //Time stamps are granule pos not directshow times
+// LONGLONG locFrameStart = locThis->mUptoFrame;
+// LONGLONG locFrameEnd = locThis->mUptoFrame
+// = fish_sound_get_frameno(locThis->mFishSound);
+//
+//
+// //locThis->debugLog << "Stamping packet "<<locFrameStart<< " to "<<locFrameEnd<<endl;
+// //Get a pointer to a new sample stamped with our time
+// IMediaSample* locSample;
+// HRESULT locHR = locThis->mOutputPin->GetDeliveryBuffer(&locSample, &locFrameStart, &locFrameEnd, NULL);
+//
+// if (FAILED(locHR)) {
+// //We get here when the application goes into stop mode usually.
+// //locThis->debugLog<<"Getting buffer failed"<<endl;
+// return locHR;
+// }
+//
+// BYTE* locBuffer = NULL;
+//
+//
+// //Make our pointers set to point to the samples buffer
+// locSample->GetPointer(&locBuffer);
+//
+//
+//
+// if (locSample->GetSize() >= inNumBytes) {
+//
+// memcpy((void*)locBuffer, (const void*)inPacketData, inNumBytes);
+//
+// //Set the sample parameters.
+// locThis->SetSampleParams(locSample, inNumBytes, &locFrameStart, &locFrameEnd);
+//
+// {
+// CAutoLock locLock(locThis->m_pLock);
+//
+// //Add a reference so it isn't deleted en route.
+// //locSample->AddRef();
+// //NO - It alrady has a ref on it.
+//
+// //TODO::: Need to propagate error states.
+// HRESULT locHR = ((SpeexEncodeOutputPin*)(locThis->mOutputPin))->mDataQueue->Receive(locSample); //->DownstreamFilter()->Receive(locSample);
+// if (locHR != S_OK) {
+// //locThis->debugLog<<"Sample rejected"<<endl;
+// } else {
+// //locThis->debugLog<<"Sample Delivered"<<endl;
+// }
+// }
+//
+// return 0;
+// } else {
+// throw 0;
+// }
+//}
+
+
+HRESULT OggRawAudioInserterInputPin::SetMediaType(const CMediaType* inMediaType)
+{
+
+ if ( (inMediaType->subtype == MEDIASUBTYPE_PCM) &&
+ (inMediaType->formattype == FORMAT_WaveFormatEx)) {
+
+ WAVEFORMATEX* locWaveFormat = (WAVEFORMATEX*)inMediaType->pbFormat;
+ //TODO::: This needs to change with channel conversion/mapping headers
+ ((OggRawAudioInserterFilter*)mParentFilter)->mOggRawAudioFormatBlock.numHeaders = 2;
+ ((OggRawAudioInserterFilter*)mParentFilter)->mOggRawAudioFormatBlock.samplesPerSec = locWaveFormat->nSamplesPerSec;
+ ((OggRawAudioInserterFilter*)mParentFilter)->mOggRawAudioFormatBlock.numChannels = locWaveFormat->nChannels;
+ ((OggRawAudioInserterFilter*)mParentFilter)->mOggRawAudioFormatBlock.bitsPerSample = locWaveFormat->wBitsPerSample;
+
+
+ } else {
+ //Failed... should never be here !
+ throw 0;
+ }
+ //This is here and not the constructor because we need audio params from the
+ // input pin to construct properly.
+
+ ConstructCodec();
+
+ return CBaseInputPin::SetMediaType(inMediaType);
+
+
+
+}
\ No newline at end of file
Added: branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioInserter/OggRawAudioInserterInputPin.h
===================================================================
--- branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioInserter/OggRawAudioInserterInputPin.h 2005-11-17 00:54:28 UTC (rev 10393)
+++ branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioInserter/OggRawAudioInserterInputPin.h 2005-11-17 11:39:32 UTC (rev 10394)
@@ -0,0 +1,108 @@
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+
+
+#include "AbstractTransformInputPin.h"
+#include "OggRawAudioInserterInputPin.h"
+
+#include "OggRawAudioInserterFilter.h"
+
+#include <libilliCore/iBE_Math.h>
+#include <libilliCore/iLE_Math.h>
+
+
+
+//#include <fstream>
+//using namespace std;
+class OggRawAudioInserterInputPin
+ : public AbstractTransformInputPin
+{
+public:
+ OggRawAudioInserterInputPin(AbstractTransformFilter* inFilter, CCritSec* inFilterLock, AbstractTransformOutputPin* inOutputPin, vector<CMediaType*> inAcceptableMediaTypes);
+ virtual ~OggRawAudioInserterInputPin(void);
+
+ //static int __cdecl OggRawAudioInserterInputPin::SpeexEncoded (FishSound* inFishSound, unsigned char* inPacketData, long inNumBytes, void* inThisPointer) ;
+
+ virtual HRESULT SetMediaType(const CMediaType* inMediaType);
+
+protected:
+
+ static const unsigned long WORKING_BUFFER_SIZE = 1 <<20; //1meg buffer
+ unsigned long identifyFormat();
+ bool makeMainHeader(unsigned char** outBuff, unsigned long* outHeaderSize);
+ bool makeCommentHeader(unsigned char** outBuff, unsigned long* outHeaderSize);
+ HRESULT sendPacket(unsigned char* inPacketData, unsigned long inNumBytes, bool inIsHeader);
+
+
+ HRESULT mHR;
+//PURE VIRTUALS
+ virtual HRESULT TransformData(unsigned char* inBuf, long inNumBytes);
+ virtual bool ConstructCodec();
+ virtual void DestroyCodec();
+
+
+ //WAVEFORMATEX* mWaveFormat;
+ __int64 mUptoFrame;
+
+ enum eRawAudioFormat {
+ FMT_S8,
+ FMT_U8,
+ FMT_S16_LE,
+ FMT_S16_BE,
+ FMT_S24_LE,
+ FMT_S24_BE,
+ FMT_S32_LE,
+ FMT_S32_BE,
+
+ FMT_ULAW = 0x10,
+ FMT_ALAW,
+
+ FMT_FLT32_LE = 0x20,
+ FMT_FLT32_BE,
+ FMT_FLT64_LE,
+ FMT_FLT64_BE,
+
+
+ };
+
+ unsigned long mNumBufferedBytes;
+ unsigned long mFrameByteWidth;
+ unsigned char* mWorkingBuffer;
+
+ unsigned long mFramesPerPacket;
+ unsigned long mBytesPerPacket;
+
+ bool mSentHeaders;
+
+
+};
Added: branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioInserter/OggRawAudioInserterOutputPin.cpp
===================================================================
--- branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioInserter/OggRawAudioInserterOutputPin.cpp 2005-11-17 00:54:28 UTC (rev 10393)
+++ branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioInserter/OggRawAudioInserterOutputPin.cpp 2005-11-17 11:39:32 UTC (rev 10394)
@@ -0,0 +1,55 @@
+//===========================================================================
+//Copyright (C) 2003, 2004, 2005 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "stdafx.h"
+#include "OggRawAudioInserterOutputPin.h"
+
+OggRawAudioInserterOutputPin::OggRawAudioInserterOutputPin(OggRawAudioInserterFilter* inParentFilter,CCritSec* inFilterLock, vector<CMediaType*> inAcceptableMediaTypes)
+ : AbstractTransformOutputPin(inParentFilter, inFilterLock,NAME("OggRawAudioInserterOutputPin"), L"Ogg Raw Audio Out", 65536, 5, inAcceptableMediaTypes)
+{
+}
+
+OggRawAudioInserterOutputPin::~OggRawAudioInserterOutputPin(void)
+{
+}
+
+HRESULT OggRawAudioInserterOutputPin::CreateAndFillFormatBuffer(CMediaType* outMediaType, int inPosition)
+{
+ if (inPosition == 0) {
+ sOggRawAudioFormatBlock* locOggRawAudioFormat = (sOggRawAudioFormatBlock*)outMediaType->AllocFormatBuffer(sizeof(sOggRawAudioFormatBlock));
+ //TODO::: Check for null ?
+
+ memcpy((void*)locOggRawAudioFormat, (const void*) &(((OggRawAudioInserterFilter*)mParentFilter)->mOggRawAudioFormatBlock), sizeof(sOggRawAudioFormatBlock));
+ return S_OK;
+ } else {
+ return S_FALSE;
+ }
+}
Added: branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioInserter/OggRawAudioInserterOutputPin.h
===================================================================
--- branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioInserter/OggRawAudioInserterOutputPin.h 2005-11-17 00:54:28 UTC (rev 10393)
+++ branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioInserter/OggRawAudioInserterOutputPin.h 2005-11-17 11:39:32 UTC (rev 10394)
@@ -0,0 +1,58 @@
+//===========================================================================
+//Copyright (C) 2003, 2004, 2005 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+
+//Local Includes
+#include "oggrawaudioinserterdllstuff.h"
+
+//External Includes
+#include "AbstractTransformOutputPin.h"
+
+//Forward Declarations
+class OggRawAudioInserterFilter;
+struct sOggRawAudioFormatBlock;
+
+class OggRawAudioInserterOutputPin
+ //Base Classes
+ : public AbstractTransformOutputPin
+{
+public:
+ //Friend Classes
+ friend class OggRawAudioInserterInputPin;
+
+ //Constructors
+ OggRawAudioInserterOutputPin(OggRawAudioInserterFilter* inParentFilter, CCritSec* inFilterLock, vector<CMediaType*> inAcceptableMediaTypes);
+ virtual ~OggRawAudioInserterOutputPin(void);
+
+protected:
+ virtual HRESULT CreateAndFillFormatBuffer(CMediaType* outMediaType, int inPosition);
+};
Added: branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioInserter/dsfOggRawAudioInserter.vcproj
===================================================================
--- branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioInserter/dsfOggRawAudioInserter.vcproj 2005-11-17 00:54:28 UTC (rev 10393)
+++ branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioInserter/dsfOggRawAudioInserter.vcproj 2005-11-17 11:39:32 UTC (rev 10394)
@@ -0,0 +1,174 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="dsfOggRawAudioInserter"
+ ProjectGUID="{EEEBA51F-0499-4AD0-A25C-36C3AF2956C9}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="Debug"
+ IntermediateDirectory="Debug"
+ ConfigurationType="2"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""C:\DXSDK\Samples\C++\DirectShow\BaseClasses";C:\DXSDK\Include;..\..\..\core\directshow\libDirectshowAbstracts;..\..\..\core\ogg;..\..\..\helper"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;DSFOGGRAWAUDIOINSERTER_EXPORTS"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="4"
+ CallingConvention="2"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="Strmbasd.lib Msvcrtd.lib Winmm.lib Strmiids.lib Quartz.lib"
+ OutputFile="$(OutDir)/dsfOggRawAudioInserter.dll"
+ LinkIncremental="2"
+ AdditionalLibraryDirectories=""C:\DXSDK\Samples\C++\DirectShow\BaseClasses\Debug""
+ ModuleDefinitionFile="oggrawaudioinserter.def"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/dsfOggRawAudioInserter.pdb"
+ SubSystem="2"
+ ImportLibrary="$(OutDir)/dsfOggRawAudioInserter.lib"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="Release"
+ IntermediateDirectory="Release"
+ ConfigurationType="2"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""C:\DXSDK\Samples\C++\DirectShow\BaseClasses";C:\DXSDK\Include;..\..\..\core\directshow\libDirectshowAbstracts;..\..\..\core\ogg;..\..\..\helper"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;DSFOGGRAWAUDIOINSERTER_EXPORTS"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"
+ CallingConvention="2"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="Strmbase.lib Winmm.lib Strmiids.lib Quartz.lib"
+ OutputFile="$(OutDir)/dsfOggRawAudioInserter.dll"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories=""C:\DXSDK\Samples\C++\DirectShow\BaseClasses\Release""
+ ModuleDefinitionFile="oggrawaudioinserter.def"
+ GenerateDebugInformation="TRUE"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ ImportLibrary="$(OutDir)/dsfOggRawAudioInserter.lib"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+ <File
+ RelativePath=".\oggrawaudioinserter.def">
+ </File>
+ <File
+ RelativePath=".\oggrawaudioinserterdllstuff.cpp">
+ </File>
+ <File
+ RelativePath=".\OggRawAudioInserterFilter.cpp">
+ </File>
+ <File
+ RelativePath=".\OggRawAudioInserterInputPin.cpp">
+ </File>
+ <File
+ RelativePath=".\OggRawAudioInserterOutputPin.cpp">
+ </File>
+ <File
+ RelativePath=".\stdafx.cpp">
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+ <File
+ RelativePath=".\oggrawaudioinserterdllstuff.h">
+ </File>
+ <File
+ RelativePath=".\OggRawAudioInserterFilter.h">
+ </File>
+ <File
+ RelativePath=".\OggRawAudioInserterInputPin.h">
+ </File>
+ <File
+ RelativePath=".\OggRawAudioInserterOutputPin.h">
+ </File>
+ <File
+ RelativePath=".\stdafx.h">
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
Added: branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioInserter/oggrawaudioinserter.def
===================================================================
--- branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioInserter/oggrawaudioinserter.def 2005-11-17 00:54:28 UTC (rev 10393)
+++ branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioInserter/oggrawaudioinserter.def 2005-11-17 11:39:32 UTC (rev 10394)
@@ -0,0 +1,7 @@
+LIBRARY dsfOggRawAudioInserter
+EXPORTS
+ DllMain PRIVATE
+ DllGetClassObject PRIVATE
+ DllCanUnloadNow PRIVATE
+ DllRegisterServer PRIVATE
+ DllUnregisterServer PRIVATE
\ No newline at end of file
Added: branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioInserter/oggrawaudioinserterdllstuff.cpp
===================================================================
--- branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioInserter/oggrawaudioinserterdllstuff.cpp 2005-11-17 00:54:28 UTC (rev 10393)
+++ branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioInserter/oggrawaudioinserterdllstuff.cpp 2005-11-17 11:39:32 UTC (rev 10394)
@@ -0,0 +1,98 @@
+//===========================================================================
+//Copyright (C) 2003, 2004, 2005 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "stdafx.h"
+#include "oggrawaudioinserterdllstuff.h"
+
+extern "C" BOOL WINAPI DllEntryPoint(HINSTANCE, ULONG, LPVOID);
+BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
+{
+ return DllEntryPoint((HINSTANCE)(hModule), dwReason, lpReserved);
+}
+
+
+//The folowing two functions do the registration and deregistration of the dll and it's contained com objects.
+STDAPI DllRegisterServer()
+{
+
+ HRESULT hr;
+ IFilterMapper2* locFilterMapper = NULL;
+
+ hr = AMovieDllRegisterServer2(TRUE);
+
+
+
+
+ hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER, IID_IFilterMapper2, (void **)&locFilterMapper);
+
+
+ hr = locFilterMapper->RegisterFilter(
+ CLSID_OggRawAudioInserterFilter, // Filter CLSID.
+ L"Ogg Raw Audio Inserter Filter", // Filter name.
+ NULL, // Device moniker.
+ &CLSID_LegacyAmFilterCategory, // Direct Show general category
+ L"Ogg Raw Audio Inserter Filter", // Instance data. ???????
+ &OggRawAudioInserterFilterReg // Pointer to filter information.
+ );
+
+ locFilterMapper->Release();
+
+ return hr;
+
+}
+
+STDAPI DllUnregisterServer()
+{
+ HRESULT hr;
+ IFilterMapper2* locFilterMapper = NULL;
+
+ hr = AMovieDllRegisterServer2(FALSE);
+ if (FAILED(hr)) {
+
+ return hr;
+ }
+
+ hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER,
+ IID_IFilterMapper2, (void **)&locFilterMapper);
+
+ if (FAILED(hr)) {
+ return hr;
+ }
+
+
+ hr = locFilterMapper->UnregisterFilter(&CLSID_LegacyAmFilterCategory, L"Ogg Raw Audio Inserter Filter", CLSID_OggRawAudioInserterFilter);
+
+
+ //
+ locFilterMapper->Release();
+ return hr;
+
+}
Added: branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioInserter/oggrawaudioinserterdllstuff.h
===================================================================
--- branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioInserter/oggrawaudioinserterdllstuff.h 2005-11-17 00:54:28 UTC (rev 10393)
+++ branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioInserter/oggrawaudioinserterdllstuff.h 2005-11-17 11:39:32 UTC (rev 10394)
@@ -0,0 +1,128 @@
+//===========================================================================
+//Copyright (C) 2003, 2004, 2005 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+
+struct sOggRawAudioFormatBlock {
+ unsigned long samplesPerSec;
+ unsigned long numHeaders;
+ unsigned long numChannels;
+ unsigned long bitsPerSample;
+
+
+};
+#include "AbstractTransformFilter.h"
+#include "AbstractTransformInputPin.h"
+#include "AbstractTransformOutputPin.h"
+#include "OggRawAudioInserterInputPin.h"
+#include "OggRawAudioInserterOutputPin.h"
+#include "OggRawAudioInserterFilter.h"
+
+#ifdef LIBOOOGG_EXPORTS
+#define LIBOOOGG_API __declspec(dllexport)
+#else
+#define LIBOOOGG_API __declspec(dllimport)
+#endif
+
+
+// {4002BC5C-C36D-4a00-B4FD-C4E506F983C0}
+DEFINE_GUID(CLSID_OggRawAudioInserterFilter,
+0x4002bc5c, 0xc36d, 0x4a00, 0xb4, 0xfd, 0xc4, 0xe5, 0x6, 0xf9, 0x83, 0xc0);
+
+// {37535B3C-F068-4f93-9763-E7208277D71F}
+DEFINE_GUID(MEDIASUBTYPE_RawOggAudio,
+0x37535b3c, 0xf068, 0x4f93, 0x97, 0x63, 0xe7, 0x20, 0x82, 0x77, 0xd7, 0x1f);
+
+// {232D3C8F-16BF-404b-99AE-296F3DBB77EE}
+DEFINE_GUID(FORMAT_RawOggAudio,
+0x232d3c8f, 0x16bf, 0x404b, 0x99, 0xae, 0x29, 0x6f, 0x3d, 0xbb, 0x77, 0xee);
+
+//// {7036C2FE-A209-464c-97AB-95B9260EDBF7}
+//DEFINE_GUID(CLSID_SpeexEncodeFilter,
+//0x7036c2fe, 0xa209, 0x464c, 0x97, 0xab, 0x95, 0xb9, 0x26, 0xe, 0xdb, 0xf7);
+//
+//// {25A9729D-12F6-420e-BD53-1D631DC217DF}
+//DEFINE_GUID(MEDIASUBTYPE_Speex,
+//0x25a9729d, 0x12f6, 0x420e, 0xbd, 0x53, 0x1d, 0x63, 0x1d, 0xc2, 0x17, 0xdf);
+//
+//// {78701A27-EFB5-4157-9553-38A7854E3E81}
+//DEFINE_GUID(FORMAT_Speex,
+//0x78701a27, 0xefb5, 0x4157, 0x95, 0x53, 0x38, 0xa7, 0x85, 0x4e, 0x3e, 0x81);
+////This structure defines the type of input we accept on the input pin... Stream/Annodex
+
+const REGPINTYPES OggRawAudioInserterInputTypes = {
+ &MEDIATYPE_Audio,
+ &MEDIASUBTYPE_PCM
+};
+
+const REGPINTYPES OggRawAudioInserterOutputTypes = {
+ &MEDIATYPE_Audio,
+ &MEDIASUBTYPE_RawOggAudio
+};
+
+const REGFILTERPINS OggRawAudioInserterPinReg[] = {
+ {
+ L"PCM Input", //Name (obsoleted)
+ FALSE, //Renders from this pin ?? Not sure about this.
+ FALSE, //Not an output pin
+ FALSE, //Cannot have zero instances of this pin
+ FALSE, //Cannot have more than one instance of this pin
+ NULL, //Connects to filter (obsoleted)
+ NULL, //Connects to pin (obsoleted)
+ 1, //upport two media type
+ &OggRawAudioInserterInputTypes //Pointer to media type (Audio/Speex or Audio/Speex)
+ } ,
+
+ {
+ L"Ogg Raw Audio Output", //Name (obsoleted)
+ FALSE, //Renders from this pin ?? Not sure about this.
+ TRUE, //Is an output pin
+ FALSE, //Cannot have zero instances of this pin
+ FALSE, //Cannot have more than one instance of this pin
+ NULL, //Connects to filter (obsoleted)
+ NULL, //Connects to pin (obsoleted)
+ 1, //Only support one media type
+ &OggRawAudioInserterOutputTypes //Pointer to media type (Audio/PCM)
+
+ }
+};
+
+
+
+const REGFILTER2 OggRawAudioInserterFilterReg = {
+ 1,
+ MERIT_DO_NOT_USE,
+ 2,
+ OggRawAudioInserterPinReg
+
+};
+
+
Added: branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioInserter/stdafx.cpp
===================================================================
--- branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioInserter/stdafx.cpp 2005-11-17 00:54:28 UTC (rev 10393)
+++ branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioInserter/stdafx.cpp 2005-11-17 11:39:32 UTC (rev 10394)
@@ -0,0 +1,39 @@
+//===========================================================================
+//Copyright (C) 2003, 2004, 2005 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// stdafx.cpp : source file that includes just the standard includes
+
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
\ No newline at end of file
Added: branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioInserter/stdafx.h
===================================================================
--- branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioInserter/stdafx.h 2005-11-17 00:54:28 UTC (rev 10393)
+++ branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioInserter/stdafx.h 2005-11-17 11:39:32 UTC (rev 10394)
@@ -0,0 +1,12 @@
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+// Windows Header Files:
+#include <windows.h>
+
+// TODO: reference additional headers your program requires here
Modified: branches/oggdsf_new_demux/src/lib/core/directshow/dsfOggMux/OggMuxInputPin.cpp
===================================================================
--- branches/oggdsf_new_demux/src/lib/core/directshow/dsfOggMux/OggMuxInputPin.cpp 2005-11-17 00:54:28 UTC (rev 10393)
+++ branches/oggdsf_new_demux/src/lib/core/directshow/dsfOggMux/OggMuxInputPin.cpp 2005-11-17 11:39:32 UTC (rev 10394)
@@ -122,6 +122,11 @@
mMuxStream->setConversionParams(locFLAC->samplesPerSec, 1, 10000000);
//debugLog<<"FLAC sample rate = "<<locFLAC->samplesPerSec<<endl;
mNeedsFLACHeaderTweak = true;
+ } else if (inMediaType->subtype == MEDIASUBTYPE_RawOggAudio) {
+ sOggRawAudioFormatBlock* locRawAudio = (sOggRawAudioFormatBlock*)inMediaType->pbFormat;
+ mMuxStream->setConversionParams(locRawAudio->samplesPerSec, 1, 10000000);
+ mMuxStream->setNumHeaders(locRawAudio->numHeaders);
+ mPaginator.setNumHeaders(locRawAudio->numHeaders);
}
@@ -166,7 +171,12 @@
outMediaType->subtype = MEDIASUBTYPE_CMML;
return S_OK;
+ case 6:
+ outMediaType->majortype = MEDIATYPE_Audio;
+ outMediaType->subtype = MEDIASUBTYPE_RawOggAudio;
+ return S_OK;
+
default:
return VFW_S_NO_MORE_ITEMS;
@@ -193,6 +203,10 @@
&& inMediaType->subtype == MEDIASUBTYPE_FLAC
&& inMediaType->formattype == FORMAT_FLAC)
||
+ (inMediaType->majortype == MEDIATYPE_Audio
+ && inMediaType->subtype == MEDIASUBTYPE_RawOggAudio
+ && inMediaType->formattype == FORMAT_RawOggAudio)
+ ||
(inMediaType->majortype == MEDIATYPE_Text
&& inMediaType->subtype == MEDIASUBTYPE_CMML
&& inMediaType->formattype == FORMAT_CMML)
Modified: branches/oggdsf_new_demux/src/lib/core/directshow/dsfOggMux/oggmuxdllstuff.h
===================================================================
--- branches/oggdsf_new_demux/src/lib/core/directshow/dsfOggMux/oggmuxdllstuff.h 2005-11-17 00:54:28 UTC (rev 10393)
+++ branches/oggdsf_new_demux/src/lib/core/directshow/dsfOggMux/oggmuxdllstuff.h 2005-11-17 11:39:32 UTC (rev 10394)
@@ -129,7 +129,13 @@
0x5a656e74, 0x6172, 0x6f26, 0xb7, 0x9c, 0xd6, 0x41, 0x6e, 0x64, 0x72, 0x82);
//Structure defining the registration details of the filter
+// {37535B3C-F068-4f93-9763-E7208277D71F}
+DEFINE_GUID(MEDIASUBTYPE_RawOggAudio,
+0x37535b3c, 0xf068, 0x4f93, 0x97, 0x63, 0xe7, 0x20, 0x82, 0x77, 0xd7, 0x1f);
+// {232D3C8F-16BF-404b-99AE-296F3DBB77EE}
+DEFINE_GUID(FORMAT_RawOggAudio,
+0x232d3c8f, 0x16bf, 0x404b, 0x99, 0xae, 0x29, 0x6f, 0x3d, 0xbb, 0x77, 0xee);
const REGPINTYPES OggMuxInputTypes[] = {
{
&MEDIATYPE_Audio,
@@ -152,6 +158,10 @@
&MEDIASUBTYPE_FLAC
},
{
+ &MEDIATYPE_Audio,
+ &MEDIASUBTYPE_RawOggAudio
+ },
+ {
&MEDIATYPE_Text,
&MEDIASUBTYPE_CMML
}
@@ -166,7 +176,7 @@
FALSE, //Cannot have more than one instance of this pin
NULL, //Connects to filter (obsoleted)
NULL, //Connects to pin (obsoleted)
- 6, //upport two media type
+ 7, //upport two media type
OggMuxInputTypes //Pointer to media type (Audio/Vorbis or Audio/Speex)
};
@@ -223,7 +233,14 @@
unsigned char yOffset;
unsigned char colourSpace;
};
+struct sOggRawAudioFormatBlock {
+ unsigned long samplesPerSec;
+ unsigned long numHeaders;
+ unsigned long numChannels;
+ unsigned long bitsPerSample;
+
+};
struct sCMMLFormatBlock {
__int64 granuleNumerator;
__int64 granuleDenominator;
More information about the commits
mailing list