comimgrend.h
上传用户:dangjiwu
上传日期:2013-07-19
资源大小:42019k
文件大小:7k
源码类别:

Symbian

开发平台:

Visual C++

  1. /* ***** BEGIN LICENSE BLOCK ***** 
  2.  * Version: RCSL 1.0/RPSL 1.0 
  3.  *  
  4.  * Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved. 
  5.  *      
  6.  * The contents of this file, and the files included with this file, are 
  7.  * subject to the current version of the RealNetworks Public Source License 
  8.  * Version 1.0 (the "RPSL") available at 
  9.  * http://www.helixcommunity.org/content/rpsl unless you have licensed 
  10.  * the file under the RealNetworks Community Source License Version 1.0 
  11.  * (the "RCSL") available at http://www.helixcommunity.org/content/rcsl, 
  12.  * in which case the RCSL will apply. You may also obtain the license terms 
  13.  * directly from RealNetworks.  You may not use this file except in 
  14.  * compliance with the RPSL or, if you have a valid RCSL with RealNetworks 
  15.  * applicable to this file, the RCSL.  Please see the applicable RPSL or 
  16.  * RCSL for the rights, obligations and limitations governing use of the 
  17.  * contents of the file.  
  18.  *  
  19.  * This file is part of the Helix DNA Technology. RealNetworks is the 
  20.  * developer of the Original Code and owns the copyrights in the portions 
  21.  * it created. 
  22.  *  
  23.  * This file, and the files included with this file, is distributed and made 
  24.  * available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 
  25.  * EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES, 
  26.  * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS 
  27.  * FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 
  28.  * 
  29.  * Technology Compatibility Kit Test Suite(s) Location: 
  30.  *    http://www.helixcommunity.org/content/tck 
  31.  * 
  32.  * Contributor(s): 
  33.  *  
  34.  * ***** END LICENSE BLOCK ***** */ 
  35. #ifndef COMIMGREND_H
  36. #define COMIMGREND_H
  37. // Forward declarations
  38. typedef _INTERFACE IHXStream             IHXStream;
  39. typedef _INTERFACE IHXPlayer             IHXPlayer;
  40. typedef _INTERFACE IHXValues             IHXValues;
  41. typedef _INTERFACE IHXPacket             IHXPacket;
  42. typedef _INTERFACE IHXBuffer             IHXBuffer;
  43. typedef _INTERFACE IHXSite               IHXSite;
  44. typedef _INTERFACE IHXVideoSurface       IHXVideoSurface;
  45. typedef _INTERFACE IHXCommonClassFactory IHXCommonClassFactory;
  46. typedef _INTERFACE IHXScheduler          IHXScheduler;
  47. typedef _INTERFACE IHXErrorMessages      IHXErrorMessages;
  48. typedef _INTERFACE IHXUpdateProperties   IHXUpdateProperties;
  49. class CHXSimpleList;
  50. class CNativeImageDecoder;
  51. class CCommonImageRenderer : public CHXBaseCountingObject,
  52.                              public IHXPlugin, 
  53.                              public IHXRenderer, 
  54.                              public IHXSiteUser,
  55.                              public CNativeImageDecoderResponse
  56. {
  57. public:
  58.     CCommonImageRenderer();
  59.     virtual ~CCommonImageRenderer();
  60.     // IUnknown Methods
  61.     STDMETHOD (QueryInterface)  (THIS_ REFIID ID, void** ppObj);
  62.     STDMETHOD_(UINT32, AddRef)  (THIS);
  63.     STDMETHOD_(UINT32, Release) (THIS);
  64.     // IHXPlugin Methods
  65.     STDMETHOD(GetPluginInfo) (THIS_ REF(BOOL)        rbLoadMultiple,
  66.                                     REF(const char*) rpszDescription,
  67.                                     REF(const char*) rpszCopyright,
  68.                                     REF(const char*) rpszMoreInfoURL,
  69.                                     REF(UINT32)      rulVersionNumber);
  70.     STDMETHOD(InitPlugin)    (THIS_ IUnknown* pContext);
  71.     // IHXRenderer Methods
  72.     STDMETHOD(GetRendererInfo) (THIS_ REF(const char**) rppszStreamMimeType,
  73.                                       REF(UINT32)       rulInitialGranularity);
  74.     STDMETHOD(StartStream)     (THIS_ IHXStream* pStream, IHXPlayer* pPlayer);
  75.     STDMETHOD(EndStream)       (THIS);
  76.     STDMETHOD(OnHeader)        (THIS_ IHXValues* pHeader);
  77.     STDMETHOD(OnPacket)        (THIS_ IHXPacket* pPacket, INT32 lTimeOffset);
  78.     STDMETHOD(OnTimeSync)      (THIS_ UINT32 ulTime);
  79.     STDMETHOD(OnPreSeek)       (THIS_ UINT32 ulTimeBefore, UINT32 ulTimeAfter);
  80.     STDMETHOD(OnPostSeek)      (THIS_ UINT32 ulTimeBefore, UINT32 ulTimeAfter);
  81.     STDMETHOD(OnPause)         (THIS_ UINT32 ulTimeBeforePause);
  82.     STDMETHOD(OnBegin)         (THIS_ UINT32 ulTimeAfterBegin);
  83.     STDMETHOD(OnBuffering)     (THIS_ UINT32 ulReason, UINT16 usPercentComplete);
  84.     STDMETHOD(GetDisplayType)  (THIS_ REF(HX_DISPLAY_TYPE) rDisplayType,
  85.                                       REF(IHXBuffer*)     rpDisplayInfo);
  86.     STDMETHOD(OnEndofPackets)  (THIS);
  87.     // IHXSiteUser Methods
  88.     STDMETHOD(AttachSite)               (THIS_ IHXSite* pSite);
  89.     STDMETHOD(DetachSite)               (THIS);
  90.     STDMETHOD(HandleEvent)              (THIS_ HXxEvent* pEvent);
  91.     STDMETHOD_(BOOL,NeedsWindowedSites) (THIS);
  92.     // CNativeImageDecoderResponse methods
  93.     STDMETHOD(DecodeDone) (THIS_ HX_RESULT           status,
  94.                                  HXBitmapInfoHeader* pHeader,
  95.                                  IHXBuffer*          pBuffer);
  96.     // CCommonImageRenderer methods
  97.     static HX_RESULT STDAPICALLTYPE HXCreateInstance(IUnknown** ppIUnknown);
  98. protected:
  99.     INT32                    m_lRefCount;
  100.     IUnknown*                m_pContext;
  101.     IHXSite*                 m_pSite;
  102.     IHXCommonClassFactory*   m_pCommonClassFactory;
  103.     IHXValues*               m_pStreamHeader;
  104.     IHXBuffer*               m_pMimeTypeStr;
  105.     UINT32                   m_ulImageWidth;
  106.     UINT32                   m_ulImageHeight;
  107.     CHXSimpleList*           m_pPacketList;
  108.     BOOL                     m_bHasForceRedraw;
  109.     BOOL                     m_bDecodeComplete;
  110.     HXBitmapInfoHeader*      m_pBitmapInfoHeader;
  111.     IHXBuffer*               m_pOutputBuffer;
  112.     CNativeImageDecoder*     m_pNativeImageDecoder;
  113.     
  114.     static const char* const m_pszName;
  115.     static const char* const m_pszDescription;
  116.     static const char* const m_pszCopyright;
  117.     static const char* const m_pszMoreInfoURL;
  118.     static const char* const m_ppszStreamMimeType[];
  119.     HX_RESULT GenerateImageBuffer(CHXSimpleList*  pPacketList,
  120.                                   IHXValues*      pStreamHeader,
  121.                                   REF(IHXBuffer*) rpBuffer);
  122.     UINT32    SumCopyPacketList(CHXSimpleList* pPacketList,
  123.                                 IHXValues*     pStreamHeader,
  124.                                 IHXBuffer*     pWholeBuffer);
  125.     void      ClearPacketList();
  126.     HX_RESULT ParseStreamHeader(IHXValues*      pHeader,
  127.                                 REF(UINT32)     rulImageWidth,
  128.                                 REF(UINT32)     rulImageHeight,
  129.                                 REF(IHXBuffer*) rpMimeTypeStr);
  130.     void _ForceRedraw();
  131.     
  132. };
  133. #endif /* #ifndef COMIMGREND_H */