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