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 PVMF_MEDIALAYER_NODE_H_INCLUDED 19 #define PVMF_MEDIALAYER_NODE_H_INCLUDED 20 21 #ifndef OSCL_BASE_H_INCLUDED 22 #include "oscl_base.h" 23 #endif 24 #ifndef OSCL_STR_PTR_LEN_H_INCLUDED 25 #include "oscl_str_ptr_len.h" 26 #endif 27 #ifndef OSCL_MEM_H_INCLUDED 28 #include "oscl_mem.h" 29 #endif 30 #ifndef OSCL_EXCLUSIVE_PTR_H_INCLUDED 31 #include "oscl_exclusive_ptr.h" 32 #endif 33 #ifndef PVMF_MEDIA_CLOCK_H_INCLUDED 34 #include "pvmf_media_clock.h" 35 #endif 36 #ifndef PVLOGGER_H_INCLUDED 37 #include "pvlogger.h" 38 #endif 39 #ifndef PV_UUID_H_INCLUDED 40 #include "pv_uuid.h" 41 #endif 42 #ifndef PV_INTERFACE_H 43 #include "pv_interface.h" 44 #endif 45 #ifndef PVLOGGER_FILE_APPENDER_H_INCLUDED 46 #include "pvlogger_file_appender.h" 47 #endif 48 #ifndef PVMF_NODE_INTERFACE_H_INCLUDED 49 #include "pvmf_node_interface.h" 50 #endif 51 #ifndef PVMF_NODE_UTILS_H_INCLUDED 52 #include "pvmf_node_utils.h" 53 #endif 54 #ifndef OSCL_SCHEDULER_AO_H_INCLUDED 55 #include "oscl_scheduler_ao.h" 56 #endif 57 #ifndef PVMF_MEDIALAYER_PORT_H_INCLUDED 58 #include "pvmf_medialayer_port.h" 59 #endif 60 #ifndef PVMF_SM_NODE_EVENTS_H_INCLUDED 61 #include "pvmf_sm_node_events.h" 62 #endif 63 #ifndef PAYLOAD_PARSER_REGISTRY_H_INCLUDED 64 #include "payload_parser_registry.h" 65 #endif 66 #ifndef PVMF_CPMPLUGIN_ACCESS_INTERFACE_H_INCLUDED 67 #include "pvmf_cpmplugin_access_interface.h" 68 #endif 69 70 /////////////////////////////////////////////// 71 //IDs for all of the asynchronous node commands. 72 /////////////////////////////////////////////// 73 enum TPVMFMediaLayerNodeCommand 74 { 75 PVMF_MEDIA_LAYER_NODE_QUERYUUID, 76 PVMF_MEDIA_LAYER_NODE_QUERYINTERFACE, 77 PVMF_MEDIA_LAYER_NODE_REQUESTPORT, 78 PVMF_MEDIA_LAYER_NODE_RELEASEPORT, 79 PVMF_MEDIA_LAYER_NODE_INIT, 80 PVMF_MEDIA_LAYER_NODE_PREPARE, 81 PVMF_MEDIA_LAYER_NODE_START, 82 PVMF_MEDIA_LAYER_NODE_STOP, 83 PVMF_MEDIA_LAYER_NODE_FLUSH, 84 PVMF_MEDIA_LAYER_NODE_PAUSE, 85 PVMF_MEDIA_LAYER_NODE_RESET, 86 PVMF_MEDIA_LAYER_NODE_CANCELALLCOMMANDS, 87 PVMF_MEDIA_LAYER_NODE_CANCELCOMMAND, 88 //add media layer node specific commands here 89 PVMF_MEDIA_LAYER_NODE_COMMAND_LAST 90 }; 91 92 #define PVMF_MEDIA_LAYER_NEW(auditCB,T,params,ptr)\ 93 {\ 94 ptr = OSCL_NEW(T,params);\ 95 } 96 97 #define PVMF_MEDIA_LAYER_DELETE(auditCB,T,ptr)\ 98 {\ 99 OSCL_DELETE(ptr);\ 100 } 101 102 /** Node command type */ 103 typedef PVMFGenericNodeCommand<PVMFMediaLayerNodeAllocator> PVMFMediaLayerNodeCommandBase; 104 105 class PVMFMediaLayerNodeCommand: public PVMFMediaLayerNodeCommandBase 106 { 107 public: Construct(PVMFSessionId s,int32 cmd,int32 arg1,int32 arg2,int32 & arg3,const OsclAny * aContext)108 void Construct(PVMFSessionId s, int32 cmd, int32 arg1, int32 arg2, int32& arg3, const OsclAny*aContext) 109 { 110 PVMFMediaLayerNodeCommandBase::Construct(s, cmd, aContext); 111 iParam1 = (OsclAny*)arg1; 112 iParam2 = (OsclAny*)arg2; 113 iParam3 = (OsclAny*) & arg3; 114 } Parse(int32 & arg1,int32 & arg2,int32 * & arg3)115 void Parse(int32&arg1, int32&arg2, int32*&arg3) 116 { 117 arg1 = (int32)iParam1; 118 arg2 = (int32)iParam2; 119 arg3 = (int32*)iParam3; 120 } 121 }; 122 123 class PVMFMediaLayerNodeLoggerDestructDealloc : public OsclDestructDealloc 124 { 125 public: destruct_and_dealloc(OsclAny * ptr)126 void destruct_and_dealloc(OsclAny* ptr) 127 { 128 PVLoggerAppender* p = OSCL_REINTERPRET_CAST(PVLoggerAppender*, ptr); 129 BinaryFileAppender* binPtr = OSCL_REINTERPRET_CAST(BinaryFileAppender*, p); 130 if (!binPtr) 131 return; 132 OSCL_DELETE(binPtr); 133 } 134 }; 135 136 /** Command queue type */ 137 typedef PVMFNodeCommandQueue < PVMFMediaLayerNodeCommand, 138 PVMFMediaLayerNodeAllocator > MediaLayerNodeCmdQ; 139 140 /** Starting value for command IDs */ 141 #define MEDIA_LAYER_NODE_CMD_START 6200 142 143 /** Default vector reserve size */ 144 #define MEDIA_LAYER_NODE_CMD_QUE_RESERVE 10 145 146 /** Default vector reserve size */ 147 #define MEDIA_LAYER_NODE_VECTOR_RESERVE 20 148 149 class mediaInfo; 150 151 class PVMFMediaLayerNodeExtensionInterface : public PVInterface 152 { 153 public: 154 OSCL_IMPORT_REF virtual PVMFStatus setDRMDecryptionInterface(uint32 maxPacketSize, PVMFCPMPluginAccessUnitDecryptionInterface* aDecryptionInterface = NULL) = 0; 155 OSCL_IMPORT_REF virtual PVMFStatus setPayloadParserRegistry(PayloadParserRegistry*) = 0; 156 OSCL_IMPORT_REF virtual PVMFStatus setPortDataLogging(bool logEnable, OSCL_String* logPath = NULL) = 0; 157 OSCL_IMPORT_REF virtual bool setPlayRange(int32 aStartTimeInMS, 158 int32 aStopTimeInMS, 159 bool oRepositioning = false) = 0; 160 OSCL_IMPORT_REF virtual bool setPortMediaParams(PVMFPortInterface* aPort, 161 OsclRefCounterMemFrag& aConfig, 162 mediaInfo* aMediaInfo = NULL) = 0; 163 OSCL_IMPORT_REF virtual bool setOutPortStreamParams(PVMFPortInterface* aPort, 164 uint streamid, 165 uint32 aPreroll, 166 bool aLiveStream = false) = 0; 167 OSCL_IMPORT_REF virtual PVMFStatus verifyPortConfigParams(const char* aFormatValType, 168 PVMFPortInterface* aPort, 169 OsclAny* aConfig, 170 mediaInfo* aMediaInfo = NULL) = 0; 171 OSCL_IMPORT_REF virtual void setInPortReposFlag(PVMFPortInterface* aPort, uint32 aSeekTimeInMS = 0) = 0; 172 OSCL_IMPORT_REF virtual uint32 getMaxOutPortTimestamp(PVMFPortInterface* aPort, 173 bool oPeek = false) = 0; 174 OSCL_IMPORT_REF virtual bool setClientPlayBackClock(PVMFMediaClock* aClientPlayBackClock) = 0; 175 OSCL_IMPORT_REF virtual void addRef() = 0; 176 OSCL_IMPORT_REF virtual void removeRef() = 0; 177 OSCL_IMPORT_REF virtual bool queryInterface(const PVUuid& uuid, PVInterface*& iface) = 0; 178 OSCL_IMPORT_REF virtual bool setTrackDisable(PVMFPortInterface* aPort) = 0; 179 OSCL_IMPORT_REF virtual void setMediaLayerTimerDurationMS(uint32 aTimer) = 0; 180 }; 181 182 /** Mimetype and Uuid for the extension interface */ 183 #define PVMF_MEDIALAYER_CUSTOMINTERFACE_MIMETYPE "pvxxx/PVMFMediaLayerNode/CustomInterface" 184 #define PVMF_MEDIALAYER_MIMETYPE "pvxxx/PVMFMediaLayerNode" 185 #define PVMF_MEDIALAYER_BASEMIMETYPE "pvxxx" 186 #define PVMF_MEDIALAYERNODE_EXTENSIONINTERFACE_UUID PVUuid(0x78361150,0x8d35,0x48de,0x8f,0xc8,0x85,0xcb,0xe7,0xbf,0x1c,0x8a) 187 188 class PVMFMediaLayerNode; 189 190 class PVMFMediaLayerNodeExtensionInterfaceImpl : 191 public PVInterfaceImpl<PVMFMediaLayerNodeAllocator>, 192 public PVMFMediaLayerNodeExtensionInterface 193 { 194 public: 195 PVMFMediaLayerNodeExtensionInterfaceImpl(PVMFMediaLayerNode*); 196 ~PVMFMediaLayerNodeExtensionInterfaceImpl(); 197 198 virtual PVMFStatus setDRMDecryptionInterface(uint32 maxPacketSize, PVMFCPMPluginAccessUnitDecryptionInterface* aDecryptionInterface = NULL); 199 200 virtual PVMFStatus setPayloadParserRegistry(PayloadParserRegistry*); 201 202 virtual PVMFStatus setPortDataLogging(bool logEnable, OSCL_String* logPath = NULL); 203 204 virtual bool setClientPlayBackClock(PVMFMediaClock* aClientPlayBackClock); 205 addRef()206 void addRef() 207 { 208 PVInterfaceImpl<PVMFMediaLayerNodeAllocator>::addRef(); 209 } removeRef()210 void removeRef() 211 { 212 PVInterfaceImpl<PVMFMediaLayerNodeAllocator>::removeRef(); 213 } queryInterface(const PVUuid & uuid,PVInterface * & iface)214 bool queryInterface(const PVUuid& uuid, PVInterface*& iface) 215 { 216 if (uuid == Uuid()) 217 { 218 addRef(); 219 iface = this; 220 return true; 221 } 222 else 223 { 224 iface = NULL; 225 return false; 226 } 227 } 228 229 bool setPlayRange(int32 aStartTimeInMS, 230 int32 aStopTimeInMS, 231 bool oRepositioning = false); 232 233 bool setPortMediaParams(PVMFPortInterface* aPort, 234 OsclRefCounterMemFrag& aConfig, 235 mediaInfo* aMediaInfo = NULL); 236 237 PVMFStatus verifyPortConfigParams(const char* aFormatValType, 238 PVMFPortInterface* aPort, 239 OsclAny* aConfig, 240 mediaInfo* aMediaInfo = NULL); 241 242 bool setOutPortStreamParams(PVMFPortInterface* aPort, uint streamid, uint32 aPreroll, bool aLiveStream = false); 243 244 void setInPortReposFlag(PVMFPortInterface* aPort, uint32 aSeekTimeInMS = 0); 245 uint32 getMaxOutPortTimestamp(PVMFPortInterface* aPort, bool oPeek = false); 246 bool setTrackDisable(PVMFPortInterface* aPort); 247 void setMediaLayerTimerDurationMS(uint32 aTimer); 248 249 private: 250 PVMFMediaLayerNode *iContainer; 251 friend class PVMFMediaLayerNode; 252 }; 253 254 class PVLogger; 255 256 class PVMFMediaLayerNode : public PVInterface, 257 public PVMFNodeInterface, 258 public OsclActiveObject, 259 public PVMFNodeErrorEventObserver, 260 public PVMFNodeInfoEventObserver, 261 public PVMFNodeCmdStatusObserver 262 { 263 public: 264 OSCL_IMPORT_REF PVMFMediaLayerNode(int32 aPriority); 265 OSCL_IMPORT_REF virtual ~PVMFMediaLayerNode(); 266 267 OSCL_IMPORT_REF PVMFStatus ThreadLogon(); 268 OSCL_IMPORT_REF PVMFStatus ThreadLogoff(); 269 OSCL_IMPORT_REF PVMFStatus GetCapability(PVMFNodeCapability& aNodeCapability); 270 OSCL_IMPORT_REF PVMFPortIter* GetPorts(const PVMFPortFilter* aFilter = NULL); 271 OSCL_IMPORT_REF PVMFCommandId RequestPort(PVMFSessionId aSession, 272 int32 aPortTag, 273 const PvmfMimeString* aPortConfig = NULL, 274 const OsclAny* aContext = NULL); 275 276 OSCL_IMPORT_REF PVMFCommandId ReleasePort(PVMFSessionId, 277 PVMFPortInterface& aPort, 278 const OsclAny* aContext = NULL); 279 OSCL_IMPORT_REF PVMFCommandId Init(PVMFSessionId, 280 const OsclAny* aContext = NULL); 281 OSCL_IMPORT_REF PVMFCommandId Prepare(PVMFSessionId, 282 const OsclAny* aContext = NULL); 283 OSCL_IMPORT_REF PVMFCommandId Start(PVMFSessionId, 284 const OsclAny* aContext = NULL); 285 OSCL_IMPORT_REF PVMFCommandId Stop(PVMFSessionId, 286 const OsclAny* aContext = NULL); 287 OSCL_IMPORT_REF PVMFCommandId Flush(PVMFSessionId, 288 const OsclAny* aContext = NULL); 289 OSCL_IMPORT_REF PVMFCommandId Pause(PVMFSessionId, 290 const OsclAny* aContext = NULL); 291 OSCL_IMPORT_REF PVMFCommandId Reset(PVMFSessionId, 292 const OsclAny* aContext = NULL); 293 OSCL_IMPORT_REF PVMFCommandId CancelAllCommands(PVMFSessionId, 294 const OsclAny* aContextData = NULL); 295 OSCL_IMPORT_REF PVMFCommandId CancelCommand(PVMFSessionId, 296 PVMFCommandId aCmdId, 297 const OsclAny* aContextData = NULL); 298 299 300 OSCL_IMPORT_REF PVMFCommandId QueryUUID(PVMFSessionId, const PvmfMimeString& aMimeType, 301 Oscl_Vector<PVUuid, PVMFMediaLayerNodeAllocator>& aUuids, 302 bool aExactUuidsOnly = false, 303 const OsclAny* aContext = NULL); 304 305 OSCL_IMPORT_REF PVMFCommandId QueryInterface(PVMFSessionId, const PVUuid& aUuid, 306 PVInterface*& aInterfacePtr, 307 const OsclAny* aContext = NULL); 308 OSCL_IMPORT_REF void setInPortReposFlag(PVMFPortInterface* aPort, uint32 aSeekTimeInMS = 0); 309 OSCL_IMPORT_REF uint32 getMaxOutPortTimestamp(PVMFPortInterface* aPort, bool oPeek = false); 310 311 /** 312 * Handle an error event that has been generated. 313 * 314 * @param "aEvent" "The event to be handled." 315 */ HandleNodeErrorEvent(const PVMFAsyncEvent & aEvent)316 virtual void HandleNodeErrorEvent(const PVMFAsyncEvent& aEvent) 317 { 318 OSCL_UNUSED_ARG(aEvent); 319 } 320 /** 321 * Handle an informational event that has been generated. 322 * 323 * @param "aEvent" "The event to be handled." 324 */ HandleNodeInformationalEvent(const PVMFAsyncEvent & aEvent)325 virtual void HandleNodeInformationalEvent(const PVMFAsyncEvent& aEvent) 326 { 327 OSCL_UNUSED_ARG(aEvent); 328 } 329 /** 330 * Handle an event that has been generated. 331 * 332 * @param "aResponse" "The response to a previously issued command." 333 */ NodeCommandCompleted(const PVMFCmdResp & aResponse)334 virtual void NodeCommandCompleted(const PVMFCmdResp& aResponse) 335 { 336 OSCL_UNUSED_ARG(aResponse); 337 } 338 339 /** from PVMFPortActivityHandler */ 340 void HandlePortActivity(const PVMFPortActivity& aActivity); 341 342 //callback from the port when memory is available in the rtp 343 //payload parser. 344 void freechunkavailable(PVMFPortInterface*); addRef()345 virtual void addRef() 346 { 347 } removeRef()348 virtual void removeRef() 349 { 350 } queryInterface(const PVUuid & uuid,PVInterface * & iface)351 virtual bool queryInterface(const PVUuid& uuid, PVInterface*& iface) 352 { 353 iface = NULL; 354 if (uuid == PVUuid(PVMF_MEDIALAYERNODE_EXTENSIONINTERFACE_UUID)) 355 { 356 if (!iExtensionInterface) 357 { 358 PVMFMediaLayerNodeAllocator alloc; 359 int32 err; 360 OsclAny*ptr = NULL; 361 OSCL_TRY(err, 362 ptr = alloc.ALLOCATE(sizeof(PVMFMediaLayerNodeExtensionInterfaceImpl)); 363 ); 364 if (err != OsclErrNone || !ptr) 365 { 366 PVMF_MLNODE_LOGERROR((0, "PVMFMediaLayerNode::queryInterface: Error - Out of memory")); 367 OSCL_LEAVE(OsclErrNoMemory); 368 } 369 iExtensionInterface = 370 OSCL_PLACEMENT_NEW(ptr, PVMFMediaLayerNodeExtensionInterfaceImpl(this)); 371 } 372 return (iExtensionInterface->queryInterface(uuid, iface)); 373 } 374 else 375 { 376 return false; 377 } 378 } 379 380 private: 381 /* from OsclActiveObject */ 382 void Run(); 383 void DoCancel(); 384 385 /** 386 * Process a port activity. This method is called by Run to process a port activity. 387 * 388 */ 389 bool ProcessPortActivity(PVMFMediaLayerPortContainer*); 390 391 /** 392 * Retrieve and process an incoming message from a port. 393 */ 394 PVMFStatus ProcessIncomingMsg(PVMFMediaLayerPortContainer*); 395 PVMFStatus ProcessInputMsg_OneToOne(PVMFMediaLayerPortContainer* pinputPort, 396 PVMFSharedMediaMsgPtr msgIn); 397 PVMFStatus ProcessInputMsg_OneToN(PVMFMediaLayerPortContainer* pinputPort, 398 PVMFSharedMediaMsgPtr msgIn); 399 bool checkOutputPortsBusy(PVMFMediaLayerPortContainer* pinputPort); 400 PVMFStatus sendAccessUnits(PVMFMediaLayerPortContainer* pinputPort); 401 PVMFStatus dispatchAccessUnits(PVMFMediaLayerPortContainer* pinputPort, 402 PVMFMediaLayerPortContainer* poutPort); 403 404 bool Allocate(OsclSharedPtr<PVMFMediaDataImpl>& mediaDataImplOut, PVMFMediaLayerPortContainer* poutPort); 405 bool Allocate(OsclAny*& ptr); 406 bool Push(PVMFMediaLayerPortContainer portParams); 407 bool AddPort(PVMFMediaLayerPort* port); 408 409 /** 410 * Process an outgoing message of a the specified port by sending the message to 411 * the receiving side. 412 */ 413 PVMFStatus ProcessOutgoingMsg(PVMFMediaLayerPortContainer*); 414 415 void QueuePortActivity(PVMFMediaLayerPortContainer*, 416 const PVMFPortActivity&); 417 418 bool CheckForPortRescheduling(); 419 bool CheckForPortActivityQueues(); 420 421 422 /* Port related routines */ 423 IPayloadParser* CreatePayLoadParser(PvmfMimeString* aPortConfig); 424 void DestroyPayLoadParser(PvmfMimeString* aPortConfig, 425 IPayloadParser* aParser); 426 bool GetPortContainer(PVMFPortInterface* aPort, 427 PVMFMediaLayerPortContainer& aContainer); 428 bool GetPortContainer(PVMFPortInterface* aPort, int& index); 429 bool GetPortContainer(PVMFPortInterface* aPort, 430 PVMFMediaLayerPortContainer*& aContainer); 431 432 PVMFPortInterface* getPortCounterpart(PVMFMediaLayerPortContainer); 433 PVMFPortInterface* getPortCounterpart(PVMFMediaLayerPortContainer*); 434 435 /* Command processing */ 436 PVMFCommandId QueueCommandL(PVMFMediaLayerNodeCommand&); 437 void MoveCmdToCurrentQueue(PVMFMediaLayerNodeCommand& aCmd); 438 bool ProcessCommand(PVMFMediaLayerNodeCommand&); 439 void CommandComplete(MediaLayerNodeCmdQ&, 440 PVMFMediaLayerNodeCommand&, 441 PVMFStatus, 442 OsclAny* aData = NULL, 443 PVUuid* aEventUUID = NULL, 444 int32* aEventCode = NULL); 445 bool FlushPending(); 446 447 /** Command handlers */ 448 void DoReset(PVMFMediaLayerNodeCommand&); 449 void DoQueryUuid(PVMFMediaLayerNodeCommand&); 450 void DoQueryInterface(PVMFMediaLayerNodeCommand&); 451 void DoRequestPort(PVMFMediaLayerNodeCommand&); 452 void DoReleasePort(PVMFMediaLayerNodeCommand&); 453 void DoInit(PVMFMediaLayerNodeCommand&); 454 void DoPrepare(PVMFMediaLayerNodeCommand&); 455 void DoStart(PVMFMediaLayerNodeCommand&); 456 void DoStop(PVMFMediaLayerNodeCommand&); 457 void DoFlush(PVMFMediaLayerNodeCommand&); 458 void DoPause(PVMFMediaLayerNodeCommand&); 459 void DoCancelAllCommands(PVMFMediaLayerNodeCommand&); 460 void DoCancelCommand(PVMFMediaLayerNodeCommand&); 461 462 /* Event reporting */ 463 void ReportErrorEvent(PVMFEventType aEventType, 464 OsclAny* aEventData = NULL, 465 PVUuid* aEventUUID = NULL, 466 int32* aEventCode = NULL); 467 void ReportInfoEvent(PVMFEventType aEventType, 468 OsclAny* aEventData = NULL, 469 PVUuid* aEventUUID = NULL, 470 int32* aEventCode = NULL); 471 void SetState(TPVMFNodeInterfaceState); 472 473 private: 474 PVMFPortVector<PVMFMediaLayerPort, PVMFMediaLayerNodeAllocator> iPortVector; 475 /* 476 * Queue holding port params - one per every port 477 */ 478 Oscl_Vector<PVMFMediaLayerPortContainer, PVMFMediaLayerNodeAllocator> iPortParamsQueue; 479 480 MediaLayerNodeCmdQ iInputCommands; 481 MediaLayerNodeCmdQ iCurrentCommand; 482 uint32 iStreamID; 483 484 PVMFNodeCapability iCapability; 485 PVLogger *iLogger; 486 PVLogger *iDataPathLogger; 487 PVLogger *iDataPathLoggerIn; 488 PVLogger *iDataPathLoggerOut; 489 PVLogger *iDataPathLoggerFlowCtrl; 490 PVLogger *iClockLogger; 491 PVLogger *iReposLogger; 492 PVLogger *iRunlLogger; 493 OsclErrorTrapImp* iOsclErrorTrapImp; 494 bool oPortDataLog; 495 char iLogFileIndex; 496 OSCL_HeapString<PVMFMediaLayerNodeAllocator> portLogPath; 497 498 PVMFMediaLayerNodeExtensionInterfaceImpl* iExtensionInterface; 499 /* 500 * Extension interface related 501 */ 502 uint8* srcPtr; 503 uint32 maxPacketSize; 504 PVMFCPMPluginAccessUnitDecryptionInterface* iDecryptionInterface; setDRMDecryptionInterface(uint32 packetsize,PVMFCPMPluginAccessUnitDecryptionInterface * aDecryptionInterface)505 PVMFStatus setDRMDecryptionInterface(uint32 packetsize, PVMFCPMPluginAccessUnitDecryptionInterface* aDecryptionInterface) 506 { 507 maxPacketSize = packetsize; 508 iDecryptionInterface = aDecryptionInterface; 509 srcPtr = (uint8 *)oscl_malloc(maxPacketSize * sizeof(uint8)); 510 return PVMFSuccess; 511 } 512 513 PayloadParserRegistry* iPayLoadParserRegistry; setPayloadParserRegistry(PayloadParserRegistry * registry)514 void setPayloadParserRegistry(PayloadParserRegistry* registry) 515 { 516 iPayLoadParserRegistry = registry; 517 } 518 void createRTPPayloadParserRegistry(); 519 void destroyRTPPayloadParserRegistry(); 520 521 IPayloadParser::Payload iPayLoad; 522 setPortDataLogging(bool logEnable,OSCL_String * logPath)523 PVMFStatus setPortDataLogging(bool logEnable, OSCL_String* logPath) 524 { 525 oPortDataLog = logEnable; 526 if (logPath != NULL) 527 { 528 portLogPath = logPath->get_cstr(); 529 } 530 return PVMFSuccess; 531 } 532 533 void LogMediaData(PVMFSharedMediaDataPtr, PVMFPortInterface*); 534 535 friend class PVMFMediaLayerPort; 536 friend class PVMFMediaLayerNodeExtensionInterfaceImpl; 537 538 int32 iPlayStartTime; 539 int32 iPlayStopTime; 540 uint64 preroll64; 541 542 bool CheckForEOS(); 543 bool setPlayRange(int32 aStartTimeInMS, 544 int32 aStopTimeInMS, 545 bool oRepositioning = false); 546 547 PVMFMediaClock* iClientPlayBackClock; setClientPlayBackClock(PVMFMediaClock * aClientPlayBackClock)548 bool setClientPlayBackClock(PVMFMediaClock* aClientPlayBackClock) 549 { 550 iClientPlayBackClock = aClientPlayBackClock; 551 return true; 552 } 553 554 bool setPortMediaParams(PVMFPortInterface* aPort, 555 OsclRefCounterMemFrag& aConfig, 556 mediaInfo* aMediaInfo = NULL); 557 558 PVMFStatus verifyPortConfigParams(const char* aFormatValType, 559 PVMFPortInterface* aPort, 560 OsclAny* aConfig, 561 mediaInfo* aMediaInfo = NULL); 562 563 bool setOutPortStreamParams(PVMFPortInterface* aPort, uint streamid, uint32 aPreroll, bool aLiveStream = false); 564 565 bool parseOutputPortMime(OSCL_String* pmime, 566 uint& inputPort); 567 568 /*reposiiotning*/ 569 uint32 diffAudioVideoTS; 570 uint32* iTimeTakenTSptr; 571 bool iAdjustTimeReady; 572 uint32 iReposTime; 573 574 /* Send EOS*/ 575 PVMFStatus checkPortCounterpartAccessUnitQueue(PVMFMediaLayerPortContainer* pinputPort, bool* IsAccessUnitsEmpty); 576 PVMFStatus sendEndOfTrackCommand(PVMFMediaLayerPortContainer* poutputPort); 577 bool iDetectBrokenTrack; 578 bool setTrackDisable(PVMFPortInterface* aPort); 579 bool oEOSsendunits; 580 581 /* Set timer */ 582 uint32 iTimerNoDataTrack; setMediaLayerTimerDurationMS(uint32 aTimer)583 void setMediaLayerTimerDurationMS(uint32 aTimer) 584 { 585 iTimerNoDataTrack = aTimer; 586 } 587 588 PVMFStatus LogPayLoadParserStats(); 589 590 PVLogger* iDiagnosticsLogger; 591 bool iDiagnosticsLogged; 592 void LogSessionDiagnostics(); 593 uint32 iNumRunL; 594 }; 595 596 #endif //MEDIALAYER_NODE_H_INCLUDED 597 598 599