Professional Web Applications Themes

new handles coming up after calling InitializeQTML () - Mac Programming

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 ...

  1. #1

    Default new handles coming up after calling InitializeQTML ()

    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



    Martin Guest

  2. #2

    Default Re: new handles coming up after calling InitializeQTML ()

    > "Martin Nedbal" <net> wrote in message
    news:EyBic.15913$chello.at... 
    InitializeQTML 


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

    http://awe.oceany.cz/temp/problem_threads.jpg [176kB]

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

    Martin.


    Martin Guest

  3. #3

    Default Re: new handles coming up after calling InitializeQTML ()

    In article <EyBic.15913$chello.at>,
    "Martin Nedbal" <net> wrote:
     

    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>
    David Guest

  4. #4

    Default Re: new handles coming up after calling InitializeQTML ()

    >"David Phillip Oster" <org> wrote in message
    news:sf.sbcglobal.net... [/ref]
    InitializeQTML [/ref]
    per 
    >
    > 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>[/ref]

    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


    Martin Guest

  5. #5

    Default Re: new handles coming up after calling InitializeQTML ()

    In article <aBDic.15985$chello.at>,
    "Martin Nedbal" <net> wrote:
     

    <http://developer.apple.com/doentation/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/doentation/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 */
    David Guest

  6. #6

    Default Re: new handles coming up after calling InitializeQTML ()

    >"David Phillip Oster" <org> wrote in message
    news:sf.sbcglobal.net... [/ref]
    Value 
    >
    >[/ref]
    <http://developer.apple.com/doentation/QuickTime/APIREF/SOURCESI/createpo
    rtassociation.htm> 
    <http://developer.apple.com/doentation/QuickTime/WIN/tp_qtwin_qtforwindow
    s.5.htm> 
    lpCmdLine, int nCmdShow){ 
    Report failure 
    MAKEINTRESOURCE(IDR_ACCELSIMPLESDI)); 
    ////////////////////////////////////////////////////////////////////////////
    /// 
    ////////////////////////////////////////////////////////////////////////////
    /// 
    ////////////////////////////////////////////////////////////////////////////
    /// 

    Jon, David,
    thanks for your replies, it made me read the doentation 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 Procesplorer (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.


    Martin Guest

Similar Threads

  1. Many handles
    By Erik in forum MySQL
    Replies: 5
    Last Post: March 5th, 10:16 PM
  2. Handles itemCreated
    By Joriz in forum ASP.NET Data Grid Control
    Replies: 2
    Last Post: June 27th, 07:30 PM
  3. What's with these transform handles?
    By Zenrock3 in forum Macromedia Freehand
    Replies: 7
    Last Post: April 15th, 11:57 AM
  4. Is this possible? (file handles)
    By Venugopal in forum PERL Beginners
    Replies: 4
    Last Post: April 3rd, 01:35 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139