| 639 | } |
| 640 | |
| 641 | void codecsToSdp(CodecSet codecs, string *codeclist, string *attrs) |
| 642 | { |
| 643 | attrs->clear(); |
| 644 | attrs->reserve(80); |
| 645 | codeclist->reserve(20); |
| 646 | // We are using the same code for offers and answers, so for now only included the one we want: |
| 647 | /** |
| 648 | if (codecs.isSet(PCMULAW)) { |
| 649 | attrs->append("a=rtpmap:0 PCMU/8000\r\n"); |
| 650 | if (!codeclist->empty()) { codeclist->append(" "); } |
| 651 | codeclist->append("0"); |
| 652 | } |
| 653 | ***/ |
| 654 | if (codecs.isSet(GSM_FR) || codecs.isSet(GSM_HR) || codecs.isEmpty()) { |
| 655 | attrs->append("a=rtpmap:3 GSM/8000\r\n"); |
| 656 | if (!codeclist->empty()) { codeclist->append(" "); } |
| 657 | codeclist->append("3"); |
| 658 | } |
| 659 | // TODO: Does the half-rate codec need a special RTP format is conversion performed lower down? |
| 660 | // RFC5993 7.1 says it is "a=rtpmap:<dynamic-port-number. GSM-HR-08/8000" |
| 661 | /** |
| 662 | if (codecs.isSet(AMR_FR) || codecs.isSet(AMR_HR)) { |
| 663 | // Dynamically allocated SDP starts at 96. |
| 664 | attrs->append("a=rtpmap:96 AMR/8000\r\n"); |
| 665 | if (!codeclist->empty()) { codeclist->append(" "); } |
| 666 | codeclist->append("96"); |
| 667 | } |
| 668 | **/ |
| 669 | } |
| 670 | |
| 671 | |
| 672 | // We dont fully parse it; just pull out the o,m,c,a lines. |
no test coverage detected