[xiph-commits] r7720 -
trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder
illiminable at motherfish-iii.xiph.org
illiminable at motherfish-iii.xiph.org
Thu Sep 9 06:51:51 PDT 2004
Author: illiminable
Date: 2004-09-09 06:51:51 -0700 (Thu, 09 Sep 2004)
New Revision: 7720
Modified:
trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeFilter.cpp
trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeFilter.h
trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/stdafx.h
trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/theoradecoderdllstuff.h
Log:
* Skeleton of new theora decoder
Modified: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeFilter.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeFilter.cpp 2004-09-09 12:27:58 UTC (rev 7719)
+++ trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeFilter.cpp 2004-09-09 13:51:51 UTC (rev 7720)
@@ -30,10 +30,11 @@
//===========================================================================
#include "StdAfx.h"
-#include "theoradecodefilter.h"
+#include "TheoraDecodeFilter.h"
+
//COM Factory Template
CFactoryTemplate g_Templates[] =
{
@@ -52,33 +53,15 @@
-//Theora Decode Filter Implementation
-//==================================
-TheoraDecodeFilter::TheoraDecodeFilter()
- : AbstractVideoDecodeFilter(NAME("Ogg Video Decoder"), CLSID_TheoraDecodeFilter, THEORA)
- , mTheoraFormatInfo(NULL)
+TheoraDecodeFilter::TheoraDecodeFilter()
+ : CVideoTransformFilter( NAME("Theora Decode Filter"), NULL, CLSID_TheoraDecodeFilter)
{
- bool locWasConstructed = ConstructPins();
}
-bool TheoraDecodeFilter::ConstructPins()
-{
-
- //Output pin must be done first because it's passed to the input pin.
- mOutputPin = new TheoraDecodeOutputPin(this, m_pLock);
+TheoraDecodeFilter::~TheoraDecodeFilter() {
- CMediaType* locAcceptMediaType = new CMediaType(&MEDIATYPE_Video);
- locAcceptMediaType->subtype = MEDIASUBTYPE_Theora;
- locAcceptMediaType->formattype = FORMAT_Theora;
- mInputPin = new TheoraDecodeInputPin(this, m_pLock, mOutputPin, locAcceptMediaType);
- return true;
-}
-TheoraDecodeFilter::~TheoraDecodeFilter(void)
-{
- //DestroyPins();
- delete mTheoraFormatInfo;
}
CUnknown* WINAPI TheoraDecodeFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr)
@@ -91,26 +74,109 @@
return pNewObject;
}
-STDMETHODIMP TheoraDecodeFilter::GetState(DWORD dw, FILTER_STATE *pState)
-{
- CheckPointer(pState, E_POINTER);
- *pState = m_State;
- if (m_State == State_Paused) {
- return VFW_S_CANT_CUE;
- } else {
- return S_OK;
- }
+
+HRESULT TheoraDecodeFilter::CheckInputType(const CMediaType* inMediaType) {
+
}
+HRESULT TheoraDecodeFilter::CheckTransform(const CMediaType* inInputMediaType, const CMediaType* inOutputMediaType) {
-//QUERY::: Do we need these ? Aren't we all friedns here ??
-//RESULT::: Keep them, set function must be kept... get could go... but keep for consistency
-sTheoraFormatBlock* TheoraDecodeFilter::getTheoraFormatBlock()
-{
- return mTheoraFormatInfo;
}
-void TheoraDecodeFilter::setTheoraFormat(sTheoraFormatBlock* inFormatBlock)
-{
- delete mTheoraFormatInfo;
- mTheoraFormatInfo = new sTheoraFormatBlock;
- *mTheoraFormatInfo = *inFormatBlock;
-}
\ No newline at end of file
+HRESULT TheoraDecodeFilter::DecideBufferSize(IMemAllocator* inAllocator, ALLOCATOR_PROPERTIES* inPropertyRequest) {
+
+}
+HRESULT TheoraDecodeFilter::GetMediaType(int inPosition, CMediaType* outOutputMediaType) {
+
+}
+HRESULT TheoraDecodeFilter::Transform(IMediaSample* inInputSample, IMediaSample* outOutputSample) {
+
+}
+
+
+
+//---------------------------------------
+//OLD IMPLOEMENTATION....
+//---------------------------------------
+//#include "theoradecodefilter.h"
+//
+//
+//
+////COM Factory Template
+//CFactoryTemplate g_Templates[] =
+//{
+// {
+// L"Theora Decode Filter", // Name
+// &CLSID_TheoraDecodeFilter, // CLSID
+// TheoraDecodeFilter::CreateInstance, // Method to create an instance of Theora Decoder
+// 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]);
+//
+//
+//
+////Theora Decode Filter Implementation
+////==================================
+//TheoraDecodeFilter::TheoraDecodeFilter()
+// : AbstractVideoDecodeFilter(NAME("Ogg Video Decoder"), CLSID_TheoraDecodeFilter, THEORA)
+// , mTheoraFormatInfo(NULL)
+//{
+//
+// bool locWasConstructed = ConstructPins();
+//}
+//
+//bool TheoraDecodeFilter::ConstructPins()
+//{
+//
+// //Output pin must be done first because it's passed to the input pin.
+// mOutputPin = new TheoraDecodeOutputPin(this, m_pLock);
+//
+// CMediaType* locAcceptMediaType = new CMediaType(&MEDIATYPE_Video);
+// locAcceptMediaType->subtype = MEDIASUBTYPE_Theora;
+// locAcceptMediaType->formattype = FORMAT_Theora;
+// mInputPin = new TheoraDecodeInputPin(this, m_pLock, mOutputPin, locAcceptMediaType);
+// return true;
+//}
+//
+//TheoraDecodeFilter::~TheoraDecodeFilter(void)
+//{
+// //DestroyPins();
+// delete mTheoraFormatInfo;
+//}
+//
+//CUnknown* WINAPI TheoraDecodeFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr)
+//{
+// //This routine is the COM implementation to create a new Filter
+// TheoraDecodeFilter *pNewObject = new TheoraDecodeFilter();
+// if (pNewObject == NULL) {
+// *pHr = E_OUTOFMEMORY;
+// }
+// return pNewObject;
+//}
+//
+//STDMETHODIMP TheoraDecodeFilter::GetState(DWORD dw, FILTER_STATE *pState)
+//{
+// CheckPointer(pState, E_POINTER);
+// *pState = m_State;
+// if (m_State == State_Paused) {
+// return VFW_S_CANT_CUE;
+// } else {
+// return S_OK;
+// }
+//}
+//
+////QUERY::: Do we need these ? Aren't we all friedns here ??
+////RESULT::: Keep them, set function must be kept... get could go... but keep for consistency
+//sTheoraFormatBlock* TheoraDecodeFilter::getTheoraFormatBlock()
+//{
+// return mTheoraFormatInfo;
+//}
+//void TheoraDecodeFilter::setTheoraFormat(sTheoraFormatBlock* inFormatBlock)
+//{
+// delete mTheoraFormatInfo;
+// mTheoraFormatInfo = new sTheoraFormatBlock;
+// *mTheoraFormatInfo = *inFormatBlock;
+//}
\ No newline at end of file
Modified: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeFilter.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeFilter.h 2004-09-09 12:27:58 UTC (rev 7719)
+++ trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeFilter.h 2004-09-09 13:51:51 UTC (rev 7720)
@@ -31,48 +31,74 @@
#pragma once
-//Include Files
#include "Theoradecoderdllstuff.h"
-#include "AbstractVideoDecodeFilter.h"
-//Forward Declarations
-struct sTheoraFormatBlock;
-class TheoraDecodeInputPin;
-class TheoraDecodeOutputPin;
+class TheoraDecodeFilter
+ : public CVideoTransformFilter
-//Class Interface
-class TheoraDecodeFilter
- //Base Classes
- : public AbstractVideoDecodeFilter
{
public:
- //Friends
- friend class TheoraDecodeInputPin;
- friend class TheoraDecodeOutputPin;
-
-
-
-
- //Constructors and Destructors
TheoraDecodeFilter(void);
virtual ~TheoraDecodeFilter(void);
//COM Creator Function
static CUnknown* WINAPI CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr);
- //IMediaFilter OVerride - This lets us tell the graph we may not produce data in pause state so don't block.
- virtual STDMETHODIMP GetState(DWORD dw, FILTER_STATE *pState);
+ //CTransfrom filter pure virtuals
+ virtual HRESULT CheckInputType(const CMediaType* inMediaType);
+ virtual HRESULT CheckTransform(const CMediaType* inInputMediaType, const CMediaType* inOutputMediaType);
+ virtual HRESULT DecideBufferSize(IMemAllocator* inAllocator, ALLOCATOR_PROPERTIES* inPropertyRequest);
+ virtual HRESULT GetMediaType(int inPosition, CMediaType* outOutputMediaType);
+ virtual HRESULT Transform(IMediaSample* inInputSample, IMediaSample* outOutputSample);
-
- //VIRTUAL FUNCTIONS - AbstractAudioDecodeFilter
- virtual bool ConstructPins();
- //FIX::: Do we need these ? Aren't they all friends ??
- virtual sTheoraFormatBlock* getTheoraFormatBlock();
- virtual void setTheoraFormat(sTheoraFormatBlock* inFormatBlock);
-
-protected:
- //Format Block
- sTheoraFormatBlock* mTheoraFormatInfo;
};
+//---------------------------------------
+//OLD IMPLOEMENTATION....
+//---------------------------------------
+////Include Files
+//#include "Theoradecoderdllstuff.h"
+//#include "AbstractVideoDecodeFilter.h"
+//
+////Forward Declarations
+//struct sTheoraFormatBlock;
+//class TheoraDecodeInputPin;
+//class TheoraDecodeOutputPin;
+//
+////Class Interface
+//class TheoraDecodeFilter
+// //Base Classes
+// : public AbstractVideoDecodeFilter
+//{
+//public:
+// //Friends
+// friend class TheoraDecodeInputPin;
+// friend class TheoraDecodeOutputPin;
+//
+//
+//
+//
+// //Constructors and Destructors
+// TheoraDecodeFilter(void);
+// virtual ~TheoraDecodeFilter(void);
+//
+// //COM Creator Function
+// static CUnknown* WINAPI CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr);
+//
+// //IMediaFilter OVerride - This lets us tell the graph we may not produce data in pause state so don't block.
+// virtual STDMETHODIMP GetState(DWORD dw, FILTER_STATE *pState);
+//
+//
+//
+// //VIRTUAL FUNCTIONS - AbstractAudioDecodeFilter
+// virtual bool ConstructPins();
+//
+// //FIX::: Do we need these ? Aren't they all friends ??
+// virtual sTheoraFormatBlock* getTheoraFormatBlock();
+// virtual void setTheoraFormat(sTheoraFormatBlock* inFormatBlock);
+//
+//protected:
+// //Format Block
+// sTheoraFormatBlock* mTheoraFormatInfo;
+//};
Modified: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/stdafx.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/stdafx.h 2004-09-09 12:27:58 UTC (rev 7719)
+++ trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/stdafx.h 2004-09-09 13:51:51 UTC (rev 7720)
@@ -41,10 +41,14 @@
#include <windows.h>
+
+
+
+//OLD
// TODO: reference additional headers your program requires here
-#include "AbstractVideoDecodeFilter.h"
-#include "AbstractVideoDecodeInputPin.h"
-#include "AbstractVideoDecodeOutputPin.h"
-#include "TheoraDecodeInputPin.h"
-#include "TheoraDecodeOutputPin.h"
-#include "TheoraDecodeFilter.h"
\ No newline at end of file
+//#include "AbstractVideoDecodeFilter.h"
+//#include "AbstractVideoDecodeInputPin.h"
+//#include "AbstractVideoDecodeOutputPin.h"
+//#include "TheoraDecodeInputPin.h"
+//#include "TheoraDecodeOutputPin.h"
+//#include "TheoraDecodeFilter.h"
\ No newline at end of file
Modified: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/theoradecoderdllstuff.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/theoradecoderdllstuff.h 2004-09-09 12:27:58 UTC (rev 7719)
+++ trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/theoradecoderdllstuff.h 2004-09-09 13:51:51 UTC (rev 7720)
@@ -30,17 +30,17 @@
//===========================================================================
#pragma once
-//#include <streams.h>
-//#include <pullpin.h>
-//#include <initguid.h>
+#include <streams.h>
+#include <pullpin.h>
+#include <initguid.h>
-#ifdef DSFABSTRACTOGGVIDEODECODER_EXPORTS
-#pragma message("----> Exporting from Abstract Video Library...")
-#define ABS_VIDEO_DEC_API __declspec(dllexport)
-#else
-#pragma message("<---- Importing from Abstract Video Library...")
-#define ABS_VIDEO_DEC_API __declspec(dllimport)
-#endif
+//#ifdef DSFABSTRACTOGGVIDEODECODER_EXPORTS
+//#pragma message("----> Exporting from Abstract Video Library...")
+//#define ABS_VIDEO_DEC_API __declspec(dllexport)
+//#else
+//#pragma message("<---- Importing from Abstract Video Library...")
+//#define ABS_VIDEO_DEC_API __declspec(dllimport)
+//#endif
#ifdef LIBOOOGG_EXPORTS
#define LIBOOOGG_API __declspec(dllexport)
More information about the commits
mailing list