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 RM_MEDIAINFO_H 19 #define RM_MEDIAINFO_H 20 #include "media_info.h" 21 22 class rm_mediaInfo : public mediaInfo 23 { 24 private: 25 /* RM Related */ 26 NptTimeFormat rm_length; 27 OSCL_HeapString<SDPParserAlloc> rm_mimetype; 28 int rm_StreamId; 29 int rm_AvgBitRate; 30 int rm_AvgPacketSize; 31 int rm_EndOneRuleEndAll; 32 int rm_MaxBitRate; 33 int rm_MaxPacketSize; 34 int rm_Preroll; 35 int rm_ActualPreroll; 36 int rm_EndTime; 37 OSCL_HeapString<SDPParserAlloc> rm_Flags; 38 OSCL_HeapString<SDPParserAlloc> rm_ASMRuleBook; 39 OSCL_HeapString<SDPParserAlloc> rm_intrinsicDurationType; 40 OSCL_HeapString<SDPParserAlloc> rm_StreamName; 41 //In real media SDP, decoder specific info is present as a separate SDP field called OpaqueData. 42 //It is not stored as a part of config field of a=fmtp. 43 OsclSharedPtr<uint8> rm_decoderSpecificdata; 44 uint32 rm_decoderSpecificdataSize; 45 46 public: rm_mediaInfo()47 rm_mediaInfo() 48 { 49 rm_StreamId = 0; 50 rm_AvgBitRate = 0; 51 rm_AvgPacketSize = 0; 52 rm_EndOneRuleEndAll = 0; 53 rm_MaxBitRate = 0; 54 rm_MaxPacketSize = 0; 55 rm_Preroll = 0; 56 rm_ActualPreroll = 0; 57 rm_EndTime = 0; 58 rm_decoderSpecificdataSize = 0; 59 }; 60 rm_mediaInfo(const rm_mediaInfo & pSource)61 rm_mediaInfo(const rm_mediaInfo &pSource) : mediaInfo(pSource) 62 { 63 setRMLength(pSource.rm_length); 64 } 65 66 const rm_mediaInfo & operator=(const rm_mediaInfo &pSource) 67 { 68 if (&pSource != this) 69 { 70 setRMLength(pSource.rm_length); 71 } 72 73 return pSource; 74 } 75 ~rm_mediaInfo()76 ~rm_mediaInfo() {}; 77 setRMMimeType(const char * MType)78 inline void setRMMimeType(const char* MType) 79 { 80 rm_mimetype = MType; 81 }; 82 setRMMimeType(const OSCL_HeapString<SDPParserAlloc> & MType)83 inline void setRMMimeType(const OSCL_HeapString<SDPParserAlloc>& MType) 84 { 85 rm_mimetype = MType; 86 }; 87 setRMMimeType(const OsclMemoryFragment memFrag)88 inline void setRMMimeType(const OsclMemoryFragment memFrag) 89 { 90 rm_mimetype.set((const char*)(memFrag.ptr), memFrag.len); 91 }; 92 setRMLength(const NptTimeFormat & in_range)93 inline void setRMLength(const NptTimeFormat& in_range) 94 { 95 rm_length = in_range; 96 }; 97 getRMMimeType()98 inline OSCL_HeapString<SDPParserAlloc> getRMMimeType() 99 { 100 return rm_mimetype; 101 }; 102 setRealStreamId(int streamid)103 inline void setRealStreamId(int streamid) 104 { 105 rm_StreamId = streamid; 106 }; 107 getRealStreamId()108 inline int getRealStreamId() 109 { 110 return rm_StreamId; 111 }; 112 setAvgBitRate(int min_bit_rate)113 inline void setAvgBitRate(int min_bit_rate) 114 { 115 rm_AvgBitRate = min_bit_rate; 116 }; 117 getAvgBitRate()118 inline int getAvgBitRate() 119 { 120 return rm_AvgBitRate; 121 }; 122 setAvgPacketSize(int pack_sz)123 inline void setAvgPacketSize(int pack_sz) 124 { 125 rm_AvgPacketSize = pack_sz; 126 }; getAvgPacketSize()127 inline int getAvgPacketSize() 128 { 129 return rm_AvgPacketSize; 130 }; setMaxBitRate(int max_bit_rate)131 inline void setMaxBitRate(int max_bit_rate) 132 { 133 rm_MaxBitRate = max_bit_rate; 134 }; getMaxBitRate()135 inline int getMaxBitRate() 136 { 137 return rm_MaxBitRate; 138 }; 139 setMaxPacketSize(int max_pack_sz)140 inline void setMaxPacketSize(int max_pack_sz) 141 { 142 rm_MaxPacketSize = max_pack_sz; 143 }; getMaxPacketSize()144 inline int getMaxPacketSize() 145 { 146 return rm_MaxPacketSize; 147 }; 148 setPreroll(int preroll)149 inline void setPreroll(int preroll) 150 { 151 rm_Preroll = preroll; 152 }; getPreroll()153 inline int getPreroll() 154 { 155 return rm_Preroll; 156 }; setActualPreroll(int acpreroll)157 inline void setActualPreroll(int acpreroll) 158 { 159 rm_ActualPreroll = acpreroll; 160 }; 161 getActualPreroll()162 inline int getActualPreroll() 163 { 164 return rm_ActualPreroll; 165 }; 166 setEndTime(int endtime)167 inline void setEndTime(int endtime) 168 { 169 rm_EndTime = endtime; 170 }; 171 getEndTime()172 inline int getEndTime() 173 { 174 return rm_EndTime; 175 }; setEndOneRuleEndAll(int endrule)176 inline void setEndOneRuleEndAll(int endrule) 177 { 178 rm_EndOneRuleEndAll = endrule; 179 }; 180 getEndOneRuleEndAll()181 inline int getEndOneRuleEndAll() 182 { 183 return rm_EndOneRuleEndAll; 184 }; 185 setRMFlags(const char * flag)186 inline void setRMFlags(const char* flag) 187 { 188 rm_Flags = flag; 189 }; 190 setRMFlags(const OSCL_HeapString<SDPParserAlloc> & flag)191 inline void setRMFlags(const OSCL_HeapString<SDPParserAlloc>& flag) 192 { 193 rm_Flags = flag; 194 }; 195 setRMFlags(const OsclMemoryFragment memFrag)196 inline void setRMFlags(const OsclMemoryFragment memFrag) 197 { 198 rm_Flags.set((const char*)(memFrag.ptr), memFrag.len); 199 }; 200 getRMFlags()201 inline OSCL_HeapString<SDPParserAlloc> getRMFlags() 202 { 203 return rm_Flags; 204 }; setASMRuleBook(const char * asmRule)205 inline void setASMRuleBook(const char* asmRule) 206 { 207 rm_ASMRuleBook = asmRule; 208 }; 209 setASMRuleBook(const OSCL_HeapString<SDPParserAlloc> & asmRule)210 inline void setASMRuleBook(const OSCL_HeapString<SDPParserAlloc>& asmRule) 211 { 212 rm_ASMRuleBook = asmRule; 213 }; 214 setASMRuleBook(const OsclMemoryFragment memFrag)215 inline void setASMRuleBook(const OsclMemoryFragment memFrag) 216 { 217 rm_ASMRuleBook.set((const char*)(memFrag.ptr), memFrag.len); 218 }; 219 getASMRuleBook()220 inline OSCL_HeapString<SDPParserAlloc> getASMRuleBook() 221 { 222 return rm_ASMRuleBook; 223 }; setintrinsicDurationType(const char * intrinsicDuration)224 inline void setintrinsicDurationType(const char* intrinsicDuration) 225 { 226 rm_intrinsicDurationType = intrinsicDuration; 227 }; 228 setintrinsicDurationType(const OSCL_HeapString<SDPParserAlloc> & intrinsicDuration)229 inline void setintrinsicDurationType(const OSCL_HeapString<SDPParserAlloc>& intrinsicDuration) 230 { 231 rm_intrinsicDurationType = intrinsicDuration; 232 }; 233 setintrinsicDurationType(const OsclMemoryFragment memFrag)234 inline void setintrinsicDurationType(const OsclMemoryFragment memFrag) 235 { 236 rm_intrinsicDurationType.set((const char*)(memFrag.ptr), memFrag.len); 237 }; 238 getintrinsicDurationType()239 inline OSCL_HeapString<SDPParserAlloc> getintrinsicDurationType() 240 { 241 return rm_intrinsicDurationType; 242 }; 243 setStreamName(const char * stream)244 inline void setStreamName(const char* stream) 245 { 246 rm_StreamName = stream; 247 }; 248 setStreamName(const OSCL_HeapString<SDPParserAlloc> & stream)249 inline void setStreamName(const OSCL_HeapString<SDPParserAlloc>& stream) 250 { 251 rm_StreamName = stream; 252 }; 253 setStreamName(const OsclMemoryFragment memFrag)254 inline void setStreamName(const OsclMemoryFragment memFrag) 255 { 256 rm_StreamName.set((const char*)(memFrag.ptr), memFrag.len); 257 }; 258 getStreamName()259 inline OSCL_HeapString<SDPParserAlloc> getStreamName() 260 { 261 return rm_StreamName; 262 }; 263 setRMDecoderSpecificInfo(OsclSharedPtr<uint8> Info)264 inline void setRMDecoderSpecificInfo(OsclSharedPtr<uint8> Info) 265 { 266 rm_decoderSpecificdata = Info; 267 } 268 getRMDecoderSpecificInfo()269 inline OsclSharedPtr<uint8> getRMDecoderSpecificInfo() 270 { 271 return rm_decoderSpecificdata; 272 } 273 setRMDecoderSpecificInfoSize(uint32 size)274 inline void setRMDecoderSpecificInfoSize(uint32 size) 275 { 276 rm_decoderSpecificdataSize = size; 277 } 278 getRMDecoderSpecificInfoSize()279 inline uint32 getRMDecoderSpecificInfoSize() 280 { 281 return rm_decoderSpecificdataSize; 282 } 283 getRMLength()284 inline NptTimeFormat *getRMLength() 285 { 286 return &rm_length; 287 }; 288 289 290 }; 291 292 #endif 293 294 295