1 /* 2 * Copyright (C) 2022 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_CAPTURE_POOL_H 17 #define GST_VIDEO_CAPTURE_POOL_H 18 19 #include <gst/gst.h> 20 #include "gst_consumer_surface_pool.h" 21 #include "video_pool_manager.h" 22 23 G_BEGIN_DECLS 24 25 #define GST_TYPE_VIDEO_CAPTURE_POOL (gst_video_capture_pool_get_type()) 26 #define GST_VIDEO_CAPTURE_POOL(obj) \ 27 (G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_VIDEO_CAPTURE_POOL, GstVideoCapturePool)) 28 #define GST_VIDEO_CAPTURE_POOL_CLASS(klass) \ 29 (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_VIDEO_CAPTURE_POOL, GstVideoCapturePoolClass)) 30 #define GST_IS_VIDEO_CAPTURE_POOL(obj) \ 31 (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_VIDEO_CAPTURE_POOL)) 32 #define GST_IS_VIDEO_CAPTURE_POOL_CLASS(klass) \ 33 (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_VIDEO_CAPTURE_POOL)) 34 #define GST_VIDEO_CAPTURE_POOL_CAST(obj) ((GstVideoCapturePool*)(obj)) 35 36 struct _GstVideoCapturePool { 37 GstConsumerSurfacePool element; 38 39 GMutex pool_lock; 40 gboolean cached_data; 41 std::shared_ptr<OHOS::Media::VideoPoolManager> poolMgr; 42 }; 43 44 struct _GstVideoCapturePoolClass { 45 GstConsumerSurfacePoolClass parent_class; 46 }; 47 48 using GstVideoCapturePool = struct _GstVideoCapturePool; 49 using GstVideoCapturePoolClass = struct _GstVideoCapturePoolClass; 50 51 GType gst_video_capture_pool_get_type(void); 52 53 GstBufferPool *gst_video_capture_pool_new(); 54 55 G_END_DECLS 56 57 #endif /* GST_VIDEO_CAPTURE_POOL_H */ 58