Mercurial > audlegacy-plugins
annotate src/neon/neon.h @ 3203:f5456241bff9 default tip
changed include path from audacious to audlegacy.
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Tue, 10 Nov 2009 05:19:25 +0900 |
parents | 3f023c46e40c |
children |
rev | line source |
---|---|
1751
dc83901850df
- Add license texts to the neon source
Ralf Ertzinger <ralf@skytale.net>
parents:
1742
diff
changeset
|
1 /* |
dc83901850df
- Add license texts to the neon source
Ralf Ertzinger <ralf@skytale.net>
parents:
1742
diff
changeset
|
2 * A neon HTTP input plugin for Audacious |
dc83901850df
- Add license texts to the neon source
Ralf Ertzinger <ralf@skytale.net>
parents:
1742
diff
changeset
|
3 * Copyright (C) 2007 Ralf Ertzinger |
dc83901850df
- Add license texts to the neon source
Ralf Ertzinger <ralf@skytale.net>
parents:
1742
diff
changeset
|
4 * |
dc83901850df
- Add license texts to the neon source
Ralf Ertzinger <ralf@skytale.net>
parents:
1742
diff
changeset
|
5 * This program is free software; you can redistribute it and/or modify |
dc83901850df
- Add license texts to the neon source
Ralf Ertzinger <ralf@skytale.net>
parents:
1742
diff
changeset
|
6 * it under the terms of the GNU General Public License as published by |
dc83901850df
- Add license texts to the neon source
Ralf Ertzinger <ralf@skytale.net>
parents:
1742
diff
changeset
|
7 * the Free Software Foundation; either version 2 of the License, or |
dc83901850df
- Add license texts to the neon source
Ralf Ertzinger <ralf@skytale.net>
parents:
1742
diff
changeset
|
8 * (at your option) any later version. |
dc83901850df
- Add license texts to the neon source
Ralf Ertzinger <ralf@skytale.net>
parents:
1742
diff
changeset
|
9 * |
dc83901850df
- Add license texts to the neon source
Ralf Ertzinger <ralf@skytale.net>
parents:
1742
diff
changeset
|
10 * This program is distributed in the hope that it will be useful, |
dc83901850df
- Add license texts to the neon source
Ralf Ertzinger <ralf@skytale.net>
parents:
1742
diff
changeset
|
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
dc83901850df
- Add license texts to the neon source
Ralf Ertzinger <ralf@skytale.net>
parents:
1742
diff
changeset
|
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
dc83901850df
- Add license texts to the neon source
Ralf Ertzinger <ralf@skytale.net>
parents:
1742
diff
changeset
|
13 * GNU General Public License for more details. |
dc83901850df
- Add license texts to the neon source
Ralf Ertzinger <ralf@skytale.net>
parents:
1742
diff
changeset
|
14 * |
dc83901850df
- Add license texts to the neon source
Ralf Ertzinger <ralf@skytale.net>
parents:
1742
diff
changeset
|
15 * You should have received a copy of the GNU General Public License |
dc83901850df
- Add license texts to the neon source
Ralf Ertzinger <ralf@skytale.net>
parents:
1742
diff
changeset
|
16 * along with this program; if not, write to the Free Software |
2835 | 17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
1751
dc83901850df
- Add license texts to the neon source
Ralf Ertzinger <ralf@skytale.net>
parents:
1742
diff
changeset
|
18 */ |
dc83901850df
- Add license texts to the neon source
Ralf Ertzinger <ralf@skytale.net>
parents:
1742
diff
changeset
|
19 |
1719
29c35cb8873e
- Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff
changeset
|
20 #ifndef _NEON_PLUGIN_H |
29c35cb8873e
- Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff
changeset
|
21 #define _NEON_PLUGIN_H |
29c35cb8873e
- Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff
changeset
|
22 |
1961
e8ea3a76a84e
Various #include cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
1751
diff
changeset
|
23 #include "config.h" |
e8ea3a76a84e
Various #include cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
1751
diff
changeset
|
24 |
1719
29c35cb8873e
- Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff
changeset
|
25 #include <glib.h> |
2971
3134a0987162
- changed include path from audacious to audlegacy.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
2835
diff
changeset
|
26 #include <audlegacy/vfs.h> |
1719
29c35cb8873e
- Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff
changeset
|
27 #include <ne_session.h> |
29c35cb8873e
- Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff
changeset
|
28 #include <ne_request.h> |
29c35cb8873e
- Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff
changeset
|
29 #include <ne_uri.h> |
29c35cb8873e
- Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff
changeset
|
30 #include "rb.h" |
29c35cb8873e
- Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff
changeset
|
31 |
29c35cb8873e
- Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff
changeset
|
32 typedef enum { |
29c35cb8873e
- Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff
changeset
|
33 NEON_READER_INIT=0, |
29c35cb8873e
- Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff
changeset
|
34 NEON_READER_RUN=1, |
29c35cb8873e
- Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff
changeset
|
35 NEON_READER_ERROR, |
29c35cb8873e
- Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff
changeset
|
36 NEON_READER_EOF, |
29c35cb8873e
- Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff
changeset
|
37 NEON_READER_TERM |
29c35cb8873e
- Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff
changeset
|
38 } neon_reader_t; |
29c35cb8873e
- Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff
changeset
|
39 |
29c35cb8873e
- Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff
changeset
|
40 struct reader_status { |
29c35cb8873e
- Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff
changeset
|
41 GMutex* mutex; |
29c35cb8873e
- Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff
changeset
|
42 GCond* cond; |
29c35cb8873e
- Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff
changeset
|
43 gboolean reading; |
29c35cb8873e
- Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff
changeset
|
44 neon_reader_t status; |
29c35cb8873e
- Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff
changeset
|
45 }; |
29c35cb8873e
- Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff
changeset
|
46 |
1730
50d151b259bb
- Add lots of code to support the completely braindead concept that is StreamCast
Ralf Ertzinger <ralf@skytale.net>
parents:
1719
diff
changeset
|
47 struct icy_metadata { |
50d151b259bb
- Add lots of code to support the completely braindead concept that is StreamCast
Ralf Ertzinger <ralf@skytale.net>
parents:
1719
diff
changeset
|
48 gchar* stream_name; |
50d151b259bb
- Add lots of code to support the completely braindead concept that is StreamCast
Ralf Ertzinger <ralf@skytale.net>
parents:
1719
diff
changeset
|
49 gchar* stream_title; |
50d151b259bb
- Add lots of code to support the completely braindead concept that is StreamCast
Ralf Ertzinger <ralf@skytale.net>
parents:
1719
diff
changeset
|
50 gchar* stream_url; |
1742
4f4634573e41
- Free memory for ICY tags
Ralf Ertzinger <ralf@skytale.net>
parents:
1730
diff
changeset
|
51 gchar* stream_contenttype; |
3078
3f023c46e40c
neon: Add support for icy-br.
William Pitcock <nenolod@atheme.org>
parents:
2971
diff
changeset
|
52 gint stream_bitrate; |
1730
50d151b259bb
- Add lots of code to support the completely braindead concept that is StreamCast
Ralf Ertzinger <ralf@skytale.net>
parents:
1719
diff
changeset
|
53 }; |
50d151b259bb
- Add lots of code to support the completely braindead concept that is StreamCast
Ralf Ertzinger <ralf@skytale.net>
parents:
1719
diff
changeset
|
54 |
1719
29c35cb8873e
- Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff
changeset
|
55 struct neon_handle { |
29c35cb8873e
- Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff
changeset
|
56 gchar* url; /* The URL, as passed to us */ |
29c35cb8873e
- Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff
changeset
|
57 ne_uri* purl; /* The URL, parsed into a structure */ |
29c35cb8873e
- Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff
changeset
|
58 struct ringbuf rb; /* Ringbuffer for our data */ |
2663 | 59 guchar redircount; /* Redirect count for the opened URL */ |
1719
29c35cb8873e
- Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff
changeset
|
60 long pos; /* Current position in the stream (number of last byte delivered to the player) */ |
2663 | 61 gulong content_start; /* Start position in the stream */ |
1719
29c35cb8873e
- Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff
changeset
|
62 long content_length; /* Total content length, counting from content_start, if known. -1 if unknown */ |
29c35cb8873e
- Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff
changeset
|
63 gboolean can_ranges; /* TRUE if the webserver advertised accept-range: bytes */ |
2663 | 64 gulong icy_metaint; /* Interval in which the server will send metadata announcements. 0 if no announcments */ |
65 gulong icy_metaleft; /* Bytes left until the next metadata block */ | |
1730
50d151b259bb
- Add lots of code to support the completely braindead concept that is StreamCast
Ralf Ertzinger <ralf@skytale.net>
parents:
1719
diff
changeset
|
66 struct icy_metadata icy_metadata; /* Current ICY metadata */ |
1719
29c35cb8873e
- Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff
changeset
|
67 ne_session* session; |
29c35cb8873e
- Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff
changeset
|
68 ne_request* request; |
29c35cb8873e
- Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff
changeset
|
69 GThread* reader; |
29c35cb8873e
- Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff
changeset
|
70 struct reader_status reader_status; |
29c35cb8873e
- Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff
changeset
|
71 gboolean eof; |
29c35cb8873e
- Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff
changeset
|
72 }; |
29c35cb8873e
- Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff
changeset
|
73 |
29c35cb8873e
- Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff
changeset
|
74 |
29c35cb8873e
- Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff
changeset
|
75 #endif |