[xiph-commits] r9564 - trunk/oggdsf/src/lib/core/directshow/dsfOggMux

ozone at svn.xiph.org ozone at svn.xiph.org
Tue Jul 12 23:13:43 PDT 2005


Author: ozone
Date: 2005-07-12 23:13:34 -0700 (Tue, 12 Jul 2005)
New Revision: 9564

Added:
   trunk/oggdsf/src/lib/core/directshow/dsfOggMux/IOggMuxSettings.h
   trunk/oggdsf/src/lib/core/directshow/dsfOggMux/PropsOggMux.cpp
   trunk/oggdsf/src/lib/core/directshow/dsfOggMux/PropsOggMux.h
   trunk/oggdsf/src/lib/core/directshow/dsfOggMux/dsfOggMux.aps
   trunk/oggdsf/src/lib/core/directshow/dsfOggMux/resource.h
Modified:
   trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxFilter.cpp
   trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxFilter.h
   trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxInputPin.cpp
   trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxInputPin.h
   trunk/oggdsf/src/lib/core/directshow/dsfOggMux/dsfOggMux.vcproj
   trunk/oggdsf/src/lib/core/directshow/dsfOggMux/oggmuxdllstuff.h
Log:
oggdsf:
 * First attempt at adding a property page to the Ogg Mux filter, so that we can dynamically adjust the number of maximum number of packets per page.  Not working yet, but I'm checking it in anyway since it doesn't break anything (at least, I don't think it breaks anything ...)


Added: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/IOggMuxSettings.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggMux/IOggMuxSettings.h	2005-07-12 20:07:16 UTC (rev 9563)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggMux/IOggMuxSettings.h	2005-07-13 06:13:34 UTC (rev 9564)
@@ -0,0 +1,20 @@
+#pragma once
+
+#ifndef __IOGGMUXSETTINGS__
+#define __IOGGMUXSETTINGS__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+DECLARE_INTERFACE_(IOggMuxSettings, IUnknown) {
+
+	virtual STDMETHODIMP_(unsigned long) maxPacketsPerPage() PURE;
+	virtual STDMETHODIMP_(bool) setMaxPacketsPerPage(unsigned long inMaxPacketsPerPage) PURE;
+};
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
\ No newline at end of file


Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/IOggMuxSettings.h
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxFilter.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxFilter.cpp	2005-07-12 20:07:16 UTC (rev 9563)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxFilter.cpp	2005-07-13 06:13:34 UTC (rev 9564)
@@ -43,6 +43,13 @@
 	    OggMuxFilter::CreateInstance,	// Method to create an instance of MyComponent
         NULL,									// Initialization function
         NULL									// Set-up information (for filters)
+    },
+    { 
+		L"Ogg Muxer Properties",						// Name
+	    &CLSID_PropsOggMux,            // CLSID
+	    PropsOggMux::CreateInstance,	// Method to create an instance of MyComponent
+        NULL,									// Initialization function
+        NULL									// Set-up information (for filters)
     }
 
 };
@@ -87,7 +94,16 @@
 		*ppv = (IOggMuxProgress*)this;
 		((IUnknown*)*ppv)->AddRef();
 		return NOERROR;
+	} else if (riid == IID_IOggMuxSettings) {
+		*ppv = (IOggMuxSettings*)this;
+		((IUnknown*)*ppv)->AddRef();
+		return NOERROR;
+	} else if (riid == IID_ISpecifyPropertyPages) {
+		*ppv = (ISpecifyPropertyPages*)this;
+		((IUnknown*)*ppv)->AddRef();
+		return NOERROR;
 	}
+
 	return CBaseFilter::NonDelegatingQueryInterface(riid, ppv); 
 }
 
@@ -408,4 +424,53 @@
 	*pCurrent = mInterleaver->progressTime();
 	debugLog<<"GetCurrentPos : "<<*pCurrent<<endl;
 	return S_OK;
-}
\ No newline at end of file
+}
+
+//SpecifyPropertyPages Implementation
+STDMETHODIMP OggMuxFilter::GetPages(CAUUID* outPropPages) {
+	if (outPropPages == NULL) return E_POINTER;
+
+	const int NUM_PROP_PAGES = 1;
+    outPropPages->cElems = NUM_PROP_PAGES;
+    outPropPages->pElems = (GUID*)(CoTaskMemAlloc(sizeof(GUID) * NUM_PROP_PAGES));
+    if (outPropPages->pElems == NULL) 
+    {
+        return E_OUTOFMEMORY;
+    }
+
+	outPropPages->pElems[0] = CLSID_PropsOggMux;
+    
+    return S_OK;
+
+}
+
+STDMETHODIMP_(bool) OggMuxFilter::setMaxPacketsPerPage(unsigned long inMaxPacketsPerPage) {
+	for (std::vector<OggMuxInputPin*>::iterator locPinIterator = mInputPins.begin();
+		 locPinIterator != mInputPins.end();
+		 locPinIterator++) {
+		OggMuxInputPin* locPin = *locPinIterator;
+		locPin->SetPaginatorMaximumPacketsPerPage(inMaxPacketsPerPage);
+	}
+
+	return true;
+}
+
+STDMETHODIMP_(unsigned long) OggMuxFilter::maxPacketsPerPage() {
+	unsigned long locCurrentMaximumPacketsPerPage = 0;
+
+	for (std::vector<OggMuxInputPin*>::iterator locPinIterator = mInputPins.begin();
+		 locPinIterator != mInputPins.end();
+		 locPinIterator++) {
+		
+		OggMuxInputPin* locPin = *locPinIterator;
+
+		unsigned long locMaximumPacketsPerPageForThisPin =
+			locPin->PaginatorMaximumPacketsPerPage();
+
+		if (locMaximumPacketsPerPageForThisPin > locCurrentMaximumPacketsPerPage) {
+			locCurrentMaximumPacketsPerPage = locMaximumPacketsPerPageForThisPin;
+		}
+	}
+
+	return locCurrentMaximumPacketsPerPage;
+}

Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxFilter.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxFilter.h	2005-07-12 20:07:16 UTC (rev 9563)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxFilter.h	2005-07-13 06:13:34 UTC (rev 9564)
@@ -33,6 +33,8 @@
 #include "oggmuxdllstuff.h"
 #include "OggMuxInputPin.h"
 #include "IOggMuxProgress.h"
+#include "IOggMuxSettings.h"
+#include "PropsOggMux.h"
 #include "BasicSeekPassThrough.h"
 #include <libOOOgg/OggPageInterleaver.h>
 #include <libOOOgg/INotifyComplete.h>
@@ -53,6 +55,8 @@
 	,	public BasicSeekPassThrough
 	,	public INotifyComplete
 	,	public IOggMuxProgress
+	,	public IOggMuxSettings
+	,	public ISpecifyPropertyPages
 {
 public:
 	OggMuxFilter(void);
@@ -131,6 +135,14 @@
 	//IMediaSeeking Override to give progress. - This is unreliable !!
 	virtual STDMETHODIMP GetPositions(LONGLONG *pCurrent, LONGLONG *pStop);
 	virtual STDMETHODIMP GetCurrentPosition(LONGLONG *pCurrent);
+
+	//IOggMuxSettings Implementation
+	STDMETHODIMP_(unsigned long) maxPacketsPerPage();
+	STDMETHODIMP_(bool) setMaxPacketsPerPage(unsigned long inMaxPacketsPerPage);
+
+	//SpecifyPropertyPages Implementation
+	STDMETHODIMP OggMuxFilter::GetPages(CAUUID* outPropPages);
+
 protected:
 
 	bool SetupOutput();

Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxInputPin.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxInputPin.cpp	2005-07-12 20:07:16 UTC (rev 9563)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxInputPin.cpp	2005-07-13 06:13:34 UTC (rev 9564)
@@ -318,4 +318,15 @@
 	//HRESULT locHR = mParentFilter->NotifyEvent(EC_COMPLETE, S_OK, NULL);
 	return S_OK;
 	
-}
\ No newline at end of file
+}
+
+unsigned long OggMuxInputPin::PaginatorMaximumPacketsPerPage()
+{
+	return mPaginator.parameters()->mMaxPacksPerPage;
+}
+
+void OggMuxInputPin::SetPaginatorMaximumPacketsPerPage(unsigned long inMaxPacketsPerPage)
+{
+	mPaginator.parameters()->mMaxPacksPerPage = inMaxPacketsPerPage;
+}
+

Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxInputPin.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxInputPin.h	2005-07-12 20:07:16 UTC (rev 9563)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxInputPin.h	2005-07-13 06:13:34 UTC (rev 9564)
@@ -74,6 +74,12 @@
 
 	/// Notification the output pin of an upstream filter has been disconnected.
 	virtual HRESULT BreakConnect();
