[xiph-commits] r8082 - trunk/oggdsf/src/lib/plugin/axAnxOggPlayer

illiminable at motherfish-iii.xiph.org illiminable at motherfish-iii.xiph.org
Sun Oct 24 03:09:10 PDT 2004


Author: illiminable
Date: 2004-10-24 03:09:09 -0700 (Sun, 24 Oct 2004)
New Revision: 8082

Modified:
   trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/ControlDialog.cpp
   trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/DSPlayer.cpp
   trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/DSPlayer.h
   trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/axAnxOggPlayer.aps
   trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/axAnxOggPlayer.rc
   trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/axAnxOggPlayer_i.c
   trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/axAnxOggPlayeridl.h
Log:
* Can now embed a fixed size video window in the control.

Modified: trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/ControlDialog.cpp
===================================================================
--- trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/ControlDialog.cpp	2004-10-24 09:19:36 UTC (rev 8081)
+++ trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/ControlDialog.cpp	2004-10-24 10:09:09 UTC (rev 8082)
@@ -44,7 +44,8 @@
 {
 	//PLay button.
 	debugLog<<"Play button pushed"<<endl;
-	mPlayer.loadFile("G:\\a.mp3");
+	mPlayer.loadFile("G:\\a.ogg", this->m_hWnd, 10, 100, 384, 240);
+	//mPlayer.loadFile("G:\\h.ogv");
 	mPlayer.play();
 }
 

Modified: trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/DSPlayer.cpp
===================================================================
--- trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/DSPlayer.cpp	2004-10-24 09:19:36 UTC (rev 8081)
+++ trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/DSPlayer.cpp	2004-10-24 10:09:09 UTC (rev 8082)
@@ -163,6 +163,156 @@
 
 	return retVal;
 }
+
+bool DSPlayer::loadFile(string inFileName, HWND inWindow, int inLeft, int inTop, int inWidth, int inHeight) {
+	//Debugging only
+	ULONG numRef = 0;
+	//
+
+
+	releaseInterfaces();
+	HRESULT locHR = S_OK;
+
+	
+	debugLog<<"File = "<<inFileName<<endl;
+	wstring locWFileName = toWStr(inFileName);
+	
+	
+	
+
+	//Have to use a local pointer or taking the adress of a member function makes the second level
+	// of indirection a __gc pointer.
+	IGraphBuilder* locGraphBuilder = NULL;
+	locHR = CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, IID_IGraphBuilder, (void **)&locGraphBuilder);
+	mGraphBuilder = locGraphBuilder;
+	
+	if (locHR != S_OK) {
+		mIsLoaded = false;
+		debugLog<<"Faild to make graph"<<endl;
+		return false;
+	}
+	
+	
+	//If it's an annodex file, then put the VMR 9 in the graph.
+	if (isFileAnnodex(inFileName)) {
+		debugLog<<"Is annodex"<<endl;
+		IBaseFilter* locVMR9 = NULL;
+
+		HRESULT locHR2 = S_OK;
+		locHR2 = mGraphBuilder->FindFilterByName(L"Video Mixing Renderer 9", &locVMR9);
+		if (locVMR9 == NULL) {
+			debugLog<<"Not in graph... making it !"<<endl;
+			locHR2= CoCreateInstance(CLSID_VideoMixingRenderer9, NULL, CLSCTX_INPROC, IID_IBaseFilter, (void **)&locVMR9);
+			if (locHR2 == S_OK) {
+				locHR2 = mGraphBuilder->AddFilter(locVMR9, L"Video Mixing Renderer 9");
+				numRef =
+					locVMR9->Release();
+				debugLog<<"VMR9 ref count = "<<numRef<<endl;
+				
+			}
+		} else {
+			numRef =
+				locVMR9->Release();
+
+			debugLog<<"VMR9 ref count = "<<numRef<<endl;
+		}
+
+
+		
+
+	}
+
+	debugLog<<"About to call render on "<<endl;
+	//Build the graph
+	locHR = mGraphBuilder->RenderFile(locWFileName.c_str(), NULL);
+	debugLog<<"After render call..."<<endl;
+	if (locHR != S_OK) {
+		debugLog<<"Render File FAILED !!"<<endl;
+		mIsLoaded = false;
+		return false;
+	}
+
+
+	//CHANGES HERE FOR EMBEDDED WINDOW
+	debugLog<<"Looking for IVideo Window"<<endl;
+	IVideoWindow* locVW = NULL;
+	locHR = locGraphBuilder->QueryInterface(IID_IVideoWindow, (void **)&locVW);
+
+	if (locHR == S_OK) {
+		debugLog<<"We got the IVideoWindow"<<endl;
+
+		locVW->put_MessageDrain((OAHWND)inWindow);
+
+
+		locVW->put_Owner((OAHWND)inWindow);
+		debugLog<<"Setting stuff..."<<endl;
+		locVW->SetWindowPosition(inLeft, inTop, inWidth, inHeight);
+		debugLog<<"Releasing windows"<<endl;
+		locVW->Release();
+
+		debugLog<<"Post release"<<endl;
+	}
+
+	//
+
+	debugLog<<"Render must have been ok"<<endl;
+	if (isFileAnnodex(inFileName)) {
+		debugLog<<"Is annodex"<<endl;
+		//Get the app control interface for CMML.
+		IBaseFilter* locCMMLFilter = NULL;
+		locHR = mGraphBuilder->FindFilterByName(L"CMML Decode Filter", &locCMMLFilter);
+		
+
+		if (locCMMLFilter != NULL) {
+			ICMMLAppControl* locCMMLAppControl = NULL;
+			
+			locHR = locCMMLFilter->QueryInterface(Y_IID_ICMMLAppControl, (void**)&locCMMLAppControl);
+			if (locCMMLAppControl != NULL) {
+				mCMMLAppControl = locCMMLAppControl;
+				
+				mCMMLAppControl->setCallbacks(mCMMLCallback);
+			}
+			numRef = 
+                locCMMLFilter->Release();
+
+			debugLog<<"CMML Filter ref Count = "<<numRef<<endl;
+		}
+
+	}
+	debugLog<<"After CMML Code..."<<endl;
+
+	//Get the media control interface
+	IMediaControl* locMediaControl = NULL;
+	locHR = mGraphBuilder->QueryInterface(IID_IMediaControl, (void**)&locMediaControl);
+	mMediaControl = locMediaControl;
+
+	if (locHR != S_OK) {
+		mIsLoaded = false;
+		return false;
+	} else {
+		mIsLoaded = true;
+	}
+
+	//get the media seeking interface if its available.
+	IMediaSeeking* locMediaSeeking = NULL;
+	locHR = mGraphBuilder->QueryInterface(IID_IMediaSeeking, (void**)&locMediaSeeking);
+	mMediaSeeking = locMediaSeeking;
+
+	//Get the media event interface
+	IMediaEvent* locMediaEvent = NULL;
+	locHR = locGraphBuilder->QueryInterface(IID_IMediaEvent, (void**)&locMediaEvent);
+
+	if (locHR == S_OK) {
+		mMediaEvent = locMediaEvent;
+		HANDLE locEventHandle = INVALID_HANDLE_VALUE;
+		locHR = locMediaEvent->GetEventHandle((OAEVENT*)&locEventHandle);
+		mEventHandle = locEventHandle;
+	}
+
+//	if (FAILED(hr))
+
+	return true;
+}
 bool DSPlayer::loadFile(string inFileName) {
 
 	//Debugging only

Modified: trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/DSPlayer.h
===================================================================
--- trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/DSPlayer.h	2004-10-24 09:19:36 UTC (rev 8081)
+++ trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/DSPlayer.h	2004-10-24 10:09:09 UTC (rev 8082)
@@ -37,6 +37,7 @@
 	
 
 		bool loadFile(string inFileName);
+		bool loadFile(string inFileName, HWND inWindow, int inLeft, int inTop, int inWidth, int inHeight);
 		bool play();
 		bool pause();
 		bool stop();

Modified: trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/axAnxOggPlayer.aps
===================================================================
(Binary files differ)

Modified: trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/axAnxOggPlayer.rc
===================================================================
--- trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/axAnxOggPlayer.rc	2004-10-24 09:19:36 UTC (rev 8081)
+++ trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/axAnxOggPlayer.rc	2004-10-24 10:09:09 UTC (rev 8082)
@@ -132,7 +132,6 @@
     WS_SYSMENU
 FONT 8, "MS Shell Dlg", 400, 0, 0x1
 BEGIN
-    LTEXT           "Static",IDC_STATIC,131,107,80,18
     PUSHBUTTON      "Play",IDC_BUTTON1,7,7,59,18
     PUSHBUTTON      "Pause",IDC_BUTTON2,77,7,53,19
     PUSHBUTTON      "Stop",IDC_BUTTON3,145,7,60,19

Modified: trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/axAnxOggPlayer_i.c
===================================================================
--- trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/axAnxOggPlayer_i.c	2004-10-24 09:19:36 UTC (rev 8081)
+++ trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/axAnxOggPlayer_i.c	2004-10-24 10:09:09 UTC (rev 8082)
@@ -6,7 +6,7 @@
 
 
  /* File created by MIDL compiler version 6.00.0361 */
-/* at Sun Oct 24 17:40:06 2004
+/* at Sun Oct 24 18:33:04 2004
  */
 /* Compiler settings for .\axAnxOggPlayer.idl:
     Oicf, W1, Zp8, env=Win32 (32b run)

Modified: trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/axAnxOggPlayeridl.h
===================================================================
--- trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/axAnxOggPlayeridl.h	2004-10-24 09:19:36 UTC (rev 8081)
+++ trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/axAnxOggPlayeridl.h	2004-10-24 10:09:09 UTC (rev 8082)
@@ -4,7 +4,7 @@
 
 
  /* File created by MIDL compiler version 6.00.0361 */
-/* at Sun Oct 24 17:40:06 2004
+/* at Sun Oct 24 18:33:04 2004
  */
 /* Compiler settings for .\axAnxOggPlayer.idl:
     Oicf, W1, Zp8, env=Win32 (32b run)



More information about the commits mailing list