| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
#ifndef __GST_VP9_PICTURE_H__ |
| 21 |
#define __GST_VP9_PICTURE_H__ |
| 22 |
|
| 23 |
#include <gst/codecs/codecs-prelude.h> |
| 24 |
#include <gst/codecs/gstcodecpicture.h> |
| 25 |
#include <gst/codecs/gstvp9statefulparser.h> |
| 26 |
#include <gst/video/video.h> |
| 27 |
|
| 28 |
G_BEGIN_DECLS |
| 29 |
|
| 30 |
#define GST_TYPE_VP9_PICTURE (gst_vp9_picture_get_type()) |
| 31 |
#define GST_IS_VP9_PICTURE(obj) (GST_IS_MINI_OBJECT_TYPE(obj, GST_TYPE_VP9_PICTURE)) |
| 32 |
#define GST_VP9_PICTURE(obj) ((GstVp9Picture *)obj) |
| 33 |
#define GST_VP9_PICTURE_CAST(obj) (GST_VP9_PICTURE(obj)) |
| 34 |
|
| 35 |
typedef struct _GstVp9Picture GstVp9Picture; |
| 36 |
|
| 37 |
struct _GstVp9Picture |
| 38 |
{ |
| 39 |
|
| 40 |
GstCodecPicture parent; |
| 41 |
|
| 42 |
GstVp9FrameHeader frame_hdr; |
| 43 |
|
| 44 |
|
| 45 |
const guint8 * data; |
| 46 |
gsize size; |
| 47 |
}; |
| 48 |
|
| 49 |
GST_CODECS_API |
| 50 |
GType gst_vp9_picture_get_type (void); |
| 51 |
|
| 52 |
GST_CODECS_API |
| 53 |
GstVp9Picture * gst_vp9_picture_new (void) G_GNUC_WARN_UNUSED_RESULT; |
| 54 |
|
| 55 |
static inline GstVp9Picture * |
| 56 |
gst_vp9_picture_ref (GstVp9Picture * picture) |
| 57 |
{ |
| 58 |
return (GstVp9Picture *) gst_mini_object_ref (GST_MINI_OBJECT_CAST (picture)); |
| 59 |
} |
| 60 |
|
| 61 |
static inline void |
| 62 |
gst_vp9_picture_unref (GstVp9Picture * picture) |
| 63 |
{ |
| 64 |
gst_mini_object_unref (GST_MINI_OBJECT_CAST (picture)); |
| 65 |
} |
| 66 |
|
| 67 |
static inline gboolean |
| 68 |
gst_vp9_picture_replace (GstVp9Picture ** old_picture, |
| 69 |
GstVp9Picture * 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_vp9_picture (GstVp9Picture ** picture) |
| 77 |
{ |
| 78 |
if (picture && *picture) { |
| 79 |
gst_vp9_picture_unref (*picture); |
| 80 |
*picture = NULL; |
| 81 |
} |
| 82 |
} |
| 83 |
|
| 84 |
static inline void |
| 85 |
gst_vp9_picture_set_user_data (GstVp9Picture * 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_vp9_picture_get_user_data (GstVp9Picture * picture) |
| 94 |
{ |
| 95 |
return gst_codec_picture_get_user_data (GST_CODEC_PICTURE (picture)); |
| 96 |
} |
| 97 |
|
| 98 |
static inline void |
| 99 |
gst_vp9_picture_set_discont_state (GstVp9Picture * picture, |
| 100 |
GstVideoCodecState * discont_state) |
| 101 |
{ |
| 102 |
gst_codec_picture_set_discont_state (GST_CODEC_PICTURE (picture), |
| 103 |
discont_state); |
| 104 |
} |
| 105 |
|
| 106 |
|
| 107 |
|
| 108 |
|
| 109 |
typedef struct _GstVp9Dpb GstVp9Dpb; |
| 110 |
|
| 111 |
struct _GstVp9Dpb |
| 112 |
{ |
| 113 |
GstVp9Picture *pic_list[GST_VP9_REF_FRAMES]; |
| 114 |
}; |
| 115 |
|
| 116 |
GST_CODECS_API |
| 117 |
GstVp9Dpb * gst_vp9_dpb_new (void); |
| 118 |
|
| 119 |
GST_CODECS_API |
| 120 |
void gst_vp9_dpb_free (GstVp9Dpb * dpb); |
| 121 |
|
| 122 |
GST_CODECS_API |
| 123 |
void gst_vp9_dpb_clear (GstVp9Dpb * dpb); |
| 124 |
|
| 125 |
GST_CODECS_API |
| 126 |
void gst_vp9_dpb_add (GstVp9Dpb * dpb, |
| 127 |
GstVp9Picture * picture); |
| 128 |
|
| 129 |
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstVp9Picture, gst_vp9_picture_unref) |
| 130 |
|
| 131 |
G_END_DECLS |
| 132 |
|
| 133 |
#endif |