X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c0badb709a86b91a203416784b649e3d00c699c7..bbd92d1dbea02db8c28e9c17bfacc0563d855b25:/src/mac/carbon/mediactrl.cpp diff --git a/src/mac/carbon/mediactrl.cpp b/src/mac/carbon/mediactrl.cpp index e5cb61a1bc..639114a1f1 100644 --- a/src/mac/carbon/mediactrl.cpp +++ b/src/mac/carbon/mediactrl.cpp @@ -57,6 +57,14 @@ #include #endif +#if !defined(__LP64__) +#define USE_QUICKTIME 1 +#else +#define USE_QUICKTIME 0 +#endif + +#if USE_QUICKTIME + //--------------------------------------------------------------------------- // Height and Width of movie controller in the movie control (apple samples) //--------------------------------------------------------------------------- @@ -75,7 +83,7 @@ class WXDLLIMPEXP_MEDIA wxQTMediaBackend : public wxMediaBackendCommonBase { public: wxQTMediaBackend(); - ~wxQTMediaBackend(); + virtual ~wxQTMediaBackend(); virtual bool CreateControl(wxControl* ctrl, wxWindow* parent, wxWindowID id, @@ -323,8 +331,7 @@ wxQTMediaBackend::~wxQTMediaBackend() // Dispose of the movie controller ::DisposeMovieController(m_mc); m_mc = NULL; - DisposeMCActionFilterWithRefConUPP(m_mcactionupp); - + // Dispose of offscreen GWorld ::DisposeGWorld(m_movieWorld); } @@ -431,13 +438,9 @@ bool wxQTMediaBackend::Load(const wxString& fileName) newMovieActive, NULL); // wasChanged - // - // check GetMoviesStickyError() because it may not find the - // proper codec and play black video and other strange effects, - // not to mention mess up the dynamic backend loading scheme - // of wxMediaCtrl - so it just does what the QuickTime player does - // - if (err == noErr && ::GetMoviesStickyError() == noErr) + // Do not use ::GetMoviesStickyError() here because it returns -2009 + // a.k.a. invalid track on valid mpegs + if (err == noErr && ::GetMoviesError() == noErr) { ::CloseMovieFile(movieResFile); @@ -477,7 +480,7 @@ bool wxQTMediaBackend::Load(const wxURI& location) const char* theURIString; #if wxUSE_UNICODE - wxCharBuffer buf = wxConvLocal.cWC2MB(theURI, theURI.length(), &len); + wxCharBuffer buf = wxConvLocal.cWC2MB(theURI.wc_str(), theURI.length(), &len); theURIString = buf; #else theURIString = theURI; @@ -521,8 +524,7 @@ bool wxQTMediaBackend::Load(const wxURI& location) // require it if you don't use a Movie Controller, // which we don't by default. // - m_preprerollupp = - NewMoviePrePrerollCompleteUPP( wxQTMediaBackend::PPRMProc ); + m_preprerollupp = wxQTMediaBackend::PPRMProc; ::PrePrerollMovie( m_movie, timeNow, playRate, m_preprerollupp, (void*)this); @@ -567,8 +569,7 @@ void wxQTMediaBackend::DoNewMovieController() // Setup a callback so we can tell when the user presses // play on the player controls - m_mcactionupp = - NewMCActionFilterWithRefConUPP( wxQTMediaBackend::MCFilterProc ); + m_mcactionupp = wxQTMediaBackend::MCFilterProc; ::MCSetActionFilterWithRefCon( m_mc, m_mcactionupp, (long)this ); wxASSERT(::GetMoviesError() == noErr); @@ -625,9 +626,6 @@ void wxQTMediaBackend::DoNewMovieController() //--------------------------------------------------------------------------- void wxQTMediaBackend::FinishLoad() { - // Dispose of the PrePrerollMovieUPP if we used it - DisposeMoviePrePrerollCompleteUPP(m_preprerollupp); - // get the real size of the movie DoLoadBestSize(); @@ -1128,7 +1126,7 @@ void wxQTMediaBackend::MacVisibilityChanged() // Suggestion from Greg Hazel to repaint the movie when idle // (on pause also) //--------------------------------------------------------------------------- -void wxQTMediaEvtHandler::OnEraseBackground(wxEraseEvent& evt) +void wxQTMediaEvtHandler::OnEraseBackground(wxEraseEvent& WXUNUSED(evt)) { // Work around Nasty OSX drawing bug: // http://lists.apple.com/archives/QuickTime-API/2002/Feb/msg00311.html @@ -1203,7 +1201,7 @@ pascal Boolean wxQTMediaBackend::MCFilterProc( // messages to our moviecontroller so it can receive mouse clicks etc. //--------------------------------------------------------------------------- pascal OSStatus wxQTMediaBackend::WindowEventHandler( - EventHandlerCallRef inHandlerCallRef, + EventHandlerCallRef WXUNUSED(inHandlerCallRef), EventRef inEvent, void *inUserData) { @@ -1236,6 +1234,8 @@ pascal OSStatus wxQTMediaBackend::WindowEventHandler( return eventNotHandledErr; } +#endif + // in source file that contains stuff you don't directly use #include "wx/html/forcelnk.h" FORCE_LINK_ME(basewxmediabackends)