Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(56)

Side by Side Diff: third_party/libva/va/va_dricommon.h

Issue 10380004: Add libva, a library for video accelerated video processing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 #ifndef _VA_DRICOMMON_H_
2 #define _VA_DRICOMMON_H_
3
4 #ifndef ANDROID
5 #include <X11/Xlib.h>
6 #include <xf86drm.h>
7 #include <drm.h>
8 #include <drm_sarea.h>
9 #endif
10
11 #include <va/va_backend.h>
12
13 #ifdef ANDROID
14 #define XID unsigned int
15 #define Bool int
16 #endif
17
18 enum
19 {
20 VA_NONE = 0,
21 VA_DRI1 = 1,
22 VA_DRI2 = 2,
23 VA_DUMMY = 3
24 };
25
26 union dri_buffer
27 {
28 struct {
29 unsigned int attachment;
30 unsigned int name;
31 unsigned int pitch;
32 unsigned int cpp;
33 unsigned int flags;
34 } dri2;
35
36 struct {
37 } dri1;
38 };
39
40 struct dri_drawable
41 {
42 XID x_drawable;
43 int is_window;
44 int x;
45 int y;
46 unsigned int width;
47 unsigned int height;
48 struct dri_drawable *next;
49 };
50
51 #define DRAWABLE_HASH_SZ 32
52 struct dri_state
53 {
54 int fd;
55 int driConnectedFlag; /* 0: disconnected, 1: DRI, 2: DRI2 */
56 #ifndef ANDROID
57 drm_handle_t hSAREA;
58 drm_context_t hwContext;
59 drmAddress pSAREA;
60 XID hwContextID;
61 struct dri_drawable *drawable_hash[DRAWABLE_HASH_SZ];
62
63 struct dri_drawable *(*createDrawable)(VADriverContextP ctx, XID x_drawable) ;
64 void (*destroyDrawable)(VADriverContextP ctx, struct dri_drawable *dri_drawa ble);
65 void (*swapBuffer)(VADriverContextP ctx, struct dri_drawable *dri_drawable);
66 union dri_buffer *(*getRenderingBuffer)(VADriverContextP ctx, struct dri_dra wable *dri_drawable);
67 void (*close)(VADriverContextP ctx);
68 #endif
69 };
70
71 Bool isDRI2Connected(VADriverContextP ctx, char **driver_name);
72 Bool isDRI1Connected(VADriverContextP ctx, char **driver_name);
73 void free_drawable(VADriverContextP ctx, struct dri_drawable* dri_drawable);
74 void free_drawable_hashtable(VADriverContextP ctx);
75 struct dri_drawable *dri_get_drawable(VADriverContextP ctx, XID drawable);
76 void dri_swap_buffer(VADriverContextP ctx, struct dri_drawable *dri_drawable);
77 union dri_buffer *dri_get_rendering_buffer(VADriverContextP ctx, struct dri_draw able *dri_drawable);
78
79 #endif /* _VA_DRICOMMON_H_ */
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698