diff --git a/subprojects/gst-plugins-bad/ext/vmaf/vmafconvert.c b/subprojects/gst-plugins-bad/ext/vmaf/gstvmafconvert.c similarity index 95% rename from subprojects/gst-plugins-bad/ext/vmaf/vmafconvert.c rename to subprojects/gst-plugins-bad/ext/vmaf/gstvmafconvert.c index 96632e02fe..b5ae90df85 100644 --- a/subprojects/gst-plugins-bad/ext/vmaf/vmafconvert.c +++ b/subprojects/gst-plugins-bad/ext/vmaf/gstvmafconvert.c @@ -1,5 +1,6 @@ /* VMAF plugin - * Copyright (C) 2015 Casey Bateman + * Copyright (C) 2021 Hudl + * @author: Casey Bateman * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -16,8 +17,8 @@ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301, USA. */ -#include "vmafconvert.h" -#include "vmafenums.h" +#include "gstvmafconvert.h" +#include "gstvmafenums.h" enum VmafOutputFormat vmaf_map_log_fmt (GstVmafLogFormats log_fmt) diff --git a/subprojects/gst-plugins-bad/ext/vmaf/vmafconvert.h b/subprojects/gst-plugins-bad/ext/vmaf/gstvmafconvert.h similarity index 86% rename from subprojects/gst-plugins-bad/ext/vmaf/vmafconvert.h rename to subprojects/gst-plugins-bad/ext/vmaf/gstvmafconvert.h index cb3317d427..be209cf056 100644 --- a/subprojects/gst-plugins-bad/ext/vmaf/vmafconvert.h +++ b/subprojects/gst-plugins-bad/ext/vmaf/gstvmafconvert.h @@ -1,5 +1,6 @@ /* VMAF plugin - * Copyright (C) 2015 Casey Bateman + * Copyright (C) 2021 Hudl + * @author: Casey Bateman * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -16,12 +17,12 @@ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301, USA. */ -#ifndef __GST_VMAFMAP_H__ -#define __GST_VMAFMAP_H__ +#ifndef __GST_VMAFCONVERT_H__ +#define __GST_VMAFCONVERT_H__ #include #include -#include "vmafenums.h" +#include "gstvmafenums.h" G_BEGIN_DECLS enum VmafOutputFormat vmaf_map_log_fmt (GstVmafLogFormats log_fmt); @@ -32,4 +33,4 @@ void fill_vmaf_picture_buffer (float *src, VmafPicture * dst, unsigned width, un void fill_vmaf_picture_buffer_hbd (float *src, VmafPicture * dst, unsigned width, unsigned height, int src_stride, unsigned bpc); G_END_DECLS -#endif /* __GST_VMAFMAP_H__ */ +#endif /* __GST_VMAFCONVERT_H__ */ diff --git a/subprojects/gst-plugins-bad/ext/vmaf/vmafplugin.c b/subprojects/gst-plugins-bad/ext/vmaf/gstvmafelement.c similarity index 98% rename from subprojects/gst-plugins-bad/ext/vmaf/vmafplugin.c rename to subprojects/gst-plugins-bad/ext/vmaf/gstvmafelement.c index d8a03dcd37..864c3b8928 100644 --- a/subprojects/gst-plugins-bad/ext/vmaf/vmafplugin.c +++ b/subprojects/gst-plugins-bad/ext/vmaf/gstvmafelement.c @@ -1,5 +1,6 @@ /* VMAF plugin - * Copyright (C) 2015 Casey Bateman + * Copyright (C) 2021 Hudl + * @author: Casey Bateman * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -59,9 +60,9 @@ #include #include -#include "vmafplugin.h" -#include "vmafconvert.h" -#include "vmafenums.h" +#include "gstvmafelements.h" +#include "gstvmafconvert.h" +#include "gstvmafenums.h" GST_DEBUG_CATEGORY_STATIC (gst_vmaf_debug); #define GST_CAT_DEFAULT gst_vmaf_debug @@ -835,11 +836,8 @@ gst_vmaf_read_and_queue_frames (GstVmaf * self, GstVideoFrame * ref, g_mutex_lock (&thread_data->check_thread_failure); if (!thread_data->thread_failure) { - gint i; + gst_buffer_copy_into (outbuf, ref->buffer, GST_BUFFER_COPY_ALL, 0, -1); result = TRUE; - for (i = 0; i < ref_info.size; i++) { - out_info.data[i] = ref_info.data[i]; - } } else { vmaf_stream_thread_stop (thread_data->vmaf_thread); result = FALSE; @@ -1323,17 +1321,3 @@ gst_vmaf_class_init (GstVmafClass * klass) "Casey Bateman "); GST_DEBUG_CATEGORY_INIT (gst_vmaf_debug, "vmaf", 0, "vmaf"); } - -static gboolean -plugin_init (GstPlugin * plugin) -{ - gboolean result = - gst_element_register (plugin, "vmaf", GST_RANK_PRIMARY, GST_TYPE_VMAF); - return result; -} - -GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, - GST_VERSION_MINOR, - vmaf, - "Netflix VMAF quality metric plugin", - plugin_init, VERSION, "GPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN) diff --git a/subprojects/gst-plugins-bad/ext/vmaf/vmafplugin.h b/subprojects/gst-plugins-bad/ext/vmaf/gstvmafelements.h similarity index 93% rename from subprojects/gst-plugins-bad/ext/vmaf/vmafplugin.h rename to subprojects/gst-plugins-bad/ext/vmaf/gstvmafelements.h index 3b1015eacd..f6b4030441 100644 --- a/subprojects/gst-plugins-bad/ext/vmaf/vmafplugin.h +++ b/subprojects/gst-plugins-bad/ext/vmaf/gstvmafelements.h @@ -1,5 +1,6 @@ /* VMAF plugin - * Copyright (C) 2015 Casey Bateman + * Copyright (C) 2021 Hudl + * @author: Casey Bateman * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -16,14 +17,14 @@ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301, USA. */ -#ifndef __GST_VMAF_H__ -#define __GST_VMAF_H__ +#ifndef __GST_VMAFELEMENT_H__ +#define __GST_VMAFELEMENT_H__ #include #include #include #include -#include "vmafenums.h" +#include "gstvmafenums.h" G_BEGIN_DECLS #define GST_TYPE_VMAF (gst_vmaf_get_type()) @@ -101,4 +102,4 @@ struct _GstVmafClass GType gst_vmaf_get_type (void); G_END_DECLS -#endif /* __GST_VMAF_H__ */ +#endif /* __GST_VMAFELEMENT_H__ */ diff --git a/subprojects/gst-plugins-bad/ext/vmaf/vmafenums.h b/subprojects/gst-plugins-bad/ext/vmaf/gstvmafenums.h similarity index 96% rename from subprojects/gst-plugins-bad/ext/vmaf/vmafenums.h rename to subprojects/gst-plugins-bad/ext/vmaf/gstvmafenums.h index b0f34bd4ab..20b11ac14b 100644 --- a/subprojects/gst-plugins-bad/ext/vmaf/vmafenums.h +++ b/subprojects/gst-plugins-bad/ext/vmaf/gstvmafenums.h @@ -1,5 +1,6 @@ /* VMAF plugin - * Copyright (C) 2015 Casey Bateman + * Copyright (C) 2021 Hudl + * @author: Casey Bateman * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public diff --git a/subprojects/gst-plugins-bad/ext/vmaf/gstvmafplugin.c b/subprojects/gst-plugins-bad/ext/vmaf/gstvmafplugin.c new file mode 100644 index 0000000000..6805c1ba2c --- /dev/null +++ b/subprojects/gst-plugins-bad/ext/vmaf/gstvmafplugin.c @@ -0,0 +1,38 @@ +/* VMAF plugin + * Copyright (C) 2021 Hudl + * @author: Casey Bateman + * + * 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. + */ +#ifdef HAVE_CONFIG_H +#include +#endif + +#include "gstvmafelements.h" + +static gboolean +plugin_init (GstPlugin * plugin) +{ + gboolean result = + gst_element_register (plugin, "vmaf", GST_RANK_PRIMARY, GST_TYPE_VMAF); + return result; +} + +GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, + GST_VERSION_MINOR, + vmaf, + "Netflix VMAF quality metric plugin", + plugin_init, VERSION, "LGPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN) diff --git a/subprojects/gst-plugins-bad/ext/vmaf/meson.build b/subprojects/gst-plugins-bad/ext/vmaf/meson.build index 86d3790e97..8d131c1119 100644 --- a/subprojects/gst-plugins-bad/ext/vmaf/meson.build +++ b/subprojects/gst-plugins-bad/ext/vmaf/meson.build @@ -1,6 +1,7 @@ vmaf_sources = [ - 'vmafplugin.c', - 'vmafconvert.c', + 'gstvmafconvert.c', + 'gstvmafelement.c', + 'gstvmafplugin.c', ] libvmaf_dep = dependency('libvmaf', required : get_option('vmaf'))