[Clientapps-cvs] symbianMmf hxmmfctrlimpl.cpp, 1.28, 1.29 hxmmfctrlimpl.h, 1.10, 1.11 hxmmfsitesupplier.cpp, 1.4, 1.5 hxmmfsitesupplier.h, 1.2, 1.3
shy_ward at helixcommunity.org shy_ward at helixcommunity.orgUpdate of /cvsroot/clientapps/symbianMmf In directory cvs:/tmp/cvs-serv26792 Modified Files: hxmmfctrlimpl.cpp hxmmfctrlimpl.h hxmmfsitesupplier.cpp hxmmfsitesupplier.h Log Message: "Nokia submits this code under the terms of a commercial contribution > agreement with RealNetworks, and I am authorized to contribute this > code under said agreement." > > Modified by: shy.ward at nokia.com > > Reviewed by: > > Date: 03-7-2006. > > Error ID: EOVL-6GVTAH > EOVL-6F4TP7 > EOVL-6K4V7V > EHSG-6LTKFT > > Project: Helix plugin for Symbian > > Synopsis: Add Post Processing Functionality for Symbian MMF/MDF. > > Three new interfaces were added: IHXSurfaceControl, IHXDSAControl, & > IHXSiteRegister. These allow the Symbian MMF/MDF to send post > processing commands to dev video in the MDF. No functionality has been > changed or added for non-MDF builds. > > The feature flag HELIX_FEATURE_MMF_SITE_CONTROL is used and defined in > the profile: helix-client-s60-mdf-common.pfi. > These new features allow the MMF client to scale, rotate, control DSA, > set contrast, etc. > > Files Modified: > clientapps\symbianMmf\hxmmfctrlimpl.cpp > clientapps\symbianMmf\hxmmfsitesupplier.cpp > clientapps\symbianMmf\hxmmfsitesupplier.h > datatype\mdf\video\renderer\mdfvideoadapter.cpp > datatype\mdf\video\renderer\umakelib > datatype\mdf\video\renderer\pub\mdfvideoadapter.h > common\include\hxiids.h > common\include\hxwintyp.h > video\sitelib\platform\symbian\minisymbiansite.cpp > video\sitelib\pub\platform\symbian\minisymbiansite.h > ribosome\build\umakepf\helix-client-s60-mdf-common.pfi > > > Files Added: > client\include\hxsite3.h > > Image Size and Heap Use impact: Minor > > Platforms and Profiles Build Verified: helix-client-s60-mmf-mdf-basic > > Platforms and Profiles Functionality verified: armv5 > > Branch: hxclient_2_1_0_cayennes,head > Index: hxmmfsitesupplier.h =================================================================== RCS file: /cvsroot/clientapps/symbianMmf/hxmmfsitesupplier.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- hxmmfsitesupplier.h 9 Feb 2006 19:58:50 -0000 1.2 +++ hxmmfsitesupplier.h 13 Mar 2006 21:52:07 -0000 1.3 @@ -65,11 +65,26 @@ #include "hxsite2.h" #include "chxmaplongtoobj.h" +#if defined(HELIX_FEATURE_MMF_SITE_CONTROL) +// +// Symbian includes +// +#include <mmf/common/mmfvideo.h> +#include <mmf/common/mmfstandardcustomcommands.h> +#endif +#if defined(HELIX_FEATURE_MMF_SITE_CONTROL) +#include "hxsite3.h" +#include <chxxtype.h> /* For CHXxRect. */ +#endif class HXMMFSiteSupplier : public CUnknownIMP, public IHXSiteSupplier, public IHXPassiveSiteWatcher +#if defined(HELIX_FEATURE_MMF_SITE_CONTROL) +,public IHXSurfaceControl +,public IHXDSAControl +#endif { public: DECLARE_UNKNOWN(HXMMFSiteSupplier) @@ -87,7 +102,29 @@ STDMETHOD(SitesNotNeeded)(THIS_ UINT32 uReqestID); STDMETHOD(BeginChangeLayout)(THIS); STDMETHOD(DoneChangeLayout)(THIS); - +#if defined(HELIX_FEATURE_MMF_SITE_CONTROL) + // + // IHXSurfaceControl methods + // + STDMETHOD(SetRotation) (THIS_ UINT32 ulValue); + STDMETHOD(GetRotation) (THIS_ REF(UINT32) ulValue); + STDMETHOD(SetContrast) (THIS_ UINT32 ulValue); + STDMETHOD(GetContrast) (THIS_ REF(UINT32) ulValue); + STDMETHOD(SetWindowRect) (THIS_ HXxRect sValue); + STDMETHOD(SetFrameRect) (THIS_ HXxRect sValue); + STDMETHOD(GetFrameRect) (THIS_ REF(HXxRect) sValue); + STDMETHOD(SetDestRect) (THIS_ HXxRect sValue); + STDMETHOD(SetScaling) (THIS_ HXFLOAT fWidthPerc, HXFLOAT fHeightPerc, HXBOOL bAntiAlias); + STDMETHOD(GetScaling) (THIS_ REF(HXFLOAT) fWidthPerc, REF(HXFLOAT) fHeightPerc, REF(HXBOOL) bAntiAlias); + STDMETHOD(SetCropRect) (THIS_ HXxRect sValue); + STDMETHOD(GetCropRect) (THIS_ REF(HXxRect) sValue); + + //IHXDSAControl + STDMETHOD(DirectScreenAccessEvent) (THIS_ HXBOOL bValue); + STDMETHOD(UpdateDisplayRegion) (THIS_ HXxRegion Region); + STDMETHOD(RefreshWindow) (THIS_); + +#endif // // IHXPassiveSiteWatcher methods // @@ -101,6 +138,7 @@ IHXCommonClassFactory* m_classFactory; IHXSiteManager* m_sitesManager; + IHXSiteManager2* m_pSitesManager2; CHXMapLongToObj m_sitesCreated; IUnknown* m_pContext; Index: hxmmfctrlimpl.h =================================================================== RCS file: /cvsroot/clientapps/symbianMmf/hxmmfctrlimpl.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- hxmmfctrlimpl.h 10 Mar 2006 19:48:07 -0000 1.10 +++ hxmmfctrlimpl.h 13 Mar 2006 21:52:07 -0000 1.11 @@ -88,6 +88,11 @@ #include "hxmmfmetadata.h" #include "hxmmferrorlogsink.h" +#if defined(HELIX_FEATURE_MMF_SITE_CONTROL) +#include "hxsite3.h" +#include <chxxtype.h> /* For CHXxRect. */ +#endif + class MDataSource; class MDataSink; class MMMFVideoFrameMessage; @@ -254,6 +259,10 @@ #ifdef DRM_ENABLED_FROM_CONTROLLER ContentAccess::TIntent m_DRMIntent; #endif +#if defined(HELIX_FEATURE_MMF_SITE_CONTROL) + IHXDSAControl* m_pDSAControl; + IHXSurfaceControl* m_pSurfaceControl; +#endif }; Index: hxmmfsitesupplier.cpp =================================================================== RCS file: /cvsroot/clientapps/symbianMmf/hxmmfsitesupplier.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- hxmmfsitesupplier.cpp 9 Feb 2006 19:58:50 -0000 1.4 +++ hxmmfsitesupplier.cpp 13 Mar 2006 21:52:07 -0000 1.5 @@ -108,12 +108,17 @@ // BEGIN_INTERFACE_LIST(HXMMFSiteSupplier) INTERFACE_LIST_ENTRY(IID_IHXSiteSupplier, IHXSiteSupplier) +#if defined(HELIX_FEATURE_MMF_SITE_CONTROL) +INTERFACE_LIST_ENTRY(IID_IHXSurfaceControl, IHXSurfaceControl) +INTERFACE_LIST_ENTRY(IID_IHXDSAControl, IHXDSAControl) +#endif END_INTERFACE_LIST HXMMFSiteSupplier::HXMMFSiteSupplier() : m_classFactory(NULL), m_sitesManager(NULL), + m_pSitesManager2(NULL), m_pScreenSize(NULL) { } @@ -123,6 +128,7 @@ HX_RELEASE(m_classFactory); HX_RELEASE(m_sitesManager); + HX_RELEASE(m_pSitesManager2); HX_RELEASE(m_pContext); HX_ASSERT(m_sitesCreated.IsEmpty()); @@ -143,9 +149,11 @@ { m_pContext->AddRef(); m_pContext->QueryInterface(IID_IHXSiteManager,(void**)&m_sitesManager); + m_pContext->QueryInterface(IID_IHXSiteManager2,(void**)&m_pSitesManager2); m_pContext->QueryInterface(IID_IHXCommonClassFactory, (void**)&m_classFactory); HX_ASSERT(m_sitesManager); HX_ASSERT(m_classFactory); + HX_ASSERT(m_pSitesManager2); } @@ -173,6 +181,13 @@ { m_WindowRect = aWinRect; m_ClipRect = aClipRect; +#if defined(HELIX_FEATURE_MMF_SITE_CONTROL) + + SetWindowRect(CHXxRect(aWinRect.iTl.iX, aWinRect.iTl.iY, aWinRect.iBr.iX, aWinRect.iBr.iY)); + + SetDestRect(CHXxRect(aClipRect.iTl.iX, aClipRect.iTl.iY, aClipRect.iBr.iX, aClipRect.iBr.iY)); + +#endif //HELIX_FEATURE_MMF_SITE_CONTROL } // @@ -426,7 +441,784 @@ HX_RESULT HXMMFSiteSupplier::SizeChanged( HXxSize* pSize ) { - HXLOGL2(HXLOG_SMMF, "HXMMFSiteSupplier::SizeChanged"); + HXLOGL2(HXLOG_SMMF, "HXMMFSiteSupplier::SizeChanged()"); return HXR_OK; } +#if defined(HELIX_FEATURE_MMF_SITE_CONTROL) + +STDMETHODIMP +HXMMFSiteSupplier::SetRotation(UINT32 ulValue) +{ + + IHXSurfaceControl* pSurfaceControl = NULL; + IHXSite* pIterationSite = NULL; + HRESULT hres; + UINT32 index; + UINT32 nNumSites = 0; + RotationType ulRotation; + + switch (ulValue) + { + case EVideoRotationClockwise90: + ulRotation = Rotate90; break; + case EVideoRotationClockwise180: + ulRotation = Rotate180; break; + case EVideoRotationClockwise270: + ulRotation = Rotate270; break; + case EVideoRotationNone: + default: + ulRotation = Rotate0; break; + } + + m_pSitesManager2->GetNumberOfSites(nNumSites); + hres = nNumSites; + for(index = 0; index< nNumSites; index++) + { + m_pSitesManager2->GetSiteAt(index, pIterationSite); + if(pIterationSite) + { + pIterationSite->QueryInterface(IID_IHXSurfaceControl, (void**) &pSurfaceControl); + if(pSurfaceControl) + { + if(pSurfaceControl->SetRotation(ulRotation) == HXR_OK) + { + //error tracking of how many sites succeded + hres--; + } + else + { + HXLOGL2( HXLOG_SMMF, "HXMMFSiteSupplier::SetRotation(FALIED)"); + } + HX_RELEASE(pSurfaceControl); + } + } + + } + // Tracking Errors but not acting on them + // if hres == 0 then all sites succesfully set the param + // if hres < #sites then at least one site updated + // if hres == #sites then no site successfully set the param + HXLOGL2( HXLOG_SMMF, "HXMMFSiteSupplier::SetRotation(%lu) #Sites[%lu] #Errors[%d]", ulValue, nNumSites, hres); + if(hres == nNumSites) + { + //no site was set + return HXR_FAIL; + } + else + { + //AT least one site set the parameter + return HXR_OK; + } +} + +STDMETHODIMP +HXMMFSiteSupplier::GetRotation(UINT32 &ulValue) +{ + + IHXSurfaceControl* pSurfaceControl = NULL; + IHXSite* pIterationSite = NULL; + HRESULT hres; + UINT32 index; + UINT32 nNumSites = 0; + + m_pSitesManager2->GetNumberOfSites(nNumSites); + hres = nNumSites; + for(index = 0; index< nNumSites; index++) + { + m_pSitesManager2->GetSiteAt(index, pIterationSite); + if(pIterationSite) + { + pIterationSite->QueryInterface(IID_IHXSurfaceControl, (void**) &pSurfaceControl); + if(pSurfaceControl) + { + if(pSurfaceControl->GetRotation(ulValue) == HXR_OK) + { + //error tracking of how many sites succeded + hres--; + } + else + { + HXLOGL2( HXLOG_SMMF, "HXMMFSiteSupplier::GetRotation(FALIED)"); + } + HX_RELEASE(pSurfaceControl); + } + } + + } + // Tracking Errors but not acting on them + // if hres == 0 then all sites succesfully set the param + // if hres < #sites then at least one site updated + // if hres == #sites then no site successfully set the param + HXLOGL2( HXLOG_SMMF, "HXMMFSiteSupplier::GetRotation(%lu) #Sites[%lu] #Errors[%d]", ulValue, nNumSites, hres); + if(hres == nNumSites) + { + //no site was gotten + return HXR_FAIL; + } + else + { + //We got the parameter from at least one site + return HXR_OK; + } +} + +STDMETHODIMP +HXMMFSiteSupplier::SetContrast(UINT32 ulValue) +{ + IHXSurfaceControl* pSurfaceControl = NULL; + IHXSite* pIterationSite = NULL; + HRESULT hres; + UINT32 index; + UINT32 nNumSites = 0; + + m_pSitesManager2->GetNumberOfSites(nNumSites); + hres = nNumSites; + for(index = 0; index< nNumSites; index++) + { + m_pSitesManager2->GetSiteAt(index, pIterationSite); + if(pIterationSite) + { + pIterationSite->QueryInterface(IID_IHXSurfaceControl, (void**) &pSurfaceControl); + if(pSurfaceControl) + { + if(pSurfaceControl->SetContrast(ulValue) == HXR_OK) + { + //error tracking of how many sites succeded + hres--; + } + else + { + HXLOGL2( HXLOG_SMMF, "HXMMFSiteSupplier::SetContrast(FALIED)"); + } + HX_RELEASE(pSurfaceControl); + } + } + + } + // Tracking Errors but not acting on them + // if hres == 0 then all sites succesfully set the param + // if hres < #sites then at least one site updated + // if hres == #sites then no site successfully set the param + HXLOGL2( HXLOG_SMMF, "HXMMFSiteSupplier::SetContrast(%lu) #Sites[%lu] #Errors[%d])", ulValue, nNumSites, hres); + if(hres == nNumSites) + { + //no site was set + return HXR_FAIL; + } + else + { + //at least one site was site + return HXR_OK; + } +} + +STDMETHODIMP +HXMMFSiteSupplier::GetContrast(UINT32 &ulValue) +{ + IHXSurfaceControl* pSurfaceControl = NULL; + IHXSite* pIterationSite = NULL; + HRESULT hres; + UINT32 index; + UINT32 nNumSites = 0; + + m_pSitesManager2->GetNumberOfSites(nNumSites); + hres = nNumSites; + for(index = 0; index< nNumSites; index++) + { + m_pSitesManager2->GetSiteAt(index, pIterationSite); + if(pIterationSite) + { + pIterationSite->QueryInterface(IID_IHXSurfaceControl, (void**) &pSurfaceControl); + if(pSurfaceControl) + { + if(pSurfaceControl->GetContrast(ulValue) == HXR_OK) + { + //error tracking of how many sites succeded + hres--; + } + else + { + HXLOGL2( HXLOG_SMMF, "HXMMFSiteSupplier::GetContrast(FALIED)"); + } + HX_RELEASE(pSurfaceControl); + } + } + + } + // Tracking Errors but not acting on them + // if hres == 0 then all sites succesfully set the param + // if hres < #sites then at least one site updated + // if hres == #sites then no site successfully set the param + HXLOGL2( HXLOG_SMMF, "HXMMFSiteSupplier::GetContrast(%lu) #Sites[%lu] #Errors[%d])", ulValue, nNumSites, hres); + if(hres == nNumSites) + { + //no site was gotten + return HXR_FAIL; + } + else + { + //We got the parameter from at least one site + return HXR_OK; + } +} + +STDMETHODIMP +HXMMFSiteSupplier::SetWindowRect(HXxRect sValue) +{ + IHXSurfaceControl* pSurfaceControl = NULL; + IHXSite* pIterationSite = NULL; + HRESULT hres; + UINT32 index; + UINT32 nNumSites = 0; + + m_pSitesManager2->GetNumberOfSites(nNumSites); + hres = nNumSites; + for(index = 0; index< nNumSites; index++) + { + m_pSitesManager2->GetSiteAt(index, pIterationSite); + if(pIterationSite) + { + pIterationSite->QueryInterface(IID_IHXSurfaceControl, (void**) &pSurfaceControl); + if(pSurfaceControl) + { + if(pSurfaceControl->SetWindowRect(sValue) == HXR_OK) + { + //error tracking of how many sites succeded + hres--; + } + else + { + HXLOGL2( HXLOG_SMMF, "HXMMFSiteSupplier::SetWindowRect(FALIED)"); + } + HX_RELEASE(pSurfaceControl); + } + } + + } + // Tracking Errors but not acting on them + // if hres == 0 then all sites succesfully set the param + // if hres < #sites then at least one site updated + // if hres == #sites then no site successfully set the param + HXLOGL2( HXLOG_SMMF, "HXMMFSiteSupplier::SetWindowRect()"); + if(hres == nNumSites) + { + //no site was set + return HXR_FAIL; + } + else + { + //at least one site was set + return HXR_OK; + } +} + +STDMETHODIMP +HXMMFSiteSupplier::SetFrameRect(HXxRect sValue) +{ + IHXSurfaceControl* pSurfaceControl = NULL; + IHXSite* pIterationSite = NULL; + HRESULT hres; + UINT32 index; + UINT32 nNumSites = 0; + + m_pSitesManager2->GetNumberOfSites(nNumSites); + hres = nNumSites; + for(index = 0; index< nNumSites; index++) + { + m_pSitesManager2->GetSiteAt(index, pIterationSite); + if(pIterationSite) + { + pIterationSite->QueryInterface(IID_IHXSurfaceControl, (void**) &pSurfaceControl); + if(pSurfaceControl) + { + if(pSurfaceControl->SetFrameRect(sValue) == HXR_OK) + { + //error tracking of how many sites succeded + hres--; + } + else + { + HXLOGL2( HXLOG_SMMF, "HXMMFSiteSupplier::SetFrameRect(FALIED)"); + } + HX_RELEASE(pSurfaceControl); + } + } + + } + // Tracking Errors but not acting on them + // if hres == 0 then all sites succesfully set the param + // if hres < #sites then at least one site updated + // if hres == #sites then no site successfully set the param + HXLOGL2( HXLOG_SMMF, "HXMMFSiteSupplier::SetFrameRect"); + if(hres == nNumSites) + { + //no site was set + return HXR_FAIL; + } + else + { + //at least one site was set + return HXR_OK; + } +} + +STDMETHODIMP +HXMMFSiteSupplier::GetFrameRect(HXxRect &sValue) +{ + IHXSurfaceControl* pSurfaceControl = NULL; + IHXSite* pIterationSite = NULL; + HRESULT hres; + UINT32 index; + UINT32 nNumSites = 0; + + m_pSitesManager2->GetNumberOfSites(nNumSites); + hres = nNumSites; + for(index = 0; index< nNumSites; index++) + { + m_pSitesManager2->GetSiteAt(index, pIterationSite); + if(pIterationSite) + { + pIterationSite->QueryInterface(IID_IHXSurfaceControl, (void**) &pSurfaceControl); + if(pSurfaceControl) + { + if(pSurfaceControl->GetFrameRect(sValue) == HXR_OK) + { + //error tracking of how many sites succeded + hres--; + } + else + { + HXLOGL2( HXLOG_SMMF, "HXMMFSiteSupplier::GetFrameRect(FALIED)"); + } + HX_RELEASE(pSurfaceControl); + } + } + + } + // Tracking Errors but not acting on them + // if hres == 0 then all sites succesfully set the param + // if hres < #sites then at least one site updated + // if hres == #sites then no site successfully set the param + HXLOGL2( HXLOG_SMMF, "HXMMFSiteSupplier::GetFrameRect"); + if(hres == nNumSites) + { + //no site was gotten + return HXR_FAIL; + } + else + { + //at least one site was got + return HXR_OK; + } +} + +STDMETHODIMP +HXMMFSiteSupplier::SetDestRect(HXxRect sValue) +{ + IHXSurfaceControl* pSurfaceControl = NULL; + IHXSite* pIterationSite = NULL; + HRESULT hres; + UINT32 index; + UINT32 nNumSites = 0; + + m_pSitesManager2->GetNumberOfSites(nNumSites); + hres = nNumSites; + for(index = 0; index< nNumSites; index++) + { + m_pSitesManager2->GetSiteAt(index, pIterationSite); + if(pIterationSite) + { + pIterationSite->QueryInterface(IID_IHXSurfaceControl, (void**) &pSurfaceControl); + if(pSurfaceControl) + { + if(pSurfaceControl->SetDestRect(sValue) == HXR_OK) + { + //error tracking of how many sites succeded + hres--; + } + else + { + HXLOGL2( HXLOG_SMMF, "HXMMFSiteSupplier::SetDestRect(FALIED)"); + } + HX_RELEASE(pSurfaceControl); + } + } + + } + // Tracking Errors but not acting on them + // if hres == 0 then all sites succesfully set the param + // if hres < #sites then at least one site updated + // if hres == #sites then no site successfully set the param + HXLOGL2( HXLOG_SMMF, "HXMMFSiteSupplier::SetDestRect"); + if(hres == nNumSites) + { + //no site was set + return HXR_FAIL; + } + else + { + //at least one site was set + return HXR_OK; + } +} + + +STDMETHODIMP +HXMMFSiteSupplier::SetScaling(HXFLOAT fWidthPerc, HXFLOAT fHeightPerc, HXBOOL bAntiAlias) +{ + IHXSurfaceControl* pSurfaceControl = NULL; + IHXSite* pIterationSite = NULL; + HRESULT hres; + UINT32 index; + UINT32 nNumSites = 0; + + m_pSitesManager2->GetNumberOfSites(nNumSites); + hres = nNumSites; + for(index = 0; index< nNumSites; index++) + { + m_pSitesManager2->GetSiteAt(index, pIterationSite); + if(pIterationSite) + { + pIterationSite->QueryInterface(IID_IHXSurfaceControl, (void**) &pSurfaceControl); + if(pSurfaceControl) + { + if(pSurfaceControl->SetScaling(fWidthPerc,fHeightPerc,bAntiAlias) == HXR_OK) + { + //error tracking of how many sites succeded + hres--; + } + else + { + HXLOGL2( HXLOG_SMMF, "HXMMFSiteSupplier::SetScaling(FALIED)"); + } + HX_RELEASE(pSurfaceControl); + } + } + + } + // Tracking Errors but not acting on them + // if hres == 0 then all sites succesfully set the param + // if hres < #sites then at least one site updated + // if hres == #sites then no site successfully set the param + HXLOGL2( HXLOG_SMMF, "HXMMFSiteSupplier::SetScaling( fWidthPerc(%lu) fHeightPerc[%lu] bAntiAlias[%d] )", fWidthPerc, fHeightPerc, bAntiAlias); + if(hres == nNumSites) + { + //no site was set + return HXR_FAIL; + } + else + { + //at least one site was set + return HXR_OK; + } +} + +STDMETHODIMP +HXMMFSiteSupplier::GetScaling(HXFLOAT &fWidthPerc, HXFLOAT &fHeightPerc, HXBOOL &bAntiAlias) +{ + IHXSurfaceControl* pSurfaceControl = NULL; + IHXSite* pIterationSite = NULL; + HRESULT hres; + UINT32 index; + UINT32 nNumSites = 0; + + m_pSitesManager2->GetNumberOfSites(nNumSites); + hres = nNumSites; + for(index = 0; index< nNumSites; index++) + { + m_pSitesManager2->GetSiteAt(index, pIterationSite); + if(pIterationSite) + { + pIterationSite->QueryInterface(IID_IHXSurfaceControl, (void**) &pSurfaceControl); + if(pSurfaceControl) + { + if(pSurfaceControl->GetScaling(fWidthPerc,fHeightPerc,bAntiAlias) == HXR_OK) + { + //error tracking of how many sites succeded + hres--; + } + else + { + HXLOGL2( HXLOG_SMMF, "HXMMFSiteSupplier::GetScaling(FALIED)"); + } + HX_RELEASE(pSurfaceControl); + } + } + + } + // Tracking Errors but not acting on them + // if hres == 0 then all sites succesfully set the param + // if hres < #sites then at least one site updated + // if hres == #sites then no site successfully set the param + HXLOGL2( HXLOG_SMMF, "HXMMFSiteSupplier::GetScaling( fWidthPerc(%lu) fHeightPerc[%lu] bAntiAlias[%d] )", fWidthPerc, fHeightPerc, bAntiAlias); + if(hres == nNumSites) + { + //no site was gotten + return HXR_FAIL; + } + else + { + //at least one site was got + return HXR_OK; + } +} + +STDMETHODIMP +HXMMFSiteSupplier::SetCropRect(HXxRect sValue) +{ + + IHXSurfaceControl* pSurfaceControl = NULL; + IHXSite* pIterationSite = NULL; + HRESULT hres; + UINT32 index; + UINT32 nNumSites = 0; + + m_pSitesManager2->GetNumberOfSites(nNumSites); + hres = nNumSites; + for(index = 0; index< nNumSites; index++) + { + m_pSitesManager2->GetSiteAt(index, pIterationSite); + if(pIterationSite) + { + pIterationSite->QueryInterface(IID_IHXSurfaceControl, (void**) &pSurfaceControl); + if(pSurfaceControl) + { + if(pSurfaceControl->SetCropRect(sValue) == HXR_OK) + { + //error tracking of how many sites succeded + hres--; + } + else + { + HXLOGL2( HXLOG_SMMF, "HXMMFSiteSupplier::SetCropRect(FALIED)"); + } + HX_RELEASE(pSurfaceControl); + } + } + + } + // Tracking Errors but not acting on them + // if hres == 0 then all sites succesfully set the param + // if hres < #sites then at least one site updated + // if hres == #sites then no site successfully set the param + HXLOGL2( HXLOG_SMMF, "HXMMFSiteSupplier::SetCropRect()"); + if(hres == nNumSites) + { + //no site was set + return HXR_FAIL; + } + else + { + //at least one site was set + return HXR_OK; + } +} + +STDMETHODIMP +HXMMFSiteSupplier::GetCropRect(HXxRect &sValue) +{ + + IHXSurfaceControl* pSurfaceControl = NULL; + IHXSite* pIterationSite = NULL; + HRESULT hres; + UINT32 index; + UINT32 nNumSites = 0; + + m_pSitesManager2->GetNumberOfSites(nNumSites); + hres = nNumSites; + for(index = 0; index< nNumSites; index++) + { + m_pSitesManager2->GetSiteAt(index, pIterationSite); + if(pIterationSite) + { + pIterationSite->QueryInterface(IID_IHXSurfaceControl, (void**) &pSurfaceControl); + if(pSurfaceControl) + { + if(pSurfaceControl->SetCropRect(sValue) == HXR_OK) + { + //error tracking of how many sites succeded + hres--; + } + else + { + HXLOGL2( HXLOG_SMMF, "HXMMFSiteSupplier::GetCropRect(FALIED)"); + } + HX_RELEASE(pSurfaceControl); + } + } + + } + // Tracking Errors but not acting on them + // if hres == 0 then all sites succesfully set the param + // if hres < #sites then at least one site updated + // if hres == #sites then no site successfully set the param + HXLOGL2( HXLOG_SMMF, "HXMMFSiteSupplier::GetCropRect()"); + if(hres == nNumSites) + { + //no site was gotten + return HXR_FAIL; + } + else + { + //at least one site was got + return HXR_OK; + } +} + +//IHXDSAControl + +STDMETHODIMP +HXMMFSiteSupplier::UpdateDisplayRegion(HXxRegion Region) +{ + IHXDSAControl* pDSAControl = NULL; + IHXSite* pIterationSite = NULL; + HRESULT hres; + UINT32 index; + UINT32 nNumSites = 0; + + m_pSitesManager2->GetNumberOfSites(nNumSites); + hres = nNumSites; + for(index = 0; index< nNumSites; index++) + { + m_pSitesManager2->GetSiteAt(index, pIterationSite); + if(pIterationSite) + { + pIterationSite->QueryInterface(IID_IHXDSAControl, (void**) &pDSAControl); + if(pDSAControl) + { + if(pDSAControl->UpdateDisplayRegion(Region) == HXR_OK) + { + //error tracking of how many sites succeded + hres--; + } + else + { + HXLOGL2( HXLOG_SMMF, "HXMMFSiteSupplier::UpdateDisplayRegion(FALIED)"); + } + HX_RELEASE(pDSAControl); + } + } + + } + // Tracking Errors but not acting on them + // if hres == 0 then all sites succesfully set the param + // if hres < #sites then at least one site updated + // if hres == #sites then no site successfully set the param + HXLOGL2( HXLOG_SMMF, "HXMMFSiteSupplier::UpdateDisplayRegion()"); + if(hres == nNumSites) + { + //no update sent + return HXR_FAIL; + } + else + { + //at least one update sent + return HXR_OK; + } +} + +STDMETHODIMP +HXMMFSiteSupplier::RefreshWindow() +{ + + IHXDSAControl* pDSAControl = NULL; + IHXSite* pIterationSite = NULL; + HRESULT hres; + UINT32 index; + UINT32 nNumSites = 0; + + m_pSitesManager2->GetNumberOfSites(nNumSites); + hres = nNumSites; + for(index = 0; index< nNumSites; index++) + { + m_pSitesManager2->GetSiteAt(index, pIterationSite); + if(pIterationSite) + { + pIterationSite->QueryInterface(IID_IHXDSAControl, (void**) &pDSAControl); + if(pDSAControl) + { + if(pDSAControl->RefreshWindow() == HXR_OK) + { + //error tracking of how many sites succeded + hres--; + } + else + { + HXLOGL2( HXLOG_SMMF, "HXMMFSiteSupplier::RefreshWindow(FALIED)"); + } + HX_RELEASE(pDSAControl); + } + } + + } + // Tracking Errors but not acting on them + // if hres == 0 then all sites succesfully set the param + // if hres < #sites then at least one site updated + // if hres == #sites then no site successfully set the param + HXLOGL2( HXLOG_SMMF, "HXMMFSiteSupplier::RefreshWindow()"); + if(hres == nNumSites) + { + //no refresh sent + return HXR_FAIL; + } + else + { + //at least one refresh sent + return HXR_OK; + } +} + +STDMETHODIMP +HXMMFSiteSupplier::DirectScreenAccessEvent(HXBOOL bValue) +{ + + IHXDSAControl* pDSAControl = NULL; + IHXSite* pIterationSite = NULL; + HRESULT hres; + UINT32 index; + UINT32 nNumSites = 0; + + m_pSitesManager2->GetNumberOfSites(nNumSites); + hres = nNumSites; + for(index = 0; index< nNumSites; index++) + { + m_pSitesManager2->GetSiteAt(index, pIterationSite); + if(pIterationSite) + { + pIterationSite->QueryInterface(IID_IHXDSAControl, (void**) &pDSAControl); + if(pDSAControl) + { + if(pDSAControl->DirectScreenAccessEvent(bValue) == HXR_OK) + { + //error tracking of how many sites succeded + hres--; + } + else + { + HXLOGL2( HXLOG_SMMF, "HXMMFSiteSupplier::DirectScreenAccessEvent(FALIED)"); + } + HX_RELEASE(pDSAControl); + } + } + + } + // Tracking Errors but not acting on them + // if hres == 0 then all sites succesfully set the param + // if hres < #sites then at least one site updated + // if hres == #sites then no site successfully set the param + HXLOGL2( HXLOG_SMMF, "HXMMFSiteSupplier::DirectScreenAccessEvent(%d) #Sites[%d] #Errors[%d]", bValue, nNumSites, hres); + if(hres == nNumSites) + { + //no DSA sent + return HXR_FAIL; + } + else + { + //at least one DSA sent + return HXR_OK; + } +} + +#endif //(HELIX_FEATURE_MMF_SITE_CONTROL) + Index: hxmmfctrlimpl.cpp =================================================================== RCS file: /cvsroot/clientapps/symbianMmf/hxmmfctrlimpl.cpp,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- hxmmfctrlimpl.cpp 10 Mar 2006 19:48:20 -0000 1.28 +++ hxmmfctrlimpl.cpp 13 Mar 2006 21:52:07 -0000 1.29 @@ -243,6 +243,11 @@ #ifdef DRM_ENABLED_FROM_CONTROLLER , m_DRMIntent(ContentAccess::EPlay) #endif + +#ifdef HELIX_FEATURE_MMF_SITE_CONTROL + ,m_pDSAControl(NULL) + ,m_pSurfaceControl(NULL) +#endif { } @@ -268,6 +273,11 @@ HX_RELEASE(m_pPrefs); HX_RELEASE(m_pRequest); HX_RELEASE(m_pFactory); + +#if defined(HELIX_FEATURE_MMF_SITE_CONTROL) + HX_RELEASE(m_pDSAControl); + HX_RELEASE(m_pSurfaceControl); +#endif m_pStateCtrl->Close(); HX_RELEASE(m_pStateCtrl); HX_DELETE(m_pEnvChange); @@ -480,6 +490,28 @@ // m_pStateCtrl->RegisterCtrlObject(this); +#if defined(HELIX_FEATURE_MMF_SITE_CONTROL) + // + // Query for Surface control & Dsa Control on Site Supplier + // + IHXSiteSupplier* pSiteSupplier; + m_pStateCtrl->QueryInterface(IID_IHXSiteSupplier, (void **) &pSiteSupplier); + HX_ASSERT(pSiteSupplier); + if(pSiteSupplier) + { + pSiteSupplier->QueryInterface(IID_IHXSurfaceControl, (void **) &m_pSurfaceControl); + HX_ASSERT(m_pSurfaceControl); + + pSiteSupplier->QueryInterface(IID_IHXDSAControl, (void **) &m_pDSAControl); + HX_ASSERT(m_pDSAControl); + + HX_RELEASE(pSiteSupplier); + } + if((!m_pSurfaceControl) || (!m_pDSAControl)) + { + User::Leave(KErrNotSupported); + } +#endif // register to receive environment change notifications (for OOM) m_bIgnoreFirstEnvChange = TRUE; HX_ASSERT(!m_pEnvChange); @@ -1132,21 +1164,17 @@ } } - /* + // Update values that need change-notification in realtime: scaling, alignments if ( status == KErrNone ) { - int autoScale = false; - m_pConfig->Map(NP_AutoScale, autoScale); - npScreenAccess::Instance()->SetAutoScale(autoScale); +#if defined(HELIX_FEATURE_MMF_SITE_CONTROL) + UINT32 contrast = 0; + contrast = prefs::GetUINT32(m_pPrefs, "Contrast", 0); - int xAlignment = npScreenParams::ELeft; - int yAlignment = npScreenParams::ETop; - m_pConfig->Map(NP_HorizontalAlignment, xAlignment); - m_pConfig->Map(NP_VerticalAlignment, yAlignment); - npScreenAccess::Instance()->SetAlignment(xAlignment, yAlignment); + m_pSurfaceControl->SetContrast(contrast); +#endif } - */ return status; } @@ -1359,30 +1387,18 @@ HXMMFCtrlImpl::MvpcDirectScreenAccessEventL( const TMMFDSAEvent aDSAEvent ) { HXLOGL1(HXLOG_SMMF, "HXMMFCtrlImpl::DSAEvent(%d)", aDSAEvent); -/* - npScreenAccess* pScreen = npScreenAccess::Instance(); - - - if ( aDSAEvent == EAbortDSA ) - { - pScreen->Abort(); - } - else if ( aDSAEvent == EResumeDSA ) - { - if (pScreen->Resume()) - { - m_pEngine->Refresh(); - } - } -*/ +#if defined(HELIX_FEATURE_MMF_SITE_CONTROL) + m_pDSAControl->DirectScreenAccessEvent(aDSAEvent == EResumeDSA); +#endif } void HXMMFCtrlImpl::MvpcUpdateDisplayRegionL( const TRegion& aRegion ) { HXLOGL1(HXLOG_SMMF, "HXMMFCtrlImpl::MvpcUpdateDisplayRegion()"); - -// npScreenAccess::Instance()->UpdateRegion(aRegion); +#if defined(HELIX_FEATURE_MMF_SITE_CONTROL) + m_pDSAControl->UpdateDisplayRegion((HXxRegion)&aRegion); +#endif } void @@ -1401,19 +1417,7 @@ tl.iX, tl.iY, br.iX, br.iY); m_pStateCtrl->SetDisplayWindow( aWindowRect, aClipRect ); -/* - npScreenAccess* pScreen = npScreenAccess::Instance(); - pScreen->SetWindow(aWindowRect, aClipRect); - - utString offset; - utString size; - if ( pScreen->GetDimensions(offset, size) ) - { - m_pConfig->Append(NP_WindowOffset, offset); - m_pConfig->Append(NP_WindowSize, size); - } -*/ } void @@ -1467,9 +1471,9 @@ HXMMFCtrlImpl::MvpcRefreshFrameL() { HXLOGL1(HXLOG_SMMF, "HXMMFCtrlImpl::MvpcRefreshL()"); - -// if (m_pEngine) -// m_pEngine->Refresh(); +#if defined(HELIX_FEATURE_MMF_SITE_CONTROL) + m_pDSAControl->RefreshWindow(); +#endif } void @@ -1483,104 +1487,69 @@ HXMMFCtrlImpl::MvpcSetRotationL( TVideoRotation aRotation ) { HXLOGL1(HXLOG_SMMF, "HXMMFCtrlImpl::MvpcSetRotationL()"); -/* - npScreenAccess* pScreen = npScreenAccess::Instance(); - - switch (aRotation) - { - case EVideoRotationClockwise90: - pScreen->SetRotation(90); - break; - case EVideoRotationClockwise180: - pScreen->SetRotation(180); - break; - case EVideoRotationClockwise270: - pScreen->SetRotation(270); - break; - case EVideoRotationNone: - default: - pScreen->SetRotation(0); - break; - } -*/ +#if defined(HELIX_FEATURE_MMF_SITE_CONTROL) + m_pSurfaceControl->SetRotation(aRotation); +#endif } void HXMMFCtrlImpl::MvpcGetRotationL(TVideoRotation& aRotation) { HXLOGL1(HXLOG_SMMF, "HXMMFCtrlImpl::MvpcGetRotationL()"); -/* - npScreenAccess* pScreen = npScreenAccess::Instance(); - - switch (pScreen->GetRotation()) +#if defined(HELIX_FEATURE_MMF_SITE_CONTROL) + UINT32 tempRotation; + m_pSurfaceControl->GetRotation(tempRotation); + switch (tempRotation) { - case 90: - aRotation = EVideoRotationClockwise90; - break; - case 180: - aRotation = EVideoRotationClockwise180; - break; - case 270: - aRotation = EVideoRotationClockwise270; - break; - case 0: - default: - aRotation = EVideoRotationNone; - break; + case Rotate90: + aRotation = EVideoRotationClockwise90; break; + case Rotate180: + aRotation = EVideoRotationClockwise180; break; + case Rotate270: + aRotation = EVideoRotationClockwise270; break; + case Rotate0: + default: + aRotation = EVideoRotationNone; break; } -*/ +#endif + } void HXMMFCtrlImpl::MvpcSetScaleFactorL( TReal32 aWidthPercentage, TReal32 aHeightPercentage, - TBool /* aAntiAliasFiltering */) + TBool aAntiAliasFiltering ) { HXLOGL1(HXLOG_SMMF, "HXMMFCtrlImpl::MvpcSetScaleFactorL()"); -/* - npScreenAccess* pScreen = npScreenAccess::Instance(); - - // we ignore the filter parameter - // and only support isometric scaling - pScreen->SetScale((int)(aWidthPercentage)); -*/ +#if defined(HELIX_FEATURE_MMF_SITE_CONTROL) + m_pSurfaceControl->SetScaling(aWidthPercentage, aHeightPercentage, aAntiAliasFiltering); +#endif } void HXMMFCtrlImpl::MvpcGetScaleFactorL(TReal32& aWidthPercentage, - TReal32& aHeightPercentage, - TBool& aAntiAliasFiltering) + TReal32& aHeightPercentage, + TBool& aAntiAliasFiltering) { HXLOGL1(HXLOG_SMMF, "HXMMFCtrlImpl::MvpcGetScaleFactorL()"); -/* - npScreenAccess* pScreen = npScreenAccess::Instance(); - - // we ignore the filter parameter and - // only support isometric scaling - aWidthPercentage = (TReal)pScreen->GetScale(); - aHeightPercentage = aWidthPercentage; - aAntiAliasFiltering = ETrue; -*/ +#if defined(HELIX_FEATURE_MMF_SITE_CONTROL) + m_pSurfaceControl->GetScaling(aWidthPercentage, aHeightPercentage, aAntiAliasFiltering); +#endif } void HXMMFCtrlImpl::MvpcSetCropRegionL(const TRect& aCropRegion) { HXLOGL1(HXLOG_SMMF, "HXMMFCtrlImpl::MvpcSetCropRegionL()"); -/* - npScreenAccess* pScreen = npScreenAccess::Instance(); - pScreen->SetCropRect(aCropRegion); -*/ +#if defined(HELIX_FEATURE_MMF_SITE_CONTROL) + m_pSurfaceControl->SetCropRect(CHXxRect(aCropRegion.iTl.iX, aCropRegion.iTl.iY, aCropRegion.iBr.iX, aCropRegion.iBr.iY)); +#endif } void HXMMFCtrlImpl::MvpcGetCropRegionL(TRect& aCropRegion) { HXLOGL1(HXLOG_SMMF, "HXMMFCtrlImpl::MvpcGetCropRegionL()"); -/* - npScreenAccess* pScreen = npScreenAccess::Instance(); - aCropRegion = pScreen->GetCropRect(); -*/ } @@ -1883,5 +1852,15 @@ HXMMFCtrlImpl::CachePresentationInfo(IHXPlayer *pPlayer) { m_pMetaData->CachePresentationInfo(pPlayer); +#if defined(HELIX_FEATURE_MMF_SITE_CONTROL) + //update frame size for site based on clip info + TInt width=0, height=0; + + m_pMetaData->FindStreamValueByName( "Video", "FrameWidth", width); + m_pMetaData->FindStreamValueByName( "Video", "FrameHeight", height); + + /* Initialization. */ + m_pSurfaceControl->SetFrameRect(CHXxRect(0, 0, width, height)); +#endif }