mirror of https://git.ffmpeg.org/ffmpeg.git
Rename variables in ff_rdt_parse_header() and callers to match the
comment documentation in that function. See discussion on ML in the "[PATCH] RDT/Realmedia patches #2" thread. Originally committed as revision 15825 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
7d0842992a
commit
239dec21ab
|
@ -39,7 +39,7 @@ struct RDTDemuxContext {
|
||||||
AVStream *st;
|
AVStream *st;
|
||||||
void *dynamic_protocol_context;
|
void *dynamic_protocol_context;
|
||||||
DynamicPayloadPacketHandlerProc parse_packet;
|
DynamicPayloadPacketHandlerProc parse_packet;
|
||||||
uint32_t prev_sn, prev_ts;
|
uint32_t prev_set_id, prev_timestamp;
|
||||||
};
|
};
|
||||||
|
|
||||||
RDTDemuxContext *
|
RDTDemuxContext *
|
||||||
|
@ -52,8 +52,8 @@ ff_rdt_parse_open(AVFormatContext *ic, AVStream *st,
|
||||||
|
|
||||||
s->ic = ic;
|
s->ic = ic;
|
||||||
s->st = st;
|
s->st = st;
|
||||||
s->prev_sn = -1;
|
s->prev_set_id = -1;
|
||||||
s->prev_ts = -1;
|
s->prev_timestamp = -1;
|
||||||
s->parse_packet = handler->parse_packet;
|
s->parse_packet = handler->parse_packet;
|
||||||
s->dynamic_protocol_context = priv_data;
|
s->dynamic_protocol_context = priv_data;
|
||||||
|
|
||||||
|
@ -173,7 +173,7 @@ rdt_load_mdpr (PayloadContext *rdt, AVStream *st, int rule_nr)
|
||||||
|
|
||||||
int
|
int
|
||||||
ff_rdt_parse_header(const uint8_t *buf, int len,
|
ff_rdt_parse_header(const uint8_t *buf, int len,
|
||||||
int *sn, int *seq, int *rn, uint32_t *ts)
|
int *set_id, int *seq_no, int *stream_id, uint32_t *timestamp)
|
||||||
{
|
{
|
||||||
int consumed = 10;
|
int consumed = 10;
|
||||||
|
|
||||||
|
@ -235,10 +235,10 @@ ff_rdt_parse_header(const uint8_t *buf, int len,
|
||||||
* [2] http://www.wireshark.org/docs/dfref/r/rdt.html and
|
* [2] http://www.wireshark.org/docs/dfref/r/rdt.html and
|
||||||
* http://anonsvn.wireshark.org/viewvc/trunk/epan/dissectors/packet-rdt.c
|
* http://anonsvn.wireshark.org/viewvc/trunk/epan/dissectors/packet-rdt.c
|
||||||
*/
|
*/
|
||||||
if (sn) *sn = (buf[0]>>1) & 0x1f;
|
if (set_id) *set_id = (buf[0]>>1) & 0x1f;
|
||||||
if (seq) *seq = AV_RB16(buf+1);
|
if (seq_no) *seq_no = AV_RB16(buf+1);
|
||||||
if (ts) *ts = AV_RB32(buf+4);
|
if (timestamp) *timestamp = AV_RB32(buf+4);
|
||||||
if (rn) *rn = buf[3] & 0x3f;
|
if (stream_id) *stream_id = buf[3] & 0x3f;
|
||||||
|
|
||||||
return consumed;
|
return consumed;
|
||||||
}
|
}
|
||||||
|
@ -287,7 +287,7 @@ int
|
||||||
ff_rdt_parse_packet(RDTDemuxContext *s, AVPacket *pkt,
|
ff_rdt_parse_packet(RDTDemuxContext *s, AVPacket *pkt,
|
||||||
const uint8_t *buf, int len)
|
const uint8_t *buf, int len)
|
||||||
{
|
{
|
||||||
int seq, flags = 0, rule, sn;
|
int seq_no, flags = 0, stream_id, set_id;
|
||||||
uint32_t timestamp;
|
uint32_t timestamp;
|
||||||
int rv= 0;
|
int rv= 0;
|
||||||
|
|
||||||
|
@ -304,13 +304,13 @@ ff_rdt_parse_packet(RDTDemuxContext *s, AVPacket *pkt,
|
||||||
|
|
||||||
if (len < 12)
|
if (len < 12)
|
||||||
return -1;
|
return -1;
|
||||||
rv = ff_rdt_parse_header(buf, len, &sn, &seq, &rule, ×tamp);
|
rv = ff_rdt_parse_header(buf, len, &set_id, &seq_no, &stream_id, ×tamp);
|
||||||
if (rv < 0)
|
if (rv < 0)
|
||||||
return rv;
|
return rv;
|
||||||
if (!(rule & 1) && (sn != s->prev_sn || timestamp != s->prev_ts)) {
|
if (!(stream_id & 1) && (set_id != s->prev_set_id || timestamp != s->prev_timestamp)) {
|
||||||
flags |= PKT_FLAG_KEY;
|
flags |= PKT_FLAG_KEY;
|
||||||
s->prev_sn = sn;
|
s->prev_set_id = set_id;
|
||||||
s->prev_ts = timestamp;
|
s->prev_timestamp = timestamp;
|
||||||
}
|
}
|
||||||
buf += rv;
|
buf += rv;
|
||||||
len -= rv;
|
len -= rv;
|
||||||
|
|
|
@ -72,14 +72,14 @@ void ff_rdt_subscribe_rule2(RDTDemuxContext *s, char *cmd, int size,
|
||||||
*
|
*
|
||||||
* @param buf input buffer
|
* @param buf input buffer
|
||||||
* @param len length of input buffer
|
* @param len length of input buffer
|
||||||
* @param sn will be set to the stream number this packet belongs to
|
* @param set_id will be set to the set ID this packet belongs to
|
||||||
* @param seq will be set to the sequence number this packet belongs to
|
* @param seq_no will be set to the sequence number this packet belongs to
|
||||||
* @param rn will be set to the rule number this packet belongs to
|
* @param stream_id will be set to the stream ID this packet belongs to
|
||||||
* @param ts will be set to the timestamp of the packet
|
* @param timestamp will be set to the timestamp of the packet
|
||||||
* @return the amount of bytes consumed, or <0 on error
|
* @return the amount of bytes consumed, or <0 on error
|
||||||
*/
|
*/
|
||||||
int ff_rdt_parse_header(const uint8_t *buf, int len,
|
int ff_rdt_parse_header(const uint8_t *buf, int len,
|
||||||
int *sn, int *seq, int *rn, uint32_t *ts);
|
int *set_id, int *seq_no, int *stream_id, uint32_t *timestamp);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parse RDT-style packet data (header + media data).
|
* Parse RDT-style packet data (header + media data).
|
||||||
|
|
Loading…
Reference in New Issue