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_mem_sink.h"
17 #include "gst_shared_mem_sink.h"
18 #include "gst_video_display_sink.h"
19
plugin_init(GstPlugin * plugin)20 static gboolean plugin_init(GstPlugin *plugin)
21 {
22 g_return_val_if_fail(plugin != nullptr, false);
23 gboolean ret = gst_element_register(plugin, "surfacememsink", GST_RANK_PRIMARY, GST_TYPE_SURFACE_MEM_SINK);
24 if (ret == FALSE) {
25 GST_WARNING_OBJECT(nullptr, "register surfacememsink failed");
26 }
27 ret = gst_element_register(plugin, "sharedmemsink", GST_RANK_PRIMARY, GST_TYPE_SHARED_MEM_SINK);
28 if (ret == FALSE) {
29 GST_WARNING_OBJECT(nullptr, "register sharedmemsink failed");
30 }
31 ret = gst_element_register(plugin, "videodisplaysink", GST_RANK_PRIMARY, GST_TYPE_VIDEO_DISPLAY_SINK);
32 if (ret == FALSE) {
33 GST_WARNING_OBJECT(nullptr, "register videodisplaysink failed");
34 }
35 return TRUE;
36 }
37
38 GST_PLUGIN_DEFINE(GST_VERSION_MAJOR,
39 GST_VERSION_MINOR,
40 _mem_sink,
41 "GStreamer Memory Sink",
42 plugin_init,
43 PACKAGE_VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)
44