• 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  #if defined(APPLEMEDIA_MOLTENVK)
31  #include <gst/vulkan/vulkan.h>
32  #endif
33  
34  G_BEGIN_DECLS
35  
36  #define GST_TYPE_VTDEC   (gst_vtdec_get_type())
37  #define GST_VTDEC(obj)   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_VTDEC,GstVtdec))
38  #define GST_VTDEC_CLASS(klass)   (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_VTDEC,GstVtdecClass))
39  #define GST_IS_VTDEC(obj)   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_VTDEC))
40  #define GST_IS_VTDEC_CLASS(obj)   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_VTDEC))
41  
42  typedef struct _GstVtdec GstVtdec;
43  typedef struct _GstVtdecClass GstVtdecClass;
44  
45  struct _GstVtdec
46  {
47    GstVideoDecoder base_vtdec;
48    GstVideoCodecState *input_state;
49    GstVideoInfo video_info;
50    CMFormatDescriptionRef format_description;
51    VTDecompressionSessionRef session;
52    GAsyncQueue *reorder_queue;
53    gint reorder_queue_length;
54    GstVideoTextureCache *texture_cache;
55    GstGLContextHelper *ctxh;
56  
57  #if defined(APPLEMEDIA_MOLTENVK)
58    GstVulkanInstance *instance;
59    GstVulkanDevice *device;
60  #endif
61  
62    gboolean require_hardware;
63  };
64  
65  struct _GstVtdecClass
66  {
67    GstVideoDecoderClass base_vtdec_class;
68  };
69  
70  GType gst_vtdec_get_type (void);
71  
72  void gst_vtdec_register_elements (GstPlugin * plugin);
73  
74  G_END_DECLS
75  
76  #endif
77