• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* GStreamer
2  * Copyright (C) <2005> Edgard Lima <edgard.lima@gmail.com>
3  * Copyright (C) <2006> Rosfran Borges <rosfran.borges@indt.org.br>
4  * Copyright (C) <2006> Andre Moreira Magalhaes <andre.magalhaes@indt.org.br>
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Library General Public License for more
15  */
16 
17 #ifndef __GST_NEONHTTP_SRC_H__
18 #define __GST_NEONHTTP_SRC_H__
19 
20 #include <gst/gst.h>
21 #include <gst/base/gstpushsrc.h>
22 #include <stdio.h>
23 
24 G_BEGIN_DECLS
25 
26 #include <ne_session.h>
27 #include <ne_request.h>
28 #include <ne_socket.h>
29 
30 #define GST_TYPE_NEONHTTP_SRC \
31   (gst_neonhttp_src_get_type())
32 #define GST_NEONHTTP_SRC(obj) \
33   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_NEONHTTP_SRC,GstNeonhttpSrc))
34 #define GST_NEONHTTP_SRC_CLASS(klass) \
35   (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_NEONHTTP_SRC,GstNeonhttpSrcClass))
36 #define GST_IS_NEONHTTP_SRC(obj) \
37   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_NEONHTTP_SRC))
38 #define GST_IS_NEONHTTP_SRC_CLASS(klass) \
39   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_NEONHTTP_SRC))
40 
41 typedef struct _GstNeonhttpSrc GstNeonhttpSrc;
42 typedef struct _GstNeonhttpSrcClass GstNeonhttpSrcClass;
43 
44 struct _GstNeonhttpSrc {
45   GstPushSrc element;
46 
47   /* socket */
48   ne_session *session;
49   ne_request *request;
50   ne_uri uri;
51   gchar *location;
52   gchar *query_string;
53   ne_uri proxy;
54   gchar *user_agent;
55   gchar **cookies;
56 
57   guint64 content_size;
58 
59   gboolean eos;
60 
61   /* whether to request icecast metadata */
62   gboolean iradio_mode;
63 
64   /* enable Neon HTTP redirects (HTTP 302 status code) */
65   gboolean automatic_redirect;
66 
67   /* enable Neon HTTP debug messages */
68   gboolean neon_http_debug;
69 
70   /* accept self-signed certificates */
71   gboolean accept_self_signed;
72 
73   gint64 read_position;
74   gboolean seekable;
75 
76   /* seconds before timing out when connecting or reading to/from a socket */
77   guint connect_timeout;
78   guint read_timeout;
79 };
80 
81 struct _GstNeonhttpSrcClass {
82   GstPushSrcClass parent_class;
83 };
84 
85 GType gst_neonhttp_src_get_type (void);
86 
87 GST_ELEMENT_REGISTER_DECLARE (neonhttpsrc);
88 
89 G_END_DECLS
90 
91 #endif /* __GST_NEONHTTP_SRC_H__ */
92 
93