Move CODEC base classes into it's own library
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Fri, 31 Jan 2020 22:54:57 +0000 (17:54 -0500)
committerNicolas Dufresne <nicolas@ndufresne.ca>
Thu, 5 Mar 2020 03:06:16 +0000 (03:06 +0000)
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.

19 files changed:
gst-libs/gst/codecs/codecs-prelude.h [new file with mode: 0644]
gst-libs/gst/codecs/gsth264decoder.c [moved from sys/d3d11/gsth264decoder.c with 99% similarity]
gst-libs/gst/codecs/gsth264decoder.h [moved from sys/d3d11/gsth264decoder.h with 97% similarity]
gst-libs/gst/codecs/gsth264picture.c [moved from sys/d3d11/gsth264picture.c with 99% similarity]
gst-libs/gst/codecs/gsth264picture.h [moved from sys/d3d11/gsth264picture.h with 92% similarity]
gst-libs/gst/codecs/gsth265decoder.c [moved from sys/d3d11/gsth265decoder.c with 99% similarity]
gst-libs/gst/codecs/gsth265decoder.h [moved from sys/d3d11/gsth265decoder.h with 98% similarity]
gst-libs/gst/codecs/gsth265picture.c [moved from sys/d3d11/gsth265picture.c with 99% similarity]
gst-libs/gst/codecs/gsth265picture.h [moved from sys/d3d11/gsth265picture.h with 90% similarity]
gst-libs/gst/codecs/gstvp9decoder.c [moved from sys/d3d11/gstvp9decoder.c with 97% similarity]
gst-libs/gst/codecs/gstvp9decoder.h [moved from sys/d3d11/gstvp9decoder.h with 97% similarity]
gst-libs/gst/codecs/gstvp9picture.c [moved from sys/d3d11/gstvp9picture.c with 97% similarity]
gst-libs/gst/codecs/gstvp9picture.h [moved from sys/d3d11/gstvp9picture.h with 93% similarity]
gst-libs/gst/codecs/meson.build [new file with mode: 0644]
gst-libs/gst/meson.build
sys/d3d11/gstd3d11h264dec.c
sys/d3d11/gstd3d11h265dec.c
sys/d3d11/gstd3d11vp9dec.c
sys/d3d11/meson.build

diff --git a/gst-libs/gst/codecs/codecs-prelude.h b/gst-libs/gst/codecs/codecs-prelude.h
new file mode 100644 (file)
index 0000000..107badd
--- /dev/null
@@ -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__ */
similarity index 99%
rename from sys/d3d11/gsth264decoder.c
rename to gst-libs/gst/codecs/gsth264decoder.c
index cc0f286..7e172fa 100644 (file)
@@ -53,8 +53,8 @@
 
 #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
 {
@@ -123,8 +123,11 @@ struct _GstH264DecoderPrivate
 };
 
 #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);
similarity index 97%
rename from sys/d3d11/gsth264decoder.h
rename to gst-libs/gst/codecs/gsth264decoder.h
index 7968b41..0b0e6d0 100644 (file)
 #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
 
@@ -105,6 +106,7 @@ struct _GstH264DecoderClass
   gpointer padding[GST_PADDING_LARGE];
 };
 
+GST_CODECS_API
 GType gst_h264_decoder_get_type (void);
 
 G_END_DECLS
similarity index 99%
rename from sys/d3d11/gsth264picture.c
rename to gst-libs/gst/codecs/gsth264picture.c
index 7110a91..1177bd4 100644 (file)
@@ -23,8 +23,8 @@
 
 #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);
 
similarity index 92%
rename from sys/d3d11/gsth264picture.h
rename to gst-libs/gst/codecs/gsth264picture.h
index bbc6fce..d71eabb 100644 (file)
@@ -20,7 +20,8 @@
 #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
@@ -94,27 +95,24 @@ struct _GstH264Picture
   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)
@@ -123,7 +121,6 @@ gst_h264_picture_replace (GstH264Picture ** old_picture,
       (GstMiniObject *) new_picture);
 }
 
-G_GNUC_INTERNAL
 static inline void
 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,
                                      gpointer user_data,
                                      GDestroyNotify notify);
 
-G_GNUC_INTERNAL
+GST_CODECS_API
 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;
 
-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
similarity index 99%
rename from sys/d3d11/gsth265decoder.c
rename to gst-libs/gst/codecs/gsth265decoder.c
index f847de9..9ce7d46 100644 (file)
@@ -25,8 +25,8 @@
 
 #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
 {
@@ -97,8 +97,11 @@ struct _GstH265DecoderPrivate
 };
 
 #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);
