Mercurial > libavformat.hg
annotate rdt.h @ 4044:5d5238798d59 libavformat
decrease atom size, fix broken files missing version/flags
author | bcoudurier |
---|---|
date | Tue, 18 Nov 2008 09:09:57 +0000 |
parents | cd5a6a766b14 |
children | 7bc64c735f8b |
rev | line source |
---|---|
3876
1026953d4ffe
Implement Realmedia/RTSP-compatible SETUP command. This includes calculation
rbultje
parents:
diff
changeset
|
1 /* |
1026953d4ffe
Implement Realmedia/RTSP-compatible SETUP command. This includes calculation
rbultje
parents:
diff
changeset
|
2 * Realmedia RTSP (RDT) definitions |
1026953d4ffe
Implement Realmedia/RTSP-compatible SETUP command. This includes calculation
rbultje
parents:
diff
changeset
|
3 * Copyright (c) 2007 Ronald S. Bultje <rbultje@ronald.bitfreak.net> |
1026953d4ffe
Implement Realmedia/RTSP-compatible SETUP command. This includes calculation
rbultje
parents:
diff
changeset
|
4 * |
1026953d4ffe
Implement Realmedia/RTSP-compatible SETUP command. This includes calculation
rbultje
parents:
diff
changeset
|
5 * This file is part of FFmpeg. |
1026953d4ffe
Implement Realmedia/RTSP-compatible SETUP command. This includes calculation
rbultje
parents:
diff
changeset
|
6 * |
1026953d4ffe
Implement Realmedia/RTSP-compatible SETUP command. This includes calculation
rbultje
parents:
diff
changeset
|
7 * FFmpeg is free software; you can redistribute it and/or |
1026953d4ffe
Implement Realmedia/RTSP-compatible SETUP command. This includes calculation
rbultje
parents:
diff
changeset
|
8 * modify it under the terms of the GNU Lesser General Public |
1026953d4ffe
Implement Realmedia/RTSP-compatible SETUP command. This includes calculation
rbultje
parents:
diff
changeset
|
9 * License as published by the Free Software Foundation; either |
1026953d4ffe
Implement Realmedia/RTSP-compatible SETUP command. This includes calculation
rbultje
parents:
diff
changeset
|
10 * version 2.1 of the License, or (at your option) any later version. |
1026953d4ffe
Implement Realmedia/RTSP-compatible SETUP command. This includes calculation
rbultje
parents:
diff
changeset
|
11 * |
1026953d4ffe
Implement Realmedia/RTSP-compatible SETUP command. This includes calculation
rbultje
parents:
diff
changeset
|
12 * FFmpeg is distributed in the hope that it will be useful, |
1026953d4ffe
Implement Realmedia/RTSP-compatible SETUP command. This includes calculation
rbultje
parents:
diff
changeset
|
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1026953d4ffe
Implement Realmedia/RTSP-compatible SETUP command. This includes calculation
rbultje
parents:
diff
changeset
|
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
1026953d4ffe
Implement Realmedia/RTSP-compatible SETUP command. This includes calculation
rbultje
parents:
diff
changeset
|
15 * Lesser General Public License for more details. |
1026953d4ffe
Implement Realmedia/RTSP-compatible SETUP command. This includes calculation
rbultje
parents:
diff
changeset
|
16 * |
1026953d4ffe
Implement Realmedia/RTSP-compatible SETUP command. This includes calculation
rbultje
parents:
diff
changeset
|
17 * You should have received a copy of the GNU Lesser General Public |
1026953d4ffe
Implement Realmedia/RTSP-compatible SETUP command. This includes calculation
rbultje
parents:
diff
changeset
|
18 * License along with FFmpeg; if not, write to the Free Software |
1026953d4ffe
Implement Realmedia/RTSP-compatible SETUP command. This includes calculation
rbultje
parents:
diff
changeset
|
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
1026953d4ffe
Implement Realmedia/RTSP-compatible SETUP command. This includes calculation
rbultje
parents:
diff
changeset
|
20 */ |
1026953d4ffe
Implement Realmedia/RTSP-compatible SETUP command. This includes calculation
rbultje
parents:
diff
changeset
|
21 |
1026953d4ffe
Implement Realmedia/RTSP-compatible SETUP command. This includes calculation
rbultje
parents:
diff
changeset
|
22 #ifndef AVFORMAT_RDT_H |
1026953d4ffe
Implement Realmedia/RTSP-compatible SETUP command. This includes calculation
rbultje
parents:
diff
changeset
|
23 #define AVFORMAT_RDT_H |
1026953d4ffe
Implement Realmedia/RTSP-compatible SETUP command. This includes calculation
rbultje
parents:
diff
changeset
|
24 |
3981
ff78dd8e198a
Fix 'make checkheaders', based on a patch by Diego Petten, flameeyes gmail com.
diego
parents:
3979
diff
changeset
|
25 #include <stdint.h> |
ff78dd8e198a
Fix 'make checkheaders', based on a patch by Diego Petten, flameeyes gmail com.
diego
parents:
3979
diff
changeset
|
26 #include "avformat.h" |
ff78dd8e198a
Fix 'make checkheaders', based on a patch by Diego Petten, flameeyes gmail com.
diego
parents:
3979
diff
changeset
|
27 #include "rtp.h" |
ff78dd8e198a
Fix 'make checkheaders', based on a patch by Diego Petten, flameeyes gmail com.
diego
parents:
3979
diff
changeset
|
28 |
3979
e6bf0896a019
Implement RDTDemuxContext, which contains RDT-specific data (similar to
rbultje
parents:
3962
diff
changeset
|
29 typedef struct RDTDemuxContext RDTDemuxContext; |
e6bf0896a019
Implement RDTDemuxContext, which contains RDT-specific data (similar to
rbultje
parents:
3962
diff
changeset
|
30 |
e6bf0896a019
Implement RDTDemuxContext, which contains RDT-specific data (similar to
rbultje
parents:
3962
diff
changeset
|
31 RDTDemuxContext *ff_rdt_parse_open(AVFormatContext *ic, AVStream *st, |
e6bf0896a019
Implement RDTDemuxContext, which contains RDT-specific data (similar to
rbultje
parents:
3962
diff
changeset
|
32 void *priv_data, |
e6bf0896a019
Implement RDTDemuxContext, which contains RDT-specific data (similar to
rbultje
parents:
3962
diff
changeset
|
33 RTPDynamicProtocolHandler *handler); |
e6bf0896a019
Implement RDTDemuxContext, which contains RDT-specific data (similar to
rbultje
parents:
3962
diff
changeset
|
34 void ff_rdt_parse_close(RDTDemuxContext *s); |
e6bf0896a019
Implement RDTDemuxContext, which contains RDT-specific data (similar to
rbultje
parents:
3962
diff
changeset
|
35 |
3876
1026953d4ffe
Implement Realmedia/RTSP-compatible SETUP command. This includes calculation
rbultje
parents:
diff
changeset
|
36 /** |
1026953d4ffe
Implement Realmedia/RTSP-compatible SETUP command. This includes calculation
rbultje
parents:
diff
changeset
|
37 * Calculate the response (RealChallenge2 in the RTSP header) to the |
1026953d4ffe
Implement Realmedia/RTSP-compatible SETUP command. This includes calculation
rbultje
parents:
diff
changeset
|
38 * challenge (RealChallenge1 in the RTSP header from the Real/Helix |
1026953d4ffe
Implement Realmedia/RTSP-compatible SETUP command. This includes calculation
rbultje
parents:
diff
changeset
|
39 * server), which is used as some sort of client validation. |
1026953d4ffe
Implement Realmedia/RTSP-compatible SETUP command. This includes calculation
rbultje
parents:
diff
changeset
|
40 * |
1026953d4ffe
Implement Realmedia/RTSP-compatible SETUP command. This includes calculation
rbultje
parents:
diff
changeset
|
41 * @param response pointer to response buffer, it should be at least 41 bytes |
1026953d4ffe
Implement Realmedia/RTSP-compatible SETUP command. This includes calculation
rbultje
parents:
diff
changeset
|
42 * (40 data + 1 zero) bytes long. |
1026953d4ffe
Implement Realmedia/RTSP-compatible SETUP command. This includes calculation
rbultje
parents:
diff
changeset
|
43 * @param chksum pointer to buffer containing a checksum of the response, |
1026953d4ffe
Implement Realmedia/RTSP-compatible SETUP command. This includes calculation
rbultje
parents:
diff
changeset
|
44 * it should be at least 9 (8 data + 1 zero) bytes long. |
1026953d4ffe
Implement Realmedia/RTSP-compatible SETUP command. This includes calculation
rbultje
parents:
diff
changeset
|
45 * @param challenge pointer to the RealChallenge1 value provided by the |
1026953d4ffe
Implement Realmedia/RTSP-compatible SETUP command. This includes calculation
rbultje
parents:
diff
changeset
|
46 * server. |
1026953d4ffe
Implement Realmedia/RTSP-compatible SETUP command. This includes calculation
rbultje
parents:
diff
changeset
|
47 */ |
1026953d4ffe
Implement Realmedia/RTSP-compatible SETUP command. This includes calculation
rbultje
parents:
diff
changeset
|
48 void ff_rdt_calc_response_and_checksum(char response[41], char chksum[9], |
1026953d4ffe
Implement Realmedia/RTSP-compatible SETUP command. This includes calculation
rbultje
parents:
diff
changeset
|
49 const char *challenge); |
1026953d4ffe
Implement Realmedia/RTSP-compatible SETUP command. This includes calculation
rbultje
parents:
diff
changeset
|
50 |
3902
5f9bec099c69
Add dynamic payload handlers to rdt.c. These follow the same API as the ones
rbultje
parents:
3876
diff
changeset
|
51 /** |
5f9bec099c69
Add dynamic payload handlers to rdt.c. These follow the same API as the ones
rbultje
parents:
3876
diff
changeset
|
52 * Register RDT-related dynamic payload handlers with our cache. |
5f9bec099c69
Add dynamic payload handlers to rdt.c. These follow the same API as the ones
rbultje
parents:
3876
diff
changeset
|
53 */ |
5f9bec099c69
Add dynamic payload handlers to rdt.c. These follow the same API as the ones
rbultje
parents:
3876
diff
changeset
|
54 void av_register_rdt_dynamic_payload_handlers(void); |
5f9bec099c69
Add dynamic payload handlers to rdt.c. These follow the same API as the ones
rbultje
parents:
3876
diff
changeset
|
55 |
3903
aeb79f68ba7e
Implement a RDT-specific SET_PARAMETER command that subscribes to the
rbultje
parents:
3902
diff
changeset
|
56 /** |
aeb79f68ba7e
Implement a RDT-specific SET_PARAMETER command that subscribes to the
rbultje
parents:
3902
diff
changeset
|
57 * Add subscription information to Subscribe parameter string. |
aeb79f68ba7e
Implement a RDT-specific SET_PARAMETER command that subscribes to the
rbultje
parents:
3902
diff
changeset
|
58 * |
aeb79f68ba7e
Implement a RDT-specific SET_PARAMETER command that subscribes to the
rbultje
parents:
3902
diff
changeset
|
59 * @param cmd string to write the subscription information into. |
aeb79f68ba7e
Implement a RDT-specific SET_PARAMETER command that subscribes to the
rbultje
parents:
3902
diff
changeset
|
60 * @param size size of cmd. |
aeb79f68ba7e
Implement a RDT-specific SET_PARAMETER command that subscribes to the
rbultje
parents:
3902
diff
changeset
|
61 * @param stream_nr stream number. |
aeb79f68ba7e
Implement a RDT-specific SET_PARAMETER command that subscribes to the
rbultje
parents:
3902
diff
changeset
|
62 * @param rule_nr rule number to conform to. |
aeb79f68ba7e
Implement a RDT-specific SET_PARAMETER command that subscribes to the
rbultje
parents:
3902
diff
changeset
|
63 */ |
3959
ed6f6aa977ec
Remove access to rdt_data struct in functions called outside of the
rbultje
parents:
3905
diff
changeset
|
64 void ff_rdt_subscribe_rule(char *cmd, int size, |
3903
aeb79f68ba7e
Implement a RDT-specific SET_PARAMETER command that subscribes to the
rbultje
parents:
3902
diff
changeset
|
65 int stream_nr, int rule_nr); |
3959
ed6f6aa977ec
Remove access to rdt_data struct in functions called outside of the
rbultje
parents:
3905
diff
changeset
|
66 // FIXME this will be removed ASAP |
3979
e6bf0896a019
Implement RDTDemuxContext, which contains RDT-specific data (similar to
rbultje
parents:
3962
diff
changeset
|
67 void ff_rdt_subscribe_rule2(RDTDemuxContext *s, char *cmd, int size, |
3959
ed6f6aa977ec
Remove access to rdt_data struct in functions called outside of the
rbultje
parents:
3905
diff
changeset
|
68 int stream_nr, int rule_nr); |
3903
aeb79f68ba7e
Implement a RDT-specific SET_PARAMETER command that subscribes to the
rbultje
parents:
3902
diff
changeset
|
69 |
3905
91987686113d
Implement RDT-specific data parsing routines. After these changes, simple
rbultje
parents:
3903
diff
changeset
|
70 /** |
3962
72efef66f566
This patch refactors RDT packet header parsing so that it can be used in
rbultje
parents:
3959
diff
changeset
|
71 * Parse RDT-style packet header. |
72efef66f566
This patch refactors RDT packet header parsing so that it can be used in
rbultje
parents:
3959
diff
changeset
|
72 * |
72efef66f566
This patch refactors RDT packet header parsing so that it can be used in
rbultje
parents:
3959
diff
changeset
|
73 * @param buf input buffer |
72efef66f566
This patch refactors RDT packet header parsing so that it can be used in
rbultje
parents:
3959
diff
changeset
|
74 * @param len length of input buffer |
4025
4a266106f604
Rename variables in ff_rdt_parse_header() and callers to match the
rbultje
parents:
3981
diff
changeset
|
75 * @param set_id will be set to the set ID this packet belongs to |
4031
cd5a6a766b14
Make function comment a bit more linguistically correct.
rbultje
parents:
4029
diff
changeset
|
76 * @param seq_no will be set to the sequence number of the packet |
4025
4a266106f604
Rename variables in ff_rdt_parse_header() and callers to match the
rbultje
parents:
3981
diff
changeset
|
77 * @param stream_id will be set to the stream ID this packet belongs to |
4029
9a0a46d465ae
Add is_keyframe param to ff_rdt_parse_header(). See ML discussion in
rbultje
parents:
4025
diff
changeset
|
78 * @param is_keyframe will be whether this packet belongs to a keyframe |
4025
4a266106f604
Rename variables in ff_rdt_parse_header() and callers to match the
rbultje
parents:
3981
diff
changeset
|
79 * @param timestamp will be set to the timestamp of the packet |
3962
72efef66f566
This patch refactors RDT packet header parsing so that it can be used in
rbultje
parents:
3959
diff
changeset
|
80 * @return the amount of bytes consumed, or <0 on error |
72efef66f566
This patch refactors RDT packet header parsing so that it can be used in
rbultje
parents:
3959
diff
changeset
|
81 */ |
72efef66f566
This patch refactors RDT packet header parsing so that it can be used in
rbultje
parents:
3959
diff
changeset
|
82 int ff_rdt_parse_header(const uint8_t *buf, int len, |
4029
9a0a46d465ae
Add is_keyframe param to ff_rdt_parse_header(). See ML discussion in
rbultje
parents:
4025
diff
changeset
|
83 int *set_id, int *seq_no, int *stream_id, |
9a0a46d465ae
Add is_keyframe param to ff_rdt_parse_header(). See ML discussion in
rbultje
parents:
4025
diff
changeset
|
84 int *is_keyframe, uint32_t *timestamp); |
3962
72efef66f566
This patch refactors RDT packet header parsing so that it can be used in
rbultje
parents:
3959
diff
changeset
|
85 |
72efef66f566
This patch refactors RDT packet header parsing so that it can be used in
rbultje
parents:
3959
diff
changeset
|
86 /** |
3905
91987686113d
Implement RDT-specific data parsing routines. After these changes, simple
rbultje
parents:
3903
diff
changeset
|
87 * Parse RDT-style packet data (header + media data). |
91987686113d
Implement RDT-specific data parsing routines. After these changes, simple
rbultje
parents:
3903
diff
changeset
|
88 * Usage similar to rtp_parse_packet(). |
91987686113d
Implement RDT-specific data parsing routines. After these changes, simple
rbultje
parents:
3903
diff
changeset
|
89 */ |
3979
e6bf0896a019
Implement RDTDemuxContext, which contains RDT-specific data (similar to
rbultje
parents:
3962
diff
changeset
|
90 int ff_rdt_parse_packet(RDTDemuxContext *s, AVPacket *pkt, |
3905
91987686113d
Implement RDT-specific data parsing routines. After these changes, simple
rbultje
parents:
3903
diff
changeset
|
91 const uint8_t *buf, int len); |
91987686113d
Implement RDT-specific data parsing routines. After these changes, simple
rbultje
parents:
3903
diff
changeset
|
92 |
3876
1026953d4ffe
Implement Realmedia/RTSP-compatible SETUP command. This includes calculation
rbultje
parents:
diff
changeset
|
93 #endif /* AVFORMAT_RDT_H */ |