Mercurial > mplayer.hg
annotate stream/librtsp/rtsp.h @ 35173:95ad1e516f03
mp_property_deinterlace: Signalize control() failure
Always having to do a GET after a SET to check if the state was
really changed, seems not very friendly from the perspective of
the client application that changes the property.
Return M_PROPERTY_UNAVAILABLE to signalize that the control() was
not positively consumed by the filter/vo chain.
Based on a patch by Vicente Sendra >visenri yahoo.es<
author | al |
---|---|
date | Thu, 25 Oct 2012 18:26:45 +0000 |
parents | 629b30951662 |
children |
rev | line source |
---|---|
18799 | 1 /* |
2 * This file was ported to MPlayer from xine CVS rtsp.h,v 1.2 2002/12/16 21:50:55 | |
3 */ | |
4 | |
5 /* | |
6 * Copyright (C) 2002 the xine project | |
7 * | |
8 * This file is part of xine, a free video player. | |
9 * | |
10 * xine is free software; you can redistribute it and/or modify | |
11 * it under the terms of the GNU General Public License as published by | |
12 * the Free Software Foundation; either version 2 of the License, or | |
13 * (at your option) any later version. | |
14 * | |
15 * xine is distributed in the hope that it will be useful, | |
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 * GNU General Public License for more details. | |
19 * | |
20 * You should have received a copy of the GNU General Public License | |
21 * along with this program; if not, write to the Free Software | |
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA | |
23 * | |
24 * | |
25 * a minimalistic implementation of rtsp protocol, | |
26 * *not* RFC 2326 compilant yet. | |
27 * | |
28 * 2006, Benjamin Zores and Vincent Mussard | |
29 * fixed a lot of RFC compliance issues. | |
30 */ | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27104
diff
changeset
|
31 |
26029 | 32 #ifndef MPLAYER_RTSP_H |
33 #define MPLAYER_RTSP_H | |
18799 | 34 |
27104
83d160a30ca7
Complete the code move across librtsp, fixes the rtsp_close collision with libnemesi
lu_zero
parents:
27103
diff
changeset
|
35 #include <inttypes.h> |
18799 | 36 |
37 /* some codes returned by rtsp_request_* functions */ | |
38 | |
39 #define RTSP_STATUS_SET_PARAMETER 10 | |
40 #define RTSP_STATUS_OK 200 | |
41 | |
42 #define RTSP_METHOD_OPTIONS "OPTIONS" | |
43 #define RTSP_METHOD_DESCRIBE "DESCRIBE" | |
44 #define RTSP_METHOD_SETUP "SETUP" | |
45 #define RTSP_METHOD_PLAY "PLAY" | |
46 #define RTSP_METHOD_TEARDOWN "TEARDOWN" | |
47 #define RTSP_METHOD_SET_PARAMETER "SET_PARAMETER" | |
48 | |
27104
83d160a30ca7
Complete the code move across librtsp, fixes the rtsp_close collision with libnemesi
lu_zero
parents:
27103
diff
changeset
|
49 #define BUF_SIZE 4096 |
30152
629b30951662
Disambiguate HEADER_SIZE definition in stream/librtsp and stream/realrtsp.
diego
parents:
29263
diff
changeset
|
50 #define RTSP_HEADER_SIZE 1024 |
27104
83d160a30ca7
Complete the code move across librtsp, fixes the rtsp_close collision with libnemesi
lu_zero
parents:
27103
diff
changeset
|
51 #define MAX_FIELDS 256 |
83d160a30ca7
Complete the code move across librtsp, fixes the rtsp_close collision with libnemesi
lu_zero
parents:
27103
diff
changeset
|
52 |
83d160a30ca7
Complete the code move across librtsp, fixes the rtsp_close collision with libnemesi
lu_zero
parents:
27103
diff
changeset
|
53 |
83d160a30ca7
Complete the code move across librtsp, fixes the rtsp_close collision with libnemesi
lu_zero
parents:
27103
diff
changeset
|
54 struct rtsp_s { |
83d160a30ca7
Complete the code move across librtsp, fixes the rtsp_close collision with libnemesi
lu_zero
parents:
27103
diff
changeset
|
55 |
83d160a30ca7
Complete the code move across librtsp, fixes the rtsp_close collision with libnemesi
lu_zero
parents:
27103
diff
changeset
|
56 int s; |
83d160a30ca7
Complete the code move across librtsp, fixes the rtsp_close collision with libnemesi
lu_zero
parents:
27103
diff
changeset
|
57 |
83d160a30ca7
Complete the code move across librtsp, fixes the rtsp_close collision with libnemesi
lu_zero
parents:
27103
diff
changeset
|
58 char *host; |
83d160a30ca7
Complete the code move across librtsp, fixes the rtsp_close collision with libnemesi
lu_zero
parents:
27103
diff
changeset
|
59 int port; |
83d160a30ca7
Complete the code move across librtsp, fixes the rtsp_close collision with libnemesi
lu_zero
parents:
27103
diff
changeset
|
60 char *path; |
83d160a30ca7
Complete the code move across librtsp, fixes the rtsp_close collision with libnemesi
lu_zero
parents:
27103
diff
changeset
|
61 char *param; |
83d160a30ca7
Complete the code move across librtsp, fixes the rtsp_close collision with libnemesi
lu_zero
parents:
27103
diff
changeset
|
62 char *mrl; |
83d160a30ca7
Complete the code move across librtsp, fixes the rtsp_close collision with libnemesi
lu_zero
parents:
27103
diff
changeset
|
63 char *user_agent; |
83d160a30ca7
Complete the code move across librtsp, fixes the rtsp_close collision with libnemesi
lu_zero
parents:
27103
diff
changeset
|
64 |
83d160a30ca7
Complete the code move across librtsp, fixes the rtsp_close collision with libnemesi
lu_zero
parents:
27103
diff
changeset
|
65 char *server; |
83d160a30ca7
Complete the code move across librtsp, fixes the rtsp_close collision with libnemesi
lu_zero
parents:
27103
diff
changeset
|
66 unsigned int server_state; |
83d160a30ca7
Complete the code move across librtsp, fixes the rtsp_close collision with libnemesi
lu_zero
parents:
27103
diff
changeset
|
67 uint32_t server_caps; |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27104
diff
changeset
|
68 |
27104
83d160a30ca7
Complete the code move across librtsp, fixes the rtsp_close collision with libnemesi
lu_zero
parents:
27103
diff
changeset
|
69 unsigned int cseq; |
83d160a30ca7
Complete the code move across librtsp, fixes the rtsp_close collision with libnemesi
lu_zero
parents:
27103
diff
changeset
|
70 char *session; |
83d160a30ca7
Complete the code move across librtsp, fixes the rtsp_close collision with libnemesi
lu_zero
parents:
27103
diff
changeset
|
71 |
83d160a30ca7
Complete the code move across librtsp, fixes the rtsp_close collision with libnemesi
lu_zero
parents:
27103
diff
changeset
|
72 char *answers[MAX_FIELDS]; /* data of last message */ |
83d160a30ca7
Complete the code move across librtsp, fixes the rtsp_close collision with libnemesi
lu_zero
parents:
27103
diff
changeset
|
73 char *scheduled[MAX_FIELDS]; /* will be sent with next message */ |
83d160a30ca7
Complete the code move across librtsp, fixes the rtsp_close collision with libnemesi
lu_zero
parents:
27103
diff
changeset
|
74 }; |
83d160a30ca7
Complete the code move across librtsp, fixes the rtsp_close collision with libnemesi
lu_zero
parents:
27103
diff
changeset
|
75 |
83d160a30ca7
Complete the code move across librtsp, fixes the rtsp_close collision with libnemesi
lu_zero
parents:
27103
diff
changeset
|
76 /* |
83d160a30ca7
Complete the code move across librtsp, fixes the rtsp_close collision with libnemesi
lu_zero
parents:
27103
diff
changeset
|
77 * constants |
83d160a30ca7
Complete the code move across librtsp, fixes the rtsp_close collision with libnemesi
lu_zero
parents:
27103
diff
changeset
|
78 */ |
83d160a30ca7
Complete the code move across librtsp, fixes the rtsp_close collision with libnemesi
lu_zero
parents:
27103
diff
changeset
|
79 |
83d160a30ca7
Complete the code move across librtsp, fixes the rtsp_close collision with libnemesi
lu_zero
parents:
27103
diff
changeset
|
80 #define RTSP_PROTOCOL_VERSION "RTSP/1.0" |
83d160a30ca7
Complete the code move across librtsp, fixes the rtsp_close collision with libnemesi
lu_zero
parents:
27103
diff
changeset
|
81 |
83d160a30ca7
Complete the code move across librtsp, fixes the rtsp_close collision with libnemesi
lu_zero
parents:
27103
diff
changeset
|
82 /* server states */ |
83d160a30ca7
Complete the code move across librtsp, fixes the rtsp_close collision with libnemesi
lu_zero
parents:
27103
diff
changeset
|
83 #define RTSP_CONNECTED 1 |
83d160a30ca7
Complete the code move across librtsp, fixes the rtsp_close collision with libnemesi
lu_zero
parents:
27103
diff
changeset
|
84 #define RTSP_INIT 2 |
83d160a30ca7
Complete the code move across librtsp, fixes the rtsp_close collision with libnemesi
lu_zero
parents:
27103
diff
changeset
|
85 #define RTSP_READY 4 |
83d160a30ca7
Complete the code move across librtsp, fixes the rtsp_close collision with libnemesi
lu_zero
parents:
27103
diff
changeset
|
86 #define RTSP_PLAYING 8 |
83d160a30ca7
Complete the code move across librtsp, fixes the rtsp_close collision with libnemesi
lu_zero
parents:
27103
diff
changeset
|
87 #define RTSP_RECORDING 16 |
83d160a30ca7
Complete the code move across librtsp, fixes the rtsp_close collision with libnemesi
lu_zero
parents:
27103
diff
changeset
|
88 |
83d160a30ca7
Complete the code move across librtsp, fixes the rtsp_close collision with libnemesi
lu_zero
parents:
27103
diff
changeset
|
89 /* server capabilities */ |
83d160a30ca7
Complete the code move across librtsp, fixes the rtsp_close collision with libnemesi
lu_zero
parents:
27103
diff
changeset
|
90 #define RTSP_OPTIONS 0x001 |
83d160a30ca7
Complete the code move across librtsp, fixes the rtsp_close collision with libnemesi
lu_zero
parents:
27103
diff
changeset
|
91 #define RTSP_DESCRIBE 0x002 |
83d160a30ca7
Complete the code move across librtsp, fixes the rtsp_close collision with libnemesi
lu_zero
parents:
27103
diff
changeset
|
92 #define RTSP_ANNOUNCE 0x004 |
83d160a30ca7
Complete the code move across librtsp, fixes the rtsp_close collision with libnemesi
lu_zero
parents:
27103
diff
changeset
|
93 #define RTSP_SETUP 0x008 |
83d160a30ca7
Complete the code move across librtsp, fixes the rtsp_close collision with libnemesi
lu_zero
parents:
27103
diff
changeset
|
94 #define RTSP_GET_PARAMETER 0x010 |
83d160a30ca7
Complete the code move across librtsp, fixes the rtsp_close collision with libnemesi
lu_zero
parents:
27103
diff
changeset
|
95 #define RTSP_SET_PARAMETER 0x020 |
83d160a30ca7
Complete the code move across librtsp, fixes the rtsp_close collision with libnemesi
lu_zero
parents:
27103
diff
changeset
|
96 #define RTSP_TEARDOWN 0x040 |
83d160a30ca7
Complete the code move across librtsp, fixes the rtsp_close collision with libnemesi
lu_zero
parents:
27103
diff
changeset
|
97 #define RTSP_PLAY 0x080 |
83d160a30ca7
Complete the code move across librtsp, fixes the rtsp_close collision with libnemesi
lu_zero
parents:
27103
diff
changeset
|
98 #define RTSP_RECORD 0x100 |
83d160a30ca7
Complete the code move across librtsp, fixes the rtsp_close collision with libnemesi
lu_zero
parents:
27103
diff
changeset
|
99 |
83d160a30ca7
Complete the code move across librtsp, fixes the rtsp_close collision with libnemesi
lu_zero
parents:
27103
diff
changeset
|
100 |
18799 | 101 typedef struct rtsp_s rtsp_t; |
102 | |
103 rtsp_t* rtsp_connect (int fd, char *mrl, char *path, char *host, int port, char *user_agent); | |
104 | |
105 int rtsp_request_options(rtsp_t *s, const char *what); | |
106 int rtsp_request_describe(rtsp_t *s, const char *what); | |
107 int rtsp_request_setup(rtsp_t *s, const char *what, char *control); | |
108 int rtsp_request_setparameter(rtsp_t *s, const char *what); | |
109 int rtsp_request_play(rtsp_t *s, const char *what); | |
110 int rtsp_request_teardown(rtsp_t *s, const char *what); | |
111 | |
112 int rtsp_send_ok(rtsp_t *s); | |
113 | |
114 int rtsp_read_data(rtsp_t *s, char *buffer, unsigned int size); | |
115 | |
116 char* rtsp_search_answers(rtsp_t *s, const char *tag); | |
117 void rtsp_add_to_payload(char **payload, const char *string); | |
118 | |
119 void rtsp_free_answers(rtsp_t *this); | |
120 | |
121 int rtsp_read (rtsp_t *this, char *data, int len); | |
122 | |
123 void rtsp_set_session(rtsp_t *s, const char *id); | |
124 char *rtsp_get_session(rtsp_t *s); | |
125 | |
126 char *rtsp_get_mrl(rtsp_t *s); | |
19108
5e767cabf4cd
marks several read-only string parameters and function return-values which can only be used read-only as const. Patch by Stefan Huehner, stefan _AT huener-org
reynaldo
parents:
18799
diff
changeset
|
127 char *rtsp_get_param(rtsp_t *s, const char *param); |
18799 | 128 |
129 /*int rtsp_peek_header (rtsp_t *this, char *data); */ | |
130 | |
131 void rtsp_schedule_field(rtsp_t *s, const char *string); | |
132 void rtsp_unschedule_field(rtsp_t *s, const char *string); | |
133 void rtsp_unschedule_all(rtsp_t *s); | |
134 | |
26029 | 135 #endif /* MPLAYER_RTSP_H */ |