similarity index 98%
rename from sys/d3d11/gsth265decoder.h
rename to gst-libs/gst/codecs/gsth265decoder.h
index 0641b63..73aa088 100644 (file)
 #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
 
@@ -136,6 +137,7 @@ struct _GstH265DecoderClass
   gpointer padding[GST_PADDING_LARGE];
 };
 
+GST_CODECS_API
 GType gst_h265_decoder_get_type (void);
 
 G_END_DECLS
similarity index 99%
rename from sys/d3d11/gsth265picture.c
rename to gst-libs/gst/codecs/gsth265picture.c
index 0df7b46..cf51c59 100644 (file)
@@ -23,8 +23,8 @@
 
 #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);
 
similarity index 90%
rename from sys/d3d11/gsth265picture.h
rename to gst-libs/gst/codecs/gsth265picture.h
index 23e597e..cb5ed16 100644 (file)
 #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
@@ -80,27 +87,24 @@ struct _GstH265Picture
   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)
@@ -109,7 +113,6 @@ gst_h265_picture_replace (GstH265Picture ** old_picture,
       (GstMiniObject *) new_picture);
 }
 
-G_GNUC_INTERNAL
 static inline void
 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,
                                      gpointer user_data,
                                      GDestroyNotify notify);
 
-G_GNUC_INTERNAL
+GST_CODECS_API
 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;
 
-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
similarity index 97%
rename from sys/d3d11/gstvp9decoder.c
rename to gst-libs/gst/codecs/gstvp9decoder.c
index 757e10c..3b11c62 100644 (file)
@@ -53,8 +53,8 @@
 
 #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
 {
@@ -71,8 +71,11 @@ 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);
similarity index 97%
rename from sys/d3d11/gstvp9decoder.h
rename to gst-libs/gst/codecs/gstvp9decoder.h
index d8031cf..d84b0e9 100644 (file)
 #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
 
@@ -107,6 +108,7 @@ struct _GstVp9DecoderClass
   gpointer padding[GST_PADDING_LARGE];
 };
 
+GST_CODECS_API
 GType gst_vp9_decoder_get_type (void);
 
 G_END_DECLS
similarity index 97%
rename from sys/d3d11/gstvp9picture.c
rename to gst-libs/gst/codecs/gstvp9picture.c
index 7193048..a66632c 100644 (file)
@@ -23,8 +23,8 @@
 
 #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);
 
similarity index 93%
rename from sys/d3d11/gstvp9picture.h
rename to gst-libs/gst/codecs/gstvp9picture.h
index 20f01cb..d8d94a0 100644 (file)
@@ -20,7 +20,7 @@
 #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
@@ -53,27 +53,24 @@ struct _GstVp9Picture
   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)
@@ -82,7 +79,6 @@ gst_vp9_picture_replace (GstVp9Picture ** old_picture,
       (GstMiniObject *) new_picture);
 }
 
-G_GNUC_INTERNAL
 static inline void
 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,
                                     gpointer user_data,
                                     GDestroyNotify notify);
 
-G_GNUC_INTERNAL
+GST_CODECS_API
 gpointer gst_vp9_picture_get_user_data (GstVp9Picture * picture);
 
 /*******************
@@ -110,16 +106,16 @@ struct _GstVp9Dpb
   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);
 
diff --git a/gst-libs/gst/codecs/meson.build b/gst-libs/gst/codecs/meson.build
new file mode 100644 (file)
index 0000000..8e0c6d8
--- /dev/null
@@ -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])
index 3ee9ad8..6cbed6c 100644 (file)
@@ -4,6 +4,7 @@ subdir('adaptivedemux')
 subdir('audio')
 subdir('basecamerabinsrc')
 subdir('codecparsers')
+subdir('codecs')
 subdir('insertbin')
 subdir('interfaces')
 subdir('isoff')
index e314cd3..6836f4d 100644 (file)
 #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 */
index cb49253..ac6b543 100644 (file)
 #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 */
index 803a88f..9acb3cd 100644 (file)
 #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 */
index 4ce1692..53f1b71 100644 (file)
@@ -19,15 +19,9 @@ d3d11_sources = [
 ]
 
 d3d11_dec_sources = [
-  'gsth264picture.c',
-  'gsth264decoder.c',
   'gstd3d11decoder.c',
   'gstd3d11h264dec.c',
-  'gstvp9picture.c',
-  'gstvp9decoder.c',
   'gstd3d11vp9dec.c',
-  'gsth265picture.c',
-  'gsth265decoder.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_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>