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 #ifndef TSC_H324M_CONFIG_H_INCLUDED 19 #define TSC_H324M_CONFIG_H_INCLUDED 20 21 #ifndef TSC_H324M_CONFIG_INTERFACE_H_INCLUDED 22 #include "tsc_h324m_config_interface.h" 23 #endif 24 25 #ifndef OSCL_VECTOR_H_INCLUDED 26 #include "oscl_vector.h" 27 #endif 28 29 #ifndef OSCL_MAP_H_INCLUDED 30 #include "oscl_map.h" 31 #endif 32 #ifndef PV_PROXIED_INTERFACE_H_INCLUDED 33 #include "pv_proxied_interface.h" 34 #endif 35 36 #ifndef TSCMAIN_H_INCLUDED 37 #include "tscmain.h" 38 #endif 39 40 class PVLogger; 41 class CPVCmnInterfaceCmdMessage; 42 class TSC_324m; 43 44 class H324MConfig : public OsclActiveObject, 45 public H324MConfigInterface, 46 public TSC_324mObserver 47 { 48 public: 49 H324MConfig(TSC_324m* aH324M, bool aUseAO); 50 virtual ~H324MConfig(); 51 52 void SetObserver(H324MConfigObserver* aObserver); 53 54 PVMFCommandId SetMultiplexLevel(TPVH223Level aLevel, OsclAny* aContextData = NULL); 55 PVMFCommandId SetMaxSduSize(TPVAdaptationLayer aLayer, int32 aSize, OsclAny* aContextData = NULL); 56 PVMFCommandId SetMaxSduSizeR(TPVAdaptationLayer aLayer, int32 aSize, OsclAny* aContextData = NULL); 57 PVMFCommandId SetAl2SequenceNumbers(int32 aSeqNumWidth, OsclAny* aContextData = NULL); 58 PVMFCommandId SetAl3ControlFieldOctets(int32 aCfo, OsclAny* aContextData = NULL); 59 PVMFCommandId SetOutoingPduType(TPVH223MuxPduType aOutgoingPduType, OsclAny* aContextData = NULL); 60 PVMFCommandId SetMaxPduSize(int32 aMaxPduSize, OsclAny* aContextData = NULL); 61 PVMFCommandId SetTerminalType(uint8 aTerminalType, OsclAny* aContextData = NULL); 62 PVMFCommandId SetALConfiguration(TPVMediaType_t aMediaType, TPVAdaptationLayer aLayer, 63 bool aAllow, OsclAny* aContextData = NULL); 64 PVMFCommandId SendRme(OsclAny* aContextData = NULL); 65 PVMFCommandId SetMaxMuxPduSize(int32 aRequestMaxMuxPduSize, OsclAny* aContextData = NULL); 66 PVMFCommandId SetMaxMuxCcsrlSduSize(int32 aMaxCcsrlSduSize, OsclAny* aContextData = NULL); 67 PVMFCommandId FastUpdate(PVMFNodeInterface& aTrack, OsclAny* aContextData = NULL); 68 PVMFCommandId SendRtd(OsclAny* aContextData = NULL); 69 PVMFCommandId SetVendor(uint8 aCc, uint8 aExt, uint32 aMc, 70 const uint8* aProduct, uint16 aProductLen, 71 const uint8* aVersion, uint16 aVersionLen, 72 OsclAny* aContextData = NULL); 73 PVMFCommandId SendEndSession(OsclAny* aContextData = NULL); 74 PVMFCommandId SetEndSessionTimeout(uint32 aTimeout, OsclAny* aContextData = NULL); 75 PVMFCommandId SetTimerCounter(TPVH324TimerCounter aTimerCounter, 76 uint8 aSeries, uint32 aSeriesOffset, 77 uint32 aValue, 78 OsclAny* aContextData = NULL); 79 PVMFCommandId SetVideoResolutions(TPVDirection aDirection, 80 Oscl_Vector<PVMFVideoResolutionRange, OsclMemAllocator>& aResolutions, 81 OsclAny* aContextData = NULL); 82 PVMFCommandId SendVendorId(OsclAny* aContextData = NULL); 83 PVMFCommandId SendVideoTemporalSpatialTradeoffCommand(TPVChannelId aLogicalChannel, uint8 aTradeoff, 84 OsclAny* aContextData = NULL); 85 PVMFCommandId SendVideoTemporalSpatialTradeoffIndication(TPVChannelId aLogicalChannel, uint8 aTradeoff, 86 OsclAny* aContextData = NULL); 87 PVMFCommandId SendSkewIndication(TPVChannelId aLogicalChannel1, TPVChannelId aLogicalChannel2, uint16 aSkew, 88 OsclAny* aContextData = NULL); 89 PVMFCommandId SetLogicalChannelBufferingMs(uint32 aInBufferingMs, 90 uint32 aOutBufferingMs, 91 OsclAny* aContextData = NULL); 92 PVMFCommandId SendUserInput(CPVUserInput* user_input, 93 OsclAny* aContextData = NULL); 94 PVMFCommandId SetWnsrp(const bool aEnableWnsrp, 95 OsclAny* aContextData = NULL); 96 //////////////////////////////////// 97 // PVInterface virtuals 98 //////////////////////////////////// 99 void addRef(); 100 void removeRef(); 101 bool queryInterface(const PVUuid& aUuid, PVInterface*& aInterfacePtr); 102 103 // TSC_324mObserver virtuals 104 void IncomingVendorId(TPVH245Vendor* vendor, const uint8* pn, uint16 pn_len, const uint8* vn, uint16 vn_len); 105 void UserInputReceived(CPVUserInput* aUI); 106 void UserInputCapability(int formats); 107 void VideoSpatialTemporalTradeoffCommandReceived(TPVChannelId id, uint8 tradeoff); 108 void VideoSpatialTemporalTradeoffIndicationReceived(TPVChannelId id, uint8 tradeoff); 109 void SkewIndicationReceived(TPVChannelId lcn1, TPVChannelId lcn2, uint16 skew); 110 private: 111 void Run(); 112 void SendCmdResponse(PVMFCommandId id, OsclAny* context, PVMFStatus status); 113 void SendAsyncEvent(PVMFAsyncEvent& event); 114 115 void UseAO(); 116 117 TSC_324m* iH324M; 118 int32 iReferenceCount; 119 PVLogger* iLogger; 120 PVMFCommandId iCommandId; 121 H324MConfigObserver* iObserver; 122 Oscl_Vector<PVMFCmdResp, OsclMemAllocator> iPendingResponses; 123 Oscl_Vector<PVMFAsyncEvent, OsclMemAllocator> iPendingEvents; 124 bool iUseAO; 125 126 friend class H324MConfigProxied; 127 }; 128 129 130 class H324MConfigProxied : 131 public H324MConfigInterface, 132 public PVProxiedInterfaceServer, 133 public PVProxiedInterfaceClient, 134 public H324MConfigObserver 135 { 136 public: 137 H324MConfigProxied(H324MConfigInterface *aH324MConfigIF, PVMainProxy *aMainProxy); 138 virtual ~H324MConfigProxied(); 139 140 void SetObserver(H324MConfigObserver* aObserver); 141 void H324MConfigCommandCompletedL(PVMFCmdResp& aResponse); 142 void H324MConfigHandleInformationalEventL(PVMFAsyncEvent& aNotification); 143 144 PVMFCommandId SetMultiplexLevel(TPVH223Level aLevel, OsclAny* aContextData = NULL); 145 PVMFCommandId SetMaxSduSize(TPVAdaptationLayer aLayer, int32 aSize, OsclAny* aContextData = NULL); 146 PVMFCommandId SetMaxSduSizeR(TPVAdaptationLayer aLayer, int32 aSize, OsclAny* aContextData = NULL); 147 PVMFCommandId SetAl2SequenceNumbers(int32 aSeqNumWidth, OsclAny* aContextData = NULL); 148 PVMFCommandId SetAl3ControlFieldOctets(int32 aCfo, OsclAny* aContextData = NULL); 149 PVMFCommandId SetMaxPduSize(int32 aMaxPduSize, OsclAny* aContextData = NULL); 150 PVMFCommandId SetTerminalType(uint8 aTerminalType, OsclAny* aContextData = NULL); 151 PVMFCommandId SetALConfiguration(TPVMediaType_t aMediaType, TPVAdaptationLayer aLayer, 152 bool aAllow, OsclAny* aContextData = NULL); 153 PVMFCommandId SendRme(OsclAny* aContextData = NULL); 154 PVMFCommandId SetMaxMuxPduSize(int32 aRequestMaxMuxPduSize, OsclAny* aContextData = NULL); 155 PVMFCommandId SetMaxMuxCcsrlSduSize(int32 aMaxCcsrlSduSize, OsclAny* aContextData = NULL); 156 PVMFCommandId FastUpdate(PVMFNodeInterface& aTrack, OsclAny* aContextData = NULL); 157 PVMFCommandId SendRtd(OsclAny* aContextData = NULL); 158 PVMFCommandId SetVendor(uint8 aCc, uint8 aExt, uint32 aMc, 159 const uint8* aProduct, uint16 aProductLen, 160 const uint8* aVersion, uint16 aVersionLen, 161 OsclAny* aContextData = NULL); 162 PVMFCommandId SendEndSession(OsclAny* aContextData = NULL); 163 PVMFCommandId SetEndSessionTimeout(uint32 aTimeout, OsclAny* aContextData = NULL); 164 PVMFCommandId SetTimerCounter(TPVH324TimerCounter aTimerCounter, 165 uint8 aSeries, uint32 aSeriesOffset, 166 uint32 aValue, 167 OsclAny* aContextData = NULL); 168 PVMFCommandId SetVideoResolutions(TPVDirection aDirection, 169 Oscl_Vector<PVMFVideoResolutionRange, OsclMemAllocator>& aResolutions, 170 OsclAny* aContextData = NULL); 171 PVMFCommandId SendVendorId(OsclAny* aContextData = NULL); 172 PVMFCommandId SendVideoTemporalSpatialTradeoffCommand(TPVChannelId aLogicalChannel, uint8 aTradeoff, 173 OsclAny* aContextData = NULL); 174 PVMFCommandId SendVideoTemporalSpatialTradeoffIndication(TPVChannelId aLogicalChannel, uint8 aTradeoff, 175 OsclAny* aContextData = NULL); 176 PVMFCommandId SendSkewIndication(TPVChannelId aLogicalChannel1, TPVChannelId aLogicalChannel2, uint16 aSkew, 177 OsclAny* aContextData = NULL); 178 PVMFCommandId SetLogicalChannelBufferingMs(uint32 aInBufferingMs, 179 uint32 aOutBufferingMs, 180 OsclAny* aContextData = NULL); 181 PVMFCommandId SendUserInput(CPVUserInput* user_input, 182 OsclAny* aContextData = NULL); 183 184 PVMFCommandId SetWnsrp(const bool aEnableWnsrp, 185 OsclAny* aContextData = NULL); 186 void CleanupNotification(TPVProxyMsgId aId, OsclAny *aMsg); 187 void HandleCommand(TPVProxyMsgId aMsgId, OsclAny *aMsg); 188 void HandleNotification(TPVProxyMsgId aId, OsclAny *aMsg); 189 void CleanupCommand(TPVProxyMsgId aId, OsclAny *aMsg); 190 191 //////////////////////////////////// 192 // PVInterface virtuals 193 //////////////////////////////////// 194 void addRef(); 195 void removeRef(); 196 bool queryInterface(const PVUuid& aUuid, PVInterface*& aInterfacePtr); 197 198 private: 199 H324MConfigInterface* iH324MConfigIF; 200 PVMainProxy* iMainProxy; 201 PVLogger* iLoggerClient; 202 PVLogger* iLoggerServer; 203 int32 iReferenceCount; 204 TPVProxyId iProxyId; 205 Oscl_Map<PVMFCommandId, CPVCmnInterfaceCmdMessage*, OsclMemAllocator> iPendingCmds; 206 PVMFCommandId iCommandId; 207 H324MConfigObserver* iObserver; 208 }; 209 210 class H324MProxiedInterface : public PVProxiedInterface 211 { 212 public: 213 H324MProxiedInterface(); 214 virtual ~H324MProxiedInterface(); 215 216 void QueryProxiedInterface(const TPVProxyUUID& aUuid, PVInterface*& aInterfacePtr); 217 void SetMainProxy(PVMainProxy* aMainProxy); 218 219 void addRef(); 220 void removeRef(); 221 bool queryInterface(const PVUuid& aUuid, PVInterface*& aInterface); 222 223 void SetH324M(TSC_324m* aH324M); 224 225 private: 226 TSC_324m* iH324M; 227 PVMainProxy* iMainProxy; 228 int32 iReferenceCount; 229 }; 230 231 #endif 232 233