2019-12-20 14:05:52 +00:00
|
|
|
/* GStreamer
|
|
|
|
* Copyright (C) 2019 Seungha Yang <seungha.yang@navercorp.com>
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __GST_VP9_PICTURE_H__
|
|
|
|
#define __GST_VP9_PICTURE_H__
|
|
|
|
|
2020-01-31 22:54:57 +00:00
|
|
|
#include <gst/codecs/codecs-prelude.h>
|
2021-03-30 02:49:43 +00:00
|
|
|
#include <gst/codecs/gstvp9statefulparser.h>
|
2019-12-20 14:05:52 +00:00
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
|
|
#define GST_TYPE_VP9_PICTURE (gst_vp9_picture_get_type())
|
|
|
|
#define GST_IS_VP9_PICTURE(obj) (GST_IS_MINI_OBJECT_TYPE(obj, GST_TYPE_VP9_PICTURE))
|
|
|
|
#define GST_VP9_PICTURE(obj) ((GstVp9Picture *)obj)
|
|
|
|
#define GST_VP9_PICTURE_CAST(obj) (GST_VP9_PICTURE(obj))
|
|
|
|
|
|
|
|
typedef struct _GstVp9Picture GstVp9Picture;
|
|
|
|
|
|
|
|
struct _GstVp9Picture
|
|
|
|
{
|
2020-10-16 08:35:36 +00:00
|
|
|
/*< private >*/
|
2019-12-20 14:05:52 +00:00
|
|
|
GstMiniObject parent;
|
|
|
|
|
2020-02-15 02:50:15 +00:00
|
|
|
/* From GstVideoCodecFrame */
|
|
|
|
guint32 system_frame_number;
|
2019-12-20 14:05:52 +00:00
|
|
|
|
2021-03-30 02:49:43 +00:00
|
|
|
GstVp9FrameHeader frame_hdr;
|
2019-12-20 14:05:52 +00:00
|
|
|
|
|
|
|
/* raw data and size (does not have ownership) */
|
|
|
|
const guint8 * data;
|
|
|
|
gsize size;
|
|
|
|
|
|
|
|
gpointer user_data;
|
|
|
|
GDestroyNotify notify;
|
|
|
|
};
|
|
|
|
|
2020-01-31 22:54:57 +00:00
|
|
|
GST_CODECS_API
|
2019-12-20 14:05:52 +00:00
|
|
|
GType gst_vp9_picture_get_type (void);
|
|
|
|
|
2020-01-31 22:54:57 +00:00
|
|
|
GST_CODECS_API
|
2019-12-20 14:05:52 +00:00
|
|
|
GstVp9Picture * gst_vp9_picture_new (void);
|
|
|
|
|
|
|
|
static inline GstVp9Picture *
|
|
|
|
gst_vp9_picture_ref (GstVp9Picture * picture)
|
|
|
|
{
|
|
|
|
return (GstVp9Picture *) gst_mini_object_ref (GST_MINI_OBJECT_CAST (picture));
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void
|
|
|
|
gst_vp9_picture_unref (GstVp9Picture * picture)
|
|
|
|
{
|
|
|
|
gst_mini_object_unref (GST_MINI_OBJECT_CAST (picture));
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline gboolean
|
|
|
|
gst_vp9_picture_replace (GstVp9Picture ** old_picture,
|
|
|
|
GstVp9Picture * new_picture)
|
|
|
|
{
|
|
|
|
return gst_mini_object_replace ((GstMiniObject **) old_picture,
|
|
|
|
(GstMiniObject *) new_picture);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void
|
|
|
|
gst_vp9_picture_clear (GstVp9Picture ** picture)
|
|
|
|
{
|
|
|
|
if (picture && *picture) {
|
|
|
|
gst_vp9_picture_unref (*picture);
|
|
|
|
*picture = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-01-31 22:54:57 +00:00
|
|
|
GST_CODECS_API
|
2019-12-20 14:05:52 +00:00
|
|
|
void gst_vp9_picture_set_user_data (GstVp9Picture * picture,
|
|
|
|
gpointer user_data,
|
|
|
|
GDestroyNotify notify);
|
|
|
|
|
2020-01-31 22:54:57 +00:00
|
|
|
GST_CODECS_API
|
2019-12-20 14:05:52 +00:00
|
|
|
gpointer gst_vp9_picture_get_user_data (GstVp9Picture * picture);
|
|
|
|
|
|
|
|
/*******************
|
|
|
|
* GstVp9Dpb *
|
|
|
|
*******************/
|
|
|
|
typedef struct _GstVp9Dpb GstVp9Dpb;
|
|
|
|
|
|
|
|
struct _GstVp9Dpb
|
|
|
|
{
|
|
|
|
GstVp9Picture *pic_list[GST_VP9_REF_FRAMES];
|
|
|
|
};
|
|
|
|
|
2020-01-31 22:54:57 +00:00
|
|
|
GST_CODECS_API
|
2019-12-20 14:05:52 +00:00
|
|
|
GstVp9Dpb * gst_vp9_dpb_new (void);
|
|
|
|
|
2020-01-31 22:54:57 +00:00
|
|
|
GST_CODECS_API
|
2019-12-20 14:05:52 +00:00
|
|
|
void gst_vp9_dpb_free (GstVp9Dpb * dpb);
|
|
|
|
|
2020-01-31 22:54:57 +00:00
|
|
|
GST_CODECS_API
|
2019-12-20 14:05:52 +00:00
|
|
|
void gst_vp9_dpb_clear (GstVp9Dpb * dpb);
|
|
|
|
|
2020-01-31 22:54:57 +00:00
|
|
|
GST_CODECS_API
|
2019-12-20 14:05:52 +00:00
|
|
|
void gst_vp9_dpb_add (GstVp9Dpb * dpb,
|
|
|
|
GstVp9Picture * picture);
|
|
|
|
|
2020-02-09 16:20:16 +00:00
|
|
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstVp9Picture, gst_vp9_picture_unref)
|
|
|
|
|
2019-12-20 14:05:52 +00:00
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __GST_VP9_PICTURE_H__ */
|