Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libva
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
libva
Commits
5bc5efa3
Commit
5bc5efa3
authored
May 05, 2010
by
Ren Zhaohan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add new va_DisplayContextGetDriverName, remove 'x11/XX' include folder name
parent
01d2fa69
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
57 additions
and
25 deletions
+57
-25
va/Android.mk
va/Android.mk
+1
-0
va/android/va_android.c
va/android/va_android.c
+50
-3
va/va_android.h
va/va_android.h
+1
-2
va/va_backend.h
va/va_backend.h
+5
-20
No files found.
va/Android.mk
View file @
5bc5efa3
...
...
@@ -17,6 +17,7 @@ LOCAL_CFLAGS += -DHAVE_CONFIG_H \
LOCAL_C_INCLUDES
+=
\
$(TOPDIR)
kernel/include
\
$(TARGET_OUT_HEADERS)
/libva
\
$(LOCAL_PATH)
/x11
\
$(TOPDIR)
kernel/include/drm
LOCAL_COPY_HEADERS_TO
:=
libva/va
...
...
va/android/va_android.c
View file @
5bc5efa3
...
...
@@ -26,7 +26,7 @@
#include "va.h"
#include "va_backend.h"
#include "va_android.h"
#include "
x11/
va_dricommon.h"
/* needs some helper functions from this file */
#include "va_dricommon.h"
/* needs some helper functions from this file */
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
...
...
@@ -37,6 +37,10 @@
#include <fcntl.h>
#include <dlfcn.h>
#include <errno.h>
#ifndef ANDROID
#include <libudev.h>
#include "drm_test.h"
#endif
#define CHECK_SYMBOL(func) { if (!func) printf("func %s not found\n", #func); return VA_STATUS_ERROR_UNKNOWN; }
#define DEVICE_NAME "/dev/dri/card0"
...
...
@@ -110,7 +114,7 @@ static void va_DisplayContextDestroy (
free
(
pDisplayContext
);
}
#ifdef ANDROID
static
VAStatus
va_DisplayContextGetDriverName
(
VADisplayContextP
pDisplayContext
,
char
**
driver_name
...
...
@@ -154,7 +158,51 @@ static VAStatus va_DisplayContextGetDriverName (
return
VA_STATUS_SUCCESS
;
}
#else
static
VAStatus
va_DisplayContextGetDriverName
(
VADisplayContextP
pDisplayContext
,
char
**
driver_name
)
{
VADriverContextP
ctx
=
pDisplayContext
->
pDriverContext
;
struct
dri_state
*
dri_state
=
(
struct
dri_state
*
)
ctx
->
dri_state
;
char
*
driver_name_env
;
struct
{
unsigned
int
vendor_id
;
unsigned
int
device_id
;
char
driver_name
[
64
];
}
devices
[]
=
{
{
0x8086
,
0x4100
,
"pvr"
},
};
memset
(
dri_state
,
0
,
sizeof
(
*
dri_state
));
dri_state
->
fd
=
drm_open_any_master
();
if
(
dri_state
->
fd
<
0
)
{
fprintf
(
stderr
,
"open DRM device by udev failed, try /dev/dri/card0
\n
"
);
dri_state
->
fd
=
open
(
"/dev/dri/card0"
,
O_RDWR
);
}
if
(
dri_state
->
fd
<
0
)
{
fprintf
(
stderr
,
"can't open DRM devices
\n
"
);
return
VA_STATUS_ERROR_UNKNOWN
;
}
if
((
driver_name_env
=
getenv
(
"LIBVA_DRIVER_NAME"
))
!=
NULL
&&
geteuid
()
==
getuid
())
{
/* don't allow setuid apps to use LIBVA_DRIVER_NAME */
*
driver_name
=
strdup
(
driver_name_env
);
return
VA_STATUS_SUCCESS
;
}
else
/* TBD: other vendor driver names */
*
driver_name
=
strdup
(
devices
[
0
].
driver_name
);
dri_state
->
driConnectedFlag
=
VA_DUMMY
;
return
VA_STATUS_SUCCESS
;
}
#endif
VADisplay
vaGetDisplay
(
void
*
native_dpy
/* implementation specific */
...
...
@@ -245,7 +293,6 @@ VAStatus vaPutSurface (
CHECK_DISPLAY
(
dpy
);
ctx
=
CTX
(
dpy
);
return
ctx
->
vtable
.
vaPutSurface
(
ctx
,
surface
,
(
void
*
)
draw
,
srcx
,
srcy
,
srcw
,
srch
,
destx
,
desty
,
destw
,
desth
,
cliprects
,
number_cliprects
,
flags
);
...
...
va/va_android.h
View file @
5bc5efa3
...
...
@@ -5,7 +5,6 @@
#ifdef __cplusplus
extern
"C"
{
#endif
/*
* Returns a suitable VADisplay for VA API
*/
...
...
@@ -16,7 +15,7 @@ VADisplay vaGetDisplay (
#if ANDROID
//#include <ui/Surface.h>
//class Surface;
/*
* Output rendering
* Following is the rendering interface for X windows,
...
...
va/va_backend.h
View file @
5bc5efa3
...
...
@@ -185,7 +185,11 @@ struct VADriverVTable
VAStatus
(
*
vaPutSurface
)
(
VADriverContextP
ctx
,
VASurfaceID
surface
,
void
*
draw
,
/* Drawable of window system */
#ifdef ANDROID
Surface
*
draw
,
/* Drawable of window system */
#else
Drawable
draw
,
#endif
short
srcx
,
short
srcy
,
unsigned
short
srcw
,
...
...
@@ -199,25 +203,6 @@ struct VADriverVTable
unsigned
int
flags
/* de-interlacing flags */
);
VAStatus
(
*
vaPutSurfaceBuf
)
(
VADriverContextP
ctx
,
VASurfaceID
surface
,
Drawable
draw
,
/* X Drawable */
unsigned
char
*
data
,
int
*
data_len
,
short
srcx
,
short
srcy
,
unsigned
short
srcw
,
unsigned
short
srch
,
short
destx
,
short
desty
,
unsigned
short
destw
,
unsigned
short
desth
,
VARectangle
*
cliprects
,
/* client supplied clip list */
unsigned
int
number_cliprects
,
/* number of clip rects in the clip list */
unsigned
int
flags
/* de-interlacing flags */
);
VAStatus
(
*
vaQueryImageFormats
)
(
VADriverContextP
ctx
,
VAImageFormat
*
format_list
,
/* out */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment