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 19 #ifndef MEDIAINFO_H 20 #define MEDIAINFO_H 21 #include "sdp_memory.h" 22 #include "oscl_string_containers.h" 23 #include "rtsp_time_formats.h" 24 #include "rtsp_range_utils.h" 25 #include "sdp_error.h" 26 #include "sdp_memory.h" 27 #include "common_info.h" 28 #include "oscl_vector.h" 29 #include "oscl_shared_ptr.h" 30 #include "oscl_refcounter.h" 31 #include "aac_payload_info.h" 32 #include "amr_payload_info.h" 33 #include "pcmu_payload_info.h" 34 #include "pcma_payload_info.h" 35 #include "h263_payload_info.h" 36 #include "h264_payload_info.h" 37 #include "m4v_payload_info.h" 38 #include "rfc3640_payload_info.h" 39 40 41 struct SRTPConfigAttrType 42 { 43 OSCL_HeapString<SDPParserAlloc> intg_nonce; 44 OSCL_HeapString<SDPParserAlloc> srtp_key_salt; 45 uint32 auth_tag_len ; 46 OSCL_HeapString<SDPParserAlloc> srtp_param_ext; 47 48 }; 49 50 struct rtcp_fbType 51 { 52 enum { ACK, NACK, TRR_INT, FB_ID }; 53 OSCL_HeapString<SDPParserAlloc> pt; 54 OSCL_HeapString<SDPParserAlloc> val; 55 int val_type; 56 57 OSCL_HeapString<SDPParserAlloc> ack_param; 58 OSCL_HeapString<SDPParserAlloc> nack_param; 59 OSCL_HeapString<SDPParserAlloc> param; 60 uint32 trr_int; 61 62 }; 63 64 class mediaInfo 65 { 66 protected: 67 int mediaTrackId; 68 Oscl_Vector<int, SDPParserAlloc> alternateTrackId; 69 Oscl_Vector<int, SDPParserAlloc> dependentTrackId; 70 OSCL_HeapString<SDPParserAlloc> type; 71 72 int suggestedPort; 73 int numOfPorts; 74 OSCL_HeapString<SDPParserAlloc> transportProfile; 75 76 Oscl_Vector<PayloadSpecificInfoTypeBase*, SDPParserAlloc> payloadSpecificInfoVector; 77 78 OSCL_HeapString<SDPParserAlloc> MIMEType; // code support multiple rtpmap with same MIMEType. 79 80 OSCL_HeapString<SDPParserAlloc> controlURL; 81 82 int controlURLTrackID; 83 uint32 mediaInfoID; 84 int bitrate; 85 int rtcpBWSender; 86 int rtcpBWReceiver; 87 int BWtias; 88 RtspRangeType range; 89 90 91 int parameter_size; 92 OSCL_HeapString<SDPParserAlloc> dependsonURL; 93 94 int DependsOnTrackID; // ID of track for DependsOn field. 95 bool allowRecord; // Allows recording of media type. 96 97 bool select; //Used for track selection 98 int ssrc; 99 100 bool ssrcIsSet; 101 102 bool randomAccessDenied; // Added for random positioning on 3rd party content - 01/08/02 103 104 QoEMetricsType qoeMetrics; 105 uint32 predecbufsize; 106 uint32 initpredecbufperiod; 107 uint32 initpostdecbufperiod; 108 uint32 decbyterate; 109 110 uint32 reportFrequency; 111 AssetInfoType assetInfo; 112 113 connectionInfo connectInfo; 114 bool c_field_found ; 115 SRTPConfigAttrType SRTPConfigAttr; 116 117 rtcp_fbType rtcp_fb; 118 OsclFloat maxprate; 119 120 int totalStringLength; 121 int segmentNumber; 122 int payloadPreference; 123 bool matched; 124 bool segmentActive; 125 126 public: mediaInfo()127 mediaInfo() 128 { 129 suggestedPort = 0; 130 numOfPorts = 0; 131 bitrate = 0; 132 rtcpBWSender = -1; 133 rtcpBWReceiver = -1; 134 BWtias = 0; 135 allowRecord = false; 136 select = false; 137 parameter_size = 0; 138 controlURLTrackID = 0; 139 mediaInfoID = 0; 140 totalStringLength = 0; 141 DependsOnTrackID = -1; 142 ssrc = 0; 143 144 range.format = RtspRangeType::INVALID_RANGE; 145 range.start_is_set = false; 146 range.end_is_set = false; 147 ssrcIsSet = false; 148 randomAccessDenied = false; 149 150 oscl_memset(qoeMetrics.name, 0, MAX_METRICS_NAME); 151 qoeMetrics.range.format = RtspRangeType::INVALID_RANGE; 152 qoeMetrics.range.start_is_set = false; 153 qoeMetrics.range.end_is_set = false; 154 predecbufsize = 0; 155 initpredecbufperiod = 0; 156 initpostdecbufperiod = 0; 157 decbyterate = 0; 158 159 reportFrequency = 0; 160 assetInfo.URL = NULL; 161 for (int ii = 0; ii < ASSET_NAME_SIZE; ii++) 162 assetInfo.Box[ii] = NULL; 163 164 connectInfo.connectionNetworkType = "IP"; 165 connectInfo.connectionAddress = "0.0.0.0"; 166 connectInfo.connectionAddressType = "IP4"; 167 c_field_found = false; 168 169 SRTPConfigAttr.intg_nonce = NULL; 170 SRTPConfigAttr.srtp_key_salt = NULL; 171 SRTPConfigAttr.auth_tag_len = 0; 172 SRTPConfigAttr.srtp_param_ext = NULL; 173 mediaTrackId = 0; 174 rtcp_fb.pt = NULL; 175 rtcp_fb.val = NULL; 176 rtcp_fb.ack_param = NULL; 177 rtcp_fb.nack_param = NULL; 178 rtcp_fb.param = NULL; 179 rtcp_fb.trr_int = 0; 180 oscl_memset(qoeMetrics.name, 0, 7); 181 qoeMetrics.rateFmt = QoEMetricsType::VAL; 182 qoeMetrics.rateVal = 0; 183 qoeMetrics.paramFmt = QoEMetricsType::IDIGIT; 184 qoeMetrics.paramExtIdigit = 0; 185 maxprate = 0; 186 segmentNumber = 0; 187 payloadPreference = 0; 188 matched = false; 189 segmentActive = true; 190 }; 191 ~mediaInfo()192 virtual ~mediaInfo() 193 { 194 int size = payloadSpecificInfoVector.size(); 195 for (int ii = 0; ii < size ; ii++) 196 { 197 payloadSpecificInfoVector[ii]->~PayloadSpecificInfoTypeBase(); 198 dealloc(payloadSpecificInfoVector[ii]); 199 } 200 assetInfo.CleanUp(); 201 }; 202 alloc(const int size)203 void *alloc(const int size) 204 { 205 void *mem = oscl_malloc(size * sizeof(char)); 206 if (mem != NULL) 207 { 208 payloadSpecificInfoVector.push_back((PayloadSpecificInfoTypeBase*)mem); 209 } 210 return mem; 211 }; 212 dealloc(void * ptr)213 inline void dealloc(void *ptr) 214 { 215 oscl_free(ptr); 216 }; 217 getPayloadSpecificInfoTypePtr(uint32 number)218 inline PayloadSpecificInfoTypeBase* getPayloadSpecificInfoTypePtr(uint32 number) 219 { 220 PayloadSpecificInfoTypeBase* retVal = NULL; 221 for (int ii = 0; ii < (int)payloadSpecificInfoVector.size(); ii++) 222 { 223 if (payloadSpecificInfoVector[ii]->getPayloadNumber() == number) 224 { 225 retVal = payloadSpecificInfoVector[ii]; 226 break; 227 } 228 } 229 return retVal; 230 }; 231 lookupPayloadNumber(uint32 number,int & pPosition)232 inline bool lookupPayloadNumber(uint32 number, int &pPosition) 233 { 234 for (int ii = 0; ii < (int)payloadSpecificInfoVector.size(); ii++) 235 { 236 if (payloadSpecificInfoVector[ii]->getPayloadNumber() == number) 237 { 238 pPosition = ii; 239 return true; 240 } 241 } 242 243 return false; 244 }; 245 resetAlternateTrackId()246 inline void resetAlternateTrackId() 247 { 248 int size = alternateTrackId.size(); 249 for (int ii = 0; ii < size; ii++) 250 alternateTrackId.pop_back(); 251 } 252 resetDependentTrackId()253 inline void resetDependentTrackId() 254 { 255 int size = dependentTrackId.size(); 256 for (int ii = 0; ii < size ; ii++) 257 dependentTrackId.pop_back(); 258 } 259 setSSRC(int ss)260 inline void setSSRC(int ss) 261 { 262 ssrc = ss; 263 ssrcIsSet = true; 264 } setType(char * typ)265 inline void setType(char* typ) 266 { 267 type = typ; 268 }; setType(const OSCL_HeapString<SDPParserAlloc> & typ)269 inline void setType(const OSCL_HeapString<SDPParserAlloc>& typ) 270 { 271 type = typ; 272 }; 273 setType(const OsclMemoryFragment memFrag)274 inline void setType(const OsclMemoryFragment memFrag) 275 { 276 type.set((const char*)(memFrag.ptr), memFrag.len); 277 }; 278 setSuggestedPort(int port)279 inline void setSuggestedPort(int port) 280 { 281 suggestedPort = port; 282 }; setNumOfPorts(int ports)283 inline void setNumOfPorts(int ports) 284 { 285 numOfPorts = ports; 286 }; 287 setTransportProfile(char * tProfile)288 inline void setTransportProfile(char* tProfile) 289 { 290 transportProfile = tProfile; 291 }; setTransportProfile(const OSCL_HeapString<SDPParserAlloc> & tProfile)292 inline void setTransportProfile(const OSCL_HeapString<SDPParserAlloc>& tProfile) 293 { 294 transportProfile = tProfile; 295 }; setTransportProfile(const OsclMemoryFragment memFrag)296 inline void setTransportProfile(const OsclMemoryFragment memFrag) 297 { 298 transportProfile.set((const char*)(memFrag.ptr), memFrag.len); 299 }; 300 setBitrate(int bRate)301 inline void setBitrate(int bRate) 302 { 303 bitrate = bRate; 304 }; setRTCPSenderBitRate(int bRate)305 inline void setRTCPSenderBitRate(int bRate) 306 { 307 rtcpBWSender = bRate; 308 }; setRTCPReceiverBitRate(int bRate)309 inline void setRTCPReceiverBitRate(int bRate) 310 { 311 rtcpBWReceiver = bRate; 312 }; setBWtias(int bRate)313 inline void setBWtias(int bRate) 314 { 315 BWtias = bRate; 316 } setParameterSize(int pSize)317 inline void setParameterSize(int pSize) 318 { 319 parameter_size = pSize; 320 }; setControlURL(char * CURL)321 inline void setControlURL(char* CURL) 322 { 323 controlURL = CURL; 324 }; setControlURL(const OSCL_HeapString<SDPParserAlloc> & CURL)325 inline void setControlURL(const OSCL_HeapString<SDPParserAlloc>& CURL) 326 { 327 controlURL = CURL; 328 }; setControlURL(const OsclMemoryFragment memFrag)329 inline void setControlURL(const OsclMemoryFragment memFrag) 330 { 331 controlURL.set((const char*)(memFrag.ptr), memFrag.len); 332 }; 333 setDependsonURL(char * DURL)334 inline void setDependsonURL(char* DURL) 335 { 336 dependsonURL = DURL; 337 }; setDependsonURL(const OSCL_HeapString<SDPParserAlloc> & DURL)338 inline void setDependsonURL(const OSCL_HeapString<SDPParserAlloc>& DURL) 339 { 340 dependsonURL = DURL; 341 }; setDependsonURL(const OsclMemoryFragment memFrag)342 inline void setDependsonURL(const OsclMemoryFragment memFrag) 343 { 344 dependsonURL.set((const char*)(memFrag.ptr), memFrag.len); 345 }; 346 setpayloadSpacificInfoVector(const Oscl_Vector<PayloadSpecificInfoTypeBase *,SDPParserAlloc> & pInfo)347 inline void setpayloadSpacificInfoVector(const Oscl_Vector<PayloadSpecificInfoTypeBase*, SDPParserAlloc>& pInfo) 348 { 349 payloadSpecificInfoVector = pInfo; 350 }; 351 setMIMEType(const char * MType)352 inline void setMIMEType(const char* MType) 353 { 354 MIMEType = MType; 355 }; setMIMEType(const OSCL_HeapString<SDPParserAlloc> & MType)356 inline void setMIMEType(const OSCL_HeapString<SDPParserAlloc>& MType) 357 { 358 MIMEType = MType; 359 }; setMIMEType(const OsclMemoryFragment memFrag)360 inline void setMIMEType(const OsclMemoryFragment memFrag) 361 { 362 MIMEType.set((const char*)(memFrag.ptr), memFrag.len); 363 }; 364 setControlTrackID(int tID)365 inline void setControlTrackID(int tID) 366 { 367 controlURLTrackID = tID; 368 }; setMediaInfoID(uint32 id)369 inline void setMediaInfoID(uint32 id) 370 { 371 mediaInfoID = id; 372 }; 373 setAllowRecord(bool allrec)374 inline void setAllowRecord(bool allrec) 375 { 376 allowRecord = allrec; 377 }; 378 setRange(const RtspRangeType & in_range)379 inline void setRange(const RtspRangeType& in_range) 380 { 381 range = in_range; 382 }; setSelect()383 inline void setSelect() 384 { 385 select = true; 386 }; resetSelect()387 inline void resetSelect() 388 { 389 select = false; 390 }; setDependsOnTrackID(int trackID)391 inline void setDependsOnTrackID(int trackID) 392 { 393 DependsOnTrackID = trackID; 394 totalStringLength += oscl_strlen("a=depends-on:") + SDP_INT_STRING_LENGTH; 395 }; 396 397 setAudioSpecificConfig(unsigned char *,int)398 inline virtual void setAudioSpecificConfig(unsigned char* /*ASCPtr*/, int /*ASCLen*/) {}; setRandomAccessDenied(bool accessdenied)399 inline void setRandomAccessDenied(bool accessdenied) 400 { 401 randomAccessDenied = accessdenied; 402 }; setQoEMetrics(const QoEMetricsType & qMetrics)403 inline void setQoEMetrics(const QoEMetricsType& qMetrics) 404 { 405 qoeMetrics = qMetrics; 406 } 407 setPreDecBuffSize(uint32 size)408 inline void setPreDecBuffSize(uint32 size) 409 { 410 predecbufsize = size; 411 } setInitPreDecBuffPeriod(uint32 period)412 inline void setInitPreDecBuffPeriod(uint32 period) 413 { 414 initpredecbufperiod = period; 415 } setInitPostDecBuffPeriod(uint32 period)416 inline void setInitPostDecBuffPeriod(uint32 period) 417 { 418 initpostdecbufperiod = period; 419 } setDecByteRate(uint32 rate)420 inline void setDecByteRate(uint32 rate) 421 { 422 decbyterate = rate; 423 } 424 setReportFrequency(uint32 freq)425 inline void setReportFrequency(uint32 freq) 426 { 427 reportFrequency = freq; 428 } setAssetInfo(const AssetInfoType & ainfo)429 inline void setAssetInfo(const AssetInfoType &ainfo) 430 { 431 assetInfo = ainfo; 432 } setCNetworkType(char * nType)433 inline void setCNetworkType(char *nType) 434 { 435 connectInfo.connectionNetworkType = nType; 436 }; setCNetworkType(const OSCL_HeapString<SDPParserAlloc> & nType)437 inline void setCNetworkType(const OSCL_HeapString<SDPParserAlloc>& nType) 438 { 439 connectInfo.connectionNetworkType = nType; 440 }; setCNetworkType(const OsclMemoryFragment memFrag)441 inline void setCNetworkType(const OsclMemoryFragment memFrag) 442 { 443 connectInfo.connectionNetworkType.set((const char*)(memFrag.ptr), memFrag.len); 444 }; 445 setCAddressType(char * aType)446 inline void setCAddressType(char* aType) 447 { 448 connectInfo.connectionAddressType = aType; 449 }; setCAddressType(const OSCL_HeapString<SDPParserAlloc> & aType)450 inline void setCAddressType(const OSCL_HeapString<SDPParserAlloc>& aType) 451 { 452 connectInfo.connectionAddressType = aType; 453 }; setCAddressType(const OsclMemoryFragment memFrag)454 inline void setCAddressType(const OsclMemoryFragment memFrag) 455 { 456 connectInfo.connectionAddressType.set((const char*)(memFrag.ptr), memFrag.len); 457 }; 458 setCAddress(char * address)459 inline void setCAddress(char* address) 460 { 461 connectInfo.connectionAddress = address; 462 }; setCAddress(const OSCL_HeapString<SDPParserAlloc> & address)463 inline void setCAddress(const OSCL_HeapString<SDPParserAlloc>& address) 464 { 465 connectInfo.connectionAddress = address; 466 }; setCAddress(const OsclMemoryFragment memFrag)467 inline void setCAddress(const OsclMemoryFragment memFrag) 468 { 469 connectInfo.connectionAddress.set((const char*)(memFrag.ptr), memFrag.len); 470 }; 471 setCFieldStatus(bool status)472 inline void setCFieldStatus(bool status) 473 { 474 c_field_found = status; 475 } 476 setSRTPintg_nonce(char * intg)477 inline void setSRTPintg_nonce(char *intg) 478 { 479 SRTPConfigAttr.intg_nonce = intg; 480 } setSRTPintg_nonce(const OSCL_HeapString<SDPParserAlloc> & intg)481 inline void setSRTPintg_nonce(const OSCL_HeapString<SDPParserAlloc>& intg) 482 { 483 SRTPConfigAttr.intg_nonce = intg; 484 } setSRTPintg_nonce(const OsclMemoryFragment memFrag)485 inline void setSRTPintg_nonce(const OsclMemoryFragment memFrag) 486 { 487 SRTPConfigAttr.intg_nonce.set((const char*)(memFrag.ptr), memFrag.len); 488 } 489 setSRTPkey_salt(char * key)490 inline void setSRTPkey_salt(char *key) 491 { 492 SRTPConfigAttr.srtp_key_salt = key; 493 } setSRTPkey_salt(const OSCL_HeapString<SDPParserAlloc> & key)494 inline void setSRTPkey_salt(const OSCL_HeapString<SDPParserAlloc>& key) 495 { 496 SRTPConfigAttr.srtp_key_salt = key; 497 } setSRTPkey_salt(const OsclMemoryFragment memFrag)498 inline void setSRTPkey_salt(const OsclMemoryFragment memFrag) 499 { 500 SRTPConfigAttr.srtp_key_salt.set((const char*)(memFrag.ptr), memFrag.len); 501 } 502 setSRTPauth_tag_len(int len)503 inline void setSRTPauth_tag_len(int len) 504 { 505 SRTPConfigAttr.auth_tag_len = len; 506 } 507 setSRTPparam_ext(char * ext)508 inline void setSRTPparam_ext(char *ext) 509 { 510 SRTPConfigAttr.srtp_param_ext = ext; 511 } setSRTPparam_ext(const OSCL_HeapString<SDPParserAlloc> & ext)512 inline void setSRTPparam_ext(const OSCL_HeapString<SDPParserAlloc>& ext) 513 { 514 SRTPConfigAttr.srtp_param_ext = ext; 515 } setSRTPparam_ext(const OsclMemoryFragment memFrag)516 inline void setSRTPparam_ext(const OsclMemoryFragment memFrag) 517 { 518 SRTPConfigAttr.srtp_param_ext.set((const char*)(memFrag.ptr), memFrag.len); 519 } 520 setmediaTrackId(int id)521 inline void setmediaTrackId(int id) 522 { 523 mediaTrackId = id; 524 } setdependentTrackId(int id)525 inline void setdependentTrackId(int id) 526 { 527 dependentTrackId.push_back(id); 528 } setalternateTrackId(int id)529 inline void setalternateTrackId(int id) 530 { 531 alternateTrackId.push_back(id); 532 } 533 setrtcp_fb(rtcp_fbType fb)534 inline void setrtcp_fb(rtcp_fbType fb) 535 { 536 rtcp_fb = fb; 537 } setrtcp_fb_pt(const OsclMemoryFragment memFrag)538 inline void setrtcp_fb_pt(const OsclMemoryFragment memFrag) 539 { 540 rtcp_fb.pt.set((const char*)(memFrag.ptr), memFrag.len); 541 } 542 setrtcp_fb_val(const OsclMemoryFragment memFrag)543 inline void setrtcp_fb_val(const OsclMemoryFragment memFrag) 544 { 545 rtcp_fb.val.set((const char*)(memFrag.ptr), memFrag.len); 546 if (!oscl_strncmp(rtcp_fb.val.get_str(), "ack", rtcp_fb.val.get_size())) 547 rtcp_fb.val_type = rtcp_fbType::ACK; 548 else if (!oscl_strncmp(rtcp_fb.val.get_str(), "nack", rtcp_fb.val.get_size())) 549 rtcp_fb.val_type = rtcp_fbType::NACK; 550 else if (!oscl_strncmp(rtcp_fb.val.get_str(), "trr-int", rtcp_fb.val.get_size())) 551 rtcp_fb.val_type = rtcp_fbType::TRR_INT; 552 else 553 rtcp_fb.val_type = rtcp_fbType::FB_ID; 554 } 555 setrtcp_fb_trr_val(uint32 trr)556 inline void setrtcp_fb_trr_val(uint32 trr) 557 { 558 rtcp_fb.trr_int = trr; 559 } setrtcp_fb_val_param(const OsclMemoryFragment memFrag)560 inline void setrtcp_fb_val_param(const OsclMemoryFragment memFrag) 561 { 562 if (rtcp_fb.val_type == (rtcp_fbType::ACK)) 563 rtcp_fb.ack_param.set((const char*)(memFrag.ptr), memFrag.len); 564 else if (rtcp_fb.val_type == rtcp_fbType::NACK) 565 rtcp_fb.nack_param.set((const char*)(memFrag.ptr), memFrag.len); 566 else if (rtcp_fb.val_type == rtcp_fbType::FB_ID) 567 rtcp_fb.param.set((const char*)(memFrag.ptr), memFrag.len); 568 569 } 570 setMaxprate(OsclFloat rate)571 inline void setMaxprate(OsclFloat rate) 572 { 573 maxprate = rate; 574 } setSegmentNumber(int segment)575 inline void setSegmentNumber(int segment) 576 { 577 segmentNumber = segment; 578 }; setPayloadPreference(int pref)579 inline void setPayloadPreference(int pref) 580 { 581 payloadPreference = pref; 582 }; setMatched(bool match)583 inline void setMatched(bool match) 584 { 585 matched = match; 586 }; setSegmentActive(bool status)587 inline void setSegmentActive(bool status) 588 { 589 segmentActive = status; 590 }; 591 getSelect()592 inline bool getSelect() 593 { 594 return select; 595 }; getType()596 inline const char *getType() 597 { 598 return type.get_cstr(); 599 }; getSuggestedPort()600 inline int getSuggestedPort() 601 { 602 return suggestedPort; 603 }; getNumOfPorts()604 inline int getNumOfPorts() 605 { 606 return numOfPorts; 607 }; getTransportProfile()608 inline const char *getTransportProfile() 609 { 610 return transportProfile.get_cstr(); 611 }; getBitrate()612 inline int getBitrate() 613 { 614 return bitrate; 615 }; getParameterSize()616 inline int getParameterSize() 617 { 618 return parameter_size; 619 }; getControlURL()620 inline const char *getControlURL() 621 { 622 return controlURL.get_cstr(); 623 }; getDependsonTrackID()624 inline const char *getDependsonTrackID() 625 { 626 return dependsonURL.get_cstr(); 627 }; getDependsonURL()628 inline const char *getDependsonURL() 629 { 630 return dependsonURL.get_cstr(); 631 }; getPayloadSpecificInfoVector()632 inline Oscl_Vector<PayloadSpecificInfoTypeBase*, SDPParserAlloc> getPayloadSpecificInfoVector() 633 { 634 return (payloadSpecificInfoVector); 635 } getMediaPayloadNumberCount()636 inline int getMediaPayloadNumberCount() 637 { 638 return payloadSpecificInfoVector.size(); 639 } getMediaPayloadNumber(int pos)640 inline uint32 getMediaPayloadNumber(int pos) 641 { 642 return payloadSpecificInfoVector[pos]->getPayloadNumber(); 643 } getMIMEType()644 inline const char *getMIMEType() 645 { 646 return MIMEType.get_cstr(); 647 }; getAudioSpecificConfig(int * size)648 inline virtual const unsigned char *getAudioSpecificConfig(int*size) 649 { 650 *size = 0; 651 return NULL; 652 }; getStreamMuxConfig()653 inline virtual const void *getStreamMuxConfig() 654 { 655 return NULL; 656 }; getMediaInfoID()657 inline uint32 getMediaInfoID() 658 { 659 return mediaInfoID; 660 } getControlTrackID()661 inline int getControlTrackID() 662 { 663 return controlURLTrackID; 664 }; getDependsOnTrackID()665 inline int getDependsOnTrackID() 666 { 667 return DependsOnTrackID; 668 }; getSSRC()669 inline int getSSRC() 670 { 671 return ssrc; 672 } getSSRCFlag()673 inline bool getSSRCFlag() 674 { 675 return ssrcIsSet; 676 } getProfileLevelID()677 inline virtual int getProfileLevelID() 678 { 679 return 0; 680 }; getVOLHeader()681 inline virtual unsigned char *getVOLHeader() 682 { 683 return NULL; 684 }; 685 686 getFrameRate()687 inline virtual double getFrameRate() 688 { 689 return 0.0; 690 } getIFrameInterval()691 inline virtual int getIFrameInterval() 692 { 693 return 0; 694 } getScalability()695 inline virtual char *getScalability() 696 { 697 return 0; 698 } getDRC()699 inline virtual bool getDRC() 700 { 701 return false; 702 }; getCodecProfile()703 inline virtual int getCodecProfile() 704 { 705 return 0; 706 }; getCodecLevel()707 inline virtual int getCodecLevel() 708 { 709 return 0; 710 }; 711 getCodecModeList()712 inline virtual int getCodecModeList() 713 { 714 return 0; 715 }; getModeChangePeriod()716 inline virtual int getModeChangePeriod() 717 { 718 return 0; 719 }; getModeChangeNeighbor()720 inline virtual bool getModeChangeNeighbor() 721 { 722 return false; 723 }; getMaximumFrames()724 inline virtual int getMaximumFrames() 725 { 726 return 0; 727 }; getRobustSorting()728 inline virtual bool getRobustSorting() 729 { 730 return false; 731 }; 732 getOctetAlign()733 inline virtual bool getOctetAlign() 734 { 735 return false; 736 }; getCRC()737 inline virtual bool getCRC() 738 { 739 return false; 740 }; getInterLeaving()741 inline virtual int getInterLeaving() 742 { 743 return 0; 744 }; getLang()745 inline virtual const char *getLang() 746 { 747 return NULL; 748 }; 749 getMaximumBundle()750 inline virtual int getMaximumBundle() 751 { 752 return 0; 753 }; getPacketTime()754 inline virtual int getPacketTime() 755 { 756 return 0; 757 }; 758 getAllowRecord()759 inline virtual bool getAllowRecord() 760 { 761 return allowRecord; 762 }; 763 getRandomAccessDenied()764 inline bool getRandomAccessDenied() 765 { 766 return randomAccessDenied; 767 }; 768 IncrementTotalStringLength(int inc)769 inline void IncrementTotalStringLength(int inc) 770 { 771 if (inc > 0) totalStringLength += inc; 772 }; getRtspRange()773 inline RtspRangeType *getRtspRange() 774 { 775 return ⦥ 776 }; 777 getPreDecBuffSize()778 inline uint32 getPreDecBuffSize() 779 { 780 return predecbufsize; 781 } getInitPreDecBuffPeriod()782 inline uint32 getInitPreDecBuffPeriod() 783 { 784 return initpredecbufperiod; 785 } getInitPostDecBuffPeriod()786 inline uint32 getInitPostDecBuffPeriod() 787 { 788 return initpostdecbufperiod; 789 } getDecByteRate()790 inline uint32 getDecByteRate() 791 { 792 return decbyterate ; 793 } 794 getQoEMetrics()795 inline QoEMetricsType& getQoEMetrics() 796 { 797 return qoeMetrics; 798 } getReportFrequency()799 inline uint32 getReportFrequency() 800 { 801 return reportFrequency; 802 } getAssetInfo()803 inline AssetInfoType &getAssetInfo() 804 { 805 return assetInfo; 806 } 807 808 getConnectionInformation(connectionInfo * ct)809 inline void getConnectionInformation(connectionInfo* ct) 810 { 811 ct->connectionNetworkType = connectInfo.connectionNetworkType; 812 ct->connectionAddress = connectInfo.connectionAddress; 813 ct->connectionAddressType = connectInfo.connectionAddressType; 814 } 815 getCFieldStatus()816 inline bool getCFieldStatus() 817 { 818 return c_field_found; 819 } 820 getRTCPReceiverBitRate()821 inline int getRTCPReceiverBitRate() 822 { 823 return rtcpBWReceiver; 824 } getRTCPSenderBitRate()825 inline int getRTCPSenderBitRate() 826 { 827 return rtcpBWSender; 828 } getBWtias()829 inline int getBWtias() 830 { 831 return BWtias; 832 } getmediaTrackId()833 inline int getmediaTrackId() 834 { 835 return mediaTrackId; 836 } 837 getdependentTrackId()838 inline Oscl_Vector<int , SDPParserAlloc> getdependentTrackId() 839 { 840 return dependentTrackId; 841 } getalternateTrackId()842 inline Oscl_Vector<int, SDPParserAlloc> getalternateTrackId() 843 { 844 return alternateTrackId; 845 } getrtcp_fb()846 inline rtcp_fbType getrtcp_fb() 847 { 848 return rtcp_fb; 849 } 850 getSRTPConfigAttr()851 inline SRTPConfigAttrType *getSRTPConfigAttr() 852 { 853 return &SRTPConfigAttr ; 854 } 855 getMaxprate()856 inline OsclFloat getMaxprate() 857 { 858 return maxprate; 859 } getSegmentNumber()860 inline uint32 getSegmentNumber() 861 { 862 return segmentNumber; 863 }; getPayloadPreference()864 inline uint32 getPayloadPreference() 865 { 866 return payloadPreference; 867 }; isMatched()868 inline bool isMatched() 869 { 870 return matched; 871 }; isSegmentActive()872 inline bool isSegmentActive() 873 { 874 return segmentActive; 875 } 876 877 mediaInfo(const mediaInfo & pSource)878 mediaInfo(const mediaInfo &pSource) 879 { 880 setSSRC(pSource.ssrc); 881 setType(pSource.type); 882 setSuggestedPort(pSource.suggestedPort); 883 setNumOfPorts(pSource.numOfPorts); 884 setTransportProfile(pSource.transportProfile); 885 setBitrate(pSource.bitrate); 886 setRTCPSenderBitRate(pSource.rtcpBWSender); 887 setRTCPReceiverBitRate(pSource.rtcpBWReceiver); 888 setBWtias(pSource.BWtias); 889 setParameterSize(pSource.parameter_size); 890 setControlURL(pSource.controlURL); 891 setDependsonURL(pSource.dependsonURL); 892 setMIMEType(pSource.MIMEType); 893 894 // setpayloadSpacificInfoVector(pSource.payloadSpecificInfoVector); 895 setSampleRateForPayloads(pSource.payloadSpecificInfoVector); 896 setNumOfChannelsForPayloads(pSource.payloadSpecificInfoVector); 897 898 setControlTrackID(pSource.controlURLTrackID); 899 setMediaInfoID(pSource.mediaInfoID); 900 setAllowRecord(pSource.allowRecord); 901 setRange(pSource.range); 902 903 if (pSource.select == true) 904 { 905 setSelect(); 906 } 907 else 908 { 909 resetSelect(); 910 } 911 setDependsOnTrackID(pSource.DependsOnTrackID); 912 913 setRandomAccessDenied(pSource.randomAccessDenied); 914 915 setQoEMetrics(pSource.qoeMetrics); 916 setPreDecBuffSize(pSource.predecbufsize); 917 setInitPreDecBuffPeriod(pSource.initpredecbufperiod); 918 setInitPostDecBuffPeriod(pSource.initpostdecbufperiod); 919 setDecByteRate(pSource.decbyterate); 920 921 setReportFrequency(pSource.reportFrequency); 922 setAssetInfo((pSource.assetInfo)); 923 924 connectionInfo connInf = pSource.connectInfo; 925 setCNetworkType(connInf.connectionNetworkType); 926 setCAddressType(connInf.connectionAddressType); 927 setCAddress(connInf.connectionAddress); 928 setCFieldStatus(pSource.c_field_found); 929 930 SRTPConfigAttrType srtp_config = pSource.SRTPConfigAttr; 931 setSRTPintg_nonce(srtp_config.intg_nonce); 932 setSRTPkey_salt(srtp_config.srtp_key_salt); 933 setSRTPauth_tag_len(srtp_config.auth_tag_len); 934 setSRTPparam_ext(srtp_config.srtp_param_ext); 935 mediaTrackId = pSource.mediaTrackId; 936 alternateTrackId = pSource.alternateTrackId; 937 dependentTrackId = pSource.dependentTrackId; 938 rtcp_fb = pSource.rtcp_fb; 939 setMaxprate(pSource.maxprate); 940 setSegmentNumber(pSource.segmentNumber); 941 setPayloadPreference(pSource.payloadPreference); 942 setMatched(pSource.matched); 943 setSegmentActive(pSource.segmentActive); 944 945 } 946 947 const mediaInfo & operator=(const mediaInfo &pSource) 948 { 949 if (&pSource != this) 950 { 951 setSSRC(pSource.ssrc); 952 setType(pSource.type); 953 setSuggestedPort(pSource.suggestedPort); 954 setNumOfPorts(pSource.numOfPorts); 955 setTransportProfile(pSource.transportProfile); 956 setBitrate(pSource.bitrate); 957 setRTCPSenderBitRate(pSource.rtcpBWSender); 958 setRTCPReceiverBitRate(pSource.rtcpBWReceiver); 959 setBWtias(pSource.BWtias); 960 setParameterSize(pSource.parameter_size); 961 setControlURL(pSource.controlURL); 962 setDependsonURL(pSource.dependsonURL); 963 964 setMIMEType(pSource.MIMEType); 965 // setpayloadSpacificInfoVector(pSource.payloadSpecificInfoVector); 966 setSampleRateForPayloads(pSource.payloadSpecificInfoVector); 967 setNumOfChannelsForPayloads(pSource.payloadSpecificInfoVector); 968 969 setControlTrackID(pSource.controlURLTrackID); 970 setAllowRecord(pSource.allowRecord); 971 setRange(pSource.range); 972 if (pSource.select == true) 973 { 974 setSelect(); 975 } 976 else 977 { 978 resetSelect(); 979 } 980 setDependsOnTrackID(pSource.DependsOnTrackID); 981 982 setRandomAccessDenied(pSource.randomAccessDenied); 983 984 setQoEMetrics(pSource.qoeMetrics); 985 setPreDecBuffSize(pSource.predecbufsize); 986 setInitPreDecBuffPeriod(pSource.initpredecbufperiod); 987 setInitPostDecBuffPeriod(pSource.initpostdecbufperiod); 988 setDecByteRate(pSource.decbyterate); 989 990 setReportFrequency(pSource.reportFrequency); 991 setAssetInfo((pSource.assetInfo)); 992 993 connectionInfo connInf = pSource.connectInfo; 994 setCNetworkType(connInf.connectionNetworkType); 995 setCAddressType(connInf.connectionAddressType); 996 setCAddress(connInf.connectionAddress); 997 998 setCFieldStatus(pSource.c_field_found); 999 1000 SRTPConfigAttrType srtp_config = pSource.SRTPConfigAttr; 1001 setSRTPintg_nonce(srtp_config.intg_nonce); 1002 setSRTPkey_salt(srtp_config.srtp_key_salt); 1003 setSRTPauth_tag_len(srtp_config.auth_tag_len); 1004 setSRTPparam_ext(srtp_config.srtp_param_ext); 1005 mediaTrackId = pSource.mediaTrackId; 1006 alternateTrackId = pSource.alternateTrackId; 1007 dependentTrackId = pSource.dependentTrackId; 1008 rtcp_fb = pSource.rtcp_fb; 1009 setMaxprate(pSource.maxprate); 1010 setSegmentNumber(pSource.segmentNumber); 1011 setPayloadPreference(pSource.payloadPreference); 1012 setMatched(pSource.matched); 1013 setSegmentActive(pSource.segmentActive); 1014 } 1015 return *this; 1016 } 1017 setSampleRateForPayloads(Oscl_Vector<PayloadSpecificInfoTypeBase *,SDPParserAlloc> payloadSpecificInfo)1018 bool setSampleRateForPayloads(Oscl_Vector<PayloadSpecificInfoTypeBase*, SDPParserAlloc> payloadSpecificInfo) 1019 { 1020 if (payloadSpecificInfoVector.size() == payloadSpecificInfo.size()) 1021 { 1022 for (uint32 ii = 0; ii < payloadSpecificInfo.size(); ii++) 1023 { 1024 payloadSpecificInfoVector[ii]->setSampleRate(payloadSpecificInfo[ii]->getSampleRate()); 1025 } 1026 return true; 1027 } 1028 else 1029 return false; 1030 } 1031 setNumOfChannelsForPayloads(Oscl_Vector<PayloadSpecificInfoTypeBase *,SDPParserAlloc> payloadSpecificInfo)1032 bool setNumOfChannelsForPayloads(Oscl_Vector<PayloadSpecificInfoTypeBase*, SDPParserAlloc>payloadSpecificInfo) 1033 { 1034 if (payloadSpecificInfoVector.size() == payloadSpecificInfo.size()) 1035 { 1036 for (uint32 ii = 0; ii < payloadSpecificInfo.size(); ii++) 1037 { 1038 payloadSpecificInfoVector[ii]->setNoOfChannels(payloadSpecificInfo[ii]->getNumberOfChannels()); 1039 } 1040 return true; 1041 } 1042 else 1043 return false; 1044 } 1045 1046 1047 }; 1048 #endif 1049