Debian Codegraph @

gst-libs/gst/codecs/gstvp8picture.h

raw symbols SCIP
1 /* GStreamer
2 * Copyright (C) 2020 Seungha Yang <[email protected]>
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 #ifndef __GST_VP8_PICTURE_H__
21 #define __GST_VP8_PICTURE_H__
22
23 #include <gst/codecs/codecs-prelude.h>
24 #include <gst/codecs/gstcodecpicture.h>
25 #include <gst/codecparsers/gstvp8parser.h>
26 #include <gst/video/video.h>
27
28 G_BEGIN_DECLS
29
30 #define GST_TYPE_VP8_PICTURE (gst_vp8_picture_get_type())
31 #define GST_IS_VP8_PICTURE(obj) (GST_IS_MINI_OBJECT_TYPE(obj, GST_TYPE_VP8_PICTURE))
32 #define GST_VP8_PICTURE(obj) ((GstVp8Picture *)obj)
33 #define GST_VP8_PICTURE_CAST(obj) (GST_VP8_PICTURE(obj))
34
35 typedef struct _GstVp8Picture GstVp8Picture;
36
37 struct _GstVp8Picture
38 {
39 /*< private >*/
40 GstCodecPicture parent;
41
42 GstVp8FrameHdr frame_hdr;
43
44 /* raw data and size (does not have ownership) */
45 const guint8 * data;
46 gsize size;
47 };
48
49 GST_CODECS_API
50 GType gst_vp8_picture_get_type (void);
51
52 GST_CODECS_API
53 GstVp8Picture * gst_vp8_picture_new (void) G_GNUC_WARN_UNUSED_RESULT;
54
55 static inline GstVp8Picture *
56 gst_vp8_picture_ref (GstVp8Picture * picture)
57 {
58 return (GstVp8Picture *) gst_mini_object_ref (GST_MINI_OBJECT_CAST (picture));
59 }
60
61 static inline void
62 gst_vp8_picture_unref (GstVp8Picture * picture)
63 {
64 gst_mini_object_unref (GST_MINI_OBJECT_CAST (picture));
65 }
66
67 static inline gboolean
68 gst_vp8_picture_replace (GstVp8Picture ** old_picture,
69 GstVp8Picture * new_picture)
70 {
71 return gst_mini_object_replace ((GstMiniObject **) old_picture,
72 (GstMiniObject *) new_picture);
73 }
74
75 static inline void
76 gst_clear_vp8_picture (GstVp8Picture ** picture)
77 {
78 if (picture && *picture) {
79 gst_vp8_picture_unref (*picture);
80 *picture = NULL;
81 }
82 }
83
84 static inline void
85 gst_vp8_picture_set_user_data (GstVp8Picture * picture, gpointer user_data,
86 GDestroyNotify notify)
87 {
88 gst_codec_picture_set_user_data (GST_CODEC_PICTURE (picture),
89 user_data, notify);
90 }
91
92 static inline gpointer
93 gst_vp8_picture_get_user_data (GstVp8Picture * picture)
94 {
95 return gst_codec_picture_get_user_data (GST_CODEC_PICTURE (picture));
96 }
97
98 static inline void
99 gst_vp8_picture_set_discont_state (GstVp8Picture * picture,
100 GstVideoCodecState * discont_state)
101 {
102 gst_codec_picture_set_discont_state (GST_CODEC_PICTURE (picture),
103 discont_state);
104 }
105
106 G_END_DECLS
107
108 #endif /* __GST_VP8_PICTURE_H__ */