[xiph-commits] r8086 - trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource

illiminable at motherfish-iii.xiph.org illiminable at motherfish-iii.xiph.org
Mon Oct 25 00:22:48 PDT 2004


Author: illiminable
Date: 2004-10-25 00:22:47 -0700 (Mon, 25 Oct 2004)
New Revision: 8086

Added:
   trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/dsfNativeFLACSource.h
Modified:
   trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/NativeFLACSourceFilter.cpp
   trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/dsfNativeFLACSource.cpp
   trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/dsfNativeFLACSource.vcproj
Log:
* Removed some accidentally pasted code.. fixed the dll linkage for FLAC native.

Modified: trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/NativeFLACSourceFilter.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/NativeFLACSourceFilter.cpp	2004-10-25 07:17:11 UTC (rev 8085)
+++ trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/NativeFLACSourceFilter.cpp	2004-10-25 07:22:47 UTC (rev 8086)
@@ -170,121 +170,8 @@
 
 HRESULT NativeFLACSourceFilter::DataProcessLoop() {
 
-    do 
-    {
-        /* parse the input data */
-        state = dirac_parse(decoder);
-        
-        switch (state)
-        {
-        case STATE_BUFFER:
-            /*
-            * parser is out of data. Read data from input stream and pass it
-            * on to the parser
-            */
-            bytes = fread (buffer, 1, sizeof(buffer), ifp);
-            if (bytes)
-                dirac_buffer (decoder, buffer, buffer + bytes);
-            break;
-
-        case STATE_SEQUENCE:
-            {
-            /*
-            * Start of sequence detected. Allocate for the frame buffers and
-            * pass this buffer to the parser
-            */
-            unsigned char *buf[3];
-
-            if (verbose)
-            {
-                fprintf (stderr, "SEQUENCE : width=%d height=%d chroma=%s chroma_width=%d chroma_height=%d num_frames=%d frame_rate=%d, interlace=%s topfieldfirst=%s\n", 
-                decoder->seq_params.width,
-                decoder->seq_params.height,
-                chroma2string(decoder->seq_params.chroma),
-                decoder->seq_params.chroma_width,
-                decoder->seq_params.chroma_height,
-                decoder->seq_params.num_frames,
-                decoder->seq_params.frame_rate,
-                decoder->seq_params.interlace ? "yes" : "no",
-                decoder->seq_params.interlace ? "yes" : "no");
-            }
-
-            FreeFrameBuffer(decoder);
-
-            buf[0] = buf[1] = buf[2] = 0;
-
-            buf[0] = (unsigned char *)malloc (decoder->seq_params.width * decoder->seq_params.height);
-            if (decoder->seq_params.chroma != Yonly)
-            {
-                buf[1] = (unsigned char *)malloc (decoder->seq_params.chroma_width * decoder->seq_params.chroma_height);
-                buf[2] = (unsigned char *)malloc (decoder->seq_params.chroma_width * decoder->seq_params.chroma_height);
-            }
-            dirac_set_buf (decoder, buf, NULL);
-
-            /* write the header file */
-            WritePicHeader(decoder, fphdr);
-            }
-            break;
-
-        case STATE_SEQUENCE_END:
-            /*
-            * End of Sequence detected. Free the frame buffers
-            */
-            if (verbose)
-                fprintf (stderr, "SEQUENCE_END\n");
-            
-            FreeFrameBuffer(decoder);
-            break;
-        
-        case STATE_PICTURE_START:
-            /*
-            * Start of frame detected. If decoder is too slow and frame can be
-            * skipped, inform the parser to skip decoding the frame
-            */
-            num_frames++;
-            if (verbose)
-            {
-                fprintf (stderr, "PICTURE_START : frame_type=%s frame_num=%d\n",
-                    ftype2string(decoder->frame_params.ftype),
-                    decoder->frame_params.fnum);
-            }
-            /* Just for testing skip every L2_frame */
-            if (skip && decoder->frame_params.ftype == L2_frame)
-            {
-                if (verbose)
-                    fprintf (stderr, "              : Skipping frame\n");
-
-                dirac_skip (decoder, 1);
-            }
-            else
-                dirac_skip (decoder, 0);
-            break;
-
-        case STATE_PICTURE_AVAIL:
-            if (verbose)
-            {
-                fprintf (stderr, "PICTURE_AVAIL : frame_type=%s frame_num=%d\n",
-                    ftype2string(decoder->frame_params.ftype),
-                    decoder->frame_params.fnum);
-            }
-            /* picture available for display */
-            WritePicData(decoder, fpdata);
-            break;
-
-        case STATE_INVALID:
-            /* Invalid state. Stop all processing */
-            fprintf (stderr, "Error processing file %s\n", iname);
-            break;
-
-        default:
-            continue;
-        }
-    } while (bytes > 0 && state != STATE_INVALID);
+ 
 
-
-
-
-
 	return S_OK;
 }
 

