Mercurial > libavformat.hg
annotate rtpenc.h @ 6491:b7f807b4cd88 libavformat tip
In mov demuxer, check that nb_streams is valid before using it in read_dac3
| author | bcoudurier |
|---|---|
| date | Tue, 28 Sep 2010 00:33:21 +0000 |
| parents | 0bcd6a8bc5d5 |
| children |
| rev | line source |
|---|---|
| 0 | 1 /* |
| 4388 | 2 * RTP muxer definitions |
|
4251
77e0c7511d41
cosmetics: Remove pointless period after copyright statement non-sentences.
diego
parents:
4101
diff
changeset
|
3 * Copyright (c) 2002 Fabrice Bellard |
| 0 | 4 * |
|
1358
0899bfe4105c
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
1167
diff
changeset
|
5 * This file is part of FFmpeg. |
|
0899bfe4105c
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
1167
diff
changeset
|
6 * |
|
0899bfe4105c
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
1167
diff
changeset
|
7 * FFmpeg is free software; you can redistribute it and/or |
| 0 | 8 * modify it under the terms of the GNU Lesser General Public |
| 9 * License as published by the Free Software Foundation; either | |
|
1358
0899bfe4105c
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
1167
diff
changeset
|
10 * version 2.1 of the License, or (at your option) any later version. |
| 0 | 11 * |
|
1358
0899bfe4105c
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
1167
diff
changeset
|
12 * FFmpeg is distributed in the hope that it will be useful, |
| 0 | 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 15 * Lesser General Public License for more details. | |
| 16 * | |
| 17 * You should have received a copy of the GNU Lesser General Public | |
|
1358
0899bfe4105c
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
1167
diff
changeset
|
18 * License along with FFmpeg; if not, write to the Free Software |
|
896
edbe5c3717f9
Update licensing information: The FSF changed postal address.
diego
parents:
885
diff
changeset
|
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 0 | 20 */ |
| 4388 | 21 #ifndef AVFORMAT_RTPENC_H |
| 22 #define AVFORMAT_RTPENC_H | |
| 4100 | 23 |
| 4388 | 24 #include "avformat.h" |
| 25 #include "rtp.h" | |
|
4291
f49e5d92ab26
Merge rtp_internal.h in rtp.h, and remove rtp_internal.h
lucabe
parents:
4251
diff
changeset
|
26 |
| 4388 | 27 struct RTPMuxContext { |
|
4291
f49e5d92ab26
Merge rtp_internal.h in rtp.h, and remove rtp_internal.h
lucabe
parents:
4251
diff
changeset
|
28 AVFormatContext *ic; |
|
f49e5d92ab26
Merge rtp_internal.h in rtp.h, and remove rtp_internal.h
lucabe
parents:
4251
diff
changeset
|
29 AVStream *st; |
|
f49e5d92ab26
Merge rtp_internal.h in rtp.h, and remove rtp_internal.h
lucabe
parents:
4251
diff
changeset
|
30 int payload_type; |
|
f49e5d92ab26
Merge rtp_internal.h in rtp.h, and remove rtp_internal.h
lucabe
parents:
4251
diff
changeset
|
31 uint32_t ssrc; |
|
f49e5d92ab26
Merge rtp_internal.h in rtp.h, and remove rtp_internal.h
lucabe
parents:
4251
diff
changeset
|
32 uint16_t seq; |
|
f49e5d92ab26
Merge rtp_internal.h in rtp.h, and remove rtp_internal.h
lucabe
parents:
4251
diff
changeset
|
33 uint32_t timestamp; |
|
f49e5d92ab26
Merge rtp_internal.h in rtp.h, and remove rtp_internal.h
lucabe
parents:
4251
diff
changeset
|
34 uint32_t base_timestamp; |
|
f49e5d92ab26
Merge rtp_internal.h in rtp.h, and remove rtp_internal.h
lucabe
parents:
4251
diff
changeset
|
35 uint32_t cur_timestamp; |
|
f49e5d92ab26
Merge rtp_internal.h in rtp.h, and remove rtp_internal.h
lucabe
parents:
4251
diff
changeset
|
36 int max_payload_size; |
|
4380
1b695f013cd3
Introduce a new num_frames field in RTPDemuxContext so that rtp_aac.c
lucabe
parents:
4291
diff
changeset
|
37 int num_frames; |
|
4291
f49e5d92ab26
Merge rtp_internal.h in rtp.h, and remove rtp_internal.h
lucabe
parents:
4251
diff
changeset
|
38 |
|
f49e5d92ab26
Merge rtp_internal.h in rtp.h, and remove rtp_internal.h
lucabe
parents:
4251
diff
changeset
|
39 /* rtcp sender statistics receive */ |
|
f49e5d92ab26
Merge rtp_internal.h in rtp.h, and remove rtp_internal.h
lucabe
parents:
4251
diff
changeset
|
40 int64_t last_rtcp_ntp_time; // TODO: move into statistics |
|
f49e5d92ab26
Merge rtp_internal.h in rtp.h, and remove rtp_internal.h
lucabe
parents:
4251
diff
changeset
|
41 int64_t first_rtcp_ntp_time; // TODO: move into statistics |
|
f49e5d92ab26
Merge rtp_internal.h in rtp.h, and remove rtp_internal.h
lucabe
parents:
4251
diff
changeset
|
42 |
|
f49e5d92ab26
Merge rtp_internal.h in rtp.h, and remove rtp_internal.h
lucabe
parents:
4251
diff
changeset
|
43 /* rtcp sender statistics */ |
|
f49e5d92ab26
Merge rtp_internal.h in rtp.h, and remove rtp_internal.h
lucabe
parents:
4251
diff
changeset
|
44 unsigned int packet_count; // TODO: move into statistics (outgoing) |
|
f49e5d92ab26
Merge rtp_internal.h in rtp.h, and remove rtp_internal.h
lucabe
parents:
4251
diff
changeset
|
45 unsigned int octet_count; // TODO: move into statistics (outgoing) |
|
f49e5d92ab26
Merge rtp_internal.h in rtp.h, and remove rtp_internal.h
lucabe
parents:
4251
diff
changeset
|
46 unsigned int last_octet_count; // TODO: move into statistics (outgoing) |
|
f49e5d92ab26
Merge rtp_internal.h in rtp.h, and remove rtp_internal.h
lucabe
parents:
4251
diff
changeset
|
47 int first_packet; |
|
f49e5d92ab26
Merge rtp_internal.h in rtp.h, and remove rtp_internal.h
lucabe
parents:
4251
diff
changeset
|
48 /* buffer for output */ |
| 4391 | 49 uint8_t *buf; |
|
4291
f49e5d92ab26
Merge rtp_internal.h in rtp.h, and remove rtp_internal.h
lucabe
parents:
4251
diff
changeset
|
50 uint8_t *buf_ptr; |
|
f49e5d92ab26
Merge rtp_internal.h in rtp.h, and remove rtp_internal.h
lucabe
parents:
4251
diff
changeset
|
51 |
|
f49e5d92ab26
Merge rtp_internal.h in rtp.h, and remove rtp_internal.h
lucabe
parents:
4251
diff
changeset
|
52 int max_frames_per_packet; |
|
6136
6c0e0ad77315
If the video stream is H.264 with MP4 syntax, store the NAL lenght size in
lucabe
parents:
4836
diff
changeset
|
53 |
|
6c0e0ad77315
If the video stream is H.264 with MP4 syntax, store the NAL lenght size in
lucabe
parents:
4836
diff
changeset
|
54 /** |
|
6c0e0ad77315
If the video stream is H.264 with MP4 syntax, store the NAL lenght size in
lucabe
parents:
4836
diff
changeset
|
55 * Number of bytes used for H.264 NAL length, if the MP4 syntax is used |
|
6c0e0ad77315
If the video stream is H.264 with MP4 syntax, store the NAL lenght size in
lucabe
parents:
4836
diff
changeset
|
56 * (1, 2 or 4) |
|
6c0e0ad77315
If the video stream is H.264 with MP4 syntax, store the NAL lenght size in
lucabe
parents:
4836
diff
changeset
|
57 */ |
|
6c0e0ad77315
If the video stream is H.264 with MP4 syntax, store the NAL lenght size in
lucabe
parents:
4836
diff
changeset
|
58 int nal_length_size; |
|
4291
f49e5d92ab26
Merge rtp_internal.h in rtp.h, and remove rtp_internal.h
lucabe
parents:
4251
diff
changeset
|
59 }; |
|
f49e5d92ab26
Merge rtp_internal.h in rtp.h, and remove rtp_internal.h
lucabe
parents:
4251
diff
changeset
|
60 |
| 4388 | 61 typedef struct RTPMuxContext RTPMuxContext; |
|
4291
f49e5d92ab26
Merge rtp_internal.h in rtp.h, and remove rtp_internal.h
lucabe
parents:
4251
diff
changeset
|
62 |
|
f49e5d92ab26
Merge rtp_internal.h in rtp.h, and remove rtp_internal.h
lucabe
parents:
4251
diff
changeset
|
63 void ff_rtp_send_data(AVFormatContext *s1, const uint8_t *buf1, int len, int m); |
|
f49e5d92ab26
Merge rtp_internal.h in rtp.h, and remove rtp_internal.h
lucabe
parents:
4251
diff
changeset
|
64 |
| 4388 | 65 void ff_rtp_send_h264(AVFormatContext *s1, const uint8_t *buf1, int size); |
| 4814 | 66 void ff_rtp_send_h263(AVFormatContext *s1, const uint8_t *buf1, int size); |
| 4389 | 67 void ff_rtp_send_aac(AVFormatContext *s1, const uint8_t *buff, int size); |
| 4836 | 68 void ff_rtp_send_amr(AVFormatContext *s1, const uint8_t *buff, int size); |
| 4389 | 69 void ff_rtp_send_mpegvideo(AVFormatContext *s1, const uint8_t *buf1, int size); |
| 6349 | 70 void ff_rtp_send_xiph(AVFormatContext *s1, const uint8_t *buff, int size); |
| 6379 | 71 void ff_rtp_send_vp8(AVFormatContext *s1, const uint8_t *buff, int size); |
|
4291
f49e5d92ab26
Merge rtp_internal.h in rtp.h, and remove rtp_internal.h
lucabe
parents:
4251
diff
changeset
|
72 |
| 4388 | 73 #endif /* AVFORMAT_RTPENC_H */ |
