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 #if !defined(MUXTBL_H) 19 #define MUXTBL_H 20 #include "oscl_types.h" 21 #include "h245def.h" 22 #include "h245pri.h" 23 #include "h223types.h" 24 #include "logicalchannel.h" 25 26 #ifndef PVLOGGER_H_INCLUDED 27 #include "pvlogger.h" 28 #endif 29 30 #define MAX_MUX_ENTRIES 16 31 #define MAX_LCN_NUM 4 32 33 #define ACTIVATE 1 34 #define DEACTIVATE 0 35 36 class MuxTableMgr 37 { 38 public: 39 MuxTableMgr(); 40 ~MuxTableMgr(); 41 42 OsclAny SetIncomingDescriptors(PS_MuxDescriptor mux_desc); 43 OsclAny SetIncomingMuxDescriptors(CPVMultiplexEntryDescriptorVector& descriptors, bool replace = true); 44 void SetOutgoingMuxDescriptors(CPVMultiplexEntryDescriptorVector& descriptors); 45 void RemoveOutgoingMuxDescriptor(uint8 muxTblNum); 46 void RemoveIncomingMuxDescriptor(uint8 muxTblNum); 47 PS_MultiplexEntryDescriptor GetIncomingDescriptor(uint8 tblNum); 48 PS_MultiplexEntryDescriptor GetOutgoingDescriptor(MuxSduDataList& data_list); 49 PS_MultiplexEntryDescriptor GetOutgoingDescriptor(OsclSharedPtr<H223OutgoingChannel>& lcn, PVMFSharedMediaDataPtr sdu); 50 51 OsclAny ResetStats(); 52 OsclAny LogStats(TPVDirection dir); 53 uint32 GetMuxEntryAccessCount(TPVDirection dir, uint8 tblNum); 54 private: 55 /* function prototypes */ 56 bool RemoveDescriptorR(uint8 tblNum); 57 OsclAny AddIncomingControlDescriptor(); 58 void AddControlDescriptor(CPVMultiplexEntryDescriptorVector& descriptors); 59 PS_MultiplexEntryDescriptor GetControlDescriptor(uint16 mux_entry_num); 60 61 /* multiplex table information */ 62 uint16 iOutgoingMuxTblCount; 63 uint16 iIncomingMuxTblCount; 64 65 uint8 iMuxDescriptorFlagR[MAX_MUX_ENTRIES]; 66 PS_MultiplexEntryDescriptor iMuxDescriptorR[MAX_MUX_ENTRIES]; 67 68 uint32 iNumCorruptMcRx; 69 uint32 iMcAccessCnt[MAX_MUX_ENTRIES]; 70 uint32 iMcAccessCntR[MAX_MUX_ENTRIES]; 71 CPVMultiplexEntryDescriptorVector* iOutgoingDescriptors; 72 MuxSduDataList iMuxSduDataList; 73 PVLogger* iLogger; 74 }; 75 76 #endif 77