+
+	/// Find out the maximum number of packets per page this input pin's paginator is using
+	unsigned long PaginatorMaximumPacketsPerPage();
+
+	/// Set the maximum number of packets per page for the Ogg paginator
+	void SetPaginatorMaximumPacketsPerPage(unsigned long inMaxPacketsPerPage);
 	
 	//virtual HRESULT DeliverEndFlush(void);
 	//virtual HRESULT DeliverBeginFlush(void);

Added: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/PropsOggMux.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggMux/PropsOggMux.cpp	2005-07-12 20:07:16 UTC (rev 9563)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggMux/PropsOggMux.cpp	2005-07-13 06:13:34 UTC (rev 9564)
@@ -0,0 +1,112 @@
+#include "stdafx.h"
+#include "PropsOggMux.h"
+
+PropsOggMux::PropsOggMux(LPUNKNOWN inUnk, HRESULT* outHR)
+	:	CBasePropertyPage(NAME("illiminable Directshow Filters"), inUnk, IDD_OGG_MUX_SETTINGS, IDS_OGG_MUX_PROPS_STRING)
+	,	mOggMuxSettings(NULL)
+
+{
+	//debugLog.open("G:\\logs\\TheoProps.log", ios_base::out);
+	*outHR = S_OK;
+}
+
+PropsOggMux::~PropsOggMux(void)
+{
+	//debugLog.close();
+}
+
+CUnknown* PropsOggMux::CreateInstance(LPUNKNOWN inUnk, HRESULT* outHR)
+{
+    return new PropsOggMux(inUnk, outHR);
+}
+
+
+HRESULT PropsOggMux::OnApplyChanges(void)
+{
+	if (mOggMuxSettings == NULL) {
+		return E_POINTER;
+	}
+
+	mOggMuxSettings->setMaxPacketsPerPage(SendDlgItemMessage(m_hwnd,IDC_SLIDER_MAX_PACKETS_PER_PAGE, TBM_GETPOS, NOT_USED, NOT_USED));
+	SetClean();
+    return S_OK;
+}
+
+HRESULT PropsOggMux::OnActivate(void)
+{
+    char* locStrBuff = new char[16];
+
+	//SetupBitrateCombo();
+	//SetupKeyframeFreqCombo();
+	
+	//Set up the sliders
+    SendDlgItemMessage(m_Dlg, IDC_SLIDER_MAX_PACKETS_PER_PAGE, TBM_SETRANGE, TRUE, MAKELONG(0, 64));
+    SendDlgItemMessage(m_Dlg, IDC_SLIDER_MAX_PACKETS_PER_PAGE, TBM_SETTICFREQ, 1, 0);
+	SendDlgItemMessage(m_Dlg, IDC_SLIDER_MAX_PACKETS_PER_PAGE, TBM_SETPOS, 1, mOggMuxSettings->maxPacketsPerPage());
+
+	itoa(mOggMuxSettings->maxPacketsPerPage(), locStrBuff, 10);
+	SendDlgItemMessage(m_Dlg, IDC_LABEL_MAX_PACKETS_PER_PAGE, WM_SETTEXT, NOT_USED, (LPARAM)locStrBuff);
+
+	delete[] locStrBuff;
+    return S_OK;
+}
+
+HRESULT PropsOggMux::OnConnect(IUnknown *pUnk)
+{
+    
+	if (mOggMuxSettings != NULL) {
+		//mOggMuxSettings->Release();
+		mOggMuxSettings = NULL;
+	}
+
+    HRESULT locHR;
+    // Query pUnk for the filter's custom interface.
+    locHR = pUnk->QueryInterface(IID_IOggMuxSettings, (void**)(&mOggMuxSettings));
+    return locHR;
+}
+
+HRESULT PropsOggMux::OnDisconnect(void)
+{
+	if (mOggMuxSettings != NULL) {
+		//mTheoraEncodeSettings->Release();
+		mOggMuxSettings = NULL;
+	}
+    return S_OK;
+}
+void PropsOggMux::SetDirty()
+{
+    m_bDirty = TRUE;
+    if (m_pPageSite)
+    {
+        m_pPageSite->OnStatusChange(PROPPAGESTATUS_DIRTY);
+    }
+}
+
+void PropsOggMux::SetClean()
+{
+    m_bDirty = FALSE;
+    if (m_pPageSite)
+    {
+        m_pPageSite->OnStatusChange(PROPPAGESTATUS_CLEAN);
+    }
+}
+INT_PTR PropsOggMux::OnReceiveMessage(HWND hwnd,  UINT uMsg, WPARAM wParam, LPARAM lParam)
+{
+	char locBuff[16];
+    switch (uMsg)    {
+		case WM_COMMAND:
+		
+		case WM_HSCROLL:
+			if (HWND(lParam) == GetDlgItem(m_hwnd, IDC_SLIDER_MAX_PACKETS_PER_PAGE)) {
+				SetDirty();
+				itoa(SendDlgItemMessage(m_hwnd,IDC_SLIDER_MAX_PACKETS_PER_PAGE, TBM_GETPOS, NOT_USED, NOT_USED), (char*)&locBuff, 10);
+				SendDlgItemMessage(m_hwnd, IDC_LABEL_MAX_PACKETS_PER_PAGE, WM_SETTEXT, NOT_USED, (LPARAM)&locBuff);
+                 return (INT_PTR)TRUE;
+			}
+
+			break;
+	} // switch
+
+    // Did not handle the message.
+    return CBasePropertyPage::OnReceiveMessage(hwnd, uMsg, wParam, lParam);
+}


Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/PropsOggMux.cpp
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/PropsOggMux.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggMux/PropsOggMux.h	2005-07-12 20:07:16 UTC (rev 9563)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggMux/PropsOggMux.h	2005-07-13 06:13:34 UTC (rev 9564)
@@ -0,0 +1,41 @@
+#pragma once
+
+#include "IOggMuxSettings.h"
+#include "resource.h"
+
+#include <commctrl.h>
+//Debug
+//#include <fstream>
+using namespace std;
+//
+
+
+class PropsOggMux
+	:	public CBasePropertyPage
+{
+public:
+	static const UINT NOT_USED = 0;
+	PropsOggMux(LPUNKNOWN inUnk, HRESULT* outHR);
+	virtual ~PropsOggMux(void);
+
+	static CUnknown* WINAPI CreateInstance(LPUNKNOWN inUnk, HRESULT* outHR);
+
+	//CBasePropertyPage Virtual Overrides
+	HRESULT OnActivate(void);
+	HRESULT OnConnect(IUnknown *pUnk);
+	HRESULT OnDisconnect(void);
+	INT_PTR OnReceiveMessage(HWND hwnd,  UINT uMsg, WPARAM wParam, LPARAM lParam);
+	HRESULT OnApplyChanges(void);
+
+protected:
+
+	void SetDirty();
+	void SetClean();
+	//
+	IOggMuxSettings* mOggMuxSettings;
+
+	//Debug
+
+	//fstream debugLog;
+	//
+};


Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/PropsOggMux.h
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/dsfOggMux.aps
===================================================================
(Binary files differ)


Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/dsfOggMux.aps
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/dsfOggMux.vcproj
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggMux/dsfOggMux.vcproj	2005-07-12 20:07:16 UTC (rev 9563)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggMux/dsfOggMux.vcproj	2005-07-13 06:13:34 UTC (rev 9564)
@@ -282,6 +282,9 @@
 				RelativePath="OggMuxInputPin.cpp">
 			</File>
 			<File
