1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/security/contentmgmt/cafstreamingsupport/inc/streamagentresolver.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,103 @@
1.4 +// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of the License "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +/**
1.20 + @file
1.21 + @internalComponent
1.22 + @released
1.23 +*/
1.24 +
1.25 +#ifndef STREAMAGENTRESOLVER_H
1.26 +#define STREAMAGENTRESOLVER_H
1.27 +
1.28 +#include <e32base.h>
1.29 +#include <ecom/ecom.h>
1.30 +#include "streamagentinfo.h"
1.31 +
1.32 +namespace StreamAccess
1.33 + {
1.34 +
1.35 + class CStreamAgentInfo;
1.36 +
1.37 + /**
1.38 + * Responsible for the identification of stream agent ECOM plug-in implementations and
1.39 + * the selection of the most appropriate agent based on the key stream session description
1.40 + * metadata and plug-in resource file information.
1.41 + */
1.42 + class CStreamAgentResolver : public CBase
1.43 + {
1.44 + public:
1.45 +
1.46 + /* Constructs a new instance of CStreamAgentResolver and pushs it onto the cleanup stack
1.47 + * @return Pointer to the new CStreamAgentResolver object
1.48 + */
1.49 + static CStreamAgentResolver* NewLC();
1.50 +
1.51 + /* Destructor
1.52 + */
1.53 + ~CStreamAgentResolver();
1.54 +
1.55 + /* Resolves a stream agent by the SDP (Session Description Protocol) media description
1.56 + * of the key stream.
1.57 + * @param aSdpKeyStream SDP media description of the key stream
1.58 + * @return Reference to the CStreamAgentInfo instance for the chosen Stream Agent, capable
1.59 + * of decoding the key stream.
1.60 + * NOTE: The lifetime of the returned reference is limited by the lifetime of the resolver.
1.61 + * The CStreamAgentInfo reference cannot be used after the CStreamAgentResolver object is
1.62 + * destroyed.
1.63 + * @leave KErrCANoAgent No stream agent can be found that supports the given SDP key management
1.64 + * description
1.65 + * @leave One of the system-wide error codes
1.66 + */
1.67 + CStreamAgentInfo& ResolveSdpKeyStreamL(const CSdpMediaField& aSdpKeyStream) const;
1.68 +
1.69 + protected:
1.70 +
1.71 + /* Constructor
1.72 + */
1.73 + CStreamAgentResolver();
1.74 +
1.75 + /* Second phase of construction for CStreamAgentResolver
1.76 + */
1.77 + void ConstructL();
1.78 +
1.79 + private:
1.80 +
1.81 + /* Constructs a list of information about plug-in implementations located
1.82 + * by the ECOM framework that satisfy the stream agent interface.
1.83 + */
1.84 + void BuildStreamAgentListL();
1.85 +
1.86 + /* Adds a new instance of a stream agent to the CStreamAgentInfo array
1.87 + * @param aAgentInfo Registration data regarding the stream agent interface implementation,
1.88 + * retrieved from the associated resource file
1.89 + */
1.90 + void AddStreamAgentL(const CImplementationInformation& aAgentInfo);
1.91 +
1.92 + /* Cleanup Item Operation used when constructing the stream agent list via ECOM
1.93 + * @param aArray Pointer to an RImplInfoPtrArray array which is used by ECOM to store
1.94 + * information about located stream agents implementations
1.95 + */
1.96 + static void CleanAgentImplArray(TAny* aArray);
1.97 +
1.98 + private:
1.99 +
1.100 + /* Array of information regarding stream agent interface implementations located by ECOM
1.101 + */
1.102 + RPointerArray<CStreamAgentInfo> iStreamAgentInfoArray;
1.103 +
1.104 + };
1.105 + } // namespace StreamAccess
1.106 +#endif /*STREAMAGENTRESOLVER_H*/