--- /dev/null
+/* 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__ */
#include "gsth264decoder.h"
-GST_DEBUG_CATEGORY_EXTERN (gst_d3d11_h264_dec_debug);
-#define GST_CAT_DEFAULT gst_d3d11_h264_dec_debug
+GST_DEBUG_CATEGORY (gst_h264_decoder_debug);
+#define GST_CAT_DEFAULT gst_h264_decoder_debug
typedef enum
{
};
#define parent_class gst_h264_decoder_parent_class
-G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (GstH264Decoder, gst_h264_decoder,
- GST_TYPE_VIDEO_DECODER);
+G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GstH264Decoder, gst_h264_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_stop (GstVideoDecoder * decoder);
#ifndef __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/codecparsers/gsth264parser.h>
-#include "gsth264picture.h"
+#include <gst/codecs/gsth264picture.h>
G_BEGIN_DECLS
gpointer padding[GST_PADDING_LARGE];
};
+GST_CODECS_API
GType gst_h264_decoder_get_type (void);
G_END_DECLS
#include "gsth264picture.h"
-GST_DEBUG_CATEGORY_EXTERN (gst_d3d11_h264_dec_debug);
-#define GST_CAT_DEFAULT gst_d3d11_h264_dec_debug
+GST_DEBUG_CATEGORY_EXTERN (gst_h264_decoder_debug);
+#define GST_CAT_DEFAULT gst_h264_decoder_debug
GST_DEFINE_MINI_OBJECT_TYPE (GstH264Picture, gst_h264_picture);
#ifndef __GST_H264_PICTURE_H__
#define __GST_H264_PICTURE_H__
-#include <gst/gst.h>
+#include <gst/codecs/codecs-prelude.h>
+
#include <gst/codecparsers/gsth264parser.h>
G_BEGIN_DECLS
GDestroyNotify notify;
};
-G_GNUC_INTERNAL
+GST_CODECS_API
GType gst_h264_picture_get_type (void);
-G_GNUC_INTERNAL
+GST_CODECS_API
GstH264Picture * gst_h264_picture_new (void);
-G_GNUC_INTERNAL
static inline GstH264Picture *
gst_h264_picture_ref (GstH264Picture * picture)
{
return (GstH264Picture *) gst_mini_object_ref (GST_MINI_OBJECT_CAST (picture));
}
-G_GNUC_INTERNAL
static inline void
gst_h264_picture_unref (GstH264Picture * picture)
{
gst_mini_object_unref (GST_MINI_OBJECT_CAST (picture));
}
-G_GNUC_INTERNAL
static inline gboolean
gst_h264_picture_replace (GstH264Picture ** old_picture,
GstH264Picture * new_picture)
(GstMiniObject *) new_picture);
}
-G_GNUC_INTERNAL
static inline void
gst_h264_picture_clear (GstH264Picture ** picture)
{
}
}
-G_GNUC_INTERNAL
+GST_CODECS_API
void gst_h264_picture_set_user_data (GstH264Picture * picture,
gpointer user_data,
GDestroyNotify notify);
-G_GNUC_INTERNAL
+GST_CODECS_API
gpointer gst_h264_picture_get_user_data (GstH264Picture * picture);
/*******************
*******************/
typedef struct _GstH264Dpb GstH264Dpb;
-G_GNUC_INTERNAL
+GST_CODECS_API
GstH264Dpb * gst_h264_dpb_new (void);
-G_GNUC_INTERNAL
+GST_CODECS_API
void gst_h264_dpb_set_max_num_pics (GstH264Dpb * dpb,
gint max_num_pics);
-G_GNUC_INTERNAL
+GST_CODECS_API
gint gst_h264_dpb_get_max_num_pics (GstH264Dpb * dpb);
-G_GNUC_INTERNAL
+GST_CODECS_API
void gst_h264_dpb_free (GstH264Dpb * dpb);
-G_GNUC_INTERNAL
+GST_CODECS_API
void gst_h264_dpb_clear (GstH264Dpb * dpb);
-G_GNUC_INTERNAL
+GST_CODECS_API
void gst_h264_dpb_add (GstH264Dpb * dpb,
GstH264Picture * picture);
-G_GNUC_INTERNAL
+GST_CODECS_API
void gst_h264_dpb_delete_unused (GstH264Dpb * dpb);
-G_GNUC_INTERNAL
+GST_CODECS_API
void gst_h264_dpb_delete_by_poc (GstH264Dpb * dpb,
gint poc);
-G_GNUC_INTERNAL
+GST_CODECS_API
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);
-G_GNUC_INTERNAL
+GST_CODECS_API
GstH264Picture * gst_h264_dpb_get_short_ref_by_pic_num (GstH264Dpb * dpb,
gint pic_num);
-G_GNUC_INTERNAL
+GST_CODECS_API
GstH264Picture * gst_h264_dpb_get_long_ref_by_pic_num (GstH264Dpb * dpb,
gint pic_num);
-G_GNUC_INTERNAL
+GST_CODECS_API
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,
GList ** out);
-G_GNUC_INTERNAL
+GST_CODECS_API
void gst_h264_dpb_get_pictures_short_term_ref (GstH264Dpb * dpb,
GList ** out);
-G_GNUC_INTERNAL
+GST_CODECS_API
void gst_h264_dpb_get_pictures_long_term_ref (GstH264Dpb * dpb,
GList ** out);
-G_GNUC_INTERNAL
+GST_CODECS_API
GArray * gst_h264_dpb_get_pictures_all (GstH264Dpb * dpb);
-G_GNUC_INTERNAL
+GST_CODECS_API
gint gst_h264_dpb_get_size (GstH264Dpb * dpb);
-G_GNUC_INTERNAL
+GST_CODECS_API
gboolean gst_h264_dpb_is_full (GstH264Dpb * dpb);
G_END_DECLS
#include "gsth265decoder.h"
-GST_DEBUG_CATEGORY_EXTERN (gst_d3d11_h265_dec_debug);
-#define GST_CAT_DEFAULT gst_d3d11_h265_dec_debug
+GST_DEBUG_CATEGORY (gst_h265_decoder_debug);
+#define GST_CAT_DEFAULT gst_h265_decoder_debug
typedef enum
{
};
#define parent_class gst_h265_decoder_parent_class
-G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (GstH265Decoder, gst_h265_decoder,
- GST_TYPE_VIDEO_DECODER);
+G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GstH265Decoder, gst_h265_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_stop (GstVideoDecoder * decoder);
#ifndef __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/codecparsers/gsth265parser.h>
-#include "gsth265picture.h"
+#include <gst/codecs/gsth265picture.h>
G_BEGIN_DECLS
gpointer padding[GST_PADDING_LARGE];
};
+GST_CODECS_API
GType gst_h265_decoder_get_type (void);
G_END_DECLS
#include "gsth265picture.h"
-GST_DEBUG_CATEGORY_EXTERN (gst_d3d11_h265_dec_debug);
-#define GST_CAT_DEFAULT gst_d3d11_h265_dec_debug
+GST_DEBUG_CATEGORY_EXTERN (gst_h265_decoder_debug);
+#define GST_CAT_DEFAULT gst_h265_decoder_debug
GST_DEFINE_MINI_OBJECT_TYPE (GstH265Picture, gst_h265_picture);
#ifndef __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/codecs/codecs-prelude.h>
+
#include <gst/codecparsers/gsth265parser.h>
G_BEGIN_DECLS
GDestroyNotify notify;
};
-G_GNUC_INTERNAL
+GST_CODECS_API
GType gst_h265_picture_get_type (void);
-G_GNUC_INTERNAL
+GST_CODECS_API
GstH265Picture * gst_h265_picture_new (void);
-G_GNUC_INTERNAL
static inline GstH265Picture *
gst_h265_picture_ref (GstH265Picture * picture)
{
return (GstH265Picture *) gst_mini_object_ref (GST_MINI_OBJECT_CAST (picture));
}
-G_GNUC_INTERNAL
static inline void
gst_h265_picture_unref (GstH265Picture * picture)
{
gst_mini_object_unref (GST_MINI_OBJECT_CAST (picture));
}
-G_GNUC_INTERNAL
static inline gboolean
gst_h265_picture_replace (GstH265Picture ** old_picture,
GstH265Picture * new_picture)
(GstMiniObject *) new_picture);
}
-G_GNUC_INTERNAL
static inline void
gst_h265_picture_clear (GstH265Picture ** picture)
{
}
}
-G_GNUC_INTERNAL
+GST_CODECS_API
void gst_h265_picture_set_user_data (GstH265Picture * picture,
gpointer user_data,
GDestroyNotify notify);
-G_GNUC_INTERNAL
+GST_CODECS_API
gpointer gst_h265_picture_get_user_data (GstH265Picture * picture);
/*******************
*******************/
typedef struct _GstH265Dpb GstH265Dpb;
-G_GNUC_INTERNAL
+GST_CODECS_API
GstH265Dpb * gst_h265_dpb_new (void);
-G_GNUC_INTERNAL
+GST_CODECS_API
void gst_h265_dpb_set_max_num_pics (GstH265Dpb * dpb,
gint max_num_pics);
-G_GNUC_INTERNAL
+GST_CODECS_API
gint gst_h265_dpb_get_max_num_pics (GstH265Dpb * dpb);
-G_GNUC_INTERNAL
+GST_CODECS_API
void gst_h265_dpb_free (GstH265Dpb * dpb);
-G_GNUC_INTERNAL
+GST_CODECS_API
void gst_h265_dpb_clear (GstH265Dpb * dpb);
-G_GNUC_INTERNAL
+GST_CODECS_API
void gst_h265_dpb_add (GstH265Dpb * dpb,
GstH265Picture * picture);
-G_GNUC_INTERNAL
+GST_CODECS_API
void gst_h265_dpb_delete_unused (GstH265Dpb * dpb);
-G_GNUC_INTERNAL
+GST_CODECS_API
void gst_h265_dpb_delete_by_poc (GstH265Dpb * dpb,
gint poc);
-G_GNUC_INTERNAL
+GST_CODECS_API
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);
-G_GNUC_INTERNAL
+GST_CODECS_API
GstH265Picture * gst_h265_dpb_get_ref_by_poc (GstH265Dpb * dpb,
gint poc);
-G_GNUC_INTERNAL
+GST_CODECS_API
GstH265Picture * gst_h265_dpb_get_ref_by_poc_lsb (GstH265Dpb * dpb,
gint poc_lsb);
-G_GNUC_INTERNAL
+GST_CODECS_API
GstH265Picture * gst_h265_dpb_get_short_ref_by_poc (GstH265Dpb * dpb,
gint poc);
-G_GNUC_INTERNAL
+GST_CODECS_API
GstH265Picture * gst_h265_dpb_get_long_ref_by_poc (GstH265Dpb * dpb,
gint poc);
-G_GNUC_INTERNAL
+GST_CODECS_API
void gst_h265_dpb_get_pictures_not_outputted (GstH265Dpb * dpb,
GList ** out);
-G_GNUC_INTERNAL
+GST_CODECS_API
GArray * gst_h265_dpb_get_pictures_all (GstH265Dpb * dpb);
-G_GNUC_INTERNAL
+GST_CODECS_API
gint gst_h265_dpb_get_size (GstH265Dpb * dpb);
-G_GNUC_INTERNAL
+GST_CODECS_API
gboolean gst_h265_dpb_is_full (GstH265Dpb * dpb);
G_END_DECLS
#include "gstvp9decoder.h"
-GST_DEBUG_CATEGORY_EXTERN (gst_d3d11_vp9_dec_debug);
-#define GST_CAT_DEFAULT gst_d3d11_vp9_dec_debug
+GST_DEBUG_CATEGORY (gst_vp9_decoder_debug);
+#define GST_CAT_DEFAULT gst_vp9_decoder_debug
struct _GstVp9DecoderPrivate
{
};
#define parent_class gst_vp9_decoder_parent_class
-G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (GstVp9Decoder, gst_vp9_decoder,
- GST_TYPE_VIDEO_DECODER);
+G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GstVp9Decoder, gst_vp9_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_stop (GstVideoDecoder * decoder);
#ifndef __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/codecparsers/gstvp9parser.h>
-#include "gstvp9picture.h"
+#include <gst/codecs/gstvp9picture.h>
G_BEGIN_DECLS
gpointer padding[GST_PADDING_LARGE];
};
+GST_CODECS_API
GType gst_vp9_decoder_get_type (void);
G_END_DECLS
#include "gstvp9picture.h"
-GST_DEBUG_CATEGORY_EXTERN (gst_d3d11_vp9_dec_debug);
-#define GST_CAT_DEFAULT gst_d3d11_vp9_dec_debug
+GST_DEBUG_CATEGORY_EXTERN (gst_vp9_decoder_debug);
+#define GST_CAT_DEFAULT gst_vp9_decoder_debug
GST_DEFINE_MINI_OBJECT_TYPE (GstVp9Picture, gst_vp9_picture);
#ifndef __GST_VP9_PICTURE_H__
#define __GST_VP9_PICTURE_H__
-#include <gst/gst.h>
+#include <gst/codecs/codecs-prelude.h>
#include <gst/codecparsers/gstvp9parser.h>
G_BEGIN_DECLS
GDestroyNotify notify;
};
-G_GNUC_INTERNAL
+GST_CODECS_API
GType gst_vp9_picture_get_type (void);
-G_GNUC_INTERNAL
+GST_CODECS_API
GstVp9Picture * gst_vp9_picture_new (void);
-G_GNUC_INTERNAL
static inline GstVp9Picture *
gst_vp9_picture_ref (GstVp9Picture * picture)
{
return (GstVp9Picture *) gst_mini_object_ref (GST_MINI_OBJECT_CAST (picture));
}
-G_GNUC_INTERNAL
static inline void
gst_vp9_picture_unref (GstVp9Picture * picture)
{
gst_mini_object_unref (GST_MINI_OBJECT_CAST (picture));
}
-G_GNUC_INTERNAL
static inline gboolean
gst_vp9_picture_replace (GstVp9Picture ** old_picture,
GstVp9Picture * new_picture)
(GstMiniObject *) new_picture);
}
-G_GNUC_INTERNAL
static inline void
gst_vp9_picture_clear (GstVp9Picture ** picture)
{
}
}
-G_GNUC_INTERNAL
+GST_CODECS_API
void gst_vp9_picture_set_user_data (GstVp9Picture * picture,
gpointer user_data,
GDestroyNotify notify);
-G_GNUC_INTERNAL
+GST_CODECS_API
gpointer gst_vp9_picture_get_user_data (GstVp9Picture * picture);
/*******************
GstVp9Picture *pic_list[GST_VP9_REF_FRAMES];
};
-G_GNUC_INTERNAL
+GST_CODECS_API
GstVp9Dpb * gst_vp9_dpb_new (void);
-G_GNUC_INTERNAL
+GST_CODECS_API
void gst_vp9_dpb_free (GstVp9Dpb * dpb);
-G_GNUC_INTERNAL
+GST_CODECS_API
void gst_vp9_dpb_clear (GstVp9Dpb * dpb);
-G_GNUC_INTERNAL
+GST_CODECS_API
void gst_vp9_dpb_add (GstVp9Dpb * dpb,
GstVp9Picture * picture);
--- /dev/null
+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])
subdir('audio')
subdir('basecamerabinsrc')
subdir('codecparsers')
+subdir('codecs')
subdir('insertbin')
subdir('interfaces')
subdir('isoff')
#include <config.h>
#endif
-#include "gsth264decoder.h"
-#include "gsth264picture.h"
#include "gstd3d11h264dec.h"
#include "gstd3d11memory.h"
#include "gstd3d11bufferpool.h"
+
+#include <gst/codecs/gsth264decoder.h>
#include <string.h>
/* HACK: to expose dxva data structure on UWP */
#include <config.h>
#endif
-#include "gsth265decoder.h"
-#include "gsth265picture.h"
#include "gstd3d11h265dec.h"
#include "gstd3d11memory.h"
#include "gstd3d11bufferpool.h"
+
+#include <gst/codecs/gsth265decoder.h>
#include <string.h>
/* HACK: to expose dxva data structure on UWP */
#endif
#include "gstd3d11vp9dec.h"
-#include "gstvp9decoder.h"
-#include "gstvp9picture.h"
#include "gstd3d11memory.h"
#include "gstd3d11bufferpool.h"
+
+#include <gst/codecs/gstvp9decoder.h>
#include <string.h>
/* HACK: to expose dxva data structure on UWP */
]
d3d11_dec_sources = [
- 'gsth264picture.c',
- 'gsth264decoder.c',
'gstd3d11decoder.c',
'gstd3d11h264dec.c',
- 'gstvp9picture.c',
- 'gstvp9decoder.c',
'gstd3d11vp9dec.c',
- 'gsth265picture.c',
- 'gsth265decoder.c',
'gstd3d11h265dec.c',
]
d3d11_conf.set('HAVE_DXVA_H', 1)
d3d11_sources += d3d11_dec_sources
extra_c_args += ['-DGST_USE_UNSTABLE_API']
- extra_dep += [gstcodecparsers_dep]
+ extra_dep += [gstcodecs_dep]
endif
winapi_desktop = cxx.compiles('''#include <winapifamily.h>