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
7272 case CODEC_ID_THEORA:
7373 case CODEC_ID_VP8:
7474 case CODEC_ID_ADPCM_G722:
75+ case CODEC_ID_ADPCM_G726:
7576 return 1;
7677 default:
7778 return 0;
@@ -411,6 +412,10 @@ static int rtp_write_packet(AVFormatContext *s1, AVPacket *pkt) · 333 unmodified lines
411412 * clock. */
412413 rtp_send_samples(s1, pkt->data, size, 8 * st->codec->channels);
413414 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;
414419 case CODEC_ID_MP2:
415420 case CODEC_ID_MP3:
416421 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
517517 payload_type,
518518 8000, c->channels);
519519 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+ }
520528 default:
521529 /* Nothing special to do here... */
522530 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