[xiph-commits] r10433 -
branches/oggdsf_new_demux/src/lib/core/directshow/dsfOggDemux2
illiminable at svn.xiph.org
illiminable at svn.xiph.org
Fri Nov 25 04:12:42 PST 2005
Author: illiminable
Date: 2005-11-25 04:12:37 -0800 (Fri, 25 Nov 2005)
New Revision: 10433
Modified:
branches/oggdsf_new_demux/src/lib/core/directshow/dsfOggDemux2/OggStreamMapper.cpp
branches/oggdsf_new_demux/src/lib/core/directshow/dsfOggDemux2/OggStreamMapper.h
Log:
* Ignore unknown streams
Modified: branches/oggdsf_new_demux/src/lib/core/directshow/dsfOggDemux2/OggStreamMapper.cpp
===================================================================
--- branches/oggdsf_new_demux/src/lib/core/directshow/dsfOggDemux2/OggStreamMapper.cpp 2005-11-25 10:50:14 UTC (rev 10432)
+++ branches/oggdsf_new_demux/src/lib/core/directshow/dsfOggDemux2/OggStreamMapper.cpp 2005-11-25 12:12:37 UTC (rev 10433)
@@ -5,6 +5,8 @@
: mStreamState(eStreamState::STRMAP_READY)
, mParentFilter(inParentFilter)
, mParentFilterLock(inParentFilterLock)
+ , mFishHeadPacket(NULL)
+ , mSkeletonSerialNo(0)
{
}
@@ -48,8 +50,20 @@
//Partial fall through
case STRMAP_DATA:
{
+ if (mFishHeadPacket != NULL) {
+ if (inOggPage->header()->StreamSerialNo() == mSkeletonSerialNo) {
+ int x= 2;
+ }
+ }
OggDemuxPacketSourcePin* locPin = getMatchingPin(inOggPage->header()->StreamSerialNo());
- return locPin->acceptOggPage(inOggPage);
+ if (locPin != NULL) {
+ return locPin->acceptOggPage(inOggPage);
+ } else {
+ //Ignore unknown streams
+ delete inOggPage;
+ return true;
+ }
+
}
case STRMAP_FINISHED:
return false;
@@ -72,15 +86,42 @@
return locAllReady && (mPins.size() > 0);
}
-bool OggStreamMapper::addNewPin(OggPage* inOggPage)
+bool OggStreamMapper::isFishHead(OggPage* inOggPage)
{
- OggDemuxPacketSourcePin* locNewPin = new OggDemuxPacketSourcePin(NAME("OggPageSourcePin"), mParentFilter, mParentFilterLock, inOggPage->getPacket(0)->clone(), inOggPage->header()->StreamSerialNo());
- //locNewPin->AddRef();
+ StampedOggPacket* locPacket = inOggPage->getStampedPacket(0);
+
+ if (locPacket == NULL) {
+ return false;
+ } else {
+ if ((strncmp((const char*)locPacket->packetData(), "fishead\0", 8)) == 0) {
+ return true;
+ }
+ }
+ return false;
+}
+
+bool OggStreamMapper::handleFishHead(OggPage* inOggPage)
+{
+ mFishHeadPacket = inOggPage->getStampedPacket(0)->clone();
+ mSkeletonSerialNo = inOggPage->header()->StreamSerialNo();
delete inOggPage;
- mPins.push_back(locNewPin);
return true;
}
+bool OggStreamMapper::addNewPin(OggPage* inOggPage)
+{
+ //FISH::: Catch the fishead here.
+ if (isFishHead(inOggPage)) {
+ return handleFishHead(inOggPage);
+ } else {
+ OggDemuxPacketSourcePin* locNewPin = new OggDemuxPacketSourcePin(NAME("OggPageSourcePin"), mParentFilter, mParentFilterLock, inOggPage->getPacket(0)->clone(), inOggPage->header()->StreamSerialNo());
+ //locNewPin->AddRef();
+ delete inOggPage;
+ mPins.push_back(locNewPin);
+ return true;
+ }
+}
+
OggDemuxPacketSourcePin* OggStreamMapper::getMatchingPin(unsigned long inSerialNo)
{
OggDemuxPacketSourcePin* locPin = NULL;
Modified: branches/oggdsf_new_demux/src/lib/core/directshow/dsfOggDemux2/OggStreamMapper.h
===================================================================
--- branches/oggdsf_new_demux/src/lib/core/directshow/dsfOggDemux2/OggStreamMapper.h 2005-11-25 10:50:14 UTC (rev 10432)
+++ branches/oggdsf_new_demux/src/lib/core/directshow/dsfOggDemux2/OggStreamMapper.h 2005-11-25 12:12:37 UTC (rev 10433)
@@ -41,6 +41,12 @@
OggDemuxPacketSourceFilter* mParentFilter;
CCritSec* mParentFilterLock;
+ OggPacket* mFishHeadPacket;
+ unsigned long mSkeletonSerialNo;
+
bool addNewPin(OggPage* inOggPage);
OggDemuxPacketSourcePin* getMatchingPin(unsigned long inSerialNo);
+
+ bool handleFishHead(OggPage* inOggPage);
+ bool isFishHead(OggPage* inOggPage);
};
More information about the commits
mailing list