sdpplin.h
上传用户:zhongxx05
上传日期:2007-06-06
资源大小:33641k
文件大小:8k
源码类别:

Symbian

开发平台:

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 _SDPPLIN_H_
  36. #define _SDPPLIN_H_
  37. #include "mdescparse.h"
  38. #include "mdescgen.h"
  39. class CSDPStreamDescription :        public IHXPlugin, 
  40.                                 public IHXStreamDescription,
  41.                                 public IHXStreamDescriptionSettings,
  42.                                 public IHXRTPPayloadInfo
  43. {
  44. private:
  45.     LONG32                            m_lRefCount;
  46.     MediaDescParser*                  m_pDescParser;
  47.     MediaDescGenerator*               m_pDescGenerator;
  48.     IUnknown*                         m_pContext;
  49.     IHXCommonClassFactory*           m_pCCF;
  50.     static const char* const          zm_pDescription;
  51.     static const char* const          zm_pCopyright;
  52.     static const char* const          zm_pMoreInfoURL;
  53.     static const char* const          zm_pStreamDescriptionMimeType;
  54.    
  55.     ~CSDPStreamDescription();
  56.     PRIVATE_DESTRUCTORS_ARE_NOT_A_CRIME
  57.     HX_RESULT        Update();
  58.     HX_RESULT   SpecComplianceCheck(UINT16 nValues, IHXValues** ppValueArray);
  59.     
  60. public:
  61.     CSDPStreamDescription();
  62.     char* EscapeBuffer(const char*, UINT32);
  63.     char* EscapeBuffer(const char*);
  64.     char* UnescapeBuffer(const char*, UINT32);
  65.     char* UnescapeBuffer(const char*);
  66.     // *** IUnknown methods ***
  67.     STDMETHOD(QueryInterface)        (THIS_
  68.                                 REFIID riid,
  69.                                 void** ppvObj);
  70.     STDMETHOD_(ULONG32,AddRef)        (THIS);
  71.     STDMETHOD_(ULONG32,Release)        (THIS);
  72.     // *** IHXPlugin methods ***
  73.     /************************************************************************
  74.      *        Method:
  75.      *            IHXPlugin::GetPluginInfo
  76.      *        Purpose:
  77.      *            Returns the basic information about this plugin. Including:
  78.      *
  79.      *            bLoadMultiple        whether or not this plugin DLL can be loaded
  80.      *                                multiple times. All File Formats must set
  81.      *                                this value to TRUE.
  82.      *            pDescription        which is used in about UIs (can be NULL)
  83.      *            pCopyright                which is used in about UIs (can be NULL)
  84.      *            pMoreInfoURL        which is used in about UIs (can be NULL)
  85.      */
  86.     STDMETHOD(GetPluginInfo)        (THIS_
  87.                                 REF(BOOL)        /*OUT*/ bLoadMultiple,
  88.                                 REF(const char*) /*OUT*/ pDescription,
  89.                                 REF(const char*) /*OUT*/ pCopyright,
  90.                                 REF(const char*) /*OUT*/ pMoreInfoURL,
  91.                                 REF(ULONG32)         /*OUT*/ ulVersionNumber
  92.                                 );
  93.     /************************************************************************
  94.      *        Method:
  95.      *            IHXPlugin::InitPlugin
  96.      *        Purpose:
  97.      *            Initializes the plugin for use. This interface must always be
  98.      *            called before any other method is called. This is primarily needed 
  99.      *            so that the plugin can have access to the context for creation of
  100.      *            IHXBuffers and IMalloc.
  101.      */
  102.     STDMETHOD(InitPlugin)   (THIS_
  103.                             IUnknown*   /*IN*/  pContext);
  104.     // *** IHXStreamDescription methods ***
  105.     /************************************************************************
  106.      *        Method:
  107.      *            IHXStreamDescription::GetStreamDescriptionInfo
  108.      *        Purpose:
  109.      *            Get info to initialize the stream description plugin
  110.      */
  111.     STDMETHOD(GetStreamDescriptionInfo)
  112.                                 (THIS_
  113.                                 REF(const char*) /*OUT*/ pMimeTypes);
  114.     /************************************************************************
  115.      *        Method:
  116.      *            IHXStreamDescription::GetValues
  117.      *        Purpose:
  118.      *            Transform a media description string into an IHXValues object
  119.      */
  120.     STDMETHOD(GetValues)    
  121.                                 (THIS_
  122.                                 IHXBuffer*          /*IN*/ pDescription,
  123.                                 REF(UINT16)          /*OUT*/ nValues,
  124.                                 REF(IHXValues**) /*OUT*/ pValueArray
  125.                                 );
  126.     /************************************************************************
  127.      *        Method:
  128.      *            IHXStreamDescription::GetDescription
  129.      *        Purpose:
  130.      *            Transform an IHXValues object into a stream description string.
  131.      *            plugins.
  132.      */
  133.     STDMETHOD(GetDescription)        
  134.                         (THIS_
  135.                         UINT16                            /*IN*/  nValues,
  136.                         IHXValues**                    /*IN*/  pValueArray,
  137.                         REF(IHXBuffer*)            /*OUT*/ pDescription
  138.                         );
  139.      // *** IHXStreamDescriptionSettings methods ***
  140.     STDMETHOD(SetOption)(const char* pKey, IHXBuffer* pVal);
  141.     STDMETHOD(GetOption)(const char* pKey, REF(IHXBuffer*) pVal);
  142.      // *** IHXRTPPayloadInfo methods ***
  143.     /************************************************************************
  144.      *        Method:
  145.      *            IHXRTPPayloadInfo::PayloadSupported
  146.      *        Purpose:
  147.      *            Returns TRUE if this payload type is handled by this interface
  148.      */
  149.     STDMETHOD_(BOOL, IsPayloadSupported)            (THIS_
  150.                                 UINT32      /*IN*/  ulRTPPayloadType);
  151.     /************************************************************************
  152.      *        Method:
  153.      *            IHXRTPPayloadInfo::GetTimestampConversionFactors
  154.      *        Purpose:
  155.      *            Retrieves the RTP and RMA factors for RTP to RMA timestamp ratio.
  156.      *      RTP->RMA is RTPTimestamp * RTPFactor / HXFactor
  157.      *      RMA->RTP is HXTimestamp * HXFactor / RTPFactor
  158.      *  Returns:
  159.      *            HXR_OK if payload is supported, HXR_FAIL if not.
  160.      */
  161.     STDMETHOD(GetTimestampConversionFactors)            (THIS_
  162.                                     UINT32      /*IN*/  ulRTPPayloadType,
  163.                                 REF(UINT32) /*OUT*/ ulRTPFactor,
  164.                                 REF(UINT32) /*OUT*/ ulHXFactor);
  165.     /************************************************************************
  166.      *        Method:
  167.      *            IHXRTPPayloadInfo::IsTimestampDeliverable
  168.      *        Purpose:
  169.      *            Returns TRUE if this payload type is timestamp deliverable
  170.      */
  171.     STDMETHOD_(BOOL, IsTimestampDeliverable)            (THIS_
  172.                                 UINT32      /*IN*/  ulRTPPayloadType);
  173. };
  174. #endif /* _MHPLIN_H_ */