[xiph-commits] r6919 -
illiminable at dactyl.lonelymoon.com
illiminable
Tue Jun 29 01:03:35 PDT 2004
trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder
Message-ID: <20040629080335.A15ED9AAAB at dactyl.lonelymoon.com>
Author: illiminable
Date: Tue Jun 29 01:03:35 2004
New Revision: 6919
Modified:
trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeFilter.cpp
trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeFilter.h
trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeInputPin.cpp
trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeInputPin.h
trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeOutputPin.cpp
trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeOutputPin.h
trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/theoraencoderdllstuff.h
Log:
* Inconsistent *
* Fleshed out some of the theora encoder.
Modified: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeFilter.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeFilter.cpp 2004-06-29 07:48:51 UTC (rev 6918)
+++ trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeFilter.cpp 2004-06-29 08:03:21 UTC (rev 6919)
@@ -1,10 +1,84 @@
+//===========================================================================
+//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.
+//===========================================================================
+
#include "StdAfx.h"
-#include "theoraencodefilter.h"
+#include "Theoraencodefilter.h"
+
+//COM Factory Template
+CFactoryTemplate g_Templates[] =
+{
+ {
+ L"Theora Encode Filter", // Name
+ &CLSID_TheoraEncodeFilter, // CLSID
+ TheoraEncodeFilter::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 TheoraEncodeFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr)
+{
+ //This routine is the COM implementation to create a new Filter
+ TheoraEncodeFilter *pNewObject = new TheoraEncodeFilter();
+ if (pNewObject == NULL) {
+ *pHr = E_OUTOFMEMORY;
+ }
+ return pNewObject;
+}
+
TheoraEncodeFilter::TheoraEncodeFilter(void)
+ : AbstractVideoEncodeFilter(NAME("Theora Encoder"), CLSID_TheoraEncodeFilter, AbstractVideoEncodeFilter::THEORA)
{
+ bool locWasConstructed = ConstructPins();
}
TheoraEncodeFilter::~TheoraEncodeFilter(void)
{
}
+
+bool TheoraEncodeFilter::ConstructPins()
+{
+
+ CMediaType* locOutputMediaType = new CMediaType(&MEDIATYPE_Video);
+ locOutputMediaType->subtype = MEDIASUBTYPE_Theora;
+ locOutputMediaType->formattype = FORMAT_Theora;
+ //Output pin must be done first because it's passed to the input pin.
+ mOutputPin = new TheoraEncodeOutputPin(this, m_pLock, locOutputMediaType);
+
+
+ mInputPin = new TheoraEncodeInputPin(this, m_pLock, mOutputPin);
+ return true;
+}
\ No newline at end of file
Modified: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeFilter.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeFilter.h 2004-06-29 07:48:51 UTC (rev 6918)
+++ trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeFilter.h 2004-06-29 08:03:21 UTC (rev 6919)
@@ -1,8 +1,59 @@
+//===========================================================================
+//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 "theoraencoderdllstuff.h"
+#include "AbstractVideoEncodeFilter.h"
+
+//Forward Declarations
+struct sTheoraFormatBlock;
+class TheoraEncodeInputPin;
+class TheoraEncodeOutputPin;
+
class TheoraEncodeFilter
+ : public AbstractVideoEncodeFilter
{
public:
+
+ friend class TheoraEncodeOutputPin;
TheoraEncodeFilter(void);
- ~TheoraEncodeFilter(void);
+ virtual ~TheoraEncodeFilter(void);
+
+ static CUnknown* WINAPI TheoraEncodeFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr);
+
+ //PURE VIRTUAL IMPLEMENTATION
+ virtual bool ConstructPins();
+
+protected:
+ sTheoraFormatBlock mTheoraFormatBlock;
+
};
Modified: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeInputPin.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeInputPin.cpp 2004-06-29 07:48:51 UTC (rev 6918)
+++ trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeInputPin.cpp 2004-06-29 08:03:21 UTC (rev 6919)
@@ -1,10 +1,171 @@
+//===========================================================================
+//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.
+//===========================================================================
+
#include "StdAfx.h"
#include "theoraencodeinputpin.h"
-TheoraEncodeInputPin::TheoraEncodeInputPin(void)
+TheoraEncodeInputPin::TheoraEncodeInputPin(AbstractVideoEncodeFilter* inParentFilter, CCritSec* inFilterLock, AbstractVideoEncodeOutputPin* inOutputPin)
+ : AbstractVideoEncodeInputPin(inParentFilter, inFilterLock, inOutputPin, NAME("TheoraEncodeInputPin"), L"YV12 In")
+ , mFishSound(NULL)
{
+
}
TheoraEncodeInputPin::~TheoraEncodeInputPin(void)
{
+ DestroyCodec();
}
+
+
+//PURE VIRTUALS
+long TheoraEncodeInputPin::encodeData(unsigned char* inBuf, long inNumBytes) {
+
+
+
+
+ //float* locFloatBuf = new float[inNumBytes/2];
+ //short locTempShort = 0;
+ //float locTempFloat = 0;
+
+ ////__int64 locGranPos = 0;
+ ////locGranPos = fish_sound_get_frameno(mFishSound);
+ ////Removed the hack
+ ////fish_sound_command(mFishSound, 7, &locGranPos, sizeof(__int64));
+ ////
+
+ ////mUptoFrame = locGranPos;
+ ////__int64 locTemp = ((FishSoundVorbisInfo*)mFishSound->codec_data)->vd.pcm_returned;
+ //for (int i = 0; i < inNumBytes; i += 2) {
+ // locTempShort = *((short*)(inBuf + i));
+ // locTempFloat = (float)locTempShort;
+ // locTempFloat /= 32767.0;
+ // locFloatBuf[i/2] = locTempFloat;;
+ //}
+ ////FIX::: The 2 is the size of a sample ie 16 bits
+ //long locErr = fish_sound_encode(mFishSound, (float**)locFloatBuf, inNumBytes/(mFishInfo.channels*2));
+ //delete locFloatBuf;
+ ////FIX::: Do something here ?
+ //if (locErr < 0) {
+ //
+ //} else {
+ //
+ //}
+ return locErr;
+}
+bool TheoraEncodeInputPin::ConstructCodec() {
+ //mFishInfo.channels = mWaveFormat->nChannels;
+ //mFishInfo.format = FISH_SOUND_VORBIS;
+ //mFishInfo.samplerate = mWaveFormat->nSamplesPerSec;
+
+
+ //mFishInfo.format = FISH_SOUND_VORBIS;
+ //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, VorbisEncodeInputPin::VorbisEncoded, this);
+ //FIX::: Proper return value
+ return true;
+
+}
+void TheoraEncodeInputPin::DestroyCodec() {
+ //fish_sound_delete(mFishSound);
+ //mFishSound = NULL;
+}
+
+
+//Encoded callback
+//int TheoraEncodeInputPin::VorbisEncoded (FishSound* inFishSound, unsigned char* inPacketData, long inNumBytes, void* inThisPointer)
+//{
+//
+// VorbisEncodeInputPin* locThis = reinterpret_cast<VorbisEncodeInputPin*> (inThisPointer);
+// VorbisEncodeFilter* locFilter = reinterpret_cast<VorbisEncodeFilter*>(locThis->m_pFilter);
+//
+//
+// //Time stamps are granule pos not directshow times
+//
+// LONGLONG locFrameStart = locThis->mUptoFrame;
+// LONGLONG locFrameEnd = locThis->mUptoFrame
+// = fish_sound_get_frameno(locThis->mFishSound);
+// //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.
+// 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();
+// HRESULT locHR = locThis->mOutputPin->mDataQueue->Receive(locSample); //->DownstreamFilter()->Receive(locSample);
+// if (locHR != S_OK) {
+//
+// } else {
+// }
+// }
+//
+// return 0;
+// } else {
+// throw 0;
+// }
+//}
+
+
+HRESULT TheoraEncodeInputPin::SetMediaType(const CMediaType* inMediaType) {
+ AbstractVideoEncodeInputPin::SetMediaType(inMediaType);
+
+ ConstructCodec();
+
+
+ return S_OK;
+
+}
\ No newline at end of file
Modified: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeInputPin.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeInputPin.h 2004-06-29 07:48:51 UTC (rev 6918)
+++ trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeInputPin.h 2004-06-29 08:03:21 UTC (rev 6919)
@@ -1,8 +1,64 @@
+//===========================================================================
+//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 "AbstractVideoEncodeInputPin.h"
+#include "TheoraEncodeInputPin.h"
+
+#include "TheoraEncodeFilter.h"
+
+
class TheoraEncodeInputPin
+ : public AbstractVideoEncodeInputPin
{
public:
- TheoraEncodeInputPin(void);
- ~TheoraEncodeInputPin(void);
+ TheoraEncodeInputPin(AbstractVideoEncodeFilter* inFilter, CCritSec* inFilterLock, AbstractVideoEncodeOutputPin* inOutputPin);
+ virtual ~TheoraEncodeInputPin(void);
+
+ //static int TheoraEncodeInputPin::VorbisEncoded (FishSound* inFishSound, unsigned char* inPacketData, long inNumBytes, void* inThisPointer) ;
+ //PURE VIRTUALS
+ virtual long encodeData(unsigned char* inBuf, long inNumBytes);
+ virtual bool ConstructCodec();
+ virtual void DestroyCodec();
+ virtual HRESULT SetMediaType(const CMediaType* inMediaType);
+
+protected:
+ HRESULT mHR;
+ bool mBegun;
+ //VorbisDecodeOutputPin* mOutputPin;
+ //__int64 mUptoFrame;
+
+ //FishSound* mFishSound;
+ //FishSoundInfo mFishInfo;
+
+
};
Modified: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeOutputPin.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeOutputPin.cpp 2004-06-29 07:48:51 UTC (rev 6918)
+++ trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeOutputPin.cpp 2004-06-29 08:03:21 UTC (rev 6919)
@@ -1,10 +1,51 @@
+//===========================================================================
+//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.
+//===========================================================================
+
#include "StdAfx.h"
#include "theoraencodeoutputpin.h"
-TheoraEncodeOutputPin::TheoraEncodeOutputPin(void)
+TheoraEncodeOutputPin::TheoraEncodeOutputPin(TheoraEncodeFilter* inParentFilter,CCritSec* inFilterLock, CMediaType* inOutputMediaType)
+ : AbstractVideoEncodeOutputPin(inParentFilter, inFilterLock,NAME("TheoraDecodeOutputPin"), L"Theora Out", inOutputMediaType)
{
}
TheoraEncodeOutputPin::~TheoraEncodeOutputPin(void)
{
}
+
+bool TheoraEncodeOutputPin::FillFormatBuffer(BYTE* inFormatBuffer) {
+ TheoraEncodeFilter* locParentFilter = (TheoraEncodeFilter*)mParentFilter;
+ memcpy((void*)inFormatBuffer, (const void*) &(locParentFilter->mTheoraFormatBlock), sizeof(sTheoraFormatBlock));
+ return true;
+}
+unsigned long TheoraEncodeOutputPin::FormatBufferSize() {
+ return sizeof(sTheoraFormatBlock);
+}
Modified: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeOutputPin.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeOutputPin.h 2004-06-29 07:48:51 UTC (rev 6918)
+++ trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeOutputPin.h 2004-06-29 08:03:21 UTC (rev 6919)
@@ -1,8 +1,54 @@
+//===========================================================================
+//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 "Theoraencoderdllstuff.h"
+#include "AbstractVideoEncodeOutputPin.h"
+
+class TheoraEncodeFilter;
+struct sTheoraFormatBlock;
+
class TheoraEncodeOutputPin
+ : public AbstractVideoEncodeOutputPin
{
public:
- TheoraEncodeOutputPin(void);
- ~TheoraEncodeOutputPin(void);
+ TheoraEncodeOutputPin(TheoraEncodeFilter* inParentFilter, CCritSec* inFilterLock, CMediaType* inOutputMediaType);
+ virtual ~TheoraEncodeOutputPin(void);
+
+ //PURE VIRTUAL IMPLEMENTATION
+ virtual bool FillFormatBuffer(BYTE* inFormatBuffer);
+ virtual unsigned long FormatBufferSize();
+
+
+protected:
+
};
Modified: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/theoraencoderdllstuff.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/theoraencoderdllstuff.h 2004-06-29 07:48:51 UTC (rev 6918)
+++ trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/theoraencoderdllstuff.h 2004-06-29 08:03:21 UTC (rev 6919)
@@ -1,8 +1,122 @@
+//===========================================================================
+//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
-class theoraencoderdllstuff
-{
-public:
- theoraencoderdllstuff(void);
- ~theoraencoderdllstuff(void);
+
+
+
+#include "AbstractVideoEncodeFilter.h"
+#include "AbstractVideoEncodeInputPin.h"
+#include "AbstractVideoEncodeOutputPin.h"
+#include "TheoraEncodeInputPin.h"
+#include "TheoraEncodeOutputPin.h"
+#include "TheoraEncodeFilter.h"
+
+#ifdef LIBOOOGG_EXPORTS
+#define LIBOOOGG_API __declspec(dllexport)
+#else
+#define LIBOOOGG_API __declspec(dllimport)
+#endif
+
+// {D124B2B1-8968-4ae8-B288-FE16EA34B0CE}
+DEFINE_GUID(MEDIASUBTYPE_Theora,
+0xd124b2b1, 0x8968, 0x4ae8, 0xb2, 0x88, 0xfe, 0x16, 0xea, 0x34, 0xb0, 0xce);
+
+// {A99F116C-DFFA-412c-95DE-725F99874826}
+DEFINE_GUID(FORMAT_Theora,
+0xa99f116c, 0xdffa, 0x412c, 0x95, 0xde, 0x72, 0x5f, 0x99, 0x87, 0x48, 0x26);
+
+const REGPINTYPES TheoraEncodeInputTypes = {
+ &MEDIATYPE_Video,
+ &MEDIASUBTYPE_YV12
};
+
+const REGPINTYPES VorbisEncodeOutputTypes = {
+ &MEDIATYPE_Video,
+ &MEDIASUBTYPE_Theora
+};
+
+const REGFILTERPINS VorbisEncodePinReg[] = {
+ {
+ L"YV12 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
+ &TheoraEncodeInputTypes //Pointer to media type (Audio/Vorbis or Audio/Speex)
+ } ,
+
+ {
+ L"Theora 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
+ &TheoraEncodeOutputTypes //Pointer to media type (Audio/PCM)
+
+ }
+};
+
+
+
+const REGFILTER2 TheoraEncodeFilterReg = {
+ 1,
+ MERIT_NORMAL,
+ 2,
+ TheoraEncodePinReg
+
+};
+
+struct sTheoraFormatBlock {
+ unsigned long theoraVersion;
+ unsigned long width;
+ unsigned long height;
+ unsigned long frameWidth;
+ unsigned long frameHeight;
+ unsigned long frameRateNumerator;
+ unsigned long frameRateDenominator;
+ unsigned long aspectNumerator;
+ unsigned long aspectDenominator;
+ unsigned long maxKeyframeInterval;
+ unsigned long targetBitrate;
+ unsigned char targetQuality;
+ unsigned char xOffset;
+ unsigned char yOffset;
+ unsigned char colourSpace;
+};
+
More information about the commits
mailing list