Revision e9fce261

View differences:

libavformat/rtp_asf.c
27 27

  
28 28
#include <libavutil/base64.h>
29 29
#include <libavutil/avstring.h>
30
#include "rtp.h"
30 31
#include "rtp_asf.h"
31 32
#include "rtsp.h"
32 33
#include "asf.h"
......
50 51
        rt->asf_ctx->pb = NULL;
51 52
    }
52 53
}
54

  
55
static int
56
asfrtp_parse_sdp_line (AVFormatContext *s, int stream_index,
57
                       PayloadContext *asf, const char *line)
58
{
59
    if (av_strstart(line, "stream:", &line)) {
60
        RTSPState *rt = s->priv_data;
61

  
62
        s->streams[stream_index]->id = strtol(line, NULL, 10);
63

  
64
        if (rt->asf_ctx) {
65
            int i;
66

  
67
            for (i = 0; i < rt->asf_ctx->nb_streams; i++) {
68
                if (s->streams[stream_index]->id == rt->asf_ctx->streams[i]->id) {
69
                    *s->streams[stream_index]->codec =
70
                        *rt->asf_ctx->streams[i]->codec;
71
                    rt->asf_ctx->streams[i]->codec->extradata_size = 0;
72
                    rt->asf_ctx->streams[i]->codec->extradata = NULL;
73
                    av_set_pts_info(s->streams[stream_index], 32, 1, 1000);
74
                }
75
           }
76
        }
77
    }
78

  
79
    return 0;
80
}
81

  
82
#define RTP_ASF_HANDLER(n, s, t) \
83
RTPDynamicProtocolHandler ff_ms_rtp_ ## n ## _handler = { \
84
    s, \
85
    t, \
86
    CODEC_ID_NONE, \
87
    asfrtp_parse_sdp_line, \
88
};
89

  
90
RTP_ASF_HANDLER(asf_pfv, "x-asf-pf",  CODEC_TYPE_VIDEO);
91
RTP_ASF_HANDLER(asf_pfa, "x-asf-pf",  CODEC_TYPE_AUDIO);
libavformat/rtp_asf.h
23 23
#define AVFORMAT_RTP_ASF_H
24 24

  
25 25
#include "avformat.h"
26
#include "rtpdec.h"
26 27

  
27 28
/**
28 29
 * Parse a Windows Media Server-specific SDP line
......
32 33
 */
33 34
void ff_wms_parse_sdp_a_line(AVFormatContext *s, const char *p);
34 35

  
36
/**
37
 * Handlers for the x-asf-pf payloads (the payload ID for RTP/ASF).
38
 * Defined and implemented in rtp_asf.c, registered in rtpdec.c.
39
 */
40
extern RTPDynamicProtocolHandler ff_ms_rtp_asf_pfv_handler,
41
                                 ff_ms_rtp_asf_pfa_handler;
42

  
35 43
#endif /* AVFORMAT_RTP_ASF_H */
libavformat/rtpdec.c
30 30
#include "network.h"
31 31

  
32 32
#include "rtpdec.h"
33
#include "rtp_asf.h"
33 34
#include "rtp_h264.h"
34 35

  
35 36
//#define DEBUG
......
60 61
    ff_register_dynamic_payload_handler(&mp4v_es_handler);
61 62
    ff_register_dynamic_payload_handler(&mpeg4_generic_handler);
62 63
    ff_register_dynamic_payload_handler(&ff_h264_dynamic_handler);
64

  
65
    ff_register_dynamic_payload_handler(&ff_ms_rtp_asf_pfv_handler);
66
    ff_register_dynamic_payload_handler(&ff_ms_rtp_asf_pfa_handler);
63 67
}
64 68

  
65 69
static int rtcp_parse_packet(RTPDemuxContext *s, const unsigned char *buf, int len)

Also available in: Unified diff