[xiph-commits] r11566 - branches/oggdsf_ce_port/src/lib/codecs/flac/filters/dsfNativeFLACSource

illiminable at svn.xiph.org illiminable at svn.xiph.org
Tue Jun 13 10:24:24 PDT 2006


Author: illiminable
Date: 2006-06-13 10:24:17 -0700 (Tue, 13 Jun 2006)
New Revision: 11566

Modified:
   branches/oggdsf_ce_port/src/lib/codecs/flac/filters/dsfNativeFLACSource/NativeFLACSourceFilter.cpp
   branches/oggdsf_ce_port/src/lib/codecs/flac/filters/dsfNativeFLACSource/NativeFLACSourcePin.cpp
Log:
* Identify places for 24 bit support in native flac

Modified: branches/oggdsf_ce_port/src/lib/codecs/flac/filters/dsfNativeFLACSource/NativeFLACSourceFilter.cpp
===================================================================
--- branches/oggdsf_ce_port/src/lib/codecs/flac/filters/dsfNativeFLACSource/NativeFLACSourceFilter.cpp	2006-06-13 14:39:34 UTC (rev 11565)
+++ branches/oggdsf_ce_port/src/lib/codecs/flac/filters/dsfNativeFLACSource/NativeFLACSourceFilter.cpp	2006-06-13 17:24:17 UTC (rev 11566)
@@ -81,10 +81,12 @@
 }
 
 //BaseFilter Interface
