Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
bitstream
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
bitstream
Commits
6610d824
Commit
6610d824
authored
Aug 05, 2011
by
Christophe Massiot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* examples/rtp_check_cc.c: New example to check the RTP counter.
parent
7114114e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
74 additions
and
1 deletion
+74
-1
examples/Makefile
examples/Makefile
+1
-1
examples/rtp_check_cc.c
examples/rtp_check_cc.c
+73
-0
No files found.
examples/Makefile
View file @
6610d824
...
...
@@ -2,7 +2,7 @@
CFLAGS
=
-Wall
-O2
-g
LDFLAGS
=
OBJ
=
dvb_print_si dvb_ecmg dvb_ecmg_test mpeg_print_pcr
OBJ
=
dvb_print_si dvb_ecmg dvb_ecmg_test mpeg_print_pcr
rtp_check_cc
all
:
$(OBJ)
...
...
examples/rtp_check_cc.c
0 → 100644
View file @
6610d824
/*****************************************************************************
* rtp_check_cc.c: Prints RTP discontinuities
*****************************************************************************
* Copyright (C) 2011 VideoLAN
* $Id: dvb_print_si.c 27 2011-04-10 16:57:59Z massiot $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
* This program is free software. It comes without any warranty, to
* the extent permitted by applicable law. You can redistribute it
* and/or modify it under the terms of the Do What The Fuck You Want
* To Public License, Version 2, as published by Sam Hocevar. See
* http://sam.zoy.org/wtfpl/COPYING for more details.
*****************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
#include <unistd.h>
#include <string.h>
#include <bitstream/ietf/rtp.h>
/*****************************************************************************
* Local declarations
*****************************************************************************/
#define DEFAULT_PACKET_SIZE 1328
/*****************************************************************************
* Main loop
*****************************************************************************/
static
void
usage
(
const
char
*
psz
)
{
fprintf
(
stderr
,
"usage: multicat -u -m <packet size> @<addr>:<port> | %s [<packet size>]
\n
"
,
psz
);
exit
(
EXIT_FAILURE
);
}
int
main
(
int
i_argc
,
char
**
ppsz_argv
)
{
int
i_packet_size
=
DEFAULT_PACKET_SIZE
;
if
(
ppsz_argv
[
1
]
!=
NULL
&&
(
!
strcmp
(
ppsz_argv
[
1
],
"-h"
)
||
!
strcmp
(
ppsz_argv
[
1
],
"--help"
)))
usage
(
ppsz_argv
[
0
]);
if
(
ppsz_argv
[
1
]
!=
NULL
)
i_packet_size
=
atoi
(
ppsz_argv
[
1
]);
if
(
i_packet_size
>
65535
||
i_packet_size
<
RTP_HEADER_SIZE
)
usage
(
ppsz_argv
[
0
]);
uint8_t
p_buffer
[
i_packet_size
];
uint16_t
i_cc
=
0
;
for
(
;
;
)
{
ssize_t
toto
;
if
((
toto
=
read
(
STDIN_FILENO
,
p_buffer
,
i_packet_size
))
!=
i_packet_size
)
{
fprintf
(
stderr
,
"couldn't read %zd
\n
"
,
toto
);
exit
(
EXIT_FAILURE
);
}
if
(
!
rtp_check_hdr
(
p_buffer
))
{
fprintf
(
stderr
,
"invalid RTP header
\n
"
);
continue
;
}
uint16_t
i_new_cc
=
rtp_get_cc
(
p_buffer
);
if
(
i_new_cc
!=
i_cc
)
fprintf
(
stderr
,
"received packet %hu while expecting %hu
\n
"
,
i_new_cc
,
i_cc
);
i_cc
=
(
i_new_cc
+
1
)
%
65536
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment