~ubuntu-branches/ubuntu/vivid/gstreamer-vaapi/vivid-proposed

« back to all changes in this revision

Viewing changes to gst-libs/gst/vaapi/gstvaapivideopool_priv.h

  • Committer: Package Import Robot
  • Author(s): Timo Aaltonen
  • Date: 2014-02-20 19:38:29 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20140220193829-j0i1n457xrnwiy16
Tags: 0.5.7-0ubuntu1
Sync from Debian NEW.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *  gstvaapivideopool_priv.h - Video object pool abstraction (private defs)
 
3
 *
 
4
 *  Copyright (C) 2010-2011 Splitted-Desktop Systems
 
5
 *    Author: Gwenole Beauchesne <gwenole.beauchesne@splitted-desktop.com>
 
6
 *  Copyright (C) 2012-2013 Intel Corporation
 
7
 *    Author: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
 
8
 *
 
9
 *  This library is free software; you can redistribute it and/or
 
10
 *  modify it under the terms of the GNU Lesser General Public License
 
11
 *  as published by the Free Software Foundation; either version 2.1
 
12
 *  of the License, or (at your option) any later version.
 
13
 *
 
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.
 
18
 *
 
19
 *  You should have received a copy of the GNU Lesser General Public
 
20
 *  License along with this library; if not, write to the Free
 
21
 *  Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 
22
 *  Boston, MA 02110-1301 USA
 
23
 */
 
24
 
 
25
#ifndef GST_VAAPI_VIDEO_POOL_PRIV_H
 
26
#define GST_VAAPI_VIDEO_POOL_PRIV_H
 
27
 
 
28
#include "gstvaapiminiobject.h"
 
29
 
 
30
G_BEGIN_DECLS
 
31
 
 
32
#define GST_VAAPI_VIDEO_POOL_CLASS(klass) \
 
33
    ((GstVaapiVideoPoolClass *)(klass))
 
34
 
 
35
#define GST_VAAPI_IS_VIDEO_POOL_CLASS(klass) \
 
36
    ((klass) != NULL)
 
37
 
 
38
typedef struct _GstVaapiVideoPoolClass          GstVaapiVideoPoolClass;
 
39
 
 
40
/**
 
41
 * GstVaapiVideoPool:
 
42
 *
 
43
 * A pool of lazily allocated video objects. e.g. surfaces, images.
 
44
 */
 
45
struct _GstVaapiVideoPool {
 
46
    /*< private >*/
 
47
    GstVaapiMiniObject  parent_instance;
 
48
 
 
49
    guint               object_type;
 
50
    GstVaapiDisplay    *display;
 
51
    GQueue              free_objects;
 
52
    GList              *used_objects;
 
53
    guint               used_count;
 
54
    guint               capacity;
 
55
    GMutex              mutex;
 
56
};
 
57
 
 
58
/**
 
59
 * GstVaapiVideoPoolClass:
 
60
 * @alloc_object: virtual function for allocating a video pool object
 
61
 *
 
62
 * A pool base class used to hold video objects. e.g. surfaces, images.
 
63
 */
 
64
struct _GstVaapiVideoPoolClass {
 
65
    /*< private >*/
 
66
    GstVaapiMiniObjectClass parent_class;
 
67
 
 
68
    /*< public >*/
 
69
    gpointer (*alloc_object)(GstVaapiVideoPool *pool);
 
70
};
 
71
 
 
72
G_GNUC_INTERNAL
 
73
void
 
74
gst_vaapi_video_pool_init(GstVaapiVideoPool *pool, GstVaapiDisplay *display,
 
75
    GstVaapiVideoPoolObjectType object_type);
 
76
 
 
77
G_GNUC_INTERNAL
 
78
void
 
79
gst_vaapi_video_pool_finalize(GstVaapiVideoPool *pool);
 
80
 
 
81
/* Internal aliases */
 
82
 
 
83
#define gst_vaapi_video_pool_ref_internal(pool) \
 
84
    ((gpointer)gst_vaapi_mini_object_ref(GST_VAAPI_MINI_OBJECT(pool)))
 
85
 
 
86
#define gst_vaapi_video_pool_unref_internal(pool) \
 
87
    gst_vaapi_mini_object_unref(GST_VAAPI_MINI_OBJECT(pool))
 
88
 
 
89
#define gst_vaapi_video_pool_replace_internal(old_pool_ptr, new_pool) \
 
90
    gst_vaapi_mini_object_replace((GstVaapiMiniObject **)(old_pool_ptr), \
 
91
        GST_VAAPI_MINI_OBJECT(new_pool))
 
92
 
 
93
#undef  gst_vaapi_video_pool_ref
 
94
#define gst_vaapi_video_pool_ref(pool) \
 
95
    gst_vaapi_video_pool_ref_internal((pool))
 
96
 
 
97
#undef  gst_vaapi_video_pool_unref
 
98
#define gst_vaapi_video_pool_unref(pool) \
 
99
    gst_vaapi_video_pool_unref_internal((pool))
 
100
 
 
101
#undef  gst_vaapi_video_pool_replace
 
102
#define gst_vaapi_video_pool_replace(old_pool_ptr, new_pool) \
 
103
    gst_vaapi_video_pool_replace_internal((old_pool_ptr), (new_pool))
 
104
 
 
105
G_END_DECLS
 
106
 
 
107
#endif /* GST_VAAPI_VIDEO_POOL_PRIV_H */