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

Symbian

开发平台:

Visual C++

  1. /* ***** BEGIN LICENSE BLOCK *****
  2.  * Source last modified: $Id: pximgfil.h,v 1.1.26.1 2004/07/09 01:54:36 hubbe Exp $
  3.  * 
  4.  * Portions Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.
  5.  * 
  6.  * The contents of this file, and the files included with this file,
  7.  * are subject to the current version of the RealNetworks Public
  8.  * Source License (the "RPSL") available at
  9.  * http://www.helixcommunity.org/content/rpsl unless you have licensed
  10.  * the file under the current version of the RealNetworks Community
  11.  * Source License (the "RCSL") available at
  12.  * http://www.helixcommunity.org/content/rcsl, in which case the RCSL
  13.  * will apply. You may also obtain the license terms directly from
  14.  * RealNetworks.  You may not use this file except in compliance with
  15.  * the RPSL or, if you have a valid RCSL with RealNetworks applicable
  16.  * to this file, the RCSL.  Please see the applicable RPSL or RCSL for
  17.  * the rights, obligations and limitations governing use of the
  18.  * contents of the file.
  19.  * 
  20.  * Alternatively, the contents of this file may be used under the
  21.  * terms of the GNU General Public License Version 2 or later (the
  22.  * "GPL") in which case the provisions of the GPL are applicable
  23.  * instead of those above. If you wish to allow use of your version of
  24.  * this file only under the terms of the GPL, and not to allow others
  25.  * to use your version of this file under the terms of either the RPSL
  26.  * or RCSL, indicate your decision by deleting the provisions above
  27.  * and replace them with the notice and other provisions required by
  28.  * the GPL. If you do not delete the provisions above, a recipient may
  29.  * use your version of this file under the terms of any one of the
  30.  * RPSL, the RCSL or the GPL.
  31.  * 
  32.  * This file is part of the Helix DNA Technology. RealNetworks is the
  33.  * developer of the Original Code and owns the copyrights in the
  34.  * portions it created.
  35.  * 
  36.  * This file, and the files included with this file, is distributed
  37.  * and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY
  38.  * KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS
  39.  * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES
  40.  * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
  41.  * ENJOYMENT OR NON-INFRINGEMENT.
  42.  * 
  43.  * Technology Compatibility Kit Test Suite(s) Location:
  44.  *    http://www.helixcommunity.org/content/tck
  45.  * 
  46.  * Contributor(s):
  47.  * 
  48.  * ***** END LICENSE BLOCK ***** */
  49. #ifndef PXIMGFIL_H
  50. #define PXIMGFIL_H
  51. // Forward declarations of interfaces
  52. typedef _INTERFACE IUnknown              IUnknown;
  53. typedef _INTERFACE IHXBuffer             IHXBuffer;
  54. typedef _INTERFACE IHXPacket             IHXPacket;
  55. typedef _INTERFACE IHXCommonClassFactory IHXCommonClassFactory;
  56. // Forward declarations of classes
  57. class CHXBaseCountingObject;
  58. class PXWireFormatManager;
  59. class PXFileFormatCodecManager;
  60. class CHXSimpleList;
  61. class PXImageFile : public CHXBaseCountingObject,
  62.                     public IUnknown
  63. {
  64. public:
  65.     PXImageFile(PXWireFormatManager*      pWireFormatManager,
  66.                 PXFileFormatCodecManager* pCodecManager,
  67.                 IHXCommonClassFactory*   pCommonClassFactory);
  68.     virtual ~PXImageFile();
  69.     // IUnknown methods
  70.     STDMETHOD(QueryInterface)  (THIS_ REFIID riid, void** ppvObj);
  71.     STDMETHOD_(UINT32,AddRef)  (THIS);
  72.     STDMETHOD_(UINT32,Release) (THIS);
  73.     HX_RESULT         AddCookie(IHXBuffer* pURLStr, IHXBuffer* pCookie);
  74.     HX_RESULT         EnqueueCookiePacket();
  75.     HX_RESULT         EnqueueImagePackets(UINT32      ulHandle,
  76.                                           IHXBuffer* pFileBuffer);
  77.     HX_RESULT         EnqueueEffectPacket(UINT32      ulEffectType,
  78.                                           UINT32      ulStart,
  79.                                           UINT32      ulDuration,
  80.                                           UINT32      ulTarget,
  81.                                           const char* pszURL,
  82.                                           UINT32      ulFillColor = 0,
  83.                                           BOOL        bBackChannel = FALSE,
  84.                                           BOOL        bLastUse = TRUE,
  85.                                           BOOL        bDisplayImmediately = FALSE);
  86.     void              ComputeStatistics();
  87.     HX_RESULT         DequeuePacket(REF(IHXPacket*) rpPacket,
  88.                                     UINT32           ulBitrate,
  89.                                     REF(INT32)       rlCurrentTimeStamp);
  90.     HX_RESULT         GetFirstPacket(REF(IHXPacket*) rpPacket);
  91.     HX_RESULT         GetNextPacket(REF(IHXPacket*) rpPacket);
  92.     UINT32            GetHandle() const;
  93.     UINT32            GetTotalBytes() const;
  94.     UINT32            GetNumPackets() const;
  95.     UINT32            GetWidth() const;
  96.     UINT32            GetHeight() const;
  97.     UINT32            GetNumPacketsLeft() const;
  98.     UINT32            GetTotalSendTime(UINT32 ulBitrate) const;
  99.     HX_RESULT         SetPacketTimeStamp(IHXPacket*      pPacket,
  100.                                          UINT32           ulTimeStamp,
  101.                                          REF(UINT32)      rulPacketSize,
  102.                                          REF(IHXPacket*) rpPacket);
  103.     static HX_RESULT  FactorySetTimeStamp(IHXPacket*             pPacket,
  104.                                           IHXCommonClassFactory* pFactory,
  105.                                           UINT32                  ulTimeStamp,
  106.                                           REF(UINT32)             rulPacketSize,
  107.                                           REF(IHXPacket*)        rpPacket);
  108.     static UINT32     GetPacketSendTime(IHXPacket* pPacket, UINT32 ulBitrate);
  109. protected:
  110.     struct CookiePair
  111.     {
  112.         IHXBuffer* m_pURLStr;
  113.         IHXBuffer* m_pCookie;
  114.     };
  115.     INT32                     m_lRefCount;
  116.     PXWireFormatManager*      m_pWireFormatManager;
  117.     PXFileFormatCodecManager* m_pCodecManager;
  118.     IHXCommonClassFactory*    m_pCommonClassFactory;
  119.     UINT32                    m_ulHandle;
  120.     UINT32                    m_ulNumPackets;
  121.     UINT32                    m_ulTotalBytes;
  122.     UINT32                    m_ulImageWidth;
  123.     UINT32                    m_ulImageHeight;
  124.     CHXSimpleList*            m_pPacketList;
  125.     CHXSimpleList*            m_pCookieList;
  126.     void*                     m_pListItr;
  127.     void                      Deallocate();
  128.     void                      ReleaseAllPackets();
  129.     void                      ClearCookieList();
  130.     HX_RESULT                 AddPacket(IHXPacket* pPacket, BOOL bTail = TRUE);
  131. };
  132. inline UINT32 PXImageFile::GetHandle()     const { return m_ulHandle;      }
  133. inline UINT32 PXImageFile::GetTotalBytes() const { return m_ulTotalBytes;  }
  134. inline UINT32 PXImageFile::GetNumPackets() const { return m_ulNumPackets;  }
  135. inline UINT32 PXImageFile::GetWidth()      const { return m_ulImageWidth;  }
  136. inline UINT32 PXImageFile::GetHeight()     const { return m_ulImageHeight; }
  137. #endif