[xiph-commits] r8680 - trunk/oggdsf/src/lib/player/libDSPlayDotNET

illiminable at motherfish-iii.xiph.org illiminable at motherfish-iii.xiph.org
Sat Jan 8 11:14:41 PST 2005


Author: illiminable
Date: 2005-01-08 11:14:41 -0800 (Sat, 08 Jan 2005)
New Revision: 8680

Modified:
   trunk/oggdsf/src/lib/player/libDSPlayDotNET/DSPlay.cpp
   trunk/oggdsf/src/lib/player/libDSPlayDotNET/DSPlay.h
Log:
* Change the order of the interface releasing.
* Move the debuglog deletion after the interface releasing.
* Some documentation of libDSPlay.

Modified: trunk/oggdsf/src/lib/player/libDSPlayDotNET/DSPlay.cpp
===================================================================
--- trunk/oggdsf/src/lib/player/libDSPlayDotNET/DSPlay.cpp	2005-01-08 18:56:10 UTC (rev 8679)
+++ trunk/oggdsf/src/lib/player/libDSPlayDotNET/DSPlay.cpp	2005-01-08 19:14:41 UTC (rev 8680)
@@ -131,8 +131,9 @@
 DSPlay::~DSPlay(void) {
 	*debugLog<<"Killing DSPlay"<<endl;
 	debugLog->close();
+	
+	releaseInterfaces();
 	delete debugLog;
-	releaseInterfaces();
 	CoUninitialize();
 }
 
@@ -150,6 +151,8 @@
 
 }
 void DSPlay::releaseInterfaces() {
+
+	mVideoRenderType = VR_NONE;
 	*debugLog<<"Releasing interfaces"<<endl;
 	ULONG numRef = 0;
 	if (mMediaControl != NULL) {
@@ -183,14 +186,7 @@
 		mCMMLAppControl = NULL;
 	}
 
-	*debugLog<<"Before Graph release..."<<endl;
-	if (mGraphBuilder != NULL) {
-		numRef =
-            mGraphBuilder->Release();
 
-		*debugLog<<"Graph Builder count = "<<numRef<<endl;
-		mGraphBuilder = NULL;
-	}
 
 	if (mVideoWindow != NULL) {
 		numRef =
@@ -216,8 +212,19 @@
 		mVMR7Window = NULL;
 	}
 
+		*debugLog<<"Before Graph release..."<<endl;
+	if (mGraphBuilder != NULL) {
+		numRef =
+            mGraphBuilder->Release();
 
+		*debugLog<<"Graph Builder count = "<<numRef<<endl;
+		mGraphBuilder = NULL;
+	}
+
+
 	*debugLog<<"After graph release>.."<<endl;
+
+	mIsLoaded = false;
 	//TODO::: Release everything !
 }
 

Modified: trunk/oggdsf/src/lib/player/libDSPlayDotNET/DSPlay.h
===================================================================
--- trunk/oggdsf/src/lib/player/libDSPlayDotNET/DSPlay.h	2005-01-08 18:56:10 UTC (rev 8679)
+++ trunk/oggdsf/src/lib/player/libDSPlayDotNET/DSPlay.h	2005-01-08 19:14:41 UTC (rev 8680)
@@ -74,30 +74,55 @@
 		DSPlay(IntPtr inWindowHandle, Int32 inLeft, Int32 inTop, Int32 inWidth, Int32 inHeight);
 		~DSPlay(void);
 
+		/// Load the named file into the player.
 		bool loadFile(String* inFileName);
+
+		/// Start playing the media file.
 		bool play();
+
+		/// Pause the media file.
 		bool pause();
+
+		/// Stop the media file.
 		bool stop();
+
+		/// Seek to the specified time in 100 nanoseconds units. ie 10 000 000 per second.
 		Int64 seek(Int64 inTime);
+
+		/// Seek to the start of the media file.
 		Int64 seekStart();
 		Int64 queryPosition();
 
+		/// Repaints the frame. Only needed for windowless rendering.
 		void repaint();
 
+		/// Returns if there is a file loaded.
 		bool isLoaded();
+
+		/// Returns the file size in bytes of the media file.
 		Int64 fileSize();
+
+		/// Returns the duration of the file in 100 nanosecond units. ie 10 000 000 per second.
 		Int64 fileDuration();
 
+		/// Returns a .NET Bitmap class of the current video frame. Requires Renderless mode.
 		System::Drawing::Bitmap* GetImage();
 	
+		/// Sets the callback for media events. Notably EC_COMPLETE.
+		bool setMediaEventCallback(IDNMediaEvent* inMediaEventCallback);
 
-		bool setMediaEventCallback(IDNMediaEvent* inMediaEventCallback);
+		/// Returns a pointer to the current media event callback.
 		IDNMediaEvent* getMediaEventCallback();
 
+		/// Sets the callback for CMMLTags. Only valid for annodex files.
 		bool setCMMLCallbacks(IDNCMMLCallbacks* inCMMLCallbacks);
+
+		/// Triggers an event check, which if needed will fire the callbacks.
 		bool checkEvents();
 
+		/// Releases all the interfaces in use and unloads the file.
 		void releaseInterfaces();
+
 	protected:
 		//static wstring toWStr(std::string inString);
 		IGraphBuilder* mGraphBuilder;
@@ -126,8 +151,6 @@
 		__int64 mFileSize;
 		bool isFileAnnodex(String* inFilename);
 
-		
-
 		__value enum eVideoRenderer {
 			VR_VIDEO_WINDOW,
 			VR_VMR7,



More information about the commits mailing list