Modified: trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/dsfNativeFLACSource.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/dsfNativeFLACSource.cpp	2004-10-25 07:17:11 UTC (rev 8085)
+++ trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/dsfNativeFLACSource.cpp	2004-10-25 07:22:47 UTC (rev 8086)
@@ -1,12 +1,118 @@
-// dsfNativeFLACSource.cpp : Defines the entry point for the DLL application.
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
 //
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+//  notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+//  notice, this list of conditions and the following disclaimer in the
+//  documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors 
+//  may be used to endorse or promote products derived from this software 
+//  without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#include "StdAfx.h"
 
-#include "stdafx.h"
-BOOL APIENTRY DllMain( HANDLE hModule, 
-                       DWORD  ul_reason_for_call, 
-                       LPVOID lpReserved
-					 )
+
+
+
+extern "C" BOOL WINAPI DllEntryPoint(HINSTANCE, ULONG, LPVOID);
+BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
 {
-    return TRUE;
+    return DllEntryPoint((HINSTANCE)(hModule), dwReason, lpReserved);
 }
 
+
+//The folowing two functions do the registration and deregistration of the dll and it's contained com objects.
+STDAPI DllRegisterServer()
+{
+	
+	////TO DO::: Should we be releasing the filter mapper even when we return early ?
+ //   HRESULT hr;
+ //   IFilterMapper2* locFilterMapper = NULL;
+	//
+ //   hr = AMovieDllRegisterServer2(TRUE);
+	//if (FAILED(hr)) {
+	//	
+ //       return hr;
+	//}
+	//
+	//
+
+ //   hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER, IID_IFilterMapper2, (void **)&locFilterMapper);
+
+	//
+	//if (FAILED(hr)) {
+ //       return hr;
+	//}
+	//
+	//hr = locFilterMapper->RegisterFilter(
+	//	CLSID_OggDemuxSourceFilter,						// Filter CLSID. 
+	//	L"Ogg Demux Source Filter",							// Filter name.
+ //       NULL,										// Device moniker. 
+ //       &CLSID_LegacyAmFilterCategory,				// Direct Show general category
+ //       L"Ogg Demux Source Filter",							// Instance data. ???????
+ //       &OggDemuxSourceFilterReg								// Pointer to filter information.
+ //   );
+
+
+	////Only call once... if you need multiple you have to fix the hack job in RegWrap !
+	//RegWrap::addMediaPlayerDesc("Ogg File",  "*.ogg;*.ogv;*.oga;*.spx");
+
+
+
+
+
+ //   locFilterMapper->Release();
+
+ //   return hr;
+	return S_OK;
+}
+
+STDAPI DllUnregisterServer()
+{
+	////This is not a general purpose function.
+	//RegWrap::removeMediaDesc();
+
+ //  HRESULT hr;
+ //   IFilterMapper2* locFilterMapper = NULL;
+
+ //   hr = AMovieDllRegisterServer2(FALSE);
+	//if (FAILED(hr)) {
+	//	
+ //       return hr;
+	//}
+ //
+ //   hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER,
+ //           IID_IFilterMapper2, (void **)&locFilterMapper);
+
+	//if (FAILED(hr)) {
+ //       return hr;
+	//}
+	//
+
+ //   hr = locFilterMapper->UnregisterFilter(&CLSID_LegacyAmFilterCategory, 
+ //           L"Ogg Demux Source Filter", CLSID_OggDemuxSourceFilter);
+
+	////
+ //   locFilterMapper->Release();
+ //   return hr;
+	return S_OK;	
+}

Added: trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/dsfNativeFLACSource.h
===================================================================

Modified: trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/dsfNativeFLACSource.vcproj
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/dsfNativeFLACSource.vcproj	2004-10-25 07:17:11 UTC (rev 8085)
+++ trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/dsfNativeFLACSource.vcproj	2004-10-25 07:22:47 UTC (rev 8086)
@@ -144,6 +144,9 @@
 			Filter="h;hpp;hxx;hm;inl;inc;xsd"
 			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
 			<File
+				RelativePath=".\dsfNativeFLACSource.h">
+			</File>
+			<File
 				RelativePath=".\NativeFLACSourceFilter.h">
 			</File>
 			<File



More information about the commits mailing list