1 /* 2 * Copyright (c) 2015, Collabora Ltd. 3 * 4 * Redistribution and use in source and binary forms, with or without modification, 5 * are permitted provided that the following conditions are met: 6 * 7 * 1. Redistributions of source code must retain the above copyright notice, this 8 * list of conditions and the following disclaimer. 9 * 10 * 2. Redistributions in binary form must reproduce the above copyright notice, this 11 * list of conditions and the following disclaimer in the documentation and/or other 12 * materials provided with the distribution. 13 * 14 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 17 * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 18 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 21 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 23 * OF SUCH DAMAGE. 24 */ 25 26 #ifndef __GST_SCTP_ENC_H__ 27 #define __GST_SCTP_ENC_H__ 28 29 #include <gst/gst.h> 30 #include <gst/base/base.h> 31 #include "sctpassociation.h" 32 33 G_BEGIN_DECLS 34 35 #define GST_TYPE_SCTP_ENC (gst_sctp_enc_get_type()) 36 #define GST_SCTP_ENC(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_SCTP_ENC, GstSctpEnc)) 37 #define GST_SCTP_ENC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_SCTP_ENC, GstSctpEncClass)) 38 #define GST_IS_SCTP_ENC(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_SCTP_ENC)) 39 #define GST_IS_SCTP_ENC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_SCTP_ENC)) 40 typedef struct _GstSctpEnc GstSctpEnc; 41 typedef struct _GstSctpEncClass GstSctpEncClass; 42 typedef struct _GstSctpEncPrivate GstSctpEncPrivate; 43 44 struct _GstSctpEnc 45 { 46 GstElement element; 47 48 GstPad *src_pad; 49 GstFlowReturn src_ret; 50 gboolean need_stream_start_caps, need_segment; 51 guint32 sctp_association_id; 52 guint16 remote_sctp_port; 53 gboolean use_sock_stream; 54 55 GstSctpAssociation *sctp_association; 56 GstDataQueue *outbound_sctp_packet_queue; 57 58 GQueue pending_pads; 59 60 gulong signal_handler_state_changed; 61 }; 62 63 struct _GstSctpEncClass 64 { 65 GstElementClass parent_class; 66 67 void (*on_sctp_association_is_established) (GstSctpEnc * sctp_enc, 68 gboolean established); 69 guint64 (*on_get_stream_bytes_sent) (GstSctpEnc * sctp_enc, 70 guint stream_id); 71 72 }; 73 74 GType gst_sctp_enc_get_type (void); 75 GST_ELEMENT_REGISTER_DECLARE (sctpenc); 76 77 G_END_DECLS 78 79 #endif /* __GST_SCTP_ENC_H__ */ 80