mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
refine examples of srs-librtmp, add srs_print_rtmp_packet. 2.0.28.
This commit is contained in:
parent
a058eeeb20
commit
d9474d7600
8 changed files with 284 additions and 101 deletions
|
@ -69,16 +69,15 @@ int main(int argc, char** argv)
|
|||
int size;
|
||||
char type;
|
||||
char* data;
|
||||
u_int32_t timestamp, pts;
|
||||
u_int32_t timestamp;
|
||||
|
||||
if (srs_read_packet(rtmp, &type, ×tamp, &data, &size) != 0) {
|
||||
goto rtmp_destroy;
|
||||
}
|
||||
if (srs_parse_timestamp(timestamp, type, data, size, &pts) != 0) {
|
||||
|
||||
if (srs_print_rtmp_packet(type, timestamp, data, size) != 0) {
|
||||
goto rtmp_destroy;
|
||||
}
|
||||
srs_lib_trace("got packet: type=%s, dts=%d, pts=%d, size=%d",
|
||||
srs_type2string(type), timestamp, pts, size);
|
||||
|
||||
free(data);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue