[xiph-commits] r7978 - in trunk/oggdsf/src:
lib/player/libDSPlayDotNET tools/DNPlay
illiminable at motherfish-iii.xiph.org
illiminable at motherfish-iii.xiph.org
Mon Oct 11 04:15:20 PDT 2004
Author: illiminable
Date: 2004-10-11 04:15:19 -0700 (Mon, 11 Oct 2004)
New Revision: 7978
Modified:
trunk/oggdsf/src/lib/player/libDSPlayDotNET/DSPlay.cpp
trunk/oggdsf/src/lib/player/libDSPlayDotNET/DSPlay.h
trunk/oggdsf/src/tools/DNPlay/frmDNPlay.cs
Log:
* Got rid of the duplicated video windows that were happening when you followed an annodex link.
Modified: trunk/oggdsf/src/lib/player/libDSPlayDotNET/DSPlay.cpp
===================================================================
--- trunk/oggdsf/src/lib/player/libDSPlayDotNET/DSPlay.cpp 2004-10-11 09:15:37 UTC (rev 7977)
+++ trunk/oggdsf/src/lib/player/libDSPlayDotNET/DSPlay.cpp 2004-10-11 11:15:19 UTC (rev 7978)
@@ -58,6 +58,8 @@
{
CoInitialize(NULL);
mCMMLProxy = new CMMLCallbackProxy; //Need to delete this !
+ debugLog = new fstream;
+ debugLog->open("G:\\logs\\dsplay.log", ios_base::out);
}
bool DSPlay::checkEvents() {
@@ -110,42 +112,65 @@
// }
DSPlay::~DSPlay(void) {
+ delete debugLog;
releaseInterfaces();
CoUninitialize();
}
void DSPlay::releaseInterfaces() {
- if (mGraphBuilder != NULL) {
- mGraphBuilder->Release();
- mGraphBuilder = NULL;
- }
-
+ *debugLog<<"Releasing interfaces"<<endl;
+ ULONG numRef = 0;
if (mMediaControl != NULL) {
- mMediaControl->Release();
+ numRef =
+ mMediaControl->Release();
+ *debugLog<<"Media Control count = "<<numRef<<endl;
mMediaControl = NULL;
}
if (mMediaSeeking != NULL) {
- mMediaSeeking->Release();
+ numRef =
+ mMediaSeeking->Release();
+
+ *debugLog<<"Media Seeking count = "<<numRef<<endl;
mMediaSeeking = NULL;
}
if (mMediaEvent != NULL) {
- mMediaEvent->Release();
+ numRef =
+ mMediaEvent->Release();
+
+ *debugLog<<"Media Event count = "<<numRef<<endl;
mMediaEvent = NULL;
}
if (mCMMLAppControl != NULL) {
- mCMMLAppControl->Release();
+ numRef =
+ mCMMLAppControl->Release();
+
+ *debugLog<<"CMML App control count = "<<numRef<<endl;
mCMMLAppControl = NULL;
}
+ if (mGraphBuilder != NULL) {
+ numRef =
+ mGraphBuilder->Release();
+
+ *debugLog<<"Graph Builder count = "<<numRef<<endl;
+ mGraphBuilder = NULL;
+ }
+
+
+
//TODO::: Release everything !
}
bool DSPlay::loadFile(String* inFileName) {
-
+ //Debugging only
+ ULONG numRef = 0;
+ //
+
+
releaseInterfaces();
HRESULT locHR = S_OK;
@@ -160,6 +185,7 @@
IGraphBuilder* locGraphBuilder = NULL;
locHR = CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, IID_IGraphBuilder, (void **)&locGraphBuilder);
mGraphBuilder = locGraphBuilder;
+
if (locHR != S_OK) {
mIsLoaded = false;
return false;
@@ -171,18 +197,25 @@
IBaseFilter* locVMR9 = NULL;
- HRESULT locHR = S_OK;
- locHR = mGraphBuilder->FindFilterByName(L"Video Mixing Renderer 9", &locVMR9);
+ HRESULT locHR2 = S_OK;
+ locHR2 = mGraphBuilder->FindFilterByName(L"Video Mixing Renderer 9", &locVMR9);
if (locVMR9 == NULL) {
locHR= CoCreateInstance(CLSID_VideoMixingRenderer9, NULL, CLSCTX_INPROC, IID_IBaseFilter, (void **)&locVMR9);
- if (locHR == S_OK) {
- locHR = mGraphBuilder->AddFilter(locVMR9, L"Video Mixing Renderer 9");
- if (locHR != S_OK) {
+ 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;
}
+
}
@@ -199,6 +232,7 @@
//Get the app control interface for CMML.
IBaseFilter* locCMMLFilter = NULL;
locHR = mGraphBuilder->FindFilterByName(L"CMML Decode Filter", &locCMMLFilter);
+
if (locCMMLFilter != NULL) {
ICMMLAppControl* locCMMLAppControl = NULL;
@@ -208,6 +242,10 @@
mCMMLAppControl = locCMMLAppControl;
mCMMLAppControl->setCallbacks(mCMMLProxy);
}
+ numRef =
+ locCMMLFilter->Release();
+
+ *debugLog<<"CMML Filter ref Count = "<<numRef<<endl;
}
}
Modified: trunk/oggdsf/src/lib/player/libDSPlayDotNET/DSPlay.h
===================================================================
--- trunk/oggdsf/src/lib/player/libDSPlayDotNET/DSPlay.h 2004-10-11 09:15:37 UTC (rev 7977)
+++ trunk/oggdsf/src/lib/player/libDSPlayDotNET/DSPlay.h 2004-10-11 11:15:19 UTC (rev 7978)
@@ -45,6 +45,8 @@
#include "CMMLCallbackProxy.h"
+#include <fstream>
+
#pragma managed
#using "libCMMLTagsDotNET.dll"
using namespace illiminable::libCMMLTagsDotNET;
@@ -101,8 +103,10 @@
bool mIsLoaded;
bool isFileAnnodex(String* inFilename);
+
+
+ fstream* debugLog;
-
};
}
Modified: trunk/oggdsf/src/tools/DNPlay/frmDNPlay.cs
===================================================================
--- trunk/oggdsf/src/tools/DNPlay/frmDNPlay.cs 2004-10-11 09:15:37 UTC (rev 7977)
+++ trunk/oggdsf/src/tools/DNPlay/frmDNPlay.cs 2004-10-11 11:15:19 UTC (rev 7978)
@@ -516,23 +516,26 @@
private void cmdFollowLink_Click(object sender, System.EventArgs e)
{
- String locFilename = mCurrentClip.anchor().href();
- tmrUpdateDuration.Enabled = false;
- lblFileLocation.Text = locFilename;
- bool locRes = mPlayer.loadFile("G:\\downloads\\firefox\\manufacturing_surveys.anx");
- //Error check
- mFileDuration = mPlayer.fileDuration();
- setDurationText(mFileDuration);
- //lblDuration.Text = mFileDuration.ToString();
-
- mNumTicks = 0;
- mLastSync = 0;
- updateProgressBar();
-
- mPlayer.setMediaEventCallback(this);
- mPlayer.setCMMLCallbacks(this);
- cmdPlay.Enabled = true;
+ String locFilename = "G:\\downloads\\firefox\\manufacturing_surveys.anx"; //mCurrentClip.anchor().href();
+ LoadFile(locFilename);
StartPlayback();
+
+// tmrUpdateDuration.Enabled = false;
+// lblFileLocation.Text = locFilename;
+// bool locRes = mPlayer.loadFile("G:\\downloads\\firefox\\manufacturing_surveys.anx");
+// //Error check
+// mFileDuration = mPlayer.fileDuration();
+// setDurationText(mFileDuration);
+// //lblDuration.Text = mFileDuration.ToString();
+//
+// mNumTicks = 0;
+// mLastSync = 0;
+// updateProgressBar();
+//
+// mPlayer.setMediaEventCallback(this);
+// mPlayer.setCMMLCallbacks(this);
+// cmdPlay.Enabled = true;
+// StartPlayback();
}
}
More information about the commits
mailing list