activeX control.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41566
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
wxAMMediaBackend::wxAMMediaBackend()
:m_pAX(NULL),
#ifdef __WXWINCE__
wxAMMediaBackend::wxAMMediaBackend()
:m_pAX(NULL),
#ifdef __WXWINCE__
+ m_bestSize(wxDefaultSize)
+ m_bestSize = wxDefaultSize;
//---------------------------------------------------------------------------
void wxAMMediaBackend::FinishLoad()
{
//---------------------------------------------------------------------------
void wxAMMediaBackend::FinishLoad()
{
- // Get the original video size
- GetAM()->get_ImageSourceWidth((long*)&m_bestSize.x);
- GetAM()->get_ImageSourceHeight((long*)&m_bestSize.y);
-
//---------------------------------------------------------------------------
wxSize wxAMMediaBackend::GetVideoSize() const
{
//---------------------------------------------------------------------------
wxSize wxAMMediaBackend::GetVideoSize() const
{
+ if (m_bestSize == wxDefaultSize)
+ {
+ wxAMMediaBackend* self = wxConstCast(this, wxAMMediaBackend);
+ long w = 0;
+ long h = 0;
+
+ self->GetAM()->get_ImageSourceWidth(&w);
+ self->GetAM()->get_ImageSourceHeight(&h);
+
+ if (w != 0 && h != 0)
+ self->m_bestSize.Set(w, h);
+ else
+ return wxSize(0,0);
+ }
+
+ return m_bestSize;
}
//---------------------------------------------------------------------------
}
//---------------------------------------------------------------------------