2 * Copyright (C) <2007> Wouter Cloetens <wouter@mind.be>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more
15 #ifndef __GST_SOUPHTTP_SRC_H__
16 #define __GST_SOUPHTTP_SRC_H__
19 #include <gst/base/gstpushsrc.h>
24 #include <libsoup/soup.h>
26 #define GST_TYPE_SOUPHTTP_SRC \
27 (gst_souphttp_src_get_type())
28 #define GST_SOUPHTTP_SRC(obj) \
29 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_SOUPHTTP_SRC,GstSouphttpSrc))
30 #define GST_SOUPHTTP_SRC_CLASS(klass) \
31 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_SOUPHTTP_SRC,GstSouphttpSrcClass))
32 #define GST_IS_SOUPHTTP_SRC(obj) \
33 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_SOUPHTTP_SRC))
34 #define GST_IS_SOUPHTTP_SRC_CLASS(klass) \
35 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SOUPHTTP_SRC))
37 typedef struct _GstSouphttpSrc GstSouphttpSrc;
38 typedef struct _GstSouphttpSrcClass GstSouphttpSrcClass;
40 struct _GstSouphttpSrc {
43 gchar * location; /* Full URI. */
44 GMainContext * context; /* I/O context. */
45 GMainLoop * loop; /* Event loop. */
46 SoupSession * session; /* Async context. */
47 SoupMessage * msg; /* Request message. */
48 GstFlowReturn ret; /* Return code from callback. */
49 GstBuffer ** outbuf; /* Return buffer allocated by callback. */
50 gboolean interrupted; /* Signal unlock(). */
51 gboolean have_size; /* Received and parsed Content-Length header. */
52 guint64 content_size; /* Value of Content-Length header. */
55 struct _GstSouphttpSrcClass {
56 GstPushSrcClass parent_class;
59 GType gst_souphttp_src_get_type (void);
63 #endif /* __GST_SOUPHTTP_SRC_H__ */