~ubuntu-branches/ubuntu/trusty/vdpau-video/trusty-proposed

« back to all changes in this revision

Viewing changes to src/vdpau_video_x11.h

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2011-09-22 11:35:45 UTC
  • mfrom: (1.2.1 upstream) (2.1.2 experimental)
  • Revision ID: package-import@ubuntu.com-20110922113545-037dkroelik2be0y
Tags: 0.7.3-0ubuntu1
New upstream version, fix FTBFS with libav 0.7. Closes: #614485, LP: #756021.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 *  vdpau_video_x11.h - VDPAU backend for VA API (X11 rendering)
 
2
 *  vdpau_video_x11.h - VDPAU backend for VA-API (X11 rendering)
3
3
 *
4
 
 *  vdpau-video (C) 2009-2010 Splitted-Desktop Systems
 
4
 *  vdpau-video (C) 2009-2011 Splitted-Desktop Systems
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
22
22
#define VDPAU_VIDEO_X11_H
23
23
 
24
24
#include "vdpau_driver.h"
 
25
#include <pthread.h>
 
26
#include "uasyncqueue.h"
25
27
 
26
28
typedef struct object_output object_output_t;
27
29
struct object_output {
35
37
    VdpPresentationQueue        vdp_flip_queue;
36
38
    VdpPresentationQueueTarget  vdp_flip_target;
37
39
    VdpOutputSurface            vdp_output_surfaces[VDPAU_MAX_OUTPUT_SURFACES];
38
 
    int                         current_output_surface;
 
40
    unsigned int                vdp_output_surfaces_dirty[VDPAU_MAX_OUTPUT_SURFACES];
 
41
    pthread_mutex_t             vdp_output_surfaces_lock;
 
42
    unsigned int                current_output_surface;
 
43
    unsigned int                displayed_output_surface;
 
44
    unsigned int                queued_surfaces;
39
45
    unsigned int                fields;
 
46
    UAsyncQueue                *render_comm;
 
47
    pthread_t                   render_thread;
 
48
    unsigned int                render_thread_ok;
 
49
    unsigned int                is_window    : 1; /* drawable is a window */
 
50
    unsigned int                size_changed : 1; /* size changed since previous vaPutSurface() and user noticed the change */
40
51
};
41
52
 
 
53
// Create output surface
 
54
object_output_p
 
55
output_surface_create(
 
56
    vdpau_driver_data_t *driver_data,
 
57
    Drawable             drawable,
 
58
    unsigned int         width,
 
59
    unsigned int         height
 
60
) attribute_hidden;
 
61
 
42
62
// Destroy output surface
43
63
void
44
64
output_surface_destroy(
61
81
    object_output_p      obj_output
62
82
) attribute_hidden;
63
83
 
 
84
// Looks up output surface
 
85
object_output_p
 
86
output_surface_lookup(object_surface_p obj_surface, Drawable drawable)
 
87
    attribute_hidden;
 
88
 
 
89
// Ensure output surface size matches drawable size
 
90
int
 
91
output_surface_ensure_size(
 
92
    vdpau_driver_data_t *driver_data,
 
93
    object_output_p      obj_output,
 
94
    unsigned int         width,
 
95
    unsigned int         height
 
96
) attribute_hidden;
 
97
 
 
98
// Render surface to the VDPAU output surface
 
99
VAStatus
 
100
render_surface(
 
101
    vdpau_driver_data_t *driver_data,
 
102
    object_surface_p     obj_surface,
 
103
    object_output_p      obj_output,
 
104
    const VARectangle   *source_rect,
 
105
    const VARectangle   *target_rect,
 
106
    unsigned int         flags
 
107
) attribute_hidden;
 
108
 
 
109
// Render subpictures to the VDPAU output surface
 
110
VAStatus
 
111
render_subpictures(
 
112
    vdpau_driver_data_t *driver_data,
 
113
    object_surface_p     obj_surface,
 
114
    object_output_p      obj_output,
 
115
    const VARectangle   *source_rect,
 
116
    const VARectangle   *target_rect
 
117
) attribute_hidden;
 
118
 
64
119
// Render surface to a Drawable
65
120
VAStatus
66
121
put_surface(
74
129
    unsigned int         flags
75
130
) attribute_hidden;
76
131
 
 
132
// Queue surface for display
 
133
VAStatus
 
134
queue_surface(
 
135
    vdpau_driver_data_t *driver_data,
 
136
    object_surface_p     obj_surface,
 
137
    object_output_p      obj_output
 
138
) attribute_hidden;
 
139
 
77
140
// vaPutSurface
78
141
VAStatus
79
142
vdpau_PutSurface(
80
143
    VADriverContextP    ctx,
81
144
    VASurfaceID         surface,
82
 
    Drawable            draw,
 
145
    VADrawable          draw,
83
146
    short               srcx,
84
147
    short               srcy,
85
148
    unsigned short      srcw,