• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* GStreamer
2  * Copyright (C) 2020 Collabora Ltd.
3  *   Author: Nicolas Dufresne <nicolas.dufresne@collabora.com>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public
16  * License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
18  * Boston, MA 02110-1301, USA.
19  */
20 
21 #ifndef _GST_V4L2_CODEC_ALLOCATOR_H_
22 #define _GST_V4L2_CODEC_ALLOCATOR_H_
23 
24 #include <gst/allocators/allocators.h>
25 #include <gst/gst.h>
26 
27 #include "gstv4l2codecdevice.h"
28 #include "gstv4l2decoder.h"
29 
30 #define GST_TYPE_V4L2_CODEC_ALLOCATOR gst_v4l2_codec_allocator_get_type ()
31 G_DECLARE_FINAL_TYPE (GstV4l2CodecAllocator, gst_v4l2_codec_allocator,
32     GST_V4L2_CODEC, ALLOCATOR, GstDmaBufAllocator);
33 
34 
35 GstV4l2CodecAllocator  *gst_v4l2_codec_allocator_new (GstV4l2Decoder * decoder,
36                                                       GstPadDirection direction,
37                                                       guint num_buffers);
38 
39 GstMemory              *gst_v4l2_codec_allocator_alloc (GstV4l2CodecAllocator * allocator);
40 
41 
42 
43 gboolean                gst_v4l2_codec_allocator_create_buffer (GstV4l2CodecAllocator * self);
44 
45 gboolean                gst_v4l2_codec_allocator_wait_for_buffer (GstV4l2CodecAllocator * self);
46 
47 gboolean                gst_v4l2_codec_allocator_prepare_buffer (GstV4l2CodecAllocator * allocator,
48                                                                  GstBuffer * buffer);
49 
50 guint                   gst_v4l2_codec_allocator_get_pool_size (GstV4l2CodecAllocator *self);
51 
52 void                    gst_v4l2_codec_allocator_detach (GstV4l2CodecAllocator * self);
53 
54 void                    gst_v4l2_codec_allocator_set_flushing (GstV4l2CodecAllocator * self,
55                                                                gboolean flushing);
56 
57 guint32                 gst_v4l2_codec_memory_get_index (GstMemory * mem);
58 
59 #endif /* _GST_V4L2_CODECS_ALLOCATOR_H_ */
60