Changeset 69c6803c9cdf2232a76903722a542e26146e7d51

Show
Ignore:
Timestamp:
03/06/08 23:06:27 (6 months ago)
Author:
Rémi Denis-Courmont <rdenis@simphalempin.com>
git-committer:
Rémi Denis-Courmont <rdenis@simphalempin.com> 1212527187 +0300
git-parent:

[7e42e3223bf8b5bb8baa8477b3636cec3dcbb72a]

git-author:
Rémi Denis-Courmont <rdenis@simphalempin.com> 1212527187 +0300
Message:

RTP: support for G.711

Note that it seems to suck badly, but as I get the same awful results
with RTSP+live555, I have to assume eitehr the whole synchro is broken
or the stream output is

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/demux/rtp.c

    r7e42e32 r69c6803  
    323323 */ 
    324324 
     325/* PT=0 
     326 * PCMU: 
     327 */ 
     328static void *pcmu_init (demux_t *demux) 
     329{ 
     330    es_format_t fmt; 
     331 
     332    es_format_Init (&fmt, AUDIO_ES, VLC_FOURCC ('u', 'l', 'a', 'w')); 
     333    fmt.audio.i_rate = 8000; 
     334    fmt.audio.i_channels = 1; 
     335    return codec_init (demux, &fmt); 
     336} 
     337 
     338/* PT=8 
     339 * PCMA: 
     340 */ 
     341static void *pcma_init (demux_t *demux) 
     342{ 
     343    es_format_t fmt; 
     344 
     345    es_format_Init (&fmt, AUDIO_ES, VLC_FOURCC ('a', 'l', 'a', 'w')); 
     346    fmt.audio.i_rate = 8000; 
     347    fmt.audio.i_channels = 1; 
     348    return codec_init (demux, &fmt); 
     349} 
     350 
    325351/* PT=14 
    326352 * MPA: MPEG Audio (RFC2250, §3.4) 
     
    420446            switch (pt.number) 
    421447            { 
     448              case 0: 
     449                msg_Dbg (demux, "detected G.711 mu-law"); 
     450                pt.init = pcmu_init; 
     451                pt.frequency = 8000; 
     452                break; 
     453 
     454              case 8: 
     455                msg_Dbg (demux, "detected G.711 A-law"); 
     456                pt.init = pcma_init; 
     457                pt.frequency = 8000; 
     458                break; 
     459 
    422460              case 14: 
    423                 msg_Dbg (demux, "detected MPEG Audio over RTP"); 
     461                msg_Dbg (demux, "detected MPEG Audio"); 
    424462                pt.init = mpa_init; 
    425463                pt.decode = mpa_decode; 
     
    428466 
    429467              case 32: 
    430                 msg_Dbg (demux, "detected MPEG Video over RTP"); 
     468                msg_Dbg (demux, "detected MPEG Video"); 
    431469                pt.init = mpv_init; 
    432470                pt.decode = mpv_decode; 
     
    435473 
    436474              case 33: 
    437                 msg_Dbg (demux, "detected MPEG2 TS over RTP"); 
     475                msg_Dbg (demux, "detected MPEG2 TS"); 
    438476                pt.init = ts_init; 
    439477                pt.destroy = stream_destroy;