+				RelativePath=".\PropsOggMux.cpp">
+			</File>
+			<File
 				RelativePath="stdafx.cpp">
 				<FileConfiguration
 					Name="Debug|Win32">
@@ -316,6 +319,9 @@
 				RelativePath=".\IOggMuxProgress.h">
 			</File>
 			<File
+				RelativePath=".\IOggMuxSettings.h">
+			</File>
+			<File
 				RelativePath="oggmuxdllstuff.h">
 			</File>
 			<File
@@ -325,12 +331,21 @@
 				RelativePath="OggMuxInputPin.h">
 			</File>
 			<File
+				RelativePath=".\PropsOggMux.h">
+			</File>
+			<File
+				RelativePath=".\resource.h">
+			</File>
+			<File
 				RelativePath="stdafx.h">
 			</File>
 		</Filter>
 		<Filter
 			Name="Resource Files"
 			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+			<File
+				RelativePath=".\dsfOggMux.rc">
+			</File>
 		</Filter>
 		<File
 			RelativePath="ReadMe.txt">

Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/oggmuxdllstuff.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggMux/oggmuxdllstuff.h	2005-07-12 20:07:16 UTC (rev 9563)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggMux/oggmuxdllstuff.h	2005-07-13 06:13:34 UTC (rev 9564)
@@ -57,6 +57,15 @@
 0x90d6513c, 0xa665, 0x4b16, 0xac, 0xa7, 0xb3, 0xd1, 0xd4, 0xef, 0xe5, 0x8d);
 
 
