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 __SDP_INFO_H__ 19 #define __SDP_INFO_H__ 20 21 #include "oscl_mem.h" 22 #include "session_info.h" 23 #include "media_info.h" 24 #include "aac_media_info.h" 25 #include "amr_media_info.h" 26 #include "m4v_media_info.h" 27 #include "rfc3640_media_info.h" 28 #include "h263_media_info.h" 29 #include "still_image_media_info.h" 30 #include "bool_array.h" 31 #include "pcmu_media_info.h" 32 #include "pcma_media_info.h" 33 34 #ifndef OSCL_STRING_H_INCLUDED 35 #include "oscl_string.h" 36 #endif 37 38 39 40 //---------------------------------------------------------------------- 41 // Global Constant Declarations 42 //---------------------------------------------------------------------- 43 #define MAX_MEDIA_OBJECTS 50 44 #define MAX_SEGMENTS 10 45 46 struct segmentSpecific 47 { 48 bool segmentActive; 49 bool segmentPayloadOrderPref; 50 }; 51 52 typedef BoolArray<MAX_MEDIA_OBJECTS> SDPSelectionType; 53 //---------------------------------------------------------------------- 54 // Global Type Declarations 55 //---------------------------------------------------------------------- 56 57 //---------------------------------------------------------------------- 58 // Global Data Declarations 59 //---------------------------------------------------------------------- 60 61 //====================================================================== 62 // CLASS DEFINITIONS and FUNCTION DECLARATIONS 63 //====================================================================== 64 #include "mime_registry.h" 65 66 class SDPInfo 67 { 68 public: 69 OSCL_IMPORT_REF 70 SDPInfo(); 71 OSCL_IMPORT_REF 72 SDPInfo(const SDPInfo &sourceSdpInfo); 73 OSCL_IMPORT_REF 74 ~SDPInfo(); 75 OSCL_IMPORT_REF 76 void freeLastMediaInfoObject(void); 77 OSCL_IMPORT_REF 78 sessionDescription *getSessionInfo(); 79 OSCL_IMPORT_REF 80 Oscl_Vector<mediaInfo *, SDPParserAlloc> getMediaInfo(int Object); 81 OSCL_IMPORT_REF 82 Oscl_Vector<mediaInfo *, SDPParserAlloc> *getMediaArray(); 83 OSCL_IMPORT_REF 84 int getNumMediaObjects(); 85 OSCL_IMPORT_REF 86 void dealloc(void *ptr); 87 OSCL_IMPORT_REF 88 mediaInfo* getMediaInfoBasedOnID(uint32 trackID); 89 OSCL_IMPORT_REF 90 mediaInfo* getMediaInfoBasedOnDependsOnID(uint32 trackID); 91 OSCL_IMPORT_REF 92 void *alloc(const int size, bool alternateMedia); 93 OSCL_IMPORT_REF 94 void IncrementAlternateMediaInfoVectorIndex(); 95 OSCL_IMPORT_REF 96 void copyFmDefMedia(mediaInfo *media); 97 OSCL_IMPORT_REF 98 void reset(); 99 OSCL_IMPORT_REF 100 uint32 getMediaObjectIndex(); 101 OSCL_IMPORT_REF 102 bool getMediaInfoInSegment(int segment, Oscl_Vector< mediaInfo *, SDPParserAlloc>& segmentMediaInfo); 103 OSCL_IMPORT_REF 104 void setSegmentCount(int count); 105 OSCL_IMPORT_REF 106 int getSegmentCount(); 107 OSCL_IMPORT_REF 108 bool setSegmentActive(int segment, bool status); 109 OSCL_IMPORT_REF 110 bool isSegmentActive(int segment); 111 OSCL_IMPORT_REF 112 bool setSegmentPayloadOrderPref(int segment, int* payloadArray, int len); 113 OSCL_IMPORT_REF 114 bool isPayloadOrderPreferenceSet(int segment); 115 OSCL_IMPORT_REF 116 mediaInfo* getPreferedMediaInfo(int segment); 117 OSCL_IMPORT_REF 118 int getPreferedPayloadNumber(int segment); 119 OSCL_IMPORT_REF 120 const oscl_wchar *getSdpFilename(uint32 &retsize); 121 OSCL_IMPORT_REF 122 void setSDPFilename(OSCL_wString& aURL); 123 private: 124 sessionDescription session_info; 125 Oscl_Vector< mediaInfo *, SDPParserAlloc> pMediaInfo[MAX_MEDIA_OBJECTS]; 126 int numMediaObjects; 127 uint32 iMediaObjectIndex; 128 int segmentCount; 129 segmentSpecific segmentInfo[MAX_SEGMENTS]; 130 OSCL_wHeapString<SDPParserAlloc> SdpFilename; 131 }; 132 #endif // __SDP_INFO_H__ 133 134