| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
#ifndef __GST_AV1_PICTURE_H__ |
| 21 |
#define __GST_AV1_PICTURE_H__ |
| 22 |
|
| 23 |
#include <gst/codecs/codecs-prelude.h> |
| 24 |
#include <gst/codecs/gstcodecpicture.h> |
| 25 |
#include <gst/codecparsers/gstav1parser.h> |
| 26 |
#include <gst/video/video.h> |
| 27 |
|
| 28 |
G_BEGIN_DECLS |
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
#define GST_TYPE_AV1_PICTURE (gst_av1_picture_get_type()) |
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
#define GST_IS_AV1_PICTURE(obj) (GST_IS_MINI_OBJECT_TYPE(obj, GST_TYPE_AV1_PICTURE)) |
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
#define GST_AV1_PICTURE(obj) ((GstAV1Picture *)obj) |
| 48 |
|
| 49 |
typedef struct _GstAV1Picture GstAV1Picture; |
| 50 |
typedef struct _GstAV1Tile GstAV1Tile; |
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
struct _GstAV1Tile |
| 58 |
{ |
| 59 |
GstAV1TileGroupOBU tile_group; |
| 60 |
|
| 61 |
GstAV1OBU obu; |
| 62 |
}; |
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
struct _GstAV1Picture |
| 70 |
{ |
| 71 |
|
| 72 |
GstCodecPicture parent; |
| 73 |
|
| 74 |
GstAV1FrameHeaderOBU frame_hdr; |
| 75 |
|
| 76 |
|
| 77 |
guint8 temporal_id; |
| 78 |
guint8 spatial_id; |
| 79 |
|
| 80 |
|
| 81 |
guint32 display_frame_id; |
| 82 |
gboolean show_frame; |
| 83 |
gboolean showable_frame; |
| 84 |
gboolean apply_grain; |
| 85 |
}; |
| 86 |
|
| 87 |
GST_CODECS_API |
| 88 |
GType gst_av1_picture_get_type (void); |
| 89 |
|
| 90 |
GST_CODECS_API |
| 91 |
GstAV1Picture * gst_av1_picture_new (void) G_GNUC_WARN_UNUSED_RESULT; |
| 92 |
|
| 93 |
static inline GstAV1Picture * |
| 94 |
gst_av1_picture_ref (GstAV1Picture * picture) |
| 95 |
{ |
| 96 |
return (GstAV1Picture *) gst_mini_object_ref (GST_MINI_OBJECT_CAST (picture)); |
| 97 |
} |
| 98 |
|
| 99 |
static inline void |
| 100 |
gst_av1_picture_unref (GstAV1Picture * picture) |
| 101 |
{ |
| 102 |
gst_mini_object_unref (GST_MINI_OBJECT_CAST (picture)); |
| 103 |
} |
| 104 |
|
| 105 |
static inline gboolean |
| 106 |
gst_av1_picture_replace (GstAV1Picture ** old_picture, |
| 107 |
GstAV1Picture * new_picture) |
| 108 |
{ |
| 109 |
return gst_mini_object_replace ((GstMiniObject **) old_picture, |
| 110 |
(GstMiniObject *) new_picture); |
| 111 |
} |
| 112 |
|
| 113 |
static inline void |
| 114 |
gst_clear_av1_picture (GstAV1Picture ** picture) |
| 115 |
{ |
| 116 |
if (picture && *picture) { |
| 117 |
gst_av1_picture_unref (*picture); |
| 118 |
*picture = NULL; |
| 119 |
} |
| 120 |
} |
| 121 |
|
| 122 |
static inline void |
| 123 |
gst_av1_picture_set_user_data (GstAV1Picture * picture, gpointer user_data, |
| 124 |
GDestroyNotify notify) |
| 125 |
{ |
| 126 |
gst_codec_picture_set_user_data (GST_CODEC_PICTURE (picture), |
| 127 |
user_data, notify); |
| 128 |
} |
| 129 |
|
| 130 |
static inline gpointer |
| 131 |
gst_av1_picture_get_user_data (GstAV1Picture * picture) |
| 132 |
{ |
| 133 |
return gst_codec_picture_get_user_data (GST_CODEC_PICTURE (picture)); |
| 134 |
} |
| 135 |
|
| 136 |
static inline void |
| 137 |
gst_av1_picture_set_discont_state (GstAV1Picture * picture, |
| 138 |
GstVideoCodecState * discont_state) |
| 139 |
{ |
| 140 |
gst_codec_picture_set_discont_state (GST_CODEC_PICTURE (picture), |
| 141 |
discont_state); |
| 142 |
} |
| 143 |
|
| 144 |
|
| 145 |
|
| 146 |
|
| 147 |
typedef struct _GstAV1Dpb GstAV1Dpb; |
| 148 |
|
| 149 |
|
| 150 |
|
| 151 |
|
| 152 |
|
| 153 |
|
| 154 |
struct _GstAV1Dpb |
| 155 |
{ |
| 156 |
GstAV1Picture *pic_list[GST_AV1_NUM_REF_FRAMES]; |
| 157 |
}; |
| 158 |
|
| 159 |
GST_CODECS_API |
| 160 |
GstAV1Dpb * gst_av1_dpb_new (void); |
| 161 |
|
| 162 |
GST_CODECS_API |
| 163 |
void gst_av1_dpb_free (GstAV1Dpb * dpb); |
| 164 |
|
| 165 |
GST_CODECS_API |
| 166 |
void gst_av1_dpb_clear (GstAV1Dpb * dpb); |
| 167 |
|
| 168 |
GST_CODECS_API |
| 169 |
void gst_av1_dpb_add (GstAV1Dpb * dpb, |
| 170 |
GstAV1Picture * picture); |
| 171 |
|
| 172 |
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstAV1Picture, gst_av1_picture_unref) |
| 173 |
|
| 174 |
G_END_DECLS |
| 175 |
|
| 176 |
#endif |