Mercurial > libavformat.hg
annotate rdt.h @ 4015:136be670d919 libavformat
Decode audio channel layout from RIFF/WAV file format.
author | pross |
---|---|
date | Wed, 05 Nov 2008 09:22:13 +0000 |
parents | ff78dd8e198a |
children | 4a266106f604 |
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 |
72efef66f566
This patch refactors RDT packet header parsing so that it can be used in
rbultje
parents:
3959
diff
changeset
|
75 * @param sn will be set to the stream number this packet belongs to |
72efef66f566
This patch refactors RDT packet header parsing so that it can be used in
rbultje
parents:
3959
diff
changeset
|
76 * @param seq will be set to the sequence number this packet belongs to |
72efef66f566
This patch refactors RDT packet header parsing so that it can be used in
rbultje
parents:
3959
diff
changeset
|
77 * @param rn will be set to the rule number this packet belongs to |
72efef66f566
This patch refactors RDT packet header parsing so that it can be used in
rbultje
parents:
3959
diff
changeset
|
78 * @param ts will be set to the timestamp of the packet |
72efef66f566
This patch refactors RDT packet header parsing so that it can be used in
rbultje
parents:
3959
diff
changeset
|
79 * @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
|
80 */ |
72efef66f566
This patch refactors RDT packet header parsing so that it can be used in
rbultje
parents:
3959
diff
changeset
|
81 int ff_rdt_parse_header(const uint8_t *buf, int len, |
72efef66f566
This patch refactors RDT packet header parsing so that it can be used in
rbultje
parents:
3959
diff
changeset
|
82 int *sn, int *seq, int *rn, uint32_t *ts); |
72efef66f566
This patch refactors RDT packet header parsing so that it can be used in
rbultje
parents:
3959
diff
changeset
|
83 |
72efef66f566
This patch refactors RDT packet header parsing so that it can be used in
rbultje
parents:
3959
diff
changeset
|
84 /** |
3905
91987686113d
Implement RDT-specific data parsing routines. After these changes, simple
rbultje
parents:
3903
diff
changeset
|
85 * Parse RDT-style packet data (header + media data). |
91987686113d
Implement RDT-specific data parsing routines. After these changes, simple
rbultje
parents:
3903
diff
changeset
|
86 * Usage similar to rtp_parse_packet(). |
91987686113d
Implement RDT-specific data parsing routines. After these changes, simple
rbultje
parents:
3903
diff
changeset
|
87 */ |
3979
e6bf0896a019
Implement RDTDemuxContext, which contains RDT-specific data (similar to
rbultje
parents:
3962
diff
changeset
|
88 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
|
89 const uint8_t *buf, int len); |
91987686113d
Implement RDT-specific data parsing routines. After these changes, simple
rbultje
parents:
3903
diff
changeset
|
90 |
3876
1026953d4ffe
Implement Realmedia/RTSP-compatible SETUP command. This includes calculation
rbultje
parents:
diff
changeset
|
91 #endif /* AVFORMAT_RDT_H */ |