2 * Copyright (C) <2006> Wim Taymans <wim.taymans@gmail.com>
3 * Copyright (C) <2014> Jurgen Slowack <jurgenslowack@gmail.com>
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.
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.
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.
21 #ifndef __GST_RTP_H265_DEPAY_H__
22 #define __GST_RTP_H265_DEPAY_H__
25 #include <gst/base/gstadapter.h>
26 #include <gst/rtp/gstrtpbasedepayload.h>
27 #include "gstrtph265types.h"
30 #define GST_TYPE_RTP_H265_DEPAY \
31 (gst_rtp_h265_depay_get_type())
32 #define GST_RTP_H265_DEPAY(obj) \
33 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_RTP_H265_DEPAY,GstRtpH265Depay))
34 #define GST_RTP_H265_DEPAY_CLASS(klass) \
35 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_RTP_H265_DEPAY,GstRtpH265DepayClass))
36 #define GST_IS_RTP_H265_DEPAY(obj) \
37 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_RTP_H265_DEPAY))
38 #define GST_IS_RTP_H265_DEPAY_CLASS(klass) \
39 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_RTP_H265_DEPAY))
40 typedef struct _GstRtpH265Depay GstRtpH265Depay;
41 typedef struct _GstRtpH265DepayClass GstRtpH265DepayClass;
43 #define GST_H265_VPS_NUT 32
44 #define GST_H265_SPS_NUT 33
45 #define GST_H265_PPS_NUT 34
49 GST_H265_STREAM_FORMAT_UNKNOWN,
50 GST_H265_STREAM_FORMAT_BYTESTREAM,
51 GST_H265_STREAM_FORMAT_HVC1,
52 GST_H265_STREAM_FORMAT_HEV1
53 } GstH265StreamFormat;
55 struct _GstRtpH265Depay
57 GstRTPBaseDepayload depayload;
59 const gchar *stream_format;
60 GstH265StreamFormat output_format; /* bytestream, hvc1 or hev1 */
63 GstBuffer *codec_data;
69 GstAdapter *picture_adapter;
70 gboolean picture_start;
72 gboolean last_keyframe;
74 /* Work around broken payloaders wrt. Fragmentation Units */
75 guint8 current_fu_type;
76 guint16 last_fu_seqnum;
77 GstClockTime fu_timestamp;
84 gboolean new_codec_data;
86 /* downstream allocator */
87 GstAllocator *allocator;
88 GstAllocationParams params;
91 struct _GstRtpH265DepayClass
93 GstRTPBaseDepayloadClass parent_class;
109 GType gst_rtp_h265_depay_get_type (void);
111 gboolean gst_rtp_h265_depay_plugin_init (GstPlugin * plugin);
113 gboolean gst_rtp_h265_add_vps_sps_pps (GstElement * rtph265, GPtrArray * vps,
114 GPtrArray * sps, GPtrArray * pps, GstBuffer * nal);
117 #endif /* __GST_RTP_H265_DEPAY_H__ */