xine-lib: xine-lib-1.2.12/src/video_out/vaapi/vaapi_util.h Source File

xine-lib 1.2.12

vaapi_util.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2012 Edgar Hucek <gimli|@dark-green.com>
3 * Copyright (C) 2012-2022 xine developers
4 *
5 * This file is part of xine, a free video player.
6 *
7 * xine is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * xine is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
20 *
21 * vaapi_util.c, VAAPI video extension interface for xine
22 *
23 */
24
25#ifndef XINE_VAAPI_UTIL_H
26#define XINE_VAAPI_UTIL_H
27
28#include <xine/video_out.h>
29#include "accel_vaapi.h"
30
31#include <sys/types.h>
32
33#include <va/va.h>
34
35/*
36 *
37 */
38
39const char *_x_va_profile_to_string(VAProfile profile);
40const char *_x_va_entrypoint_to_string(VAEntrypoint entrypoint);
41
42void _x_va_reset_va_context(ff_vaapi_context_t *va_context);
43
44/*
45 *
46 */
47
48struct xine_va_display_t;
49
50 typedef struct vaapi_context_impl vaapi_context_impl_t;
51
52#define RENDER_SURFACES 50
53
54 struct vaapi_context_impl {
55 ff_vaapi_context_t c;
56
57 xine_t *xine;
58
59 struct xine_va_display_t *va_display_plugin;
60 int query_va_status;
61
62 pthread_mutex_t ctx_lock; /* lock init / close / surface usage */
63
64 unsigned int num_frames;
65 vo_frame_t *frames[RENDER_SURFACES];
66
67 pthread_mutex_t surfaces_lock;
68 unsigned va_head;
69 ff_vaapi_surface_t va_render_surfaces_storage[RENDER_SURFACES + 1];
70 VASurfaceID va_surface_ids_storage[RENDER_SURFACES + 1];
71};
72
73 vaapi_context_impl_t *_x_va_new(xine_t *xine, int visual_type, const void *visual, unsigned va_display_flags);
74void _x_va_free(vaapi_context_impl_t **va_context);
75
76int _x_va_check_status(vaapi_context_impl_t *va_context, VAStatus vaStatus, const char *msg);
77
78void _x_va_destroy_image(vaapi_context_impl_t *va_context, VAImage *va_image);
79VAStatus _x_va_create_image(vaapi_context_impl_t *va_context, VASurfaceID va_surface_id, VAImage *va_image, int width, int height, int clear, int *is_bound);
80
81int _x_va_profile_from_imgfmt(vaapi_context_impl_t *va_context, unsigned format);
82
83/*
84 * surface pool
85 */
86
87void _x_va_close(vaapi_context_impl_t *va_context);
88VAStatus _x_va_init(vaapi_context_impl_t *va_context, int va_profile, int width, int height);
89
90 ff_vaapi_surface_t *_x_va_alloc_surface(vaapi_context_impl_t *va_context);
91void _x_va_render_surface(vaapi_context_impl_t *va_context, ff_vaapi_surface_t *va_surface);
92void _x_va_release_surface(vaapi_context_impl_t *va_context, ff_vaapi_surface_t *va_surface);
93void _x_va_surface_displayed(vaapi_context_impl_t *va_context, ff_vaapi_surface_t *va_surface);
94
95#endif /* XINE_VAAPI_UTIL_H */
accel_vaapi.h
height
unsigned int height
Definition: gfontrle.c:5
width
unsigned int width
Definition: gfontrle.c:4
video_out.h
ff_vaapi_context_s
Definition: accel_vaapi.h:52
ff_vaapi_surface_s
Definition: accel_vaapi.h:72
vaapi_context_impl
Definition: vaapi_util.h:54
vaapi_context_impl::query_va_status
int query_va_status
Definition: vaapi_util.h:60
vaapi_context_impl::va_render_surfaces_storage
ff_vaapi_surface_t va_render_surfaces_storage[50+1]
Definition: vaapi_util.h:69
vaapi_context_impl::va_display_plugin
struct xine_va_display_t * va_display_plugin
Definition: vaapi_util.h:59
vaapi_context_impl::num_frames
unsigned int num_frames
Definition: vaapi_util.h:64
vaapi_context_impl::c
ff_vaapi_context_t c
Definition: vaapi_util.h:55
vaapi_context_impl::frames
vo_frame_t * frames[50]
Definition: vaapi_util.h:65
vaapi_context_impl::xine
xine_t * xine
Definition: vaapi_util.h:57
vaapi_context_impl::ctx_lock
pthread_mutex_t ctx_lock
Definition: vaapi_util.h:62
vaapi_context_impl::surfaces_lock
pthread_mutex_t surfaces_lock
Definition: vaapi_util.h:67
vaapi_context_impl::va_head
unsigned va_head
Definition: vaapi_util.h:68
vaapi_context_impl::va_surface_ids_storage
VASurfaceID va_surface_ids_storage[50+1]
Definition: vaapi_util.h:70
vo_frame_s
Definition: video_out.h:70
xine_s
Definition: xine_internal.h:80
xine_va_display_t
Definition: xine_va_display.h:32
_x_va_reset_va_context
void _x_va_reset_va_context(ff_vaapi_context_t *va_context)
Definition: vaapi_util.c:108
_x_va_destroy_image
void _x_va_destroy_image(vaapi_context_impl_t *va_context, VAImage *va_image)
Definition: vaapi_util.c:210
_x_va_entrypoint_to_string
const char * _x_va_entrypoint_to_string(VAEntrypoint entrypoint)
Definition: vaapi_util.c:81
_x_va_init
VAStatus _x_va_init(vaapi_context_impl_t *va_context, int va_profile, int width, int height)
Definition: vaapi_util.c:338
_x_va_close
void _x_va_close(vaapi_context_impl_t *va_context)
Definition: vaapi_util.c:313
_x_va_alloc_surface
ff_vaapi_surface_t * _x_va_alloc_surface(vaapi_context_impl_t *va_context)
Definition: vaapi_util.c:543
_x_va_profile_to_string
const char * _x_va_profile_to_string(VAProfile profile)
Definition: vaapi_util.c:56
_x_va_profile_from_imgfmt
int _x_va_profile_from_imgfmt(vaapi_context_impl_t *va_context, unsigned format)
Definition: vaapi_util.c:444
_x_va_new
vaapi_context_impl_t * _x_va_new(xine_t *xine, int visual_type, const void *visual, unsigned va_display_flags)
Definition: vaapi_util.c:146
_x_va_free
void _x_va_free(vaapi_context_impl_t **va_context)
Definition: vaapi_util.c:127
_x_va_release_surface
void _x_va_release_surface(vaapi_context_impl_t *va_context, ff_vaapi_surface_t *va_surface)
Definition: vaapi_util.c:593
_x_va_surface_displayed
void _x_va_surface_displayed(vaapi_context_impl_t *va_context, ff_vaapi_surface_t *va_surface)
Definition: vaapi_util.c:612
_x_va_render_surface
void _x_va_render_surface(vaapi_context_impl_t *va_context, ff_vaapi_surface_t *va_surface)
Definition: vaapi_util.c:583
_x_va_check_status
int _x_va_check_status(vaapi_context_impl_t *va_context, VAStatus vaStatus, const char *msg)
Definition: vaapi_util.c:98
RENDER_SURFACES
#define RENDER_SURFACES
Definition: vaapi_util.h:52
_x_va_create_image
VAStatus _x_va_create_image(vaapi_context_impl_t *va_context, VASurfaceID va_surface_id, VAImage *va_image, int width, int height, int clear, int *is_bound)
Definition: vaapi_util.c:224