os/security/contentmgmt/cafstreamingsupport/inc/streamagentresolver.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of the License "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
//
sl@0
    15
sl@0
    16
/**
sl@0
    17
 @file
sl@0
    18
 @internalComponent
sl@0
    19
 @released
sl@0
    20
*/
sl@0
    21
sl@0
    22
#ifndef STREAMAGENTRESOLVER_H
sl@0
    23
#define STREAMAGENTRESOLVER_H
sl@0
    24
sl@0
    25
#include <e32base.h>
sl@0
    26
#include <ecom/ecom.h>
sl@0
    27
#include "streamagentinfo.h"
sl@0
    28
sl@0
    29
namespace StreamAccess
sl@0
    30
	{
sl@0
    31
	
sl@0
    32
	class CStreamAgentInfo;
sl@0
    33
	
sl@0
    34
	/**
sl@0
    35
	 * Responsible for the identification of stream agent ECOM plug-in implementations and
sl@0
    36
	 * the selection of the most appropriate agent based on the key stream session description
sl@0
    37
	 * metadata and plug-in resource file information. 
sl@0
    38
	 */
sl@0
    39
	class CStreamAgentResolver : public CBase
sl@0
    40
		{
sl@0
    41
	public:
sl@0
    42
	
sl@0
    43
		/* Constructs a new instance of CStreamAgentResolver and pushs it onto the cleanup stack
sl@0
    44
		 * @return Pointer to the new CStreamAgentResolver object
sl@0
    45
		 */
sl@0
    46
		static CStreamAgentResolver* NewLC();
sl@0
    47
		
sl@0
    48
		/* Destructor
sl@0
    49
		 */
sl@0
    50
		~CStreamAgentResolver();
sl@0
    51
		
sl@0
    52
		/* Resolves a stream agent by the SDP (Session Description Protocol) media description
sl@0
    53
		 * of the key stream.
sl@0
    54
		 * @param aSdpKeyStream SDP media description of the key stream
sl@0
    55
		 * @return Reference to the CStreamAgentInfo instance for the chosen Stream Agent, capable
sl@0
    56
		 * of decoding the key stream. 
sl@0
    57
		 * NOTE: The lifetime of the returned reference is limited by the lifetime of the resolver. 
sl@0
    58
		 * The CStreamAgentInfo reference cannot be used after the CStreamAgentResolver object is
sl@0
    59
		 * destroyed.
sl@0
    60
		 * @leave KErrCANoAgent No stream agent can be found that supports the given SDP key management
sl@0
    61
		 * description
sl@0
    62
		 * @leave One of the system-wide error codes
sl@0
    63
		 */
sl@0
    64
		CStreamAgentInfo& ResolveSdpKeyStreamL(const CSdpMediaField& aSdpKeyStream) const;
sl@0
    65
		
sl@0
    66
	protected:
sl@0
    67
		
sl@0
    68
		/* Constructor
sl@0
    69
	 	*/
sl@0
    70
		CStreamAgentResolver();
sl@0
    71
	
sl@0
    72
		/* Second phase of construction for CStreamAgentResolver 
sl@0
    73
		 */
sl@0
    74
		void ConstructL();
sl@0
    75
		
sl@0
    76
	private:
sl@0
    77
	
sl@0
    78
		/* Constructs a list of information about plug-in implementations located
sl@0
    79
		 * by the ECOM framework that satisfy the stream agent interface.
sl@0
    80
		 */
sl@0
    81
		void BuildStreamAgentListL();
sl@0
    82
		
sl@0
    83
		/* Adds a new instance of a stream agent to the CStreamAgentInfo array
sl@0
    84
		 * @param aAgentInfo Registration data regarding the stream agent interface implementation,
sl@0
    85
		 * retrieved from the associated resource file
sl@0
    86
		 */
sl@0
    87
		void AddStreamAgentL(const CImplementationInformation& aAgentInfo);
sl@0
    88
			
sl@0
    89
		/* Cleanup Item Operation used when constructing the stream agent list via ECOM
sl@0
    90
		 * @param aArray Pointer to an RImplInfoPtrArray array which is used by ECOM to store 
sl@0
    91
		 * information about located stream agents implementations
sl@0
    92
		 */ 
sl@0
    93
		static void CleanAgentImplArray(TAny* aArray);
sl@0
    94
		
sl@0
    95
	private:
sl@0
    96
		
sl@0
    97
		/* Array of information regarding stream agent interface implementations located by ECOM
sl@0
    98
		 */
sl@0
    99
		RPointerArray<CStreamAgentInfo> iStreamAgentInfoArray;
sl@0
   100
		
sl@0
   101
		};
sl@0
   102
	} // namespace StreamAccess
sl@0
   103
#endif /*STREAMAGENTRESOLVER_H*/