|
1 /* |
|
2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 /** |
|
20 @file |
|
21 @internalComponent |
|
22 */ |
|
23 |
|
24 #include "comxilclockconfigmanager.h" |
|
25 #include "comxilclockprocessingfunction.h" |
|
26 #include "clocksupervisor.h" |
|
27 |
|
28 |
|
29 |
|
30 COmxILClockConfigManager* COmxILClockConfigManager::NewL( |
|
31 MOmxILPortManagerIf& aPortManager, |
|
32 const TDesC8& aComponentName, |
|
33 const OMX_VERSIONTYPE& aComponentVersion, |
|
34 const RPointerArray<TDesC8>& aComponentRoleList, |
|
35 COmxILClockProcessingFunction& aProcessingFunction) |
|
36 { |
|
37 COmxILClockConfigManager* self = new(ELeave) COmxILClockConfigManager(aPortManager, aProcessingFunction); |
|
38 CleanupStack::PushL(self); |
|
39 self->ConstructL(aComponentName, aComponentVersion, aComponentRoleList); |
|
40 CleanupStack::Pop(self); |
|
41 return self; |
|
42 } |
|
43 |
|
44 COmxILClockConfigManager::COmxILClockConfigManager(MOmxILPortManagerIf& aPortManager, COmxILClockProcessingFunction& aProcessingFunction): |
|
45 COmxILConfigManager(aPortManager), |
|
46 iProcessingFunction(&aProcessingFunction) |
|
47 { |
|
48 // nothing to do |
|
49 } |
|
50 |
|
51 void COmxILClockConfigManager::ConstructL(const TDesC8& aComponentName, |
|
52 const OMX_VERSIONTYPE& aComponentVersion, |
|
53 const RPointerArray<TDesC8>& aComponentRoleList) |
|
54 { |
|
55 COmxILConfigManager::ConstructL(aComponentName, aComponentVersion, aComponentRoleList); |
|
56 } |
|
57 |
|
58 COmxILClockConfigManager::~COmxILClockConfigManager() |
|
59 { |
|
60 } |
|
61 |
|
62 OMX_ERRORTYPE COmxILClockConfigManager::GetConfig(OMX_INDEXTYPE aConfigIndex, |
|
63 TAny* apComponentConfigStructure) const |
|
64 { |
|
65 OMX_ERRORTYPE error = iProcessingFunction->ProduceRequest(aConfigIndex, CClockSupervisor::EGetConfig, apComponentConfigStructure); |
|
66 if(error != OMX_ErrorUnsupportedIndex) |
|
67 { |
|
68 return error; |
|
69 } |
|
70 |
|
71 // try base class if PF did not support the index |
|
72 return COmxILConfigManager::GetConfig(aConfigIndex, apComponentConfigStructure); |
|
73 } |
|
74 |
|
75 OMX_ERRORTYPE COmxILClockConfigManager::SetConfig(OMX_INDEXTYPE aConfigIndex, |
|
76 const TAny* apComponentConfigStructure) |
|
77 { |
|
78 OMX_ERRORTYPE error = iProcessingFunction->ProduceRequest(aConfigIndex, CClockSupervisor::ESetConfig, const_cast<TAny*>(apComponentConfigStructure)); |
|
79 if(error != OMX_ErrorUnsupportedIndex) |
|
80 { |
|
81 return error; |
|
82 } |
|
83 |
|
84 // try base class if PF did not support the index |
|
85 return COmxILConfigManager::SetConfig(aConfigIndex, apComponentConfigStructure); |
|
86 } |
|
87 |