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_CONSUMER_SURFACE_ALLOCATOR_H 17 #define GST_CONSUMER_SURFACE_ALLOCATOR_H 18 19 #include <gst/gst.h> 20 #include "surface.h" 21 22 G_BEGIN_DECLS 23 24 #define GST_TYPE_CONSUMER_SURFACE_ALLOCATOR (gst_consumer_surface_allocator_get_type()) 25 #define GST_CONSUMER_SURFACE_ALLOCATOR(obj) \ 26 (G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_CONSUMER_SURFACE_ALLOCATOR, GstConsumerSurfaceAllocator)) 27 #define GST_CONSUMER_SURFACE_ALLOCATOR_CLASS(klass) \ 28 (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_CONSUMER_SURFACE_ALLOCATOR, GstConsumerSurfaceAllocatorClass)) 29 #define GST_IS_CONSUMER_SURFACE_ALLOCATOR(obj) \ 30 (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_CONSUMER_SURFACE_ALLOCATOR)) 31 #define GST_IS_CONSUMER_SURFACE_ALLOCATOR_CLASS(klass) \ 32 (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_CONSUMER_SURFACE_ALLOCATOR)) 33 #define GST_CONSUMER_SURFACE_ALLOCATOR_CAST(obj) ((GstConsumerSurfaceAllocator*)(obj)) 34 35 typedef struct _GstConsumerSurfaceAllocator GstConsumerSurfaceAllocator; 36 typedef struct _GstConsumerSurfaceAllocatorClass GstConsumerSurfaceAllocatorClass; 37 typedef struct _GstConsumerSurfaceAllocatorPrivate GstConsumerSurfaceAllocatorPrivate; 38 39 struct _GstConsumerSurfaceAllocator { 40 GstAllocator parent; 41 42 /* < private > */ 43 GstConsumerSurfaceAllocatorPrivate *priv; 44 }; 45 46 struct _GstConsumerSurfaceAllocatorClass { 47 GstAllocatorClass parent; 48 }; 49 50 GType gst_consumer_surface_allocator_get_type(void); 51 52 GstAllocator *gst_consumer_surface_allocator_new(); 53 54 void gst_consumer_surface_allocator_set_surface(GstAllocator *allocator, 55 OHOS::sptr<OHOS::Surface> &consumerSurface); 56 57 G_END_DECLS 58 59 #endif 60