[xiph-commits] r10396 - in
branches/oggdsf_new_demux/src/lib/codecs/RawAudio:
dsfOggRawAudioExtractor dsfOggRawAudioInserter
illiminable at svn.xiph.org
illiminable at svn.xiph.org
Thu Nov 17 08:14:19 PST 2005
Author: illiminable
Date: 2005-11-17 08:14:07 -0800 (Thu, 17 Nov 2005)
New Revision: 10396
Modified:
branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioExtractor/OggRawAudioExtractorFilter.cpp
branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioExtractor/OggRawAudioExtractorFilter.h
branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioExtractor/OggRawAudioExtractorInputPin.cpp
branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioExtractor/OggRawAudioExtractorInputPin.h
branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioInserter/OggRawAudioInserterFilter.cpp
branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioInserter/OggRawAudioInserterInputPin.cpp
branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioInserter/OggRawAudioInserterInputPin.h
Log:
* Remove over-zealous copy and pasting
Modified: branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioExtractor/OggRawAudioExtractorFilter.cpp
===================================================================
--- branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioExtractor/OggRawAudioExtractorFilter.cpp 2005-11-17 15:52:54 UTC (rev 10395)
+++ branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioExtractor/OggRawAudioExtractorFilter.cpp 2005-11-17 16:14:07 UTC (rev 10396)
@@ -280,134 +280,11 @@
return S_FALSE;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- // unsigned long locLength = inSample->GetActualDataLength();
-
- // memcpy((void*)locBuff, (const void*)locInBuff, locLength);
- // locPack.mBuff = locBuff;
- // locPack.mLength = locLength;
-
- // unsigned long locNumLenBytes = locInBuff[0];
- //
- //
- // //Find out how many bytes of the header are the length field
- // const unsigned char LEN_MASK = 0xC2; //11000010
- // locNumLenBytes &= LEN_MASK;
- // locNumLenBytes = (locNumLenBytes >> 6) | ((locNumLenBytes&2) << 1);
-
- // __int64 locPackTime = 0;
- // if (locNumLenBytes != 0) {
- // for (int i = 0; i < locNumLenBytes; i++) {
- // locPackTime |= ((__int64)locInBuff[1+i] << (i * 8));
- // }
- // } else {
- // locPackTime = 1;
- // }
- //
- // mFramesBuffered += locPackTime;
- // locPack.mDuration = locPackTime;
- // locPack.mHeaderSize = locNumLenBytes + 1;
- // locPack.mIsKeyframe = ((locInBuff[0] & (1<<3)) != 0);
-
- // mPacketBuffer.push_back(locPack);
-
- // if (locEnd > 0) {
- // REFERENCE_TIME locGlobalStart = 0;
- // REFERENCE_TIME locGlobalEnd = 0;
-
- // __int64 locFrameDuration = mInputPin->getVideoFormatBlock()->AvgTimePerFrame;
- // __int64 locNumBuffered = mPacketBuffer.size();
-
- // locGlobalEnd = locEnd * locFrameDuration;
- // locGlobalStart = locGlobalEnd - (mFramesBuffered * locFrameDuration);
-
- // __int64 locUptoStart = locGlobalStart;
- // __int64 locUptoEnd = locGlobalStart;
-
- // __int64 locAdjustedStart = 0;
- // __int64 locAdjustedEnd = 0;
- // for (int i = 0; i < locNumBuffered; i++) {
- // IMediaSample* locOutSample = NULL;
- //
- // locHR = InitializeOutputSample(inSample, &locOutSample);
- // if (locHR == S_OK) {
- // locUptoEnd = locUptoStart + (mPacketBuffer[i].mDuration * locFrameDuration);
-
- // locAdjustedStart = locUptoStart - mSegStart;
- // locAdjustedEnd = locUptoEnd - mSegStart;
- // locOutSample->SetTime(&locAdjustedStart, &locAdjustedEnd);
- // locOutSample->SetMediaTime(&locAdjustedStart, &locAdjustedEnd);
- // locOutSample->SetSyncPoint(mPacketBuffer[i].mIsKeyframe);
- // locOutSample->SetActualDataLength(mPacketBuffer[i].mLength - mPacketBuffer[i].mHeaderSize);
- // BYTE* locOutBuff = NULL;
- // locOutSample->GetPointer(&locOutBuff);
- // memcpy((void*)locOutBuff, (const void*)(mPacketBuffer[i].mBuff + mPacketBuffer[i].mHeaderSize), mPacketBuffer[i].mLength - mPacketBuffer[i].mHeaderSize);
- // locHR = m_pOutput->Deliver(locOutSample);
- // locOutSample->Release();
-
- // if (locHR != S_OK) {
- // deleteBufferedPackets();
- // return S_FALSE;
- // }
-
- //
- // locUptoStart = locUptoEnd;
-
- //
- // } else {
- // deleteBufferedPackets();
- // return S_FALSE;
- // }
-
- // }
-
- // deleteBufferedPackets();
- // return S_OK;
-
-
-
-
-
- // } else {
- // return S_OK;
- // }
-
- //}
}
HRESULT OggRawAudioExtractorFilter::Transform(IMediaSample* inInputSample, IMediaSample* inOutputSample)
{
- //BYTE* locInBuff = NULL;
- //BYTE* locOutBuff = NULL;
-
- //inInputSample->GetPointer(&locInBuff);
- //inOutputSample->GetPointer(&locOutBuff);
-
- //mempcy((void*)locOutBuff, (const void*)locInBuff, inInputSample->GetActualDataLength());
return E_NOTIMPL;
}
Modified: branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioExtractor/OggRawAudioExtractorFilter.h
===================================================================
--- branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioExtractor/OggRawAudioExtractorFilter.h 2005-11-17 15:52:54 UTC (rev 10395)
+++ branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioExtractor/OggRawAudioExtractorFilter.h 2005-11-17 16:14:07 UTC (rev 10396)
@@ -46,9 +46,6 @@
: public CTransformFilter
{
public:
- //Friends
- //friend class OGMDecodeInputPin;
- //friend class OGMDecodeOutputPin;
//Constructors and Destructors
OggRawAudioExtractorFilter(void);
Modified: branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioExtractor/OggRawAudioExtractorInputPin.cpp
===================================================================
--- branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioExtractor/OggRawAudioExtractorInputPin.cpp 2005-11-17 15:52:54 UTC (rev 10395)
+++ branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioExtractor/OggRawAudioExtractorInputPin.cpp 2005-11-17 16:14:07 UTC (rev 10396)
@@ -177,53 +177,7 @@
}
- //__int64 locTimePerBlock = iLE_Math::CharArrToInt64(inHeaderPack->packetData() + 17);
- //
- //__int64 locSamplesPerBlock = iLE_Math::CharArrToInt64(inHeaderPack->packetData() + 25);
-
- ////debugLog<<"t/block = "<<locTimePerBlock<<" Sam/block = "<<locSamplesPerBlock<<endl;
-
- //mVideoFormatBlock->AvgTimePerFrame = locTimePerBlock / locSamplesPerBlock;
-
- ////debugLog<<"Time per frame = "<<mVideoFormatBlock->AvgTimePerFrame<<endl;
-
- //__int64 locFPSec = (UNITS / locTimePerBlock) * locSamplesPerBlock;
-
- ////debugLog<<"Rate = "<<locFPSec<<" fps"<<endl;
- //unsigned short locBPSample = ((unsigned char)(inHeaderPack->packetData()[41])) + (((unsigned short)(inHeaderPack->packetData()[42])) * 256);
-
- //
- //
- //mVideoFormatBlock->bmiHeader.biBitCount = locBPSample;
- //mVideoFormatBlock->bmiHeader.biClrImportant = 0; //All colours important
- //mVideoFormatBlock->bmiHeader.biClrUsed = 0; //Use max colour depth
- //mVideoFormatBlock->bmiHeader.biCompression = MAKEFOURCC(inHeaderPack->packetData()[9], inHeaderPack->packetData()[10], inHeaderPack->packetData()[11], inHeaderPack->packetData()[12]);;
-
- //unsigned long locHeight = iLE_Math::charArrToULong(inHeaderPack->packetData() + 49);
- //unsigned long locWidth = iLE_Math::charArrToULong(inHeaderPack->packetData() + 45);
-
- //mVideoFormatBlock->dwBitRate = 0;
-
- //mVideoFormatBlock->bmiHeader.biHeight = locHeight;
- //mVideoFormatBlock->bmiHeader.biPlanes = 1; //Must be 1
- //mVideoFormatBlock->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); //????? Size of what ?
- //mVideoFormatBlock->bmiHeader.biSizeImage = (locHeight * locWidth * locBPSample) / 8; //Size in bytes of image ??
- //mVideoFormatBlock->bmiHeader.biWidth = locWidth;
- //mVideoFormatBlock->bmiHeader.biXPelsPerMeter = 2000; //Fuck knows
- //mVideoFormatBlock->bmiHeader.biYPelsPerMeter = 2000; //" " " " "
- //
- //mVideoFormatBlock->rcSource.top = 0;
- //mVideoFormatBlock->rcSource.bottom = locHeight;
- //mVideoFormatBlock->rcSource.left = 0;
- //mVideoFormatBlock->rcSource.right = locWidth;
-
- //mVideoFormatBlock->rcTarget.top = 0;
- //mVideoFormatBlock->rcTarget.bottom = locHeight;
- //mVideoFormatBlock->rcTarget.left = 0;
- //mVideoFormatBlock->rcTarget.right = locWidth;
-
- //mVideoFormatBlock->dwBitErrorRate=0;
return true;
}
string OggRawAudioExtractorInputPin::getCodecShortName()
Modified: branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioExtractor/OggRawAudioExtractorInputPin.h
===================================================================
--- branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioExtractor/OggRawAudioExtractorInputPin.h 2005-11-17 15:52:54 UTC (rev 10395)
+++ branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioExtractor/OggRawAudioExtractorInputPin.h 2005-11-17 16:14:07 UTC (rev 10396)
@@ -70,6 +70,6 @@
};
- //static const unsigned long OGM_BUFFER_SIZE = 1024*512*3;;
+
};
Modified: 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 15:52:54 UTC (rev 10395)
+++ branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioInserter/OggRawAudioInserterFilter.cpp 2005-11-17 16:14:07 UTC (rev 10396)
@@ -73,9 +73,8 @@
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;
Modified: 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 15:52:54 UTC (rev 10395)
+++ branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioInserter/OggRawAudioInserterInputPin.cpp 2005-11-17 16:14:07 UTC (rev 10396)
@@ -249,95 +249,15 @@
}
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)
Modified: 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 15:52:54 UTC (rev 10395)
+++ branches/oggdsf_new_demux/src/lib/codecs/RawAudio/dsfOggRawAudioInserter/OggRawAudioInserterInputPin.h 2005-11-17 16:14:07 UTC (rev 10396)
@@ -51,7 +51,6 @@
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);
@@ -71,7 +70,7 @@
virtual void DestroyCodec();
- //WAVEFORMATEX* mWaveFormat;
+
__int64 mUptoFrame;
enum eRawAudioFormat {
More information about the commits
mailing list