Welcome to MacForumz.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

new handles coming up after calling InitializeQTML ()

 
   Macintosh computer (Home) -> Programmer Help RSS
Next:  LATSUITextbox does not reformat text when window ..  
Author Message
Martin Nedbal

External


Since: Apr 24, 2004
Posts: 4



(Msg. 1) Posted: Sun Apr 25, 2004 1:07 am
Post subject: new handles coming up after calling InitializeQTML ()
Archived from groups: comp>sys>mac>programmer>help, others (more info?)

Hi guys,
I have little problem with QuickTime on windows, when I call InitializeQTML
(0) new handles start popping up - it is approximately two new handles per
second and it's still counting.

I'm using current Qt SDK called from MSVC 6.0, QuickTime version 6.5 on
WindowsXP (patched with all hotfixes)

This is simpliest sample code which causes described problem :

#include <windows.h>
#include <QTML.h>
#include <Movies.h>
#include <Files.h>

int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
OSErr hr;

hr = InitializeQTML(0);
hr = EnterMovies();

while (true) Sleep (100);

ExitMovies();
TerminateQTML();

return 0;
}

I can provide another data (config files, exe file etc.)

Any ideas ?

Best regards,
Martin Nedbal

 >> Stay informed about: new handles coming up after calling InitializeQTML () 
Back to top
Login to vote
Martin Nedbal

External


Since: Apr 24, 2004
Posts: 4



