Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How can I destroy the video window?

How can I destroy the video window?

Scheduled Pinned Locked Moved C / C++ / MFC
questionhelp
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Shuang Wu
    wrote on last edited by
    #1

    I wrappered a class to play video using DirectShow, almost following the sample "playwnd", but i found it cannot destroy the media window by the destructor, unless I destroy the parent window. I checked the state of the player window, it was stopped, but I could still saw it was running after the destructor invoked...:( Following list the destructor, what is the problem? CMediaPlay::~CMediaPlay(void) { HRESULT hr; if (m_pMediaControl) { LIF( m_pMediaControl->Stop()); OAFilterState fs; LIF( m_pMediaControl->GetState(200L, &fs)); if (fs == State_Stopped) Msg(_T("Successfully stopped the filter run")); } // Relinquish ownership (IMPORTANT!) after hiding video window if(m_pVideoWindow) { LIF(m_pVideoWindow->put_Visible(OAFALSE)); LIF(m_pVideoWindow->put_Owner(NULL)); } // Disable event callbacks if (m_pMediaEventEx) LIF(m_pMediaEventEx->SetNotifyWindow((OAHWND)NULL, 0, 0)); #ifdef REGISTER_FILTERGRAPH if (g_dwGraphRegister) { RemoveGraphFromRot(g_dwGraphRegister); g_dwGraphRegister = 0; } #endif SAFE_RELEASE(m_pFileSource ); SAFE_RELEASE(m_pVideoDecoder ); SAFE_RELEASE(m_pAVISplitter ); SAFE_RELEASE(m_pSourceReader ); SAFE_RELEASE(m_pMediaEventEx ); SAFE_RELEASE(m_pMediaSeeking ); SAFE_RELEASE(m_pVideoFrameStep ); SAFE_RELEASE(m_pMediaControl ); SAFE_RELEASE(m_pBasicAudio ); SAFE_RELEASE(m_pBasicVideo ); SAFE_RELEASE(m_pVideoWindow ); SAFE_RELEASE(m_pGraphBuilder ); }


    |-|3llo Wo|2ld

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups