1 /* ------------------------------------------------------------------
2 * Copyright (C) 1998-2009 PacketVideo
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
13 * express or implied.
14 * See the License for the specific language governing permissions
15 * and limitations under the License.
16 * -------------------------------------------------------------------
17 */
18 #include "tsc_componentregistry.h"
19
TSCComponentRegistry(TSC_statemanager & aTSCStateManager,TSC_capability & aTSCcapability,TSC_lc & aTSClc,TSC_blc & aTSCblc,TSC_clc & aTSCclc,TSC_mt & aTSCmt)20 TSCComponentRegistry::TSCComponentRegistry(TSC_statemanager& aTSCStateManager,
21 TSC_capability& aTSCcapability,
22 TSC_lc& aTSClc,
23 TSC_blc& aTSCblc,
24 TSC_clc& aTSCclc,
25 TSC_mt& aTSCmt) :
26 iTSCstatemanager(aTSCStateManager),
27 iTSCcapability(aTSCcapability),
28 iTSClc(aTSClc),
29 iTSCblc(aTSCblc),
30 iTSCclc(aTSCclc),
31 iTSCmt(aTSCmt)
32 {
33 }
34
QueryRegistry(Tsc324mNodeCommand & aCmd)35 void TSCComponentRegistry::QueryRegistry(Tsc324mNodeCommand& aCmd)
36 {
37
38 OSCL_String* mimetype;
39 Oscl_Vector<PVUuid, OsclMemAllocator>* uuidvec;
40 bool exactMatch;
41 aCmd.Parse(mimetype, uuidvec, exactMatch);
42
43 // uuidvec->clear();
44 if (*mimetype == (TSC_COMPONENT_MIME_TYPE))
45 {
46 uuidvec->push_back((PVUuidH324ComponentInterface));
47 }
48 }
49
Create(PVMFSessionId aSession,const PVUuid & aUuid,PVInterface * & aInterfacePtr,const OsclAny * aContext)50 TSC_component* TSCComponentRegistry::Create(PVMFSessionId aSession,
51 const PVUuid& aUuid,
52 PVInterface*& aInterfacePtr,
53 const OsclAny* aContext)
54 {
55 OSCL_UNUSED_ARG(aSession);
56 OSCL_UNUSED_ARG(aContext);
57 TSC_component* component = NULL;
58 if (aUuid == PVUuidH324ComponentInterface)
59 {
60 component = OSCL_NEW(TSC_component,
61 (iTSCstatemanager, iTSCcapability, iTSClc, iTSCblc, iTSCclc, iTSCmt));
62 aInterfacePtr = (PVMFComponentInterface*)component;
63 }
64 return component;
65 }
66
67
68