summaryrefslogtreecommitdiff
path: root/sys/nvcodec/gstcudafilter.c
blob: eadf1c616eaf6aaad20edce3ba5ae830c6829635 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/* GStreamer
 * Copyright (C) 2019 Seungha Yang <seungha.yang@navercorp.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.
 */

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include "gstcudafilter.h"
#include "gstcudaloader.h"
#include "gstnvrtcloader.h"
#include "gstcudanvrtc.h"
#include "gstcudaconvert.h"
#include "gstcudascale.h"

/* *INDENT-OFF* */
const gchar *nvrtc_test_source =
    "__global__ void\n"
    "my_kernel (void) {}";
/* *INDENT-ON* */

void
gst_cuda_filter_plugin_init (GstPlugin * plugin)
{
  gchar *test_ptx = NULL;

  if (!gst_nvrtc_load_library ())
    return;

  test_ptx = gst_cuda_nvrtc_compile (nvrtc_test_source);

  if (!test_ptx) {
    return;
  }
  g_free (test_ptx);

  gst_element_register (plugin, "cudaconvert", GST_RANK_NONE,
      GST_TYPE_CUDA_CONVERT);
  gst_element_register (plugin, "cudascale", GST_RANK_NONE,
      GST_TYPE_CUDA_SCALE);
}