(Msg. 2) Posted: Sun Apr 25, 2004 1:21 am
Post subject: Re: new handles coming up after calling InitializeQTML () [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

 > "Martin Nedbal" <martin.TakeThisOut@nedbal.net> wrote in message
news:EyBic.15913$N9.15003@news.chello.at...
 > Hi guys,
 > I have little problem with QuickTime on windows, when I call
InitializeQTML
 > (0) new handles start popping up - it is approximately two new handles per
 > second and it's still counting.
 >
 > I'm using current Qt SDK called from MSVC 6.0, QuickTime version 6.5 on
 > WindowsXP (patched with all hotfixes)
 >
 > This is simpliest sample code which causes described problem :
 >
 > #include <windows.h>
 > #include <QTML.h>
 > #include <Movies.h>
 > #include <Files.h>
 >
 > int APIENTRY WinMain(HINSTANCE hInstance,
 > HINSTANCE hPrevInstance,
 > LPSTR lpCmdLine,
 > int nCmdShow)
 > {
 > OSErr hr;
 >
 > hr = InitializeQTML(0);
 > hr = EnterMovies();
 >
 > while (true) Sleep (100);
 >
 > ExitMovies();
 > TerminateQTML();
 >
 > return 0;
 > }
 >
 > I can provide another data (config files, exe file etc.)
 >
 > Any ideas ?
 >
 > Best regards,
 > Martin Nedbal
 >


I run the program in rational quantify and this is the result :

<a style='text-decoration: underline;' href="http://awe.oceany.cz/temp/problem_threads.jpg" target="_blank">http://awe.oceany.cz/temp/problem_threads.jpg</a> [176kB]

something in QuickTime is launching new and new threads but why ? I honestly
have no idea ;(

Martin.<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: new handles coming up after calling InitializeQTML () 
Back to top
Login to vote
David Phillip Oste

External


Since: Apr 25, 2004
Posts: 1083



(Msg. 3) Posted: Sun Apr 25, 2004 1:45 am
Post subject: Re: new handles coming up after calling InitializeQTML () [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article <EyBic.15913$N9.15003@news.chello.at>,
"Martin Nedbal" <martin DeleteThis @nedbal.net> wrote:

 > Hi guys,
 > I have little problem with QuickTime on windows, when I call InitializeQTML
 > (0) new handles start popping up - it is approximately two new handles per
 > second and it's still counting.
 >
 > I'm using current Qt SDK called from MSVC 6.0, QuickTime version 6.5 on
 > WindowsXP (patched with all hotfixes)
 >
 > This is simpliest sample code which causes described problem :
 >
 > #include <windows.h>
 > #include <QTML.h>
 > #include <Movies.h>
 > #include <Files.h>
 >
 > int APIENTRY WinMain(HINSTANCE hInstance,
 > HINSTANCE hPrevInstance,
 > LPSTR lpCmdLine,
 > int nCmdShow)
 > {
 > OSErr hr;
 >
 > hr = InitializeQTML(0);
 > hr = EnterMovies();
 >
 > while (true) Sleep (100);
 >
 > ExitMovies();
 > TerminateQTML();
 >
 > return 0;
 > }

You didn't call InitializeQTM() with the kQTMLNoIdleEvents flag, so
it wouldn't surprise me if you are seeing sludge build up because you
aren't properly calling Quicktime to handle its events. If you search
the header files for "Idle", you'll find a number of calls, not
including MoviesTask() that you should be calling.

This tech note might be helpful:
Tech Q&A QA1349 "How often should I call SGIdle()?"
<http://developer.apple.com/qa/qa2001/qa1349.html><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: new handles coming up after calling InitializeQTML () 
Back to top
Login to vote
Martin Nedbal

External


Since: Apr 24, 2004
Posts: 4



(Msg. 4) Posted: Sun Apr 25, 2004 3:26 am
Post subject: Re: new handles coming up after calling InitializeQTML () [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

 >"David Phillip Oster" <oster.TakeThisOut@ieee.org> wrote in message
news:oster-311A2D.15452024042004@news.sf.sbcglobal.net...
 > In article <EyBic.15913$N9.15003@news.chello.at>,
 > "Martin Nedbal" <martin.TakeThisOut@nedbal.net> wrote:
 >
  > > Hi guys,
  > > I have little problem with QuickTime on windows, when I call
InitializeQTML
  > > (0) new handles start popping up - it is approximately two new handles
per
  > > second and it's still counting.
  > >
  > > I'm using current Qt SDK called from MSVC 6.0, QuickTime version 6.5 on
  > > WindowsXP (patched with all hotfixes)
  > >
  > > This is simpliest sample code which causes described problem :
  > >
  > > #include <windows.h>
  > > #include <QTML.h>
  > > #include <Movies.h>
  > > #include <Files.h>
  > >
  > > int APIENTRY WinMain(HINSTANCE hInstance,
  > > HINSTANCE hPrevInstance,
  > > LPSTR lpCmdLine,
  > > int nCmdShow)
  > > {
  > > OSErr hr;
  > >
  > > hr = InitializeQTML(0);
  > > hr = EnterMovies();
  > >
  > > while (true) Sleep (100);
  > >
  > > ExitMovies();
  > > TerminateQTML();
  > >
  > > return 0;
  > > }
 >
 > You didn't call InitializeQTM() with the kQTMLNoIdleEvents flag, so
 > it wouldn't surprise me if you are seeing sludge build up because you
 > aren't properly calling Quicktime to handle its events. If you search
 > the header files for "Idle", you'll find a number of calls, not
 > including MoviesTask() that you should be calling.
 >
 > This tech note might be helpful:
 > Tech Q&A QA1349 "How often should I call SGIdle()?"
 > <http://developer.apple.com/qa/qa2001/qa1349.html>

Hi David,
thanks for such a quick reply. Is this the correct flag definition ? Value
1L << 1 is shared by two flags (kInitializeQTMLUseGDIFlag and
kQTMLNoIdleEvents) ?

QTMH.h :

....
/* InitializeQTML flags*/
enum {
kInitializeQTMLNoSoundFlag = (1L << 0), /* flag for
requesting no sound when calling InitializeQTML*/
kInitializeQTMLUseGDIFlag = (1L << 1), /* flag for
requesting GDI when calling InitializeQTML*/
kInitializeQTMLDisableDirectSound = (1L << 2), /* disables
QTML's use of DirectSound*/
kInitializeQTMLUseExclusiveFullScreenModeFlag = (1L << 3), /* later
than QTML 3.0: qtml starts up in exclusive full screen mode*/
kInitializeQTMLDisableDDClippers = (1L << 4) /* flag for
requesting QTML not to use DirectDraw clipper objects; QTML 5.0 and later*/
};

enum {
kQTMLNoIdleEvents = (1L << 1) /* ask for a
non-auto-idled port to be created*/
};
....

Martin<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: new handles coming up after calling InitializeQTML () 
Back to top
Login to vote
David Phillip Oste

External


Since: Apr 25, 2004
Posts: 1083



(Msg. 5) Posted: Sun Apr 25, 2004 8:20 am
Post subject: Re: new handles coming up after calling InitializeQTML () [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article <aBDic.15985$N9.9229@news.chello.at>,
"Martin Nedbal" <martin.TakeThisOut@nedbal.net> wrote:

 > thanks for such a quick reply. Is this the correct flag definition ? Value
 > 1L << 1 is shared by two flags (kInitializeQTMLUseGDIFlag and
 > kQTMLNoIdleEvents) ?

<http://developer.apple.com/documentation/QuickTime/APIREF/SOURCESI/createportassociation.htm>

says that kQTMLNoIdleEvents gets passed to CreatePortAssociation.

Did you try the minimal sample Windows Quicktime program from:

<http://developer.apple.com/documentation/QuickTime/WIN/tp_qtwin_qtforwindows.5.htm>
Listing 2 (near the end of the page)?

int CALLBACK WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow){
MSG msg;
HANDLE hAccelTable;
OSStatus stat = noErr;

// Is there a previous instance? and couldn't Register window class? Report failure
if( ! hPrevInstance && ! InitApplication(hInstance)){
return FALSE;
}
if(noErr == stat){ stat = InitializeQTML(0); } // Initialize QTML
if(noErr == stat){ stat = EnterMovies(); } // Initialize QuickTime
if(noErr != stat){
MessageBox (hWnd, "QuickTime not available", "", MB_OK);
return FALSE; // Report failure
}
if( ! InitInstance(hInstance, nCmdShow)){ // Create main window
return FALSE; // Report failure
}
hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDR_ACCELSIMPLESDI));


///////////////////////////////////////////////////////////////////////////////
// Main message loop
///////////////////////////////////////////////////////////////////////////////

while(GetMessage(&msg, NULL, 0, 0)){   // Retrieve next message
// Check for keyboard accelerator
if( ! TranslateAccelerator (msg.hwnd, hAccelTable, &msg)){
TranslateMessage(&msg);  // Convert virtual key to character
DispatchMessage(&msg);   // Send message to window procedure
}
}
///////////////////////////////////////////////////////////////////////////////
ExitMovies(); // Terminate QuickTime
TerminateQTML(); // Terminate QTML
return msg.wParam;

} /* end WinMain */<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: new handles coming up after calling InitializeQTML () 
Back to top
Login to vote
Martin Nedbal

External


Since: Apr 24, 2004
Posts: 4



(Msg. 6) Posted: Sun Apr 25, 2004 1:29 pm
Post subject: Re: new handles coming up after calling InitializeQTML () [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

 >"David Phillip Oster" <oster.DeleteThis@ieee.org> wrote in message
news:oster-55C6EC.22204424042004@news.sf.sbcglobal.net...
 > In article <aBDic.15985$N9.9229@news.chello.at>,
 > "Martin Nedbal" <martin.DeleteThis@nedbal.net> wrote:
 >
  > > thanks for such a quick reply. Is this the correct flag definition ?
Value
  > > 1L << 1 is shared by two flags (kInitializeQTMLUseGDIFlag and
  > > kQTMLNoIdleEvents) ?
 >
 >
<http://developer.apple.com/documentation/QuickTime/APIREF/SOURCESI/createpo
rtassociation.htm>
 >
 > says that kQTMLNoIdleEvents gets passed to CreatePortAssociation.
 >
 > Did you try the minimal sample Windows Quicktime program from:
 >
 >
<http://developer.apple.com/documentation/QuickTime/WIN/tp_qtwin_qtforwindow
s.5.htm>
 > Listing 2 (near the end of the page)?
 >
 > int CALLBACK WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR
lpCmdLine, int nCmdShow){
 > MSG msg;
 > HANDLE hAccelTable;
 > OSStatus stat = noErr;
 >
 > // Is there a previous instance? and couldn't Register window class?
Report failure
 > if( ! hPrevInstance && ! InitApplication(hInstance)){
 > return FALSE;
 > }
 > if(noErr == stat){ stat = InitializeQTML(0); } // Initialize QTML
 > if(noErr == stat){ stat = EnterMovies(); } // Initialize QuickTime
 > if(noErr != stat){
 > MessageBox (hWnd, "QuickTime not available", "", MB_OK);
 > return FALSE; // Report failure
 > }
 > if( ! InitInstance(hInstance, nCmdShow)){ // Create main window
 > return FALSE; // Report failure
 > }
 > hAccelTable = LoadAccelerators(hInstance,
MAKEINTRESOURCE(IDR_ACCELSIMPLESDI));
 >
 >
 >
////////////////////////////////////////////////////////////////////////////
///
 > // Main message loop
 >
////////////////////////////////////////////////////////////////////////////
///
 >
 > while(GetMessage(&msg, NULL, 0, 0)){ // Retrieve next message
 > // Check for keyboard accelerator
 > if( ! TranslateAccelerator (msg.hwnd, hAccelTable, &msg)){
 > TranslateMessage(&msg); // Convert virtual key to character
 > DispatchMessage(&msg); // Send message to window procedure
 > }
 > }
 >
////////////////////////////////////////////////////////////////////////////
///
 > ExitMovies(); // Terminate QuickTime
 > TerminateQTML(); // Terminate QTML
 > return msg.wParam;
 >
 > } /* end WinMain */

Jon, David,
thanks for your replies, it made me read the documentation properly at
least. However it seems to me that I've found (strange) bug - the handles
are from event objects, which seem to be stuck somewhere, there are system
treads (in blocked state) created for each event as well. I found out that
the sample application (mdiplayer.win) and even the QuickTime player (!)
behaves the same way BUT this behavior occurs AFAIK only when the process is
watched with ProcessExplorer (http://www.sysinternals.com/) in "DLL mode".
I'll tried to reproduce it on other versions of windows and I wasn't
successfull - it would be windows xp related. I'm going to gather as much
information as possible to report it to Apple.

Thanks for your time, I'll post the resolution from Apple here once I have
it.<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: new handles coming up after calling InitializeQTML () 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
memory leaking in 10.2.8? - Hi groups, I have a question concerning the memory management in the OS X (10.2.8 to be exact). Either I don't understand the way it works or there is something like major memory leak in the version I referred to (I haven't noticed it with previous..

Changing an AVI audio track via QuickTime - I've got an AVI movie, and I'd like to replace it's current audio track with a new track, changing the format of the audio for the movie from PCM to WAVE. I can create a new track for the audio, and then flatten a new movie with the audio using..

Where to get the AddressBook data back from after iSync tr.. - Hi, since my iSync happily trashed some important entries (dunno whom to blame now), I am very urgently looking for some help on the matter. The only thing I found, which _might_ still contain the old data is located at: /Library/Application\..

Shell command line to set Login startup items - What is the shell command line to set Login startup items (like in Account System Preferences) ?

How are iMovie's Camera Controls implemented? - How are iMovie's Camera Controls implemented? I've previously written application programs in C++ that use Canopus analog video -> DV over firewire converters, and they worked just fine using Apple's standard Quicktime Sequence Grabber examples lik...
   Macintosh computer (Home) -> Programmer Help All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]