1 /* 2 * GStreamer AVTP Plugin 3 * Copyright (C) 2019 Intel Corporation 4 * 5 * This library is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU Lesser General Public 7 * License as published by the Free Software Foundation; either 8 * version 2.1 of the License, or (at your option) any later 9 * 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 * Lesser General Public License for more details. 15 * 16 * You should have received a copy of the GNU Lesser General Public 17 * License along with this library; if not, write to the 18 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 19 * Boston, MA 02110-1301 USA 20 */ 21 22 #ifndef __GST_AVTP_BASE_PAYLOAD_H__ 23 #define __GST_AVTP_BASE_PAYLOAD_H__ 24 25 #include <gst/gst.h> 26 27 G_BEGIN_DECLS 28 29 #define GST_TYPE_AVTP_BASE_PAYLOAD (gst_avtp_base_payload_get_type()) 30 #define GST_AVTP_BASE_PAYLOAD(obj) \ 31 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AVTP_BASE_PAYLOAD,GstAvtpBasePayload)) 32 #define GST_AVTP_BASE_PAYLOAD_CLASS(klass) \ 33 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_AVTP_BASE_PAYLOAD,GstAvtpBasePayloadClass)) 34 #define GST_IS_AVTP_BASE_PAYLOAD(obj) \ 35 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AVTP_BASE_PAYLOAD)) 36 #define GST_IS_AVTP_BASE_PAYLOAD_CLASS(klass) \ 37 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AVTP_BASE_PAYLOAD)) 38 39 typedef struct _GstAvtpBasePayload GstAvtpBasePayload; 40 typedef struct _GstAvtpBasePayloadClass GstAvtpBasePayloadClass; 41 42 struct _GstAvtpBasePayload 43 { 44 GstElement element; 45 46 GstPad *sinkpad; 47 GstPad *srcpad; 48 49 guint64 streamid; 50 guint mtt; 51 guint tu; 52 guint64 processing_deadline; 53 54 GstClockTime latency; 55 GstSegment segment; 56 guint8 seqnum; 57 58 gpointer _gst_reserved[GST_PADDING]; 59 }; 60 61 struct _GstAvtpBasePayloadClass 62 { 63 GstElementClass parent_class; 64 65 /* Pure virtual function. */ 66 GstPadChainFunction chain; 67 68 GstPadEventFunction sink_event; 69 70 gpointer _gst_reserved[GST_PADDING]; 71 }; 72 73 GType gst_avtp_base_payload_get_type (void); 74 75 GstClockTime gst_avtp_base_payload_calc_ptime (GstAvtpBasePayload * 76 avtpbasepayload, GstBuffer * buffer); 77 78 G_END_DECLS 79 80 #endif /* __GST_AVTP_BASE_PAYLOAD_H__ */ 81