From 3396f052277c2e85222011fb633a3d7634d25c1a Mon Sep 17 00:00:00 2001
|
From: Francis Fan <francis.fan@rock-chips.com>
|
Date: Tue, 2 Jul 2019 20:48:29 +0800
|
Subject: [PATCH 10/11] add ion type for hwcontext table
|
|
Change-Id: I609145796477221df5daa79f2a4771718c34794f
|
Signed-off-by: Francis Fan <francis.fan@rock-chips.com>
|
---
|
libavutil/hwcontext.c | 3 +++
|
libavutil/hwcontext_ion.h | 37 +++++++++++++++++++++++++++++++++++++
|
2 files changed, 40 insertions(+)
|
create mode 100644 libavutil/hwcontext_ion.h
|
|
diff --git a/libavutil/hwcontext.c b/libavutil/hwcontext.c
|
index f1e404a..6caa742 100644
|
--- a/libavutil/hwcontext.c
|
+++ b/libavutil/hwcontext.c
|
@@ -27,6 +27,7 @@
|
#include "mem.h"
|
#include "pixdesc.h"
|
#include "pixfmt.h"
|
+#include "hwcontext_ion.h"
|
|
static const HWContextType * const hw_table[] = {
|
#if CONFIG_CUDA
|
@@ -37,6 +38,8 @@ static const HWContextType * const hw_table[] = {
|
#endif
|
#if CONFIG_LIBDRM
|
&ff_hwcontext_type_drm,
|
+#elif CONFIG_ION
|
+ &ff_hwcontext_type_ion,
|
#endif
|
#if CONFIG_DXVA2
|
&ff_hwcontext_type_dxva2,
|
diff --git a/libavutil/hwcontext_ion.h b/libavutil/hwcontext_ion.h
|
new file mode 100644
|
index 0000000..5a5d98f
|
--- /dev/null
|
+++ b/libavutil/hwcontext_ion.h
|
@@ -0,0 +1,37 @@
|
+/*
|
+ * This file is part of FFmpeg.
|
+ *
|
+ * FFmpeg is free software; you can redistribute it and/or
|
+ * modify it under the terms of the GNU Lesser General Public
|
+ * License as published by the Free Software Foundation; either
|
+ * version 2.1 of the License, or (at your option) any later version.
|
+ *
|
+ * FFmpeg 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
|
+ * Lesser General Public License for more details.
|
+ *
|
+ * You should have received a copy of the GNU Lesser General Public
|
+ * License along with FFmpeg; if not, write to the Free Software
|
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
+ */
|
+
|
+#ifndef AVUTIL_HWCONTEXT_ION_H
|
+#define AVUTIL_HWCONTEXT_ION_H
|
+
|
+#include "hwcontext_internal.h"
|
+#include "pixfmt.h"
|
+
|
+const HWContextType ff_hwcontext_type_ion = {
|
+ .type = AV_HWDEVICE_TYPE_DRM,
|
+ .name = "ION",
|
+
|
+ .device_hwctx_size = sizeof(int),
|
+
|
+ .pix_fmts = (const enum AVPixelFormat[]) {
|
+ AV_PIX_FMT_DRM_PRIME,
|
+ AV_PIX_FMT_NONE
|
+ },
|
+};
|
+
|
+#endif /* AVUTIL_HWCONTEXT_ION_H */
|
--
|
2.7.4
|