1 /*
2  * GStreamer
3  * Copyright (C) 2010 Jan Schmidt <thaytan@noraisin.net>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public
16  * License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
18  * Boston, MA 02110-1301, USA.
19  */
20 
21 #ifndef __GST_RTMP_SINK_H__
22 #define __GST_RTMP_SINK_H__
23 
24 #include <gst/gst.h>
25 #include <gst/base/gstbasesink.h>
26 
27 #include <librtmp/rtmp.h>
28 #include <librtmp/log.h>
29 #include <librtmp/amf.h>
30 
31 G_BEGIN_DECLS
32 
33 #define GST_TYPE_RTMP_SINK \
34   (gst_rtmp_sink_get_type())
35 #define GST_RTMP_SINK(obj) \
36   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_RTMP_SINK,GstRTMPSink))
37 #define GST_RTMP_SINK_CLASS(klass) \
38   (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_RTMP_SINK,GstRTMPSinkClass))
39 #define GST_IS_RTMP_SINK(obj) \
40   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_RTMP_SINK))
41 #define GST_IS_RTMP_SINK_CLASS(klass) \
42   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_RTMP_SINK))
43 
44 typedef struct _GstRTMPSink      GstRTMPSink;
45 typedef struct _GstRTMPSinkClass GstRTMPSinkClass;
46 
47 struct _GstRTMPSink {
48   GstBaseSink parent;
49 
50   /* < private > */
51   gchar *uri;
52 
53   RTMP *rtmp;
54   gchar *rtmp_uri; /* copy of url for librtmp */
55 
56   GstBuffer *header;
57   gboolean first;
58   gboolean have_write_error;
59 };
60 
61 struct _GstRTMPSinkClass {
62   GstBaseSinkClass parent_class;
63 };
64 
65 GType gst_rtmp_sink_get_type (void);
66 
67 G_END_DECLS
68 
69 #endif /* __GST_RTMP_SINK_H__ */
70