Commit e45e5e27 authored by Christophe Massiot's avatar Christophe Massiot

* ietf/rtp.h: API CHANGE: Renamed RTP cc to seqnum because that's how it is...

* ietf/rtp.h: API CHANGE: Renamed RTP cc to seqnum because that's how it is actually called in the RFC, and CC is supposed to be something else. Applications have to be changed. * mpeg/ts.h: Add a missing const.
parent 23757cdc
......@@ -2,7 +2,7 @@
CFLAGS = -Wall -O2 -g
LDFLAGS =
OBJ = dvb_print_si dvb_ecmg dvb_ecmg_test mpeg_print_pcr rtp_check_cc
OBJ = dvb_print_si dvb_ecmg dvb_ecmg_test mpeg_print_pcr rtp_check_seqnum
all: $(OBJ)
......
/*****************************************************************************
* rtp_check_cc.c: Prints RTP discontinuities
* rtp_check_seqnum.c: Prints RTP discontinuities
*****************************************************************************
* Copyright (C) 2011 VideoLAN
* $Id: dvb_print_si.c 27 2011-04-10 16:57:59Z massiot $
......@@ -50,7 +50,7 @@ int main(int i_argc, char **ppsz_argv)
usage(ppsz_argv[0]);
uint8_t p_buffer[i_packet_size];
uint16_t i_cc = 0;
uint16_t i_seqnum = 0;
for ( ; ; ) {
ssize_t toto;
......@@ -64,10 +64,10 @@ int main(int i_argc, char **ppsz_argv)
continue;
}
uint16_t i_new_cc = rtp_get_cc(p_buffer);
if (i_new_cc != i_cc)
uint16_t i_new_seqnum = rtp_get_seqnum(p_buffer);
if (i_new_seqnum != i_seqnum)
fprintf(stderr, "received packet %hu while expecting %hu\n",
i_new_cc, i_cc);
i_cc = (i_new_cc + 1) % 65536;
i_new_seqnum, i_seqnum);
i_seqnum = (i_new_seqnum + 1) % 65536;
}
}
......@@ -65,13 +65,13 @@ static inline uint8_t rtp_get_type(const uint8_t *p_rtp)
return p_rtp[1] & 0x7f;
}
static inline void rtp_set_cc(uint8_t *p_rtp, uint16_t i_rtp_cc)
static inline void rtp_set_seqnum(uint8_t *p_rtp, uint16_t i_seqnum)
{
p_rtp[2] = i_rtp_cc >> 8;
p_rtp[3] = i_rtp_cc & 0xff;
p_rtp[2] = i_seqnum >> 8;
p_rtp[3] = i_seqnum & 0xff;
}
static inline uint16_t rtp_get_cc(uint8_t *p_rtp)
static inline uint16_t rtp_get_seqnum(uint8_t *p_rtp)
{
return (p_rtp[2] << 8) | p_rtp[3];
}
......@@ -83,6 +83,7 @@ static inline void rtp_set_timestamp(uint8_t *p_rtp, uint32_t i_timestamp)
p_rtp[6] = (i_timestamp >> 8) & 0xff;
p_rtp[7] = i_timestamp & 0xff;
}
static inline uint32_t rtp_get_timestamp(uint8_t *p_rtp)
{
return (p_rtp[4] << 24) | (p_rtp[5] << 16) | (p_rtp[6] << 8) | p_rtp[7];
......
......@@ -226,7 +226,7 @@ static inline void tsaf_set_pcrext(uint8_t *p_ts, uint16_t i_pcr_ext)
p_ts[11] = i_pcr_ext & 0xff;
}
static inline bool tsaf_has_pcr(uint8_t *p_ts)
static inline bool tsaf_has_pcr(const uint8_t *p_ts)
{
return !!(p_ts[5] & 0x10);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment