va: Implement the vaav1enc plugin

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3015>
This commit is contained in:
He Junyan 2022-09-12 14:48:50 +08:00 committed by GStreamer Marge Bot
parent f4779f1fab
commit b4eb97101f
4 changed files with 4490 additions and 0 deletions

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,34 @@
/* GStreamer
* Copyright (C) 2022 Intel Corporation
* Author: He Junyan <junyan.he@intel.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.
*/
#pragma once
#include "gstvadevice.h"
G_BEGIN_DECLS
gboolean gst_va_av1_enc_register (GstPlugin * plugin,
GstVaDevice * device,
GstCaps * sink_caps,
GstCaps * src_caps,
guint rank,
VAEntrypoint entrypoint);
G_END_DECLS

View file

@ -71,6 +71,10 @@ if cc.get_id() == 'msvc'
c_std_arg = ['c_std=c11'] c_std_arg = ['c_std=c11']
endif endif
if libva_dep.version().version_compare('>= 1.15')
va_sources += 'gstvaav1enc.c'
endif
gstva = library('gstva', gstva = library('gstva',
va_sources, va_sources,
c_args : gst_plugins_bad_args + extra_args, c_args : gst_plugins_bad_args + extra_args,

View file

@ -28,6 +28,7 @@
#endif #endif
#include "gstvaav1dec.h" #include "gstvaav1dec.h"
#include "gstvaav1enc.h"
#include "gstvacaps.h" #include "gstvacaps.h"
#include "gstvacompositor.h" #include "gstvacompositor.h"
#include "gstvadeinterlace.h" #include "gstvadeinterlace.h"
@ -207,6 +208,15 @@ plugin_register_encoders (GstPlugin * plugin, GstVaDevice * device,
device->render_device_path); device->render_device_path);
} }
break; break;
#if VA_CHECK_VERSION(1, 15, 0)
case AV1:
if (!gst_va_av1_enc_register (plugin, device, sinkcaps, srccaps,
GST_RANK_NONE, entrypoint)) {
GST_WARNING ("Failed to register AV1 encoder: %s",
device->render_device_path);
}
break;
#endif
default: default:
GST_DEBUG ("No encoder implementation for %" GST_FOURCC_FORMAT, GST_DEBUG ("No encoder implementation for %" GST_FOURCC_FORMAT,
GST_FOURCC_ARGS (codec)); GST_FOURCC_ARGS (codec));