[xiph-commits] r7141 - in trunk/oggdsf/src/lib:
illiminable at dactyl.lonelymoon.com
illiminable
Thu Jul 15 13:29:54 PDT 2004
codecs/cmml/dsfCMMLDecoder core/directshow/dsfAbstractAudioDecoder
core/directshow/dsfAbstractVideoDecoder
core/directshow/dsfAnxDemux core/directshow/dsfOggDemux
core/directshow/dsfSeeking
Message-ID: <20040715202954.6BFB09AAAB at dactyl.lonelymoon.com>
Author: illiminable
Date: Thu Jul 15 13:29:54 2004
New Revision: 7141
Modified:
trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLDecoder/CMMLDecodeFilter.cpp
trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/AbstractAudioDecodeFilter.cpp
trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/AbstractAudioDecodeFilter.h
trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/AbstractAudioDecodeInputPin.cpp
trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/AbstractAudioDecodeInputPin.h
trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoDecoder/AbstractVideoDecodeInputPin.cpp
trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoDecoder/AbstractVideoDecodeInputPin.h
trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/AnxStreamMapper.cpp
trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/CMMLSourcePin.cpp
trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/CMMLStream.cpp
trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/CMMLStream.h
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FFDShowVideoStream.cpp
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FFDShowVideoStream.h
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FLACStream.cpp
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FLACStream.h
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourceFilter.cpp
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourceFilter.h
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourcePin.cpp
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourcePin.h
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStream.cpp
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStream.h
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStreamFactory.cpp
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStreamFactory.h
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStreamMapper.cpp
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/SpeexStream.cpp
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/SpeexStream.h
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/TheoraStream.cpp
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/TheoraStream.h
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/VorbisStream.cpp
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/VorbisStream.h
trunk/oggdsf/src/lib/core/directshow/dsfSeeking/BasicSeekable.cpp
trunk/oggdsf/src/lib/core/directshow/dsfSeeking/BasicSeekable.h
Log:
* Theoras granule pos scheme killed my inner child !
Modified: trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLDecoder/CMMLDecodeFilter.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLDecoder/CMMLDecodeFilter.cpp 2004-07-15 19:28:35 UTC (rev 7140)
+++ trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLDecoder/CMMLDecodeFilter.cpp 2004-07-15 20:29:52 UTC (rev 7141)
@@ -192,6 +192,7 @@
char* locText = NULL;
string locTextStr;
unsigned long locTextSize = 0;
+ outSample->SetMediaTime(NULL, NULL);
//debugLog<<"Transform : Input Sample Size = "<<locSize<<endl;
if (locSize > 0) {
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/AbstractAudioDecodeFilter.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/AbstractAudioDecodeFilter.cpp 2004-07-15 19:28:35 UTC (rev 7140)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/AbstractAudioDecodeFilter.cpp 2004-07-15 20:29:52 UTC (rev 7141)
@@ -35,6 +35,7 @@
AbstractAudioDecodeFilter::AbstractAudioDecodeFilter(TCHAR* inFilterName, REFCLSID inFilterGUID, unsigned short inAudioFormat )
: CBaseFilter(inFilterName, NULL,m_pLock, inFilterGUID),
mAudioFormat(inAudioFormat)
+
{
m_pLock = new CCritSec;
}
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/AbstractAudioDecodeFilter.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/AbstractAudioDecodeFilter.h 2004-07-15 19:28:35 UTC (rev 7140)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/AbstractAudioDecodeFilter.h 2004-07-15 20:29:52 UTC (rev 7141)
@@ -89,6 +89,8 @@
//Member Data
AbstractAudioDecodeInputPin* mInputPin;
AbstractAudioDecodeOutputPin* mOutputPin;
+
+
};
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/AbstractAudioDecodeInputPin.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/AbstractAudioDecodeInputPin.cpp 2004-07-15 19:28:35 UTC (rev 7140)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/AbstractAudioDecodeInputPin.cpp 2004-07-15 20:29:52 UTC (rev 7141)
@@ -44,6 +44,7 @@
, mSampleRate(0)
, mFilterLock(inFilterLock)
, mLastSeenStartGranPos(0)
+ , mSeekTimeBase(0)
{
//ConstructCodec();
//aadDebug.open("c:\\aadec.log", ios_base::out);
@@ -115,6 +116,14 @@
//New start time hacks
REFERENCE_TIME locStart = 0;
REFERENCE_TIME locEnd = 0;
+
+ //More work arounds for that stupid granule pos scheme in theora!
+ REFERENCE_TIME locTimeBase = 0;
+ REFERENCE_TIME locDummy = 0;
+ inSample->GetMediaTime(&locTimeBase, &locDummy);
+ mSeekTimeBase = locTimeBase;
+ //
+
inSample->GetTime(&locStart, &locEnd);
//Error chacks needed here
//aadDebug<<"Receive : Start = "<<locStart<<endl;
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/AbstractAudioDecodeInputPin.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/AbstractAudioDecodeInputPin.h 2004-07-15 19:28:35 UTC (rev 7140)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/AbstractAudioDecodeInputPin.h 2004-07-15 20:29:52 UTC (rev 7141)
@@ -104,5 +104,7 @@
unsigned long mNumChannels;
unsigned long mSampleRate;
+ REFERENCE_TIME mSeekTimeBase;
+
};
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoDecoder/AbstractVideoDecodeInputPin.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoDecoder/AbstractVideoDecodeInputPin.cpp 2004-07-15 19:28:35 UTC (rev 7140)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoDecoder/AbstractVideoDecodeInputPin.cpp 2004-07-15 20:29:52 UTC (rev 7141)
@@ -47,6 +47,7 @@
, mFrameCount(0)
, mStreamLock(NULL)
, mLastSeenStartGranPos(0)
+ , mSeekTimeBase(0)
{
//ConstructCodec();
@@ -115,6 +116,13 @@
inSample->GetTime(&locStart, &locEnd);
//Error chacks needed here
+ //More work arounds for that stupid granule pos scheme in theora!
+ REFERENCE_TIME locTimeBase = 0;
+ REFERENCE_TIME locDummy = 0;
+ inSample->GetMediaTime(&locTimeBase, &locDummy);
+ mSeekTimeBase = locTimeBase;
+ //
+
if ((mLastSeenStartGranPos != locStart) && (locStart != -1)) {
ResetFrameCount();
mLastSeenStartGranPos = locStart;
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoDecoder/AbstractVideoDecodeInputPin.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoDecoder/AbstractVideoDecodeInputPin.h 2004-07-15 19:28:35 UTC (rev 7140)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoDecoder/AbstractVideoDecodeInputPin.h 2004-07-15 20:29:52 UTC (rev 7141)
@@ -93,5 +93,5 @@
CCritSec* mStreamLock;
-
+ REFERENCE_TIME mSeekTimeBase;
};
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/AnxStreamMapper.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/AnxStreamMapper.cpp 2004-07-15 19:28:35 UTC (rev 7140)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/AnxStreamMapper.cpp 2004-07-15 20:29:52 UTC (rev 7141)
@@ -84,7 +84,7 @@
char* locStr = (char*)(inOggPage->getPacket(0)->packetData() + 28);
if (strstr(locStr, "text/x-cmml") != NULL) {
mSeenCMML = true;
- OggStream* locStream = new CMMLStream(inOggPage, mOwningFilter);//OggStreamFactory::CreateStream(inOggPage, mOwningFilter);
+ OggStream* locStream = new CMMLStream(inOggPage, mOwningFilter, true);//OggStreamFactory::CreateStream(inOggPage, mOwningFilter);
if (locStream != NULL) {
mStreamList.push_back(locStream);
}
@@ -113,7 +113,7 @@
//for (int i = 0; i < mSeenStreams.size(); i++) {
if (mSeenStreams[i] == inOggPage->header()->StreamSerialNo()) {
//If the page is a BOS we need to start a new stream
- OggStream* locStream = OggStreamFactory::CreateStream(inOggPage, mOwningFilter);
+ OggStream* locStream = OggStreamFactory::CreateStream(inOggPage, mOwningFilter, false);
//FIX::: Need to check for NULL
if (locStream != NULL) {
mStreamList.push_back(locStream);
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/CMMLSourcePin.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/CMMLSourcePin.cpp 2004-07-15 19:28:35 UTC (rev 7140)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/CMMLSourcePin.cpp 2004-07-15 20:29:52 UTC (rev 7141)
@@ -41,7 +41,7 @@
StreamHeaders* inHeaderSource,
CMediaType* inMediaType,
wstring inPinName)
- : OggDemuxSourcePin(inObjectName, inParentFilter, inFilterLock, inHeaderSource, inMediaType, inPinName)
+ : OggDemuxSourcePin(inObjectName, inParentFilter, inFilterLock, inHeaderSource, inMediaType, inPinName, true)
{
}
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/CMMLStream.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/CMMLStream.cpp 2004-07-15 19:28:35 UTC (rev 7140)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/CMMLStream.cpp 2004-07-15 20:29:52 UTC (rev 7141)
@@ -35,8 +35,8 @@
#include "StdAfx.h"
#include "cmmlstream.h"
-CMMLStream::CMMLStream(OggPage* inBOSPage, OggDemuxSourceFilter* inOwningFilter)
- : OggStream(inBOSPage, inOwningFilter)
+CMMLStream::CMMLStream(OggPage* inBOSPage, OggDemuxSourceFilter* inOwningFilter, bool inAllowSeek)
+ : OggStream(inBOSPage, inOwningFilter, inAllowSeek)
, mCMMLFormatBlock(NULL)
{
InitCodec(inBOSPage->getStampedPacket(0));
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/CMMLStream.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/CMMLStream.h 2004-07-15 19:28:35 UTC (rev 7140)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/CMMLStream.h 2004-07-15 20:29:52 UTC (rev 7141)
@@ -42,7 +42,7 @@
: public OggStream
{
public:
- CMMLStream(OggPage* inBOSPage, OggDemuxSourceFilter* inOwningFilter);
+ CMMLStream(OggPage* inBOSPage, OggDemuxSourceFilter* inOwningFilter, bool inAllowSeek);
virtual ~CMMLStream(void);
virtual void setLastEndGranPos(__int64 inGranPos);
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FFDShowVideoStream.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FFDShowVideoStream.cpp 2004-07-15 19:28:35 UTC (rev 7140)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FFDShowVideoStream.cpp 2004-07-15 20:29:52 UTC (rev 7141)
@@ -34,8 +34,8 @@
-FFDShowVideoStream::FFDShowVideoStream(OggPage* inBOSPage, OggDemuxSourceFilter* inOwningFilter)
- : OggStream(inBOSPage, inOwningFilter)
+FFDShowVideoStream::FFDShowVideoStream(OggPage* inBOSPage, OggDemuxSourceFilter* inOwningFilter, bool inAllowSeek)
+ : OggStream(inBOSPage, inOwningFilter, inAllowSeek)
, mFFDShowVideoFormatBlock(NULL)
, mLastTimeStamp(0)
//, mLastGranulePos(0)
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FFDShowVideoStream.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FFDShowVideoStream.h 2004-07-15 19:28:35 UTC (rev 7140)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FFDShowVideoStream.h 2004-07-15 20:29:52 UTC (rev 7141)
@@ -35,7 +35,7 @@
: public OggStream
{
public:
- FFDShowVideoStream(OggPage* inOggPage, OggDemuxSourceFilter* inOwningFilter);
+ FFDShowVideoStream(OggPage* inOggPage, OggDemuxSourceFilter* inOwningFilter, bool inAllowSeek);
virtual ~FFDShowVideoStream(void);
virtual bool InitCodec(StampedOggPacket* inOggPacket);
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FLACStream.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FLACStream.cpp 2004-07-15 19:28:35 UTC (rev 7140)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FLACStream.cpp 2004-07-15 20:29:52 UTC (rev 7141)
@@ -33,8 +33,8 @@
#include "FLACstream.h"
#include "FLACMath.h"
-FLACStream::FLACStream(OggPage* inBOSPage, OggDemuxSourceFilter* inOwningFilter)
- : OggStream(inBOSPage, inOwningFilter)
+FLACStream::FLACStream(OggPage* inBOSPage, OggDemuxSourceFilter* inOwningFilter, bool inAllowSeek)
+ : OggStream(inBOSPage, inOwningFilter, inAllowSeek)
, mFLACFormatBlock(NULL)
{
InitCodec(inBOSPage->getStampedPacket(0));
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FLACStream.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FLACStream.h 2004-07-15 19:28:35 UTC (rev 7140)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FLACStream.h 2004-07-15 20:29:52 UTC (rev 7141)
@@ -38,7 +38,7 @@
: public OggStream
{
public:
- FLACStream(OggPage* inOggPage, OggDemuxSourceFilter* inOwningFilter);
+ FLACStream(OggPage* inOggPage, OggDemuxSourceFilter* inOwningFilter, bool inAllowSeek);
virtual ~FLACStream(void);
//Implementing virtuals in OGgStream
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourceFilter.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourceFilter.cpp 2004-07-15 19:28:35 UTC (rev 7140)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourceFilter.cpp 2004-07-15 20:29:52 UTC (rev 7141)
@@ -100,6 +100,7 @@
, mSeekTable(NULL)
, mDataSource(NULL)
+ , mSeekTimeBase(0)
{
//LEAK CHECK:::Both get deleted in constructor.
m_pLock = new CCritSec;
@@ -117,6 +118,7 @@
: CBaseFilter(NAME("OggDemuxSourceFilter"), NULL, m_pLock, inFilterGUID)
, mSeekTable(NULL)
, mStreamMapper(NULL)
+ , mSeekTimeBase(0)
{
//LEAK CHECK:::Both get deleted in constructor.
m_pLock = new CCritSec;
@@ -327,7 +329,15 @@
//
mDataSource->seek(mSeekTable->getStartPos(*pCurrent));
//
- *pCurrent = mSeekTable->getRealStartPos();
+
+ //We have to save this here now... since time can't be reverted to granule pos in all cases
+ // we have to use granule pos timestamps in order for downstream codecs to work.
+ // Because of this we can't factor time bases after seeking into the sample times.
+ // So this is a big fat hack so that theora's crazy ass time scheme can work in directshow.
+ // We save the actual seek position as we do a seek and we misuse the MediaTime fields in the
+ // samples to send the time base. Theora 1, Compatability 0.
+ *pCurrent = mSeekTimeBase
+ = mSeekTable->getRealStartPos();
//debugLog<<" : Seek complete."<<endl;
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourceFilter.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourceFilter.h 2004-07-15 19:28:35 UTC (rev 7140)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourceFilter.h 2004-07-15 20:29:52 UTC (rev 7141)
@@ -126,6 +126,8 @@
CCritSec* mStreamLock;
+ REFERENCE_TIME mSeekTimeBase; //Don't ask !
+
protected:
void resetStream();
void DeliverEOS();
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourcePin.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourcePin.cpp 2004-07-15 19:28:35 UTC (rev 7140)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourcePin.cpp 2004-07-15 20:29:52 UTC (rev 7141)
@@ -36,7 +36,8 @@
CCritSec* inFilterLock,
StreamHeaders* inHeaderSource,
CMediaType* inMediaType,
- wstring inPinName)
+ wstring inPinName,
+ bool inAllowSeek)
: CBaseOutputPin(NAME("Ogg Demux Output Pin"), inParentFilter, inFilterLock, &mFilterHR, inPinName.c_str()),
mHeaders(inHeaderSource),
mParentFilter(inParentFilter),
@@ -48,8 +49,12 @@
{
//debugLog.open("C:\\sourcefilterpin.log", ios_base::out);
IMediaSeeking* locSeeker = NULL;
- inParentFilter->NonDelegatingQueryInterface(IID_IMediaSeeking, (void**)&locSeeker);
+ if (inAllowSeek) {
+ inParentFilter->NonDelegatingQueryInterface(IID_IMediaSeeking, (void**)&locSeeker);
+
+
+ }
SetDelegate(locSeeker);
}
@@ -85,9 +90,15 @@
//debugLog<<"Failure... No buffer"<<endl;
return false;
}
+
+ //More hacks so we can send a timebase after a seek, since granule pos in theora
+ // is not convertible in both directions to time.
+
//TIMESTAMP FIXING !
locSample->SetTime(&locStart, &locStop);
- locSample->SetMediaTime(NULL, NULL);
+
+ //Yes this is way dodgy !
+ locSample->SetMediaTime(&mParentFilter->mSeekTimeBase, &mParentFilter->mSeekTimeBase);
locSample->SetSyncPoint(TRUE);
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourcePin.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourcePin.h 2004-07-15 19:28:35 UTC (rev 7140)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourcePin.h 2004-07-15 20:29:52 UTC (rev 7141)
@@ -54,7 +54,8 @@
CCritSec* inFilterLock,
StreamHeaders* inHeaderSource,
CMediaType* inMediaType,
- wstring inPinName);
+ wstring inPinName,
+ bool inAllowSeek);
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStream.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStream.cpp 2004-07-15 19:28:35 UTC (rev 7140)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStream.cpp 2004-07-15 20:29:52 UTC (rev 7141)
@@ -31,9 +31,10 @@
#include "StdAfx.h"
#include "oggstream.h"
-OggStream::OggStream(OggPage* inBOSPage, OggDemuxSourceFilter* inOwningFilter)
+OggStream::OggStream(OggPage* inBOSPage, OggDemuxSourceFilter* inOwningFilter, bool inAllowSeek)
: mCodecHeaders(NULL)
, mOwningFilter(inOwningFilter)
+ , mAllowSeek(inAllowSeek)
, mSerialNo(0)
, mSourcePin(NULL)
, mNumHeadersNeeded(0)
@@ -204,7 +205,8 @@
mOwningFilter->m_pLock,
mCodecHeaders,
locMediaType,
- getPinName());
+ getPinName(),
+ mAllowSeek);
mStreamReady = true;
mSourcePin = locSourcePin;
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStream.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStream.h 2004-07-15 19:28:35 UTC (rev 7140)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStream.h 2004-07-15 20:29:52 UTC (rev 7141)
@@ -47,7 +47,7 @@
: public IOggCallback
{
public:
- OggStream(OggPage* inBOSPage, OggDemuxSourceFilter* inOwningFilter);
+ OggStream(OggPage* inBOSPage, OggDemuxSourceFilter* inOwningFilter, bool inAllowSeek);
virtual ~OggStream(void);
//more hacks
@@ -95,6 +95,7 @@
bool mStreamReady;
bool mFirstRun;
bool mSendExcess;
+ bool mAllowSeek;
__int64 mLastEndGranulePos;
__int64 mLastStartGranulePos;
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStreamFactory.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStreamFactory.cpp 2004-07-15 19:28:35 UTC (rev 7140)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStreamFactory.cpp 2004-07-15 20:29:52 UTC (rev 7141)
@@ -42,18 +42,18 @@
}
//New codecs need to be added here and write a derived Stream Class.
-OggStream* OggStreamFactory::CreateStream(OggPage* inOggPage, OggDemuxSourceFilter* inOwningFilter) {
+OggStream* OggStreamFactory::CreateStream(OggPage* inOggPage, OggDemuxSourceFilter* inOwningFilter, bool inAllowSeek) {
switch (OggStreamFactory::IdentifyCodec(inOggPage->getPacket(0))) {
case StreamHeaders::VORBIS:
- return new VorbisStream(inOggPage, inOwningFilter);
+ return new VorbisStream(inOggPage, inOwningFilter, inAllowSeek);
case StreamHeaders::SPEEX:
- return new SpeexStream(inOggPage, inOwningFilter);
+ return new SpeexStream(inOggPage, inOwningFilter, inAllowSeek);
case StreamHeaders::FLAC:
- return new FLACStream(inOggPage, inOwningFilter);
+ return new FLACStream(inOggPage, inOwningFilter, inAllowSeek);
case StreamHeaders::THEORA:
- return new TheoraStream(inOggPage, inOwningFilter);
+ return new TheoraStream(inOggPage, inOwningFilter, inAllowSeek);
case StreamHeaders::FFDSHOW_VIDEO:
- return new FFDShowVideoStream(inOggPage, inOwningFilter);
+ return new FFDShowVideoStream(inOggPage, inOwningFilter, inAllowSeek);
case StreamHeaders::NONE:
default:
return NULL;
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStreamFactory.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStreamFactory.h 2004-07-15 19:28:35 UTC (rev 7140)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStreamFactory.h 2004-07-15 20:29:52 UTC (rev 7141)
@@ -48,6 +48,6 @@
OggStreamFactory(void);
~OggStreamFactory(void);
- static OggStream* CreateStream(OggPage* inOggPage, OggDemuxSourceFilter* inOwningFilter);
+ static OggStream* CreateStream(OggPage* inOggPage, OggDemuxSourceFilter* inOwningFilter, bool inAllowSeek);
static StreamHeaders::eCodecType IdentifyCodec(OggPacket* inPacket);
};
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStreamMapper.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStreamMapper.cpp 2004-07-15 19:28:35 UTC (rev 7140)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStreamMapper.cpp 2004-07-15 20:29:52 UTC (rev 7141)
@@ -70,9 +70,15 @@
}
if (inOggPage->header()->isBOS()) {
-
+ bool locAllowSeekThrough = false;
+
+ //We only want one of the pins to delegate their seek to us.
+ if (mStreamList.size() == 0) {
+ locAllowSeekThrough = true;
+ }
+
//If the page is a BOS we need to start a new stream
- OggStream* locStream = OggStreamFactory::CreateStream(inOggPage, mOwningFilter);
+ OggStream* locStream = OggStreamFactory::CreateStream(inOggPage, mOwningFilter, locAllowSeekThrough);
//FIX::: Need to check for NULL
if (locStream != NULL) {
mStreamList.push_back(locStream);
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/SpeexStream.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/SpeexStream.cpp 2004-07-15 19:28:35 UTC (rev 7140)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/SpeexStream.cpp 2004-07-15 20:29:52 UTC (rev 7141)
@@ -31,8 +31,8 @@
#include "StdAfx.h"
#include "speexstream.h"
-SpeexStream::SpeexStream(OggPage* inBOSPage, OggDemuxSourceFilter* inOwningFilter)
- : OggStream(inBOSPage, inOwningFilter)
+SpeexStream::SpeexStream(OggPage* inBOSPage, OggDemuxSourceFilter* inOwningFilter, bool inAllowSeek)
+ : OggStream(inBOSPage, inOwningFilter, inAllowSeek)
, mSpeexFormatBlock(NULL)
{
InitCodec(inBOSPage->getStampedPacket(0));
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/SpeexStream.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/SpeexStream.h 2004-07-15 19:28:35 UTC (rev 7140)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/SpeexStream.h 2004-07-15 20:29:52 UTC (rev 7141)
@@ -38,7 +38,7 @@
: public OggStream
{
public:
- SpeexStream(OggPage* inOggPage, OggDemuxSourceFilter* inOwningFilter);
+ SpeexStream(OggPage* inOggPage, OggDemuxSourceFilter* inOwningFilter, bool inAllowSeek);
virtual ~SpeexStream(void);
virtual bool InitCodec(StampedOggPacket* inOggPacket);
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/TheoraStream.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/TheoraStream.cpp 2004-07-15 19:28:35 UTC (rev 7140)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/TheoraStream.cpp 2004-07-15 20:29:52 UTC (rev 7141)
@@ -31,8 +31,8 @@
#include "StdAfx.h"
#include "theorastream.h"
-TheoraStream::TheoraStream(OggPage* inBOSPage, OggDemuxSourceFilter* inOwningFilter)
- : OggStream(inBOSPage, inOwningFilter)
+TheoraStream::TheoraStream(OggPage* inBOSPage, OggDemuxSourceFilter* inOwningFilter, bool inAllowSeek)
+ : OggStream(inBOSPage, inOwningFilter, inAllowSeek)
, mTheoraFormatBlock(NULL)
{
InitCodec(inBOSPage->getStampedPacket(0));
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/TheoraStream.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/TheoraStream.h 2004-07-15 19:28:35 UTC (rev 7140)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/TheoraStream.h 2004-07-15 20:29:52 UTC (rev 7141)
@@ -40,7 +40,7 @@
: public OggStream
{
public:
- TheoraStream(OggPage* inOggPage, OggDemuxSourceFilter* inOwningFilter);
+ TheoraStream(OggPage* inOggPage, OggDemuxSourceFilter* inOwningFilter, bool inAllowSeek);
virtual ~TheoraStream(void);
virtual bool InitCodec(StampedOggPacket* inOggPacket);
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/VorbisStream.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/VorbisStream.cpp 2004-07-15 19:28:35 UTC (rev 7140)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/VorbisStream.cpp 2004-07-15 20:29:52 UTC (rev 7141)
@@ -31,8 +31,8 @@
#include "StdAfx.h"
#include "vorbisstream.h"
-VorbisStream::VorbisStream(OggPage* inBOSPage, OggDemuxSourceFilter* inOwningFilter)
- : OggStream(inBOSPage, inOwningFilter)
+VorbisStream::VorbisStream(OggPage* inBOSPage, OggDemuxSourceFilter* inOwningFilter, bool inAllowSeek)
+ : OggStream(inBOSPage, inOwningFilter, inAllowSeek)
, mVorbisFormatBlock(NULL)
{
InitCodec(inBOSPage->getStampedPacket(0));
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/VorbisStream.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/VorbisStream.h 2004-07-15 19:28:35 UTC (rev 7140)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/VorbisStream.h 2004-07-15 20:29:52 UTC (rev 7141)
@@ -42,7 +42,7 @@
: public OggStream
{
public:
- VorbisStream(OggPage* inOggPage, OggDemuxSourceFilter* inOwningFilter);
+ VorbisStream(OggPage* inOggPage, OggDemuxSourceFilter* inOwningFilter, bool inAllowSeek);
virtual ~VorbisStream(void);
virtual bool InitCodec(StampedOggPacket* inOggPacket);
Modified: trunk/oggdsf/src/lib/core/directshow/dsfSeeking/BasicSeekable.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfSeeking/BasicSeekable.cpp 2004-07-15 19:28:35 UTC (rev 7140)
+++ trunk/oggdsf/src/lib/core/directshow/dsfSeeking/BasicSeekable.cpp 2004-07-15 20:29:52 UTC (rev 7141)
@@ -5,7 +5,7 @@
//: CUnknown(NAME("Basic Seekable Thing"), NULL, &mHR)
{
mSeekDelegate = inDelegate;
- mSeekTimeBase = 0;
+ //mSeekTimeBase = 0;
mSeekingCap = 0;
mSeekingCap = AM_SEEKING_CanSeekAbsolute |
@@ -22,7 +22,7 @@
BasicSeekable::BasicSeekable(void)
//: CUnknown(NAME("Basic Seekable Thing"), NULL, &mHR)
{
- mSeekTimeBase = 0;
+ //mSeekTimeBase = 0;
mSeekDelegate = NULL;
mSeekingCap = AM_SEEKING_CanSeekAbsolute |
AM_SEEKING_CanSeekForwards |
@@ -213,7 +213,7 @@
//seekDebug<<"Set pos : Requested Time : "<<*inoutCurrent<<endl;
HRESULT locHR = mSeekDelegate->SetPositions(inoutCurrent, inCurrentFlags, inStop, inStopFlags);
if (locHR == S_OK) {
- mSeekTimeBase = *inoutCurrent;
+ //mSeekTimeBase = *inoutCurrent;
//seekDebug<<"Set Pos : Actual Time : "<<mSeekTimeBase<<endl;
}
Modified: trunk/oggdsf/src/lib/core/directshow/dsfSeeking/BasicSeekable.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfSeeking/BasicSeekable.h 2004-07-15 19:28:35 UTC (rev 7140)
+++ trunk/oggdsf/src/lib/core/directshow/dsfSeeking/BasicSeekable.h 2004-07-15 20:29:52 UTC (rev 7141)
@@ -73,7 +73,7 @@
protected:
IMediaSeeking* mSeekDelegate;
- REFERENCE_TIME mSeekTimeBase;
+ //REFERENCE_TIME mSeekTimeBase;
HRESULT mHR;
//fstream seekDebug;
More information about the commits
mailing list