pximgfil.h
Upload User: zhongxx05
Upload Date: 2007-06-06
Package Size: 33641k
Code Size: 6k
Category:

Symbian

Development Platform:

C/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 PXIMGFIL_H
  36. #define PXIMGFIL_H
  37. // Forward declarations of interfaces
  38. typedef _INTERFACE IUnknown              IUnknown;
  39. typedef _INTERFACE IHXBuffer             IHXBuffer;
  40. typedef _INTERFACE IHXPacket             IHXPacket;
  41. typedef _INTERFACE IHXCommonClassFactory IHXCommonClassFactory;
  42. // Forward declarations of classes
  43. class CHXBaseCountingObject;
  44. class PXWireFormatManager;
  45. class PXFileFormatCodecManager;
  46. class CHXSimpleList;
  47. class PXImageFile : public CHXBaseCountingObject,
  48.                     public IUnknown
  49. {
  50. public:
  51.     PXImageFile(PXWireFormatManager*      pWireFormatManager,
  52.                 PXFileFormatCodecManager* pCodecManager,
  53.                 IHXCommonClassFactory*   pCommonClassFactory);
  54.     virtual ~PXImageFile();
  55.     // IUnknown methods
  56.     STDMETHOD(QueryInterface)  (THIS_ REFIID riid, void** ppvObj);
  57.     STDMETHOD_(UINT32,AddRef)  (THIS);
  58.     STDMETHOD_(UINT32,Release) (THIS);
  59.     HX_RESULT         AddCookie(IHXBuffer* pURLStr, IHXBuffer* pCookie);
  60.     HX_RESULT         EnqueueCookiePacket();
  61.     HX_RESULT         EnqueueImagePackets(UINT32      ulHandle,
  62.                                           IHXBuffer* pFileBuffer);
  63.     HX_RESULT         EnqueueEffectPacket(UINT32      ulEffectType,
  64.                                           UINT32      ulStart,
  65.                                           UINT32      ulDuration,
  66.                                           UINT32      ulTarget,
  67.                                           const char* pszURL,
  68.                                           UINT32      ulFillColor = 0,
  69.                                           BOOL        bBackChannel = FALSE,
  70.                                           BOOL        bLastUse = TRUE,
  71.                                           BOOL        bDisplayImmediately = FALSE);
  72.     void              ComputeStatistics();
  73.     HX_RESULT         DequeuePacket(REF(IHXPacket*) rpPacket,
  74.                                     UINT32           ulBitrate,
  75.                                     REF(INT32)       rlCurrentTimeStamp);
  76.     HX_RESULT         GetFirstPacket(REF(IHXPacket*) rpPacket);
  77.     HX_RESULT         GetNextPacket(REF(IHXPacket*) rpPacket);
  78.     UINT32            GetHandle() const;
  79.     UINT32            GetTotalBytes() const;
  80.     UINT32            GetNumPackets() const;
  81.     UINT32            GetWidth() const;
  82.     UINT32            GetHeight() const;
  83.     UINT32            GetNumPacketsLeft() const;
  84.     UINT32            GetTotalSendTime(UINT32 ulBitrate) const;
  85.     HX_RESULT         SetPacketTimeStamp(IHXPacket*      pPacket,
  86.                                          UINT32           ulTimeStamp,
  87.                                          REF(UINT32)      rulPacketSize,
  88.                                          REF(IHXPacket*) rpPacket);
  89.     static HX_RESULT  FactorySetTimeStamp(IHXPacket*             pPacket,
  90.                                           IHXCommonClassFactory* pFactory,
  91.                                           UINT32                  ulTimeStamp,
  92.                                           REF(UINT32)             rulPacketSize,
  93.                                           REF(IHXPacket*)        rpPacket);
  94.     static UINT32     GetPacketSendTime(IHXPacket* pPacket, UINT32 ulBitrate);
  95. protected:
  96.     struct CookiePair
  97.     {
  98.         IHXBuffer* m_pURLStr;
  99.         IHXBuffer* m_pCookie;
  100.     };
  101.     INT32                     m_lRefCount;
  102.     PXWireFormatManager*      m_pWireFormatManager;
  103.     PXFileFormatCodecManager* m_pCodecManager;
  104.     IHXCommonClassFactory*    m_pCommonClassFactory;
  105.     UINT32                    m_ulHandle;
  106.     UINT32                    m_ulNumPackets;
  107.     UINT32                    m_ulTotalBytes;
  108.     UINT32                    m_ulImageWidth;
  109.     UINT32                    m_ulImageHeight;
  110.     CHXSimpleList*            m_pPacketList;
  111.     CHXSimpleList*            m_pCookieList;
  112.     void*                     m_pListItr;
  113.     void                      Deallocate();
  114.     void                      ReleaseAllPackets();
  115.     void                      ClearCookieList();
  116.     HX_RESULT                 AddPacket(IHXPacket* pPacket, BOOL bTail = TRUE);
  117. };
  118. inline UINT32 PXImageFile::GetHandle()     const { return m_ulHandle;      }
  119. inline UINT32 PXImageFile::GetTotalBytes() const { return m_ulTotalBytes;  }
  120. inline UINT32 PXImageFile::GetNumPackets() const { return m_ulNumPackets;  }
  121. inline UINT32 PXImageFile::GetWidth()      const { return m_ulImageWidth;  }
  122. inline UINT32 PXImageFile::GetHeight()     const { return m_ulImageHeight; }
  123. #endif