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_SURFACE_SRC_H__ 17 #define __GST_SURFACE_SRC_H__ 18 19 #include "gst_mem_src.h" 20 #include "surface.h" 21 22 G_BEGIN_DECLS 23 24 #define GST_TYPE_SURFACE_SRC (gst_surface_src_get_type()) 25 #define GST_SURFACE_SRC(obj) \ 26 (G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_SURFACE_SRC, GstSurfaceSrc)) 27 #define GST_SURFACE_SRC_CLASS(klass) \ 28 (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_SURFACE_SRC, GstSurfaceSrcClass)) 29 #define GST_IS_SURFACE_SRC(obj) \ 30 (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_SURFACE_SRC)) 31 #define GST_IS_SURFACE_SRC_CLASS(klass) \ 32 (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_SURFACE_SRC)) 33 #define GST_SURFACE_SRC_CAST(obj) ((GstSurfaceSrc*)(obj)) 34 35 typedef struct _GstSurfaceSrc GstSurfaceSrc; 36 typedef struct _GstSurfaceSrcClass GstSurfaceSrcClass; 37 typedef struct _GstSurfaceMemSrcDump GstSurfaceMemSrcDump; 38 39 struct _GstSurfaceMemSrcDump { 40 gboolean enable_dump; 41 FILE *dump_file; 42 }; 43 44 struct _GstSurfaceSrc { 45 GstMemSrc memsrc; 46 OHOS::sptr<OHOS::Surface> consumerSurface; 47 OHOS::sptr<OHOS::Surface> producerSurface; 48 GstBufferPool *pool; 49 guint stride; 50 gboolean need_flush; 51 gboolean flushing; 52 GstSurfaceMemSrcDump dump; 53 }; 54 55 struct _GstSurfaceSrcClass { 56 GstMemSrcClass parent_class; 57 }; 58 59 GST_API_EXPORT GType gst_surface_src_get_type(void); 60 61 G_END_DECLS 62 #endif