From d0b587eb1593e3579aa6f8704e1f0e51f92c24bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Cr=C3=AAte?= Date: Thu, 19 Oct 2023 19:33:49 -0400 Subject: [PATCH] onnx: Remove enums file Part-of: --- .../gst-plugins-bad/ext/onnx/gstonnxclient.h | 17 +++++++- .../gst-plugins-bad/ext/onnx/gstonnxenums.h | 41 ------------------- .../ext/onnx/gstonnxinference.cpp | 22 ++++++++++ .../ext/onnx/gstonnxinference.h | 24 ----------- 4 files changed, 38 insertions(+), 66 deletions(-) delete mode 100644 subprojects/gst-plugins-bad/ext/onnx/gstonnxenums.h diff --git a/subprojects/gst-plugins-bad/ext/onnx/gstonnxclient.h b/subprojects/gst-plugins-bad/ext/onnx/gstonnxclient.h index 18a661a8d1..feed54a826 100644 --- a/subprojects/gst-plugins-bad/ext/onnx/gstonnxclient.h +++ b/subprojects/gst-plugins-bad/ext/onnx/gstonnxclient.h @@ -26,9 +26,24 @@ #include #include #include "gstml.h" -#include "gstonnxenums.h" #include "tensor/gsttensormeta.h" + +typedef enum +{ + GST_ONNX_OPTIMIZATION_LEVEL_DISABLE_ALL, + GST_ONNX_OPTIMIZATION_LEVEL_ENABLE_BASIC, + GST_ONNX_OPTIMIZATION_LEVEL_ENABLE_EXTENDED, + GST_ONNX_OPTIMIZATION_LEVEL_ENABLE_ALL, +} GstOnnxOptimizationLevel; + +typedef enum +{ + GST_ONNX_EXECUTION_PROVIDER_CPU, + GST_ONNX_EXECUTION_PROVIDER_CUDA, +} GstOnnxExecutionProvider; + + namespace GstOnnxNamespace { class GstOnnxClient { diff --git a/subprojects/gst-plugins-bad/ext/onnx/gstonnxenums.h b/subprojects/gst-plugins-bad/ext/onnx/gstonnxenums.h deleted file mode 100644 index 6cc8658b91..0000000000 --- a/subprojects/gst-plugins-bad/ext/onnx/gstonnxenums.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * GStreamer gstreamer-onnxenums - * Copyright (C) 2021 Collabora Ltd - * - * gstonnxenums.h - * - * 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_ONNX_ENUMS_H__ -#define __GST_ONNX_ENUMS_H__ - -typedef enum -{ - GST_ONNX_OPTIMIZATION_LEVEL_DISABLE_ALL, - GST_ONNX_OPTIMIZATION_LEVEL_ENABLE_BASIC, - GST_ONNX_OPTIMIZATION_LEVEL_ENABLE_EXTENDED, - GST_ONNX_OPTIMIZATION_LEVEL_ENABLE_ALL, -} GstOnnxOptimizationLevel; - -typedef enum -{ - GST_ONNX_EXECUTION_PROVIDER_CPU, - GST_ONNX_EXECUTION_PROVIDER_CUDA, -} GstOnnxExecutionProvider; - - -#endif /* __GST_ONNX_ENUMS_H__ */ diff --git a/subprojects/gst-plugins-bad/ext/onnx/gstonnxinference.cpp b/subprojects/gst-plugins-bad/ext/onnx/gstonnxinference.cpp index 15d68ed7b5..54363a72ca 100644 --- a/subprojects/gst-plugins-bad/ext/onnx/gstonnxinference.cpp +++ b/subprojects/gst-plugins-bad/ext/onnx/gstonnxinference.cpp @@ -87,6 +87,28 @@ #include "gstonnxinference.h" #include "gstonnxclient.h" + +/* + * GstOnnxInference: + * + * @model_file model file + * @optimization_level: ONNX session optimization level + * @execution_provider: ONNX execution provider + * @onnx_client opaque pointer to ONNX client + * @onnx_disabled true if inference is disabled + * @video_info @ref GstVideoInfo of sink caps + */ +struct _GstOnnxInference +{ + GstBaseTransform basetransform; + gchar *model_file; + GstOnnxOptimizationLevel optimization_level; + GstOnnxExecutionProvider execution_provider; + gpointer onnx_client; + gboolean onnx_disabled; + GstVideoInfo video_info; +}; + GST_DEBUG_CATEGORY_STATIC (onnx_inference_debug); #define GST_CAT_DEFAULT onnx_inference_debug #define GST_ONNX_CLIENT_MEMBER( self ) ((GstOnnxNamespace::GstOnnxClient *) (self->onnx_client)) diff --git a/subprojects/gst-plugins-bad/ext/onnx/gstonnxinference.h b/subprojects/gst-plugins-bad/ext/onnx/gstonnxinference.h index 1f12941882..53e2fc5d12 100644 --- a/subprojects/gst-plugins-bad/ext/onnx/gstonnxinference.h +++ b/subprojects/gst-plugins-bad/ext/onnx/gstonnxinference.h @@ -26,7 +26,6 @@ #include #include #include -#include "gstonnxenums.h" G_BEGIN_DECLS @@ -34,29 +33,6 @@ G_BEGIN_DECLS G_DECLARE_FINAL_TYPE (GstOnnxInference, gst_onnx_inference, GST, ONNX_INFERENCE, GstBaseTransform) -/** - * GstOnnxInference: - * - * @model_file model file - * @optimization_level: ONNX session optimization level - * @execution_provider: ONNX execution provider - * @onnx_client opaque pointer to ONNX client - * @onnx_disabled true if inference is disabled - * @video_info @ref GstVideoInfo of sink caps - * - * Since: 1.24 - */ - struct _GstOnnxInference - { - GstBaseTransform basetransform; - gchar *model_file; - GstOnnxOptimizationLevel optimization_level; - GstOnnxExecutionProvider execution_provider; - gpointer onnx_client; - gboolean onnx_disabled; - GstVideoInfo video_info; - }; - GST_ELEMENT_REGISTER_DECLARE (onnx_inference) G_END_DECLS