History

rtpenc: Add support for G726 audio

Martin Storsjö committed 14 years ago

Commit 04403ec1 parent fa6dce42 files · +13 −0Browse files

Unified · Split

2 files
  1. libavformat/rtpenc.c +5 −0
  2. libavformat/sdp.c +8 −0
libavformat/rtpenc.c+5−0
@@ -72,6 +72,7 @@ static int is_supported(enum CodecID id) · 71 unmodified lines
72 case CODEC_ID_THEORA:72 case CODEC_ID_THEORA:
73 case CODEC_ID_VP8:73 case CODEC_ID_VP8:
74 case CODEC_ID_ADPCM_G722:74 case CODEC_ID_ADPCM_G722:
75 case CODEC_ID_ADPCM_G726:
75 return 1;76 return 1;
76 default:77 default:
77 return 0;78 return 0;
@@ -411,6 +412,10 @@ static int rtp_write_packet(AVFormatContext *s1, AVPacket *pkt) · 333 unmodified lines
411 * clock. */412 * clock. */
412 rtp_send_samples(s1, pkt->data, size, 8 * st->codec->channels);413 rtp_send_samples(s1, pkt->data, size, 8 * st->codec->channels);
413 break;414 break;
415 case CODEC_ID_ADPCM_G726:
416 rtp_send_samples(s1, pkt->data, size,
417 st->codec->bits_per_coded_sample * st->codec->channels);
418 break;
414 case CODEC_ID_MP2:419 case CODEC_ID_MP2:
415 case CODEC_ID_MP3:420 case CODEC_ID_MP3:
416 rtp_send_mpegaudio(s1, pkt->data, size);421 rtp_send_mpegaudio(s1, pkt->data, size);
libavformat/sdp.c+8−0
@@ -517,6 +517,14 @@ static char *sdp_write_media_attributes(char *buff, int size, AVCodecContext *c, · 516 unmodified lines
517 payload_type,517 payload_type,
518 8000, c->channels);518 8000, c->channels);
519 break;519 break;
520 case CODEC_ID_ADPCM_G726: {
521 if (payload_type >= RTP_PT_PRIVATE)
522 av_strlcatf(buff, size, "a=rtpmap:%d G726-%d/%d\r\n",
523 payload_type,
524 c->bits_per_coded_sample*8,
525 c->sample_rate);
526 break;
527 }
520 default:528 default:
521 /* Nothing special to do here... */529 /* Nothing special to do here... */
522 break;530 break;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t