~siretart/ubuntu/utopic/libav/libav10

« back to all changes in this revision

Viewing changes to libavformat/rtpdec.h

  • Committer: Package Import Robot
  • Author(s): Reinhard Tartler
  • Date: 2014-05-11 12:28:45 UTC
  • mfrom: (1.1.22) (2.1.38 experimental)
  • Revision ID: package-import@ubuntu.com-20140511122845-gxvpts83i958y0i5
Tags: 6:10.1-1
* New upstream release 10:
   - pcm-dvd: Fix 20bit decoding (bug/592)
   - avi: Improve non-interleaved detection (bug/666)
   - arm: hpeldsp: fix put_pixels8_y2_{,no_rnd_}armv6
   - arm: hpeldsp: prevent overreads in armv6 asm (bug/646)
   - avfilter: Add missing emms_c when needed
   - rtmpproto: Check the buffer sizes when copying app/playpath strings
   - swscale: Fix an undefined behaviour
   - vp9: Read the frame size as unsigned
   - dcadec: Use correct channel count in stereo downmix check
   - dcadec: Do not decode the XCh extension when downmixing to stereo
   - matroska: add the Opus mapping
   - matroskadec: read the CodecDelay element
   - rtmpproto: Make sure to pass on the error code if read_connect failed
   - lavr: allocate the resampling buffer with a positive size
   - mp3enc: Properly write bitrate value in XING header (Closes: #736088)
   - golomb: Fix the implementation of get_se_golomb_long
* Drop debian/libav-tools.maintscript. ffserver is no longer found in
  stable, and this seems to cause other problems today (Closes: #742676)

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
#include "avformat.h"
28
28
#include "rtp.h"
29
29
#include "url.h"
 
30
#include "srtp.h"
30
31
 
31
32
typedef struct PayloadContext PayloadContext;
32
33
typedef struct RTPDynamicProtocolHandler RTPDynamicProtocolHandler;
33
34
 
34
35
#define RTP_MIN_PACKET_LENGTH 12
35
 
#define RTP_MAX_PACKET_LENGTH 1500
 
36
#define RTP_MAX_PACKET_LENGTH 8192
36
37
 
37
38
#define RTP_REORDER_QUEUE_DEFAULT_SIZE 10
38
39
 
43
44
                                   int payload_type, int queue_size);
44
45
void ff_rtp_parse_set_dynamic_protocol(RTPDemuxContext *s, PayloadContext *ctx,
45
46
                                       RTPDynamicProtocolHandler *handler);
 
47
void ff_rtp_parse_set_crypto(RTPDemuxContext *s, const char *suite,
 
48
                             const char *params);
46
49
int ff_rtp_parse_packet(RTPDemuxContext *s, AVPacket *pkt,
47
50
                        uint8_t **buf, int len);
48
51
void ff_rtp_parse_close(RTPDemuxContext *s);
49
52
int64_t ff_rtp_queued_packet_time(RTPDemuxContext *s);
50
53
void ff_rtp_reset_packet_queue(RTPDemuxContext *s);
51
 
int ff_rtp_get_local_rtp_port(URLContext *h);
52
 
int ff_rtp_get_local_rtcp_port(URLContext *h);
53
 
 
54
 
int ff_rtp_set_remote_url(URLContext *h, const char *uri);
55
54
 
56
55
/**
57
56
 * Send a dummy packet on both port pairs to set up the connection
73
72
 */
74
73
int ff_rtp_check_and_send_back_rr(RTPDemuxContext *s, URLContext *fd,
75
74
                                  AVIOContext *avio, int count);
 
75
int ff_rtp_send_rtcp_feedback(RTPDemuxContext *s, URLContext *fd,
 
76
                              AVIOContext *avio);
76
77
 
77
78
// these statistics are used for rtcp receiver reports...
78
79
typedef struct RTPStatistics {
81
82
    uint32_t base_seq;          ///< base sequence number
82
83
    uint32_t bad_seq;           ///< last bad sequence number + 1
83
84
    int probation;              ///< sequence packets till source is valid
84
 
    int received;               ///< packets received
85
 
    int expected_prior;         ///< packets expected in last interval
86
 
    int received_prior;         ///< packets received in last interval
 
85
    uint32_t received;          ///< packets received
 
86
    uint32_t expected_prior;    ///< packets expected in last interval
 
87
    uint32_t received_prior;    ///< packets received in last interval
87
88
    uint32_t transit;           ///< relative transit time for previous packet
88
89
    uint32_t jitter;            ///< estimated jitter.
89
90
} RTPStatistics;
130
131
    void (*free)(PayloadContext *protocol_data);
131
132
    /** Parse handler for this dynamic packet */
132
133
    DynamicPayloadPacketHandlerProc parse_packet;
 
134
    int (*need_keyframe)(PayloadContext *context);
133
135
 
134
136
    struct RTPDynamicProtocolHandler *next;
135
137
};
154
156
    int64_t  unwrapped_timestamp;
155
157
    int64_t  range_start_offset;
156
158
    int max_payload_size;
157
 
    struct MpegTSContext *ts;   /* only used for MP2T payloads */
158
 
    int read_buf_index;
159
 
    int read_buf_size;
160
159
    /* used to send back RTCP RR */
161
160
    char hostname[256];
162
161
 
 
162
    int srtp_enabled;
 
163
    struct SRTPContext srtp;
 
164
 
163
165
    /** Statistics for this stream (used by RTCP receiver reports) */
164
166
    RTPStatistics statistics;
165
167
 
172
174
 
173
175
    /* rtcp sender statistics receive */
174
176
    int64_t last_rtcp_ntp_time;
 
177
    int64_t last_rtcp_reception_time;
175
178
    int64_t first_rtcp_ntp_time;
176
179
    uint32_t last_rtcp_timestamp;
177
180
    int64_t rtcp_ts_offset;
180
183
    unsigned int packet_count;
181
184
    unsigned int octet_count;
182
185
    unsigned int last_octet_count;
183
 
    /* buffer for partially parsed packets */
184
 
    uint8_t buf[RTP_MAX_PACKET_LENGTH];
 
186
    int64_t last_feedback_time;
185
187
 
186
188
    /* dynamic payload stuff */
187
 
    DynamicPayloadPacketHandlerProc parse_packet;
 
189
    const RTPDynamicProtocolHandler *handler;
188
190
    PayloadContext *dynamic_protocol_context;
189
191
};
190
192
 
203
205
                                    PayloadContext *data,
204
206
                                    char *attr, char *value));
205
207
 
206
 
void av_register_rtp_dynamic_payload_handlers(void);
 
208
void ff_register_rtp_dynamic_payload_handlers(void);
207
209
 
208
210
/**
209
211
 * Close the dynamic buffer and make a packet from it.