summaryrefslogtreecommitdiff
path: root/gst-libs/gst/vaapi/gstvaapivideopool_priv.h
blob: 1d5115a0d765f140ad4d1bf3a8c4be17bb9f0cd3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/*
 *  gstvaapivideopool_priv.h - Video object pool abstraction (private defs)
 *
 *  Copyright (C) 2010-2011 Splitted-Desktop Systems
 *    Author: Gwenole Beauchesne <gwenole.beauchesne@splitted-desktop.com>
 *  Copyright (C) 2012-2013 Intel Corporation
 *    Author: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public License
 *  as published by the Free Software Foundation; either version 2.1
 *  of the License, or (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this library; if not, write to the Free
 *  Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 *  Boston, MA 02110-1301 USA
 */

#ifndef GST_VAAPI_VIDEO_POOL_PRIV_H
#define GST_VAAPI_VIDEO_POOL_PRIV_H

#include "gstvaapiminiobject.h"

G_BEGIN_DECLS

#define GST_VAAPI_VIDEO_POOL_CLASS(klass) \
  ((GstVaapiVideoPoolClass *)(klass))
#define GST_VAAPI_IS_VIDEO_POOL_CLASS(klass)    \
  ((klass) != NULL)

typedef struct _GstVaapiVideoPoolClass GstVaapiVideoPoolClass;

/**
 * GstVaapiVideoPool:
 *
 * A pool of lazily allocated video objects. e.g. surfaces, images.
 */
struct _GstVaapiVideoPool
{
  /*< private >*/
  GstVaapiMiniObject parent_instance;

  guint object_type;
  GstVaapiDisplay *display;
  GQueue free_objects;
  GList *used_objects;
  guint used_count;
  guint capacity;
  GMutex mutex;
};

/**
 * GstVaapiVideoPoolClass:
 * @alloc_object: virtual function for allocating a video pool object
 *
 * A pool base class used to hold video objects. e.g. surfaces, images.
 */
struct _GstVaapiVideoPoolClass
{
  /*< private >*/
  GstVaapiMiniObjectClass parent_class;

  /*< public >*/
  gpointer (*alloc_object) (GstVaapiVideoPool * pool);
};

G_GNUC_INTERNAL
void
gst_vaapi_video_pool_init (GstVaapiVideoPool * pool, GstVaapiDisplay * display,
    GstVaapiVideoPoolObjectType object_type);

G_GNUC_INTERNAL
void
gst_vaapi_video_pool_finalize (GstVaapiVideoPool * pool);

G_END_DECLS

#endif /* GST_VAAPI_VIDEO_POOL_PRIV_H */