mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
Move CODEC base classes into it's own library
This introduce a library which contains a set of base classes which handles the parsing and the state tracking for the purpose of decoding different CODECs. Currently H264, H265 and VP9 are supported. These bases classes are used to decode with low level decoding API like DXVA, NVDEC, VDPAU, VAAPI and V4L2 State Less decoders. The new library is named gstreamer-codecs-1.0 / libgstcodecs.
This commit is contained in:
parent
ad53de1da1
commit
00d04784d3
19 changed files with 189 additions and 104 deletions
40
gst-libs/gst/codecs/codecs-prelude.h
Normal file
40
gst-libs/gst/codecs/codecs-prelude.h
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
/* GStreamer CODEC Library
|
||||||
|
* Copyright (C) 2020 GStreamer developers
|
||||||
|
*
|
||||||
|
* codecs-prelude.h: prelude include header for gst-codecs library
|
||||||
|
*
|
||||||
|
* 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_CODECS_PRELUDE_H__
|
||||||
|
#define __GST_CODECS_PRELUDE_H__
|
||||||
|
|
||||||
|
#ifndef GST_USE_UNSTABLE_API
|
||||||
|
#warning "The CODECs library is unstable API and may change in future."
|
||||||
|
#warning "You can define GST_USE_UNSTABLE_API to avoid this warning."
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <gst/gst.h>
|
||||||
|
|
||||||
|
#ifndef GST_CODECS_API
|
||||||
|
# ifdef BUILDING_GST_CODECS
|
||||||
|
# define GST_CODECS_API GST_API_EXPORT /* from config.h */
|
||||||
|
# else
|
||||||
|
# define GST_CODECS_API GST_API_IMPORT
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* __GST_CODECS_PRELUDE_H__ */
|
|
@ -53,8 +53,8 @@
|
||||||
|
|
||||||
#include "gsth264decoder.h"
|
#include "gsth264decoder.h"
|
||||||
|
|
||||||
GST_DEBUG_CATEGORY_EXTERN (gst_d3d11_h264_dec_debug);
|
GST_DEBUG_CATEGORY (gst_h264_decoder_debug);
|
||||||
#define GST_CAT_DEFAULT gst_d3d11_h264_dec_debug
|
#define GST_CAT_DEFAULT gst_h264_decoder_debug
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
|
@ -123,8 +123,11 @@ struct _GstH264DecoderPrivate
|
||||||
};
|
};
|
||||||
|
|
||||||
#define parent_class gst_h264_decoder_parent_class
|
#define parent_class gst_h264_decoder_parent_class
|
||||||
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (GstH264Decoder, gst_h264_decoder,
|
G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GstH264Decoder, gst_h264_decoder,
|
||||||
GST_TYPE_VIDEO_DECODER);
|
GST_TYPE_VIDEO_DECODER,
|
||||||
|
G_ADD_PRIVATE (GstH264Decoder);
|
||||||
|
GST_DEBUG_CATEGORY_INIT (gst_h264_decoder_debug, "h264decoder", 0,
|
||||||
|
"H.264 Video Decoder"));
|
||||||
|
|
||||||
static gboolean gst_h264_decoder_start (GstVideoDecoder * decoder);
|
static gboolean gst_h264_decoder_start (GstVideoDecoder * decoder);
|
||||||
static gboolean gst_h264_decoder_stop (GstVideoDecoder * decoder);
|
static gboolean gst_h264_decoder_stop (GstVideoDecoder * decoder);
|
|
@ -20,10 +20,11 @@
|
||||||
#ifndef __GST_H264_DECODER_H__
|
#ifndef __GST_H264_DECODER_H__
|
||||||
#define __GST_H264_DECODER_H__
|
#define __GST_H264_DECODER_H__
|
||||||
|
|
||||||
#include <gst/gst.h>
|
#include <gst/codecs/codecs-prelude.h>
|
||||||
|
|
||||||
#include <gst/video/video.h>
|
#include <gst/video/video.h>
|
||||||
#include <gst/codecparsers/gsth264parser.h>
|
#include <gst/codecparsers/gsth264parser.h>
|
||||||
#include "gsth264picture.h"
|
#include <gst/codecs/gsth264picture.h>
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
|
@ -105,6 +106,7 @@ struct _GstH264DecoderClass
|
||||||
gpointer padding[GST_PADDING_LARGE];
|
gpointer padding[GST_PADDING_LARGE];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
GST_CODECS_API
|
||||||
GType gst_h264_decoder_get_type (void);
|
GType gst_h264_decoder_get_type (void);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
|
@ -23,8 +23,8 @@
|
||||||
|
|
||||||
#include "gsth264picture.h"
|
#include "gsth264picture.h"
|
||||||
|
|
||||||
GST_DEBUG_CATEGORY_EXTERN (gst_d3d11_h264_dec_debug);
|
GST_DEBUG_CATEGORY_EXTERN (gst_h264_decoder_debug);
|
||||||
#define GST_CAT_DEFAULT gst_d3d11_h264_dec_debug
|
#define GST_CAT_DEFAULT gst_h264_decoder_debug
|
||||||
|
|
||||||
GST_DEFINE_MINI_OBJECT_TYPE (GstH264Picture, gst_h264_picture);
|
GST_DEFINE_MINI_OBJECT_TYPE (GstH264Picture, gst_h264_picture);
|
||||||
|
|
|
@ -20,7 +20,8 @@
|
||||||
#ifndef __GST_H264_PICTURE_H__
|
#ifndef __GST_H264_PICTURE_H__
|
||||||
#define __GST_H264_PICTURE_H__
|
#define __GST_H264_PICTURE_H__
|
||||||
|
|
||||||
#include <gst/gst.h>
|
#include <gst/codecs/codecs-prelude.h>
|
||||||
|
|
||||||
#include <gst/codecparsers/gsth264parser.h>
|
#include <gst/codecparsers/gsth264parser.h>
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
@ -94,27 +95,24 @@ struct _GstH264Picture
|
||||||
GDestroyNotify notify;
|
GDestroyNotify notify;
|
||||||
};
|
};
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
GST_CODECS_API
|
||||||
GType gst_h264_picture_get_type (void);
|
GType gst_h264_picture_get_type (void);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
GST_CODECS_API
|
||||||
GstH264Picture * gst_h264_picture_new (void);
|
GstH264Picture * gst_h264_picture_new (void);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
|
||||||
static inline GstH264Picture *
|
static inline GstH264Picture *
|
||||||
gst_h264_picture_ref (GstH264Picture * picture)
|
gst_h264_picture_ref (GstH264Picture * picture)
|
||||||
{
|
{
|
||||||
return (GstH264Picture *) gst_mini_object_ref (GST_MINI_OBJECT_CAST (picture));
|
return (GstH264Picture *) gst_mini_object_ref (GST_MINI_OBJECT_CAST (picture));
|
||||||
}
|
}
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
|
||||||
static inline void
|
static inline void
|
||||||
gst_h264_picture_unref (GstH264Picture * picture)
|
gst_h264_picture_unref (GstH264Picture * picture)
|
||||||
{
|
{
|
||||||
gst_mini_object_unref (GST_MINI_OBJECT_CAST (picture));
|
gst_mini_object_unref (GST_MINI_OBJECT_CAST (picture));
|
||||||
}
|
}
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
|
||||||
static inline gboolean
|
static inline gboolean
|
||||||
gst_h264_picture_replace (GstH264Picture ** old_picture,
|
gst_h264_picture_replace (GstH264Picture ** old_picture,
|
||||||
GstH264Picture * new_picture)
|
GstH264Picture * new_picture)
|
||||||
|
@ -123,7 +121,6 @@ gst_h264_picture_replace (GstH264Picture ** old_picture,
|
||||||
(GstMiniObject *) new_picture);
|
(GstMiniObject *) new_picture);
|
||||||
}
|
}
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
|
||||||
static inline void
|
static inline void
|
||||||
gst_h264_picture_clear (GstH264Picture ** picture)
|
gst_h264_picture_clear (GstH264Picture ** picture)
|
||||||
{
|
{
|
||||||
|
@ -133,12 +130,12 @@ gst_h264_picture_clear (GstH264Picture ** picture)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
GST_CODECS_API
|
||||||
void gst_h264_picture_set_user_data (GstH264Picture * picture,
|
void gst_h264_picture_set_user_data (GstH264Picture * picture,
|
||||||
gpointer user_data,
|
gpointer user_data,
|
||||||
GDestroyNotify notify);
|
GDestroyNotify notify);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
GST_CODECS_API
|
||||||
gpointer gst_h264_picture_get_user_data (GstH264Picture * picture);
|
gpointer gst_h264_picture_get_user_data (GstH264Picture * picture);
|
||||||
|
|
||||||
/*******************
|
/*******************
|
||||||
|
@ -146,69 +143,69 @@ gpointer gst_h264_picture_get_user_data (GstH264Picture * picture);
|
||||||
*******************/
|
*******************/
|
||||||
typedef struct _GstH264Dpb GstH264Dpb;
|
typedef struct _GstH264Dpb GstH264Dpb;
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
GST_CODECS_API
|
||||||
GstH264Dpb * gst_h264_dpb_new (void);
|
GstH264Dpb * gst_h264_dpb_new (void);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
GST_CODECS_API
|
||||||
void gst_h264_dpb_set_max_num_pics (GstH264Dpb * dpb,
|
void gst_h264_dpb_set_max_num_pics (GstH264Dpb * dpb,
|
||||||
gint max_num_pics);
|
gint max_num_pics);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
GST_CODECS_API
|
||||||
gint gst_h264_dpb_get_max_num_pics (GstH264Dpb * dpb);
|
gint gst_h264_dpb_get_max_num_pics (GstH264Dpb * dpb);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
GST_CODECS_API
|
||||||
void gst_h264_dpb_free (GstH264Dpb * dpb);
|
void gst_h264_dpb_free (GstH264Dpb * dpb);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
GST_CODECS_API
|
||||||
void gst_h264_dpb_clear (GstH264Dpb * dpb);
|
void gst_h264_dpb_clear (GstH264Dpb * dpb);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
GST_CODECS_API
|
||||||
void gst_h264_dpb_add (GstH264Dpb * dpb,
|
void gst_h264_dpb_add (GstH264Dpb * dpb,
|
||||||
GstH264Picture * picture);
|
GstH264Picture * picture);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
GST_CODECS_API
|
||||||
void gst_h264_dpb_delete_unused (GstH264Dpb * dpb);
|
void gst_h264_dpb_delete_unused (GstH264Dpb * dpb);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
GST_CODECS_API
|
||||||
void gst_h264_dpb_delete_by_poc (GstH264Dpb * dpb,
|
void gst_h264_dpb_delete_by_poc (GstH264Dpb * dpb,
|
||||||
gint poc);
|
gint poc);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
GST_CODECS_API
|
||||||
gint gst_h264_dpb_num_ref_pictures (GstH264Dpb * dpb);
|
gint gst_h264_dpb_num_ref_pictures (GstH264Dpb * dpb);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
GST_CODECS_API
|
||||||
void gst_h264_dpb_mark_all_non_ref (GstH264Dpb * dpb);
|
void gst_h264_dpb_mark_all_non_ref (GstH264Dpb * dpb);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
GST_CODECS_API
|
||||||
GstH264Picture * gst_h264_dpb_get_short_ref_by_pic_num (GstH264Dpb * dpb,
|
GstH264Picture * gst_h264_dpb_get_short_ref_by_pic_num (GstH264Dpb * dpb,
|
||||||
gint pic_num);
|
gint pic_num);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
GST_CODECS_API
|
||||||
GstH264Picture * gst_h264_dpb_get_long_ref_by_pic_num (GstH264Dpb * dpb,
|
GstH264Picture * gst_h264_dpb_get_long_ref_by_pic_num (GstH264Dpb * dpb,
|
||||||
gint pic_num);
|
gint pic_num);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
GST_CODECS_API
|
||||||
GstH264Picture * gst_h264_dpb_get_lowest_frame_num_short_ref (GstH264Dpb * dpb);
|
GstH264Picture * gst_h264_dpb_get_lowest_frame_num_short_ref (GstH264Dpb * dpb);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
GST_CODECS_API
|
||||||
void gst_h264_dpb_get_pictures_not_outputted (GstH264Dpb * dpb,
|
void gst_h264_dpb_get_pictures_not_outputted (GstH264Dpb * dpb,
|
||||||
GList ** out);
|
GList ** out);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
GST_CODECS_API
|
||||||
void gst_h264_dpb_get_pictures_short_term_ref (GstH264Dpb * dpb,
|
void gst_h264_dpb_get_pictures_short_term_ref (GstH264Dpb * dpb,
|
||||||
GList ** out);
|
GList ** out);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
GST_CODECS_API
|
||||||
void gst_h264_dpb_get_pictures_long_term_ref (GstH264Dpb * dpb,
|
void gst_h264_dpb_get_pictures_long_term_ref (GstH264Dpb * dpb,
|
||||||
GList ** out);
|
GList ** out);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
GST_CODECS_API
|
||||||
GArray * gst_h264_dpb_get_pictures_all (GstH264Dpb * dpb);
|
GArray * gst_h264_dpb_get_pictures_all (GstH264Dpb * dpb);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
GST_CODECS_API
|
||||||
gint gst_h264_dpb_get_size (GstH264Dpb * dpb);
|
gint gst_h264_dpb_get_size (GstH264Dpb * dpb);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
GST_CODECS_API
|
||||||
gboolean gst_h264_dpb_is_full (GstH264Dpb * dpb);
|
gboolean gst_h264_dpb_is_full (GstH264Dpb * dpb);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
|
@ -25,8 +25,8 @@
|
||||||
|
|
||||||
#include "gsth265decoder.h"
|
#include "gsth265decoder.h"
|
||||||
|
|
||||||
GST_DEBUG_CATEGORY_EXTERN (gst_d3d11_h265_dec_debug);
|
GST_DEBUG_CATEGORY (gst_h265_decoder_debug);
|
||||||
#define GST_CAT_DEFAULT gst_d3d11_h265_dec_debug
|
#define GST_CAT_DEFAULT gst_h265_decoder_debug
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
|
@ -97,8 +97,11 @@ struct _GstH265DecoderPrivate
|
||||||
};
|
};
|
||||||
|
|
||||||
#define parent_class gst_h265_decoder_parent_class
|
#define parent_class gst_h265_decoder_parent_class
|
||||||
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (GstH265Decoder, gst_h265_decoder,
|
G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GstH265Decoder, gst_h265_decoder,
|
||||||
GST_TYPE_VIDEO_DECODER);
|
GST_TYPE_VIDEO_DECODER,
|
||||||
|
G_ADD_PRIVATE (GstH265Decoder);
|
||||||
|
GST_DEBUG_CATEGORY_INIT (gst_h265_decoder_debug, "h265decoder", 0,
|
||||||
|
"H.265 Video Decoder"));
|
||||||
|
|
||||||
static gboolean gst_h265_decoder_start (GstVideoDecoder * decoder);
|
static gboolean gst_h265_decoder_start (GstVideoDecoder * decoder);
|
||||||
static gboolean gst_h265_decoder_stop (GstVideoDecoder * decoder);
|
static gboolean gst_h265_decoder_stop (GstVideoDecoder * decoder);
|
|
@ -20,10 +20,11 @@
|
||||||
#ifndef __GST_H265_DECODER_H__
|
#ifndef __GST_H265_DECODER_H__
|
||||||
#define __GST_H265_DECODER_H__
|
#define __GST_H265_DECODER_H__
|
||||||
|
|
||||||
#include <gst/gst.h>
|
#include <gst/codecs/codecs-prelude.h>
|
||||||
|
|
||||||
#include <gst/video/video.h>
|
#include <gst/video/video.h>
|
||||||
#include <gst/codecparsers/gsth265parser.h>
|
#include <gst/codecparsers/gsth265parser.h>
|
||||||
#include "gsth265picture.h"
|
#include <gst/codecs/gsth265picture.h>
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
|
@ -136,6 +137,7 @@ struct _GstH265DecoderClass
|
||||||
gpointer padding[GST_PADDING_LARGE];
|
gpointer padding[GST_PADDING_LARGE];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
GST_CODECS_API
|
||||||
GType gst_h265_decoder_get_type (void);
|
GType gst_h265_decoder_get_type (void);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
|
@ -23,8 +23,8 @@
|
||||||
|
|
||||||
#include "gsth265picture.h"
|
#include "gsth265picture.h"
|
||||||
|
|
||||||
GST_DEBUG_CATEGORY_EXTERN (gst_d3d11_h265_dec_debug);
|
GST_DEBUG_CATEGORY_EXTERN (gst_h265_decoder_debug);
|
||||||
#define GST_CAT_DEFAULT gst_d3d11_h265_dec_debug
|
#define GST_CAT_DEFAULT gst_h265_decoder_debug
|
||||||
|
|
||||||
GST_DEFINE_MINI_OBJECT_TYPE (GstH265Picture, gst_h265_picture);
|
GST_DEFINE_MINI_OBJECT_TYPE (GstH265Picture, gst_h265_picture);
|
||||||
|
|
|
@ -20,7 +20,14 @@
|
||||||
#ifndef __GST_H265_PICTURE_H__
|
#ifndef __GST_H265_PICTURE_H__
|
||||||
#define __GST_H265_PICTURE_H__
|
#define __GST_H265_PICTURE_H__
|
||||||
|
|
||||||
|
#ifndef GST_USE_UNSTABLE_API
|
||||||
|
#warning "The CODECs library is unstable API and may change in future."
|
||||||
|
#warning "You can define GST_USE_UNSTABLE_API to avoid this warning."
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <gst/gst.h>
|
#include <gst/gst.h>
|
||||||
|
#include <gst/codecs/codecs-prelude.h>
|
||||||
|
|
||||||
#include <gst/codecparsers/gsth265parser.h>
|
#include <gst/codecparsers/gsth265parser.h>
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
@ -80,27 +87,24 @@ struct _GstH265Picture
|
||||||
GDestroyNotify notify;
|
GDestroyNotify notify;
|
||||||
};
|
};
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
GST_CODECS_API
|
||||||
GType gst_h265_picture_get_type (void);
|
GType gst_h265_picture_get_type (void);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
GST_CODECS_API
|
||||||
GstH265Picture * gst_h265_picture_new (void);
|
GstH265Picture * gst_h265_picture_new (void);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
|
||||||
static inline GstH265Picture *
|
static inline GstH265Picture *
|
||||||
gst_h265_picture_ref (GstH265Picture * picture)
|
gst_h265_picture_ref (GstH265Picture * picture)
|
||||||
{
|
{
|
||||||
return (GstH265Picture *) gst_mini_object_ref (GST_MINI_OBJECT_CAST (picture));
|
return (GstH265Picture *) gst_mini_object_ref (GST_MINI_OBJECT_CAST (picture));
|
||||||
}
|
}
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
|
||||||
static inline void
|
static inline void
|
||||||
gst_h265_picture_unref (GstH265Picture * picture)
|
gst_h265_picture_unref (GstH265Picture * picture)
|
||||||
{
|
{
|
||||||
gst_mini_object_unref (GST_MINI_OBJECT_CAST (picture));
|
gst_mini_object_unref (GST_MINI_OBJECT_CAST (picture));
|
||||||
}
|
}
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
|
||||||
static inline gboolean
|
static inline gboolean
|
||||||
gst_h265_picture_replace (GstH265Picture ** old_picture,
|
gst_h265_picture_replace (GstH265Picture ** old_picture,
|
||||||
GstH265Picture * new_picture)
|
GstH265Picture * new_picture)
|
||||||
|
@ -109,7 +113,6 @@ gst_h265_picture_replace (GstH265Picture ** old_picture,
|
||||||
(GstMiniObject *) new_picture);
|
(GstMiniObject *) new_picture);
|
||||||
}
|
}
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
|
||||||
static inline void
|
static inline void
|
||||||
gst_h265_picture_clear (GstH265Picture ** picture)
|
gst_h265_picture_clear (GstH265Picture ** picture)
|
||||||
{
|
{
|
||||||
|
@ -119,12 +122,12 @@ gst_h265_picture_clear (GstH265Picture ** picture)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
GST_CODECS_API
|
||||||
void gst_h265_picture_set_user_data (GstH265Picture * picture,
|
void gst_h265_picture_set_user_data (GstH265Picture * picture,
|
||||||
gpointer user_data,
|
gpointer user_data,
|
||||||
GDestroyNotify notify);
|
GDestroyNotify notify);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
GST_CODECS_API
|
||||||
gpointer gst_h265_picture_get_user_data (GstH265Picture * picture);
|
gpointer gst_h265_picture_get_user_data (GstH265Picture * picture);
|
||||||
|
|
||||||
/*******************
|
/*******************
|
||||||
|
@ -132,66 +135,66 @@ gpointer gst_h265_picture_get_user_data (GstH265Picture * picture);
|
||||||
*******************/
|
*******************/
|
||||||
typedef struct _GstH265Dpb GstH265Dpb;
|
typedef struct _GstH265Dpb GstH265Dpb;
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
GST_CODECS_API
|
||||||
GstH265Dpb * gst_h265_dpb_new (void);
|
GstH265Dpb * gst_h265_dpb_new (void);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
GST_CODECS_API
|
||||||
void gst_h265_dpb_set_max_num_pics (GstH265Dpb * dpb,
|
void gst_h265_dpb_set_max_num_pics (GstH265Dpb * dpb,
|
||||||
gint max_num_pics);
|
gint max_num_pics);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
GST_CODECS_API
|
||||||
gint gst_h265_dpb_get_max_num_pics (GstH265Dpb * dpb);
|
gint gst_h265_dpb_get_max_num_pics (GstH265Dpb * dpb);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
GST_CODECS_API
|
||||||
void gst_h265_dpb_free (GstH265Dpb * dpb);
|
void gst_h265_dpb_free (GstH265Dpb * dpb);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
GST_CODECS_API
|
||||||
void gst_h265_dpb_clear (GstH265Dpb * dpb);
|
void gst_h265_dpb_clear (GstH265Dpb * dpb);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
GST_CODECS_API
|
||||||
void gst_h265_dpb_add (GstH265Dpb * dpb,
|
void gst_h265_dpb_add (GstH265Dpb * dpb,
|
||||||
GstH265Picture * picture);
|
GstH265Picture * picture);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
GST_CODECS_API
|
||||||
void gst_h265_dpb_delete_unused (GstH265Dpb * dpb);
|
void gst_h265_dpb_delete_unused (GstH265Dpb * dpb);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
GST_CODECS_API
|
||||||
void gst_h265_dpb_delete_by_poc (GstH265Dpb * dpb,
|
void gst_h265_dpb_delete_by_poc (GstH265Dpb * dpb,
|
||||||
gint poc);
|
gint poc);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
GST_CODECS_API
|
||||||
gint gst_h265_dpb_num_ref_pictures (GstH265Dpb * dpb);
|
gint gst_h265_dpb_num_ref_pictures (GstH265Dpb * dpb);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
GST_CODECS_API
|
||||||
void gst_h265_dpb_mark_all_non_ref (GstH265Dpb * dpb);
|
void gst_h265_dpb_mark_all_non_ref (GstH265Dpb * dpb);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
GST_CODECS_API
|
||||||
GstH265Picture * gst_h265_dpb_get_ref_by_poc (GstH265Dpb * dpb,
|
GstH265Picture * gst_h265_dpb_get_ref_by_poc (GstH265Dpb * dpb,
|
||||||
gint poc);
|
gint poc);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
GST_CODECS_API
|
||||||
GstH265Picture * gst_h265_dpb_get_ref_by_poc_lsb (GstH265Dpb * dpb,
|
GstH265Picture * gst_h265_dpb_get_ref_by_poc_lsb (GstH265Dpb * dpb,
|
||||||
gint poc_lsb);
|
gint poc_lsb);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
GST_CODECS_API
|
||||||
GstH265Picture * gst_h265_dpb_get_short_ref_by_poc (GstH265Dpb * dpb,
|
GstH265Picture * gst_h265_dpb_get_short_ref_by_poc (GstH265Dpb * dpb,
|
||||||
gint poc);
|
gint poc);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
GST_CODECS_API
|
||||||
GstH265Picture * gst_h265_dpb_get_long_ref_by_poc (GstH265Dpb * dpb,
|
GstH265Picture * gst_h265_dpb_get_long_ref_by_poc (GstH265Dpb * dpb,
|
||||||
gint poc);
|
gint poc);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
GST_CODECS_API
|
||||||
void gst_h265_dpb_get_pictures_not_outputted (GstH265Dpb * dpb,
|
void gst_h265_dpb_get_pictures_not_outputted (GstH265Dpb * dpb,
|
||||||
GList ** out);
|
GList ** out);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
GST_CODECS_API
|
||||||
GArray * gst_h265_dpb_get_pictures_all (GstH265Dpb * dpb);
|
GArray * gst_h265_dpb_get_pictures_all (GstH265Dpb * dpb);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
GST_CODECS_API
|
||||||
gint gst_h265_dpb_get_size (GstH265Dpb * dpb);
|
gint gst_h265_dpb_get_size (GstH265Dpb * dpb);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
GST_CODECS_API
|
||||||
gboolean gst_h265_dpb_is_full (GstH265Dpb * dpb);
|
gboolean gst_h265_dpb_is_full (GstH265Dpb * dpb);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
|
@ -53,8 +53,8 @@
|
||||||
|
|
||||||
#include "gstvp9decoder.h"
|
#include "gstvp9decoder.h"
|
||||||
|
|
||||||
GST_DEBUG_CATEGORY_EXTERN (gst_d3d11_vp9_dec_debug);
|
GST_DEBUG_CATEGORY (gst_vp9_decoder_debug);
|
||||||
#define GST_CAT_DEFAULT gst_d3d11_vp9_dec_debug
|
#define GST_CAT_DEFAULT gst_vp9_decoder_debug
|
||||||
|
|
||||||
struct _GstVp9DecoderPrivate
|
struct _GstVp9DecoderPrivate
|
||||||
{
|
{
|
||||||
|
@ -71,8 +71,11 @@ struct _GstVp9DecoderPrivate
|
||||||
};
|
};
|
||||||
|
|
||||||
#define parent_class gst_vp9_decoder_parent_class
|
#define parent_class gst_vp9_decoder_parent_class
|
||||||
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (GstVp9Decoder, gst_vp9_decoder,
|
G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GstVp9Decoder, gst_vp9_decoder,
|
||||||
GST_TYPE_VIDEO_DECODER);
|
GST_TYPE_VIDEO_DECODER,
|
||||||
|
G_ADD_PRIVATE (GstVp9Decoder);
|
||||||
|
GST_DEBUG_CATEGORY_INIT (gst_vp9_decoder_debug, "vp9decoder", 0,
|
||||||
|
"VP9 Video Decoder"));
|
||||||
|
|
||||||
static gboolean gst_vp9_decoder_start (GstVideoDecoder * decoder);
|
static gboolean gst_vp9_decoder_start (GstVideoDecoder * decoder);
|
||||||
static gboolean gst_vp9_decoder_stop (GstVideoDecoder * decoder);
|
static gboolean gst_vp9_decoder_stop (GstVideoDecoder * decoder);
|
|
@ -20,10 +20,11 @@
|
||||||
#ifndef __GST_VP9_DECODER_H__
|
#ifndef __GST_VP9_DECODER_H__
|
||||||
#define __GST_VP9_DECODER_H__
|
#define __GST_VP9_DECODER_H__
|
||||||
|
|
||||||
#include <gst/gst.h>
|
#include <gst/codecs/codecs-prelude.h>
|
||||||
|
|
||||||
#include <gst/video/video.h>
|
#include <gst/video/video.h>
|
||||||
#include <gst/codecparsers/gstvp9parser.h>
|
#include <gst/codecparsers/gstvp9parser.h>
|
||||||
#include "gstvp9picture.h"
|
#include <gst/codecs/gstvp9picture.h>
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
|
@ -107,6 +108,7 @@ struct _GstVp9DecoderClass
|
||||||
gpointer padding[GST_PADDING_LARGE];
|
gpointer padding[GST_PADDING_LARGE];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
GST_CODECS_API
|
||||||
GType gst_vp9_decoder_get_type (void);
|
GType gst_vp9_decoder_get_type (void);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
|
@ -23,8 +23,8 @@
|
||||||
|
|
||||||
#include "gstvp9picture.h"
|
#include "gstvp9picture.h"
|
||||||
|
|
||||||
GST_DEBUG_CATEGORY_EXTERN (gst_d3d11_vp9_dec_debug);
|
GST_DEBUG_CATEGORY_EXTERN (gst_vp9_decoder_debug);
|
||||||
#define GST_CAT_DEFAULT gst_d3d11_vp9_dec_debug
|
#define GST_CAT_DEFAULT gst_vp9_decoder_debug
|
||||||
|
|
||||||
GST_DEFINE_MINI_OBJECT_TYPE (GstVp9Picture, gst_vp9_picture);
|
GST_DEFINE_MINI_OBJECT_TYPE (GstVp9Picture, gst_vp9_picture);
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
#ifndef __GST_VP9_PICTURE_H__
|
#ifndef __GST_VP9_PICTURE_H__
|
||||||
#define __GST_VP9_PICTURE_H__
|
#define __GST_VP9_PICTURE_H__
|
||||||
|
|
||||||
#include <gst/gst.h>
|
#include <gst/codecs/codecs-prelude.h>
|
||||||
#include <gst/codecparsers/gstvp9parser.h>
|
#include <gst/codecparsers/gstvp9parser.h>
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
@ -53,27 +53,24 @@ struct _GstVp9Picture
|
||||||
GDestroyNotify notify;
|
GDestroyNotify notify;
|
||||||
};
|
};
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
GST_CODECS_API
|
||||||
GType gst_vp9_picture_get_type (void);
|
GType gst_vp9_picture_get_type (void);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
GST_CODECS_API
|
||||||
GstVp9Picture * gst_vp9_picture_new (void);
|
GstVp9Picture * gst_vp9_picture_new (void);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
|
||||||
static inline GstVp9Picture *
|
static inline GstVp9Picture *
|
||||||
gst_vp9_picture_ref (GstVp9Picture * picture)
|
gst_vp9_picture_ref (GstVp9Picture * picture)
|
||||||
{
|
{
|
||||||
return (GstVp9Picture *) gst_mini_object_ref (GST_MINI_OBJECT_CAST (picture));
|
return (GstVp9Picture *) gst_mini_object_ref (GST_MINI_OBJECT_CAST (picture));
|
||||||
}
|
}
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
|
||||||
static inline void
|
static inline void
|
||||||
gst_vp9_picture_unref (GstVp9Picture * picture)
|
gst_vp9_picture_unref (GstVp9Picture * picture)
|
||||||
{
|
{
|
||||||
gst_mini_object_unref (GST_MINI_OBJECT_CAST (picture));
|
gst_mini_object_unref (GST_MINI_OBJECT_CAST (picture));
|
||||||
}
|
}
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
|
||||||
static inline gboolean
|
static inline gboolean
|
||||||
gst_vp9_picture_replace (GstVp9Picture ** old_picture,
|
gst_vp9_picture_replace (GstVp9Picture ** old_picture,
|
||||||
GstVp9Picture * new_picture)
|
GstVp9Picture * new_picture)
|
||||||
|
@ -82,7 +79,6 @@ gst_vp9_picture_replace (GstVp9Picture ** old_picture,
|
||||||
(GstMiniObject *) new_picture);
|
(GstMiniObject *) new_picture);
|
||||||
}
|
}
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
|
||||||
static inline void
|
static inline void
|
||||||
gst_vp9_picture_clear (GstVp9Picture ** picture)
|
gst_vp9_picture_clear (GstVp9Picture ** picture)
|
||||||
{
|
{
|
||||||
|
@ -92,12 +88,12 @@ gst_vp9_picture_clear (GstVp9Picture ** picture)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
GST_CODECS_API
|
||||||
void gst_vp9_picture_set_user_data (GstVp9Picture * picture,
|
void gst_vp9_picture_set_user_data (GstVp9Picture * picture,
|
||||||
gpointer user_data,
|
gpointer user_data,
|
||||||
GDestroyNotify notify);
|
GDestroyNotify notify);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
GST_CODECS_API
|
||||||
gpointer gst_vp9_picture_get_user_data (GstVp9Picture * picture);
|
gpointer gst_vp9_picture_get_user_data (GstVp9Picture * picture);
|
||||||
|
|
||||||
/*******************
|
/*******************
|
||||||
|
@ -110,16 +106,16 @@ struct _GstVp9Dpb
|
||||||
GstVp9Picture *pic_list[GST_VP9_REF_FRAMES];
|
GstVp9Picture *pic_list[GST_VP9_REF_FRAMES];
|
||||||
};
|
};
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
GST_CODECS_API
|
||||||
GstVp9Dpb * gst_vp9_dpb_new (void);
|
GstVp9Dpb * gst_vp9_dpb_new (void);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
GST_CODECS_API
|
||||||
void gst_vp9_dpb_free (GstVp9Dpb * dpb);
|
void gst_vp9_dpb_free (GstVp9Dpb * dpb);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
GST_CODECS_API
|
||||||
void gst_vp9_dpb_clear (GstVp9Dpb * dpb);
|
void gst_vp9_dpb_clear (GstVp9Dpb * dpb);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
GST_CODECS_API
|
||||||
void gst_vp9_dpb_add (GstVp9Dpb * dpb,
|
void gst_vp9_dpb_add (GstVp9Dpb * dpb,
|
||||||
GstVp9Picture * picture);
|
GstVp9Picture * picture);
|
||||||
|
|
39
gst-libs/gst/codecs/meson.build
Normal file
39
gst-libs/gst/codecs/meson.build
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
codecs_sources = files([
|
||||||
|
'gsth264decoder.c',
|
||||||
|
'gsth264picture.c',
|
||||||
|
'gsth265decoder.c',
|
||||||
|
'gsth265picture.c',
|
||||||
|
'gstvp9decoder.c',
|
||||||
|
'gstvp9picture.c',
|
||||||
|
])
|
||||||
|
|
||||||
|
codecs_headers = [
|
||||||
|
'gsth264decoder.h',
|
||||||
|
'gsth264picture.h',
|
||||||
|
'gsth265decoder.h',
|
||||||
|
'gsth265picture.h',
|
||||||
|
'gstvp9decoder.h',
|
||||||
|
'gstvp9picture.h',
|
||||||
|
]
|
||||||
|
|
||||||
|
install_headers(codecs_headers, subdir : 'gstreamer-1.0/gst/codecs')
|
||||||
|
|
||||||
|
cp_args = [
|
||||||
|
'-DGST_USE_UNSTABLE_API',
|
||||||
|
'-DBUILDING_GST_CODECS',
|
||||||
|
]
|
||||||
|
|
||||||
|
gstcodecs = library('gstcodecs-' + api_version,
|
||||||
|
codecs_sources,
|
||||||
|
c_args : gst_plugins_bad_args + cp_args,
|
||||||
|
include_directories : [configinc, libsinc],
|
||||||
|
version : libversion,
|
||||||
|
soversion : soversion,
|
||||||
|
darwin_versions : osxversion,
|
||||||
|
install : true,
|
||||||
|
dependencies : [gstvideo_dep, gstcodecparsers_dep],
|
||||||
|
)
|
||||||
|
|
||||||
|
gstcodecs_dep = declare_dependency(link_with : gstcodecs,
|
||||||
|
include_directories : [libsinc],
|
||||||
|
dependencies : [gstvideo_dep, gstcodecparsers_dep])
|
|
@ -4,6 +4,7 @@ subdir('adaptivedemux')
|
||||||
subdir('audio')
|
subdir('audio')
|
||||||
subdir('basecamerabinsrc')
|
subdir('basecamerabinsrc')
|
||||||
subdir('codecparsers')
|
subdir('codecparsers')
|
||||||
|
subdir('codecs')
|
||||||
subdir('insertbin')
|
subdir('insertbin')
|
||||||
subdir('interfaces')
|
subdir('interfaces')
|
||||||
subdir('isoff')
|
subdir('isoff')
|
||||||
|
|
|
@ -51,11 +51,11 @@
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "gsth264decoder.h"
|
|
||||||
#include "gsth264picture.h"
|
|
||||||
#include "gstd3d11h264dec.h"
|
#include "gstd3d11h264dec.h"
|
||||||
#include "gstd3d11memory.h"
|
#include "gstd3d11memory.h"
|
||||||
#include "gstd3d11bufferpool.h"
|
#include "gstd3d11bufferpool.h"
|
||||||
|
|
||||||
|
#include <gst/codecs/gsth264decoder.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
/* HACK: to expose dxva data structure on UWP */
|
/* HACK: to expose dxva data structure on UWP */
|
||||||
|
|
|
@ -21,11 +21,11 @@
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "gsth265decoder.h"
|
|
||||||
#include "gsth265picture.h"
|
|
||||||
#include "gstd3d11h265dec.h"
|
#include "gstd3d11h265dec.h"
|
||||||
#include "gstd3d11memory.h"
|
#include "gstd3d11memory.h"
|
||||||
#include "gstd3d11bufferpool.h"
|
#include "gstd3d11bufferpool.h"
|
||||||
|
|
||||||
|
#include <gst/codecs/gsth265decoder.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
/* HACK: to expose dxva data structure on UWP */
|
/* HACK: to expose dxva data structure on UWP */
|
||||||
|
|
|
@ -52,10 +52,10 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "gstd3d11vp9dec.h"
|
#include "gstd3d11vp9dec.h"
|
||||||
#include "gstvp9decoder.h"
|
|
||||||
#include "gstvp9picture.h"
|
|
||||||
#include "gstd3d11memory.h"
|
#include "gstd3d11memory.h"
|
||||||
#include "gstd3d11bufferpool.h"
|
#include "gstd3d11bufferpool.h"
|
||||||
|
|
||||||
|
#include <gst/codecs/gstvp9decoder.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
/* HACK: to expose dxva data structure on UWP */
|
/* HACK: to expose dxva data structure on UWP */
|
||||||
|
|
|
@ -19,15 +19,9 @@ d3d11_sources = [
|
||||||
]
|
]
|
||||||
|
|
||||||
d3d11_dec_sources = [
|
d3d11_dec_sources = [
|
||||||
'gsth264picture.c',
|
|
||||||
'gsth264decoder.c',
|
|
||||||
'gstd3d11decoder.c',
|
'gstd3d11decoder.c',
|
||||||
'gstd3d11h264dec.c',
|
'gstd3d11h264dec.c',
|
||||||
'gstvp9picture.c',
|
|
||||||
'gstvp9decoder.c',
|
|
||||||
'gstd3d11vp9dec.c',
|
'gstd3d11vp9dec.c',
|
||||||
'gsth265picture.c',
|
|
||||||
'gsth265decoder.c',
|
|
||||||
'gstd3d11h265dec.c',
|
'gstd3d11h265dec.c',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -129,7 +123,7 @@ if cc.has_header('dxva.h') and cc.has_header('d3d9.h')
|
||||||
d3d11_conf.set('HAVE_DXVA_H', 1)
|
d3d11_conf.set('HAVE_DXVA_H', 1)
|
||||||
d3d11_sources += d3d11_dec_sources
|
d3d11_sources += d3d11_dec_sources
|
||||||
extra_c_args += ['-DGST_USE_UNSTABLE_API']
|
extra_c_args += ['-DGST_USE_UNSTABLE_API']
|
||||||
extra_dep += [gstcodecparsers_dep]
|
extra_dep += [gstcodecs_dep]
|
||||||
endif
|
endif
|
||||||
|
|
||||||
winapi_desktop = cxx.compiles('''#include <winapifamily.h>
|
winapi_desktop = cxx.compiles('''#include <winapifamily.h>
|
||||||
|
|
Loading…
Reference in a new issue