• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2021 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 #include "config.h"
16 #include "gst_surface_src.h"
17 #include "gst_shmem_src.h"
18 #include "gst_video_capture_src.h"
19 
plugin_init(GstPlugin * plugin)20 static gboolean plugin_init(GstPlugin *plugin)
21 {
22     gboolean ret = FALSE;
23     if (gst_element_register(plugin, "surfacesrc", GST_RANK_PRIMARY, GST_TYPE_SURFACE_SRC)) {
24         ret = TRUE;
25     } else {
26         GST_WARNING_OBJECT(plugin, "register surfacesrc failed");
27     }
28     if (gst_element_register(plugin, "shmemsrc", GST_RANK_PRIMARY, GST_TYPE_SHMEM_SRC)) {
29         ret = TRUE;
30     } else {
31         GST_WARNING_OBJECT(plugin, "register shmemsrc failed");
32     }
33     if (gst_element_register(plugin, "videocapturesrc", GST_RANK_PRIMARY, GST_TYPE_VIDEO_CAPTURE_SRC)) {
34         ret = TRUE;
35     } else {
36         GST_WARNING_OBJECT(plugin, "register videocapturesrc failed");
37     }
38 
39     return ret;
40 }
41 
42 GST_PLUGIN_DEFINE(GST_VERSION_MAJOR,
43     GST_VERSION_MINOR,
44     _mem_src,
45     "GStreamer Codec Source",
46     plugin_init,
47     PACKAGE_VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)
48