+
+// {30393ca2-c404-4744-a21e-90975700ea8f}
+DEFINE_GUID(CLSID_PropsOggMux,
+0x30393ca2, 0xc404, 0x4744, 0xa2, 0x1e, 0x90, 0x97, 0x57, 0x00, 0xea, 0x8f);
+
+// {3a2cf997-0aeb-4d3f-9846-b5db2ca4c80b}
+DEFINE_GUID(IID_IOggMuxSettings, 
+0x3a2cf997, 0x0aeb, 0x4d3f, 0x98, 0x46, 0xb5, 0xdb, 0x2c, 0xa4, 0xc8, 0x0b);
+
 //New section
 // {31CA0186-1FF0-4181-AA38-3CA4040BD260}
 DEFINE_GUID(CLSID_OggDemuxSourceFilter, 

Added: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/resource.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggMux/resource.h	2005-07-12 20:07:16 UTC (rev 9563)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggMux/resource.h	2005-07-13 06:13:34 UTC (rev 9564)
@@ -0,0 +1,21 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by dsfOggMux.rc
+//
+#define IDD_OGG_MUX_SETTINGS            9
+#define IDS_OGG_MUX_PROPS_STRING        103
+#define IDC_GROUP_BITRATE               1016
+#define IDC_GROUP_MAX_PACKETS_PER_PAGE  1016
+#define IDC_SLIDER_BITRATE              1017
+#define IDC_LABEL_BITRATE               1019
+
+// Next default values for new objects
+// 
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE        103
+#define _APS_NEXT_COMMAND_VALUE         40001
+#define _APS_NEXT_CONTROL_VALUE         1001
+#define _APS_NEXT_SYMED_VALUE           101
+#endif
+#endif


Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/resource.h
___________________________________________________________________
Name: svn:eol-style
   + native



More information about the commits mailing list