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 16 #ifndef GST_VIDEO_SHMEM_SINK_H 17 #define GST_VIDEO_SHMEM_SINK_H 18 19 #include "config.h" 20 #include <gst/base/gstbasesink.h> 21 22 G_BEGIN_DECLS 23 24 #define GST_TYPE_VIDEO_SHMEM_SINK (gst_video_shmem_sink_get_type()) 25 #define GST_VIDEO_SHMEM_SINK(obj) \ 26 (G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_VIDEO_SHMEM_SINK, GstVideoShMemSink)) 27 #define GST_VIDEO_SHMEM_SINK_CLASS(klass) \ 28 (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_VIDEO_SHMEM_SINK, GstVideoShMemSinkClass)) 29 #define GST_IS_VIDEO_SHMEM_SINK(obj) \ 30 (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_VIDEO_SHMEM_SINK)) 31 #define GST_IS_VIDEO_SHMEM_SINK_CLASS(klass) \ 32 (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_VIDEO_SHMEM_SINK)) 33 #define GST_VIDEO_SHMEM_SINK_CAST(obj) ((GstVideoShMemSink*)(obj)) 34 35 typedef struct _GstVideoShMemSink GstVideoShMemSink; 36 typedef struct _GstVideoShMemSinkClass GstVideoShMemSinkClass; 37 typedef struct _GstVideoShMemSinkPrivate GstVideoShMemSinkPrivate; 38 39 struct _GstVideoShMemSink { 40 GstBaseSink basesink; 41 42 /* < private > */ 43 GstVideoShMemSinkPrivate *priv; 44 }; 45 46 struct _GstVideoShMemSinkClass { 47 GstBaseSinkClass basesink_class; 48 49 /* signals */ 50 GstFlowReturn (*new_preroll)(GstVideoShMemSink *appsink); 51 GstFlowReturn (*new_sample)(GstVideoShMemSink *appsink); 52 53 /* actions */ 54 GstSample *(*pull_preroll)(GstVideoShMemSink *appsink); 55 GstSample *(*pull_sample)(GstVideoShMemSink *appsink); 56 }; 57 58 G_GNUC_INTERNAL GType gst_video_shmem_sink_get_type(void); 59 60 #ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC 61 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstVideoShMemSink, gst_object_unref) 62 #endif 63 64 G_END_DECLS 65 #endif