• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* GStreamer
2  * Copyright (C) 2010, 2013 Ole André Vadla Ravnås <oleavr@soundrop.com>
3  * Copyright (C) 2012, 2013 Alessandro Decina <alessandro.d@gmail.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_VTDEC_H_
22 #define _GST_VTDEC_H_
23 
24 #include <gst/video/video.h>
25 #include <gst/video/gstvideodecoder.h>
26 #include <CoreMedia/CoreMedia.h>
27 #include <VideoToolbox/VideoToolbox.h>
28 #include "videotexturecache.h"
29 #include "glcontexthelper.h"
30 
31 G_BEGIN_DECLS
32 
33 #define GST_TYPE_VTDEC   (gst_vtdec_get_type())
34 #define GST_VTDEC(obj)   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_VTDEC,GstVtdec))
35 #define GST_VTDEC_CLASS(klass)   (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_VTDEC,GstVtdecClass))
36 #define GST_IS_VTDEC(obj)   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_VTDEC))
37 #define GST_IS_VTDEC_CLASS(obj)   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_VTDEC))
38 
39 typedef struct _GstVtdec GstVtdec;
40 typedef struct _GstVtdecClass GstVtdecClass;
41 
42 struct _GstVtdec
43 {
44   GstVideoDecoder base_vtdec;
45   GstVideoCodecState *input_state;
46   GstVideoInfo video_info;
47   CMFormatDescriptionRef format_description;
48   VTDecompressionSessionRef session;
49   GAsyncQueue *reorder_queue;
50   gint reorder_queue_length;
51   GstVideoTextureCache *texture_cache;
52   GstGLContextHelper *ctxh;
53 
54   gboolean require_hardware;
55 };
56 
57 struct _GstVtdecClass
58 {
59   GstVideoDecoderClass base_vtdec_class;
60 };
61 
62 GType gst_vtdec_get_type (void);
63 
64 void gst_vtdec_register_elements (GstPlugin * plugin);
65 
66 G_END_DECLS
67 
68 #endif
69