-int NativeFLACSourceFilter::GetPinCount() {
+int NativeFLACSourceFilter::GetPinCount() 
+{
 	return 1;
 }
-CBasePin* NativeFLACSourceFilter::GetPin(int inPinNo) {
+CBasePin* NativeFLACSourceFilter::GetPin(int inPinNo) 
+{
 	if (inPinNo == 0) {
 		return mFLACSourcePin;
 	} else {
@@ -93,12 +95,14 @@
 }
 
 //IAMFilterMiscFlags Interface
-ULONG NativeFLACSourceFilter::GetMiscFlags(void) {
+ULONG NativeFLACSourceFilter::GetMiscFlags(void) 
+{
 	return AM_FILTER_MISC_FLAGS_IS_SOURCE;
 }
 
 	//IFileSource Interface
-STDMETHODIMP NativeFLACSourceFilter::GetCurFile(LPOLESTR* outFileName, AM_MEDIA_TYPE* outMediaType) {
+STDMETHODIMP NativeFLACSourceFilter::GetCurFile(LPOLESTR* outFileName, AM_MEDIA_TYPE* outMediaType) 
+{
 	LPOLESTR x = SysAllocString(mFileName.c_str());
 	*outFileName = x;
 	return S_OK;
@@ -111,7 +115,7 @@
 	CAutoLock locLock(m_pLock);
 	mFileName = inFileName;
 
-	mInputFile.open(StringHelper::toNarrowStr(mFileName).c_str(), ios_base::in | ios_base::binary);
+	mInputFile.open(mFileName.c_str(), ios_base::in | ios_base::binary);
 
 	//CT> Added header check (for FLAC files with ID3 v1/2 tags in them)
 	//    We'll look in the first 128kb of the file
@@ -172,11 +176,13 @@
 
 
 //IMEdiaStreaming
-STDMETHODIMP NativeFLACSourceFilter::Run(REFERENCE_TIME tStart) {
+STDMETHODIMP NativeFLACSourceFilter::Run(REFERENCE_TIME tStart) 
+{
 	CAutoLock locLock(m_pLock);
 	return CBaseFilter::Run(tStart);
 }
-STDMETHODIMP NativeFLACSourceFilter::Pause(void) {
+STDMETHODIMP NativeFLACSourceFilter::Pause(void) 
+{
 	CAutoLock locLock(m_pLock);
 	if (m_State == State_Stopped) {
 		if (ThreadExists() == FALSE) {
@@ -189,7 +195,8 @@
 	return locHR;
 	
 }
-STDMETHODIMP NativeFLACSourceFilter::Stop(void) {
+STDMETHODIMP NativeFLACSourceFilter::Stop(void) 
+{
 	CAutoLock locLock(m_pLock);
 	CallWorker(THREAD_EXIT);
 	Close();
@@ -214,9 +221,11 @@
 				mJustSeeked = false;
 				bool res2 = false;
 				res2 = seek_absolute(mSeekRequest);
+                //ERROR???
 			}
 			
 			res = process_single();
+            //ERROR???
 
 			if (mWasEOF) {
 				break;
@@ -233,7 +242,8 @@
 }
 
 //CAMThread Stuff
-DWORD NativeFLACSourceFilter::ThreadProc(void) {
+DWORD NativeFLACSourceFilter::ThreadProc(void) 
+{
 	while(true) {
 		DWORD locThreadCommand = GetRequest();
 		switch(locThreadCommand) {
@@ -245,34 +255,41 @@
 				Reply(S_OK);
 				DataProcessLoop();
 				break;
+            //OTHER CASES?
 		}
 	}
 	return S_OK;
 }
 
 
-::FLAC__SeekableStreamDecoderReadStatus NativeFLACSourceFilter::read_callback(FLAC__byte outBuffer[], unsigned int* outNumBytes) {
+::FLAC__SeekableStreamDecoderReadStatus NativeFLACSourceFilter::read_callback(FLAC__byte outBuffer[], unsigned int* outNumBytes) 
+{
 	const unsigned long BUFF_SIZE = 8192;
 	mInputFile.read((char*)outBuffer, BUFF_SIZE);
 	*outNumBytes = mInputFile.gcount();
 	mWasEOF = mInputFile.eof();
 	return FLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_OK;
 }
-::FLAC__SeekableStreamDecoderSeekStatus NativeFLACSourceFilter::seek_callback(FLAC__uint64 inSeekPos) {
+::FLAC__SeekableStreamDecoderSeekStatus NativeFLACSourceFilter::seek_callback(FLAC__uint64 inSeekPos) 
+{
 	mInputFile.seekg(inSeekPos);
 	return FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_OK;
 }
-::FLAC__SeekableStreamDecoderTellStatus NativeFLACSourceFilter::tell_callback(FLAC__uint64* outTellPos) {
+::FLAC__SeekableStreamDecoderTellStatus NativeFLACSourceFilter::tell_callback(FLAC__uint64* outTellPos) 
+{
 	*outTellPos = mInputFile.tellg();
 	return FLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_OK;
 }
-::FLAC__SeekableStreamDecoderLengthStatus NativeFLACSourceFilter::length_callback(FLAC__uint64* outLength) {
+::FLAC__SeekableStreamDecoderLengthStatus NativeFLACSourceFilter::length_callback(FLAC__uint64* outLength) 
+{
 	*outLength = mFileSize;
 	return FLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_OK;
 }
-::FLAC__StreamDecoderWriteStatus NativeFLACSourceFilter::write_callback(const FLAC__Frame* inFrame,const FLAC__int32 *const inBuffer[]) {
+::FLAC__StreamDecoderWriteStatus NativeFLACSourceFilter::write_callback(const FLAC__Frame* inFrame,const FLAC__int32 *const inBuffer[]) 
+{
 	
 
+    //WFE::: wave format extensible
 	if (! mBegun) {
 		mBegun = true;
 		

Modified: branches/oggdsf_ce_port/src/lib/codecs/flac/filters/dsfNativeFLACSource/NativeFLACSourcePin.cpp
===================================================================
--- branches/oggdsf_ce_port/src/lib/codecs/flac/filters/dsfNativeFLACSource/NativeFLACSourcePin.cpp	2006-06-13 14:39:34 UTC (rev 11565)
+++ branches/oggdsf_ce_port/src/lib/codecs/flac/filters/dsfNativeFLACSource/NativeFLACSourcePin.cpp	2006-06-13 17:24:17 UTC (rev 11566)
@@ -64,7 +64,6 @@
 HRESULT NativeFLACSourcePin::DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate)
 {
 	mDataQueue->NewSegment(tStart, tStop, dRate);
-
 	return S_OK;
 }
 HRESULT NativeFLACSourcePin::DeliverEndOfStream(void)
@@ -92,6 +91,8 @@
 	mDataQueue = new COutputQueue (inReceivePin, &mFilterHR, FALSE, TRUE,1,TRUE, NUM_BUFFERS);
 	if (FAILED(mFilterHR)) {
 		//TODO::: Probably should handle this !
+        //CHECK::: See if it ever silently reports failure but actually does work before bailing here.
+        
 		mFilterHR = mFilterHR;
 	}
 	
@@ -105,7 +106,9 @@
 }
 
 	//CSourceStream virtuals
-HRESULT NativeFLACSourcePin::GetMediaType(int inPosition, CMediaType* outMediaType) {
+HRESULT NativeFLACSourcePin::GetMediaType(int inPosition, CMediaType* outMediaType) 
+{
+    //WFE::: Also offer extensible format
 	if (inPosition == 0) {
 		outMediaType->SetType(&MEDIATYPE_Audio);
 		outMediaType->SetSubtype(&MEDIASUBTYPE_PCM);
@@ -128,14 +131,17 @@
 		return VFW_S_NO_MORE_ITEMS;
 	}
 }
-HRESULT NativeFLACSourcePin::CheckMediaType(const CMediaType* inMediaType) {
+HRESULT NativeFLACSourcePin::CheckMediaType(const CMediaType* inMediaType) 
+{
+    //WFE::: Do check for extensible type
 	if ((inMediaType->majortype == MEDIATYPE_Audio) && (inMediaType->subtype == MEDIASUBTYPE_PCM) && (inMediaType->formattype == FORMAT_WaveFormatEx)) {
 		return S_OK;
 	} else {
 		return E_FAIL;
 	}
 }
-HRESULT NativeFLACSourcePin::DecideBufferSize(IMemAllocator* inoutAllocator, ALLOCATOR_PROPERTIES* inoutInputRequest) {
+HRESULT NativeFLACSourcePin::DecideBufferSize(IMemAllocator* inoutAllocator, ALLOCATOR_PROPERTIES* inoutInputRequest) 
+{
 	HRESULT locHR = S_OK;
 
 	ALLOCATOR_PROPERTIES locReqAlloc;
@@ -158,7 +164,8 @@
 }
 
 //This method is responsible for deleting the incoming buffer.
-HRESULT NativeFLACSourcePin::deliverData(unsigned char* inBuff, unsigned long inBuffSize, __int64 inStart, __int64 inEnd) {
+HRESULT NativeFLACSourcePin::deliverData(unsigned char* inBuff, unsigned long inBuffSize, __int64 inStart, __int64 inEnd) 
+{
 	//Locks !!
 	
 	IMediaSample* locSample = NULL;



More information about the commits mailing list