• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* ASF RTP Payloader plugin for GStreamer
2  * Copyright (C) 2009 Thiago Santos <thiagoss@embedded.ufcg.edu.br>
3  *
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.
8  *
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 details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
17  * Boston, MA 02110-1301, USA.
18  */
19 
20 
21 #ifndef __GST_RTP_ASF_PAY_H__
22 #define __GST_RTP_ASF_PAY_H__
23 
24 #include <gst/gst.h>
25 #include <gst/rtp/gstrtpbasepayload.h>
26 #include <gst/rtp/gstrtpbuffer.h>
27 #include <gst/base/gstadapter.h>
28 
29 #include "gstasfobjects.h"
30 
31 G_BEGIN_DECLS
32 #define GST_TYPE_RTP_ASF_PAY \
33   (gst_rtp_asf_pay_get_type())
34 #define GST_RTP_ASF_PAY(obj) \
35   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_RTP_ASF_PAY,GstRtpAsfPay))
36 #define GST_RTP_ASF_PAY_CLASS(klass) \
37   (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_RTP_ASF_PAY,GstRtpAsfPayClass))
38 #define GST_IS_RTP_ASF_PAY(obj) \
39   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_RTP_ASF_PAY))
40 #define GST_IS_RTP_ASF_PAY_CLASS(klass) \
41   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_RTP_ASF_PAY))
42 #define GST_RTP_ASF_PAY_CAST(obj) ((GstRtpAsfPay*)(obj))
43     enum GstRtpAsfPayState
44 {
45   ASF_NOT_STARTED,
46   ASF_DATA_OBJECT,
47   ASF_PACKETS,
48   ASF_END
49 };
50 
51 typedef struct _GstRtpAsfPay GstRtpAsfPay;
52 typedef struct _GstRtpAsfPayClass GstRtpAsfPayClass;
53 
54 struct _GstRtpAsfPay
55 {
56   GstRTPBasePayload rtppay;
57 
58   enum GstRtpAsfPayState state;
59 
60   guint32 first_ts;
61   gchar *config;
62   guint64 packets_count;
63   GstAsfFileInfo asfinfo;
64 
65   /* current output buffer */
66   GstBuffer *current;
67   guint32 cur_off;
68   guint32 ts;
69   gboolean has_ts;
70   gboolean marker;
71 
72   /* keeping it here to avoid allocs/frees */
73   GstAsfPacketInfo packetinfo;
74 
75   GstBuffer *headers;
76 };
77 
78 struct _GstRtpAsfPayClass
79 {
80   GstRTPBasePayloadClass parent_class;
81 };
82 
83 GType gst_rtp_asf_pay_get_type (void);
84 
85 GST_ELEMENT_REGISTER_DECLARE (rtpasfpay);
86 
87 G_END_DECLS
88 #endif /* __GST_RTP_ASF_PAY_H__ */
89