Add sami extension for auto-loading of subs
[vlc.git] / modules / codec / gstreamer / gstvlcpictureplaneallocator.h
blob7607b4adf5cba064010355849849da85eab1e89c
1 /*****************************************************************************
2 * gstvlcpictureplaneallocator.h: VLC pictures wrapped by GstAllocator
3 *****************************************************************************
4 * Copyright (C) 2016 VLC authors and VideoLAN
5 * $Id:
7 * Author: Vikram Fugro <vikram.fugro@gmail.com>
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Library General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 *****************************************************************************/
24 /*****************************************************************************
25 * Preamble
26 *****************************************************************************/
27 #ifndef VLC_GST_PICTURE_PLANE_ALLOCATOR_H_
28 #define VLC_GST_PICTURE_PLANE_ALLOCATOR_H_
30 #include <gst/gst.h>
31 #include <gst/video/video.h>
32 #include <gst/video/gstvideometa.h>
34 #include <vlc_common.h>
35 #include <vlc_codec.h>
37 typedef struct _GstVlcPicturePlane GstVlcPicturePlane;
38 typedef struct _GstVlcPicturePlaneAllocator GstVlcPicturePlaneAllocator;
39 typedef struct _GstVlcPicturePlaneAllocatorClass \
40 GstVlcPicturePlaneAllocatorClass;
42 /* allocator functions */
43 #define GST_TYPE_VLC_PICTURE_PLANE_ALLOCATOR \
44 (gst_vlc_picture_plane_allocator_get_type())
45 #define GST_IS_VLC_PICTURE_PLANE_ALLOCATOR(obj) \
46 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VLC_PICTURE_PLANE_ALLOCATOR))
47 #define GST_VLC_PICTURE_PLANE_ALLOCATOR(obj) \
48 (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VLC_PICTURE_PLANE_ALLOCATOR, \
49 GstVlcPicturePlaneAllocator))
50 #define GST_VLC_PICTURE_PLANE_ALLOCATOR_CAST(obj) \
51 ((GstVlcPicturePlaneAllocator*)(obj))
53 struct _GstVlcPicturePlane
55 GstMemory parent;
57 decoder_t *p_dec;
58 picture_t *p_pic;
59 plane_t *p_plane;
62 struct _GstVlcPicturePlaneAllocator
64 GstAllocator parent;
65 picture_t pic_info;;
67 decoder_t *p_dec;
70 struct _GstVlcPicturePlaneAllocatorClass
72 GstAllocatorClass parent_class;
75 GType gst_vlc_picture_plane_allocator_get_type( void );
76 GstVlcPicturePlaneAllocator* gst_vlc_picture_plane_allocator_new(
77 decoder_t *p_dec );
78 bool gst_vlc_picture_plane_allocator_query_format(
79 GstVlcPicturePlaneAllocator *p_gallocator, GstVideoInfo *p_info,
80 GstVideoAlignment *p_align, GstCaps *p_caps );
81 bool gst_vlc_set_vout_fmt( GstVideoInfo *p_info, GstVideoAlignment *p_align,
82 GstCaps *p_caps, decoder_t *p_dec );
83 void gst_vlc_dec_ensure_empty_queue( decoder_t* p_dec );
84 bool gst_vlc_picture_plane_allocator_hold( GstVlcPicturePlaneAllocator
85 *p_allocator, GstBuffer *p_buffer );
86 void gst_vlc_picture_plane_allocator_release(
87 GstVlcPicturePlaneAllocator *p_allocator, GstBuffer *p_buffer );
88 bool gst_vlc_picture_plane_allocator_alloc(
89 GstVlcPicturePlaneAllocator *p_allocator,
90 GstBuffer *p_buffer );
91 #endif