Mercurial > libavformat.hg
comparison rtp_mpv.c @ 2419:584898b8189e libavformat
Set the "TR" field in the payload header
author | lucabe |
---|---|
date | Mon, 03 Sep 2007 07:22:37 +0000 |
parents | c13c82994800 |
children | 4ca7ed628eff |
comparison
equal
deleted
inserted
replaced
2418:c13c82994800 | 2419:584898b8189e |
---|---|
29 { | 29 { |
30 RTPDemuxContext *s = s1->priv_data; | 30 RTPDemuxContext *s = s1->priv_data; |
31 AVStream *st = s1->streams[0]; | 31 AVStream *st = s1->streams[0]; |
32 int len, h, max_packet_size; | 32 int len, h, max_packet_size; |
33 uint8_t *q; | 33 uint8_t *q; |
34 int begin_of_slice, end_of_slice, frame_type; | 34 int begin_of_slice, end_of_slice, frame_type, temporal_reference; |
35 | 35 |
36 max_packet_size = s->max_payload_size; | 36 max_packet_size = s->max_payload_size; |
37 begin_of_slice = 1; | 37 begin_of_slice = 1; |
38 end_of_slice = 0; | 38 end_of_slice = 0; |
39 frame_type = 0; | 39 frame_type = 0; |
40 temporal_reference = 0; | |
40 | 41 |
41 while (size > 0) { | 42 while (size > 0) { |
42 len = max_packet_size - 4; | 43 len = max_packet_size - 4; |
43 | 44 |
44 if (len >= size) { | 45 if (len >= size) { |
54 r = ff_find_start_code(r1, buf1 + size, &start_code); | 55 r = ff_find_start_code(r1, buf1 + size, &start_code); |
55 if((start_code & 0xFFFFFF00) == 0x100) { | 56 if((start_code & 0xFFFFFF00) == 0x100) { |
56 /* New start code found */ | 57 /* New start code found */ |
57 if (start_code == 0x100) { | 58 if (start_code == 0x100) { |
58 frame_type = (r[1] & 0x38) >> 3; | 59 frame_type = (r[1] & 0x38) >> 3; |
60 temporal_reference = (int)r[0] << 2 | r[1] >> 6; | |
59 } | 61 } |
60 | 62 |
61 if (r - buf1 < len) { | 63 if (r - buf1 < len) { |
62 /* The current slice fits in the packet */ | 64 /* The current slice fits in the packet */ |
63 if (begin_of_slice == 0) { | 65 if (begin_of_slice == 0) { |
79 } | 81 } |
80 } | 82 } |
81 } | 83 } |
82 | 84 |
83 h = 0; | 85 h = 0; |
86 h |= temporal_reference << 16; | |
84 h |= begin_of_slice << 12; | 87 h |= begin_of_slice << 12; |
85 h |= end_of_slice << 11; | 88 h |= end_of_slice << 11; |
86 h |= frame_type << 8; | 89 h |= frame_type << 8; |
87 | 90 |
88 q = s->buf; | 91 q = s->buf; |