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
01d2fa69
Commit
01d2fa69
authored
May 04, 2010
by
Ren Zhaohan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove udev
parent
94b49e9a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
29 deletions
+40
-29
va/Android.mk
va/Android.mk
+1
-2
va/android/va_android.c
va/android/va_android.c
+35
-23
va/va.c
va/va.c
+1
-1
va/va_android.h
va/va_android.h
+3
-3
No files found.
va/Android.mk
View file @
01d2fa69
...
...
@@ -8,8 +8,7 @@ include $(CLEAR_VARS)
LOCAL_SRC_FILES
:=
\
va.c
\
va_trace.c
\
android/va_android.c
\
android/drmtest.c
\
android/va_android.c
LOCAL_CFLAGS
+=
-DHAVE_CONFIG_H
\
...
...
va/android/va_android.c
View file @
01d2fa69
...
...
@@ -26,7 +26,7 @@
#include "va.h"
#include "va_backend.h"
#include "va_android.h"
#include "va_dricommon.h"
/* needs some helper functions from this file */
#include "
x11/
va_dricommon.h"
/* needs some helper functions from this file */
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
...
...
@@ -43,6 +43,35 @@
static
VADisplayContextP
pDisplayContexts
=
NULL
;
static
int
open_device
(
char
*
dev_name
)
{
struct
stat
st
;
int
fd
;
if
(
-
1
==
stat
(
dev_name
,
&
st
))
{
printf
(
"Cannot identify '%s': %d, %s
\n
"
,
dev_name
,
errno
,
strerror
(
errno
));
return
-
1
;
}
if
(
!
S_ISCHR
(
st
.
st_mode
))
{
printf
(
"%s is no device
\n
"
,
dev_name
);
return
-
1
;
}
fd
=
open
(
dev_name
,
O_RDWR
/* required */
|
O_NONBLOCK
,
0
);
if
(
-
1
==
fd
)
{
fprintf
(
stderr
,
"Cannot open '%s': %d, %s
\n
"
,
dev_name
,
errno
,
strerror
(
errno
));
return
-
1
;
}
return
fd
;
}
static
int
va_DisplayContextIsValid
(
VADisplayContextP
pDisplayContext
...
...
@@ -103,41 +132,24 @@ static VAStatus va_DisplayContextGetDriverName (
};
memset
(
dri_state
,
0
,
sizeof
(
*
dri_state
));
dri_state
->
fd
=
drm_open_any
(
&
vendor_id
,
&
device_id
);
dri_state
->
fd
=
open_device
(
DEVICE_NAME
);
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 */
int
i
=
0
;
while
(
devices
[
i
].
device_id
!=
0
)
{
if
((
devices
[
i
].
vendor_id
==
vendor_id
)
&&
(
devices
[
i
].
device_id
==
device_id
))
break
;
i
++
;
}
if
(
devices
[
i
].
device_id
!=
0
)
*
driver_name
=
strdup
(
devices
[
i
].
driver_name
);
else
{
fprintf
(
stderr
,
"device (0x%04x:0x%04x) is not supported
\n
"
,
vendor_id
,
device_id
);
return
VA_STATUS_ERROR_UNKNOWN
;
}
vendor_id
=
devices
[
0
].
vendor_id
;
device_id
=
devices
[
0
].
device_id
;
*
driver_name
=
strdup
(
devices
[
0
].
driver_name
);
}
printf
(
"DRM device is opened, loading driver %s for device 0x%04x:0x%04x
\n
"
,
driver_name
,
vendor_id
,
device_id
);
dri_state
->
driConnectedFlag
=
VA_DUMMY
;
return
VA_STATUS_SUCCESS
;
...
...
va/va.c
View file @
01d2fa69
...
...
@@ -350,7 +350,7 @@ VAStatus vaInitialize (
{
vaStatus
=
va_openDriver
(
dpy
,
driver_name
);
va_infoMessage
(
"va_openDriver() returns %d
\n
"
,
vaStatus
);
*
major_version
=
VA_MAJOR_VERSION
;
*
minor_version
=
VA_MINOR_VERSION
;
}
...
...
va/va_android.h
View file @
01d2fa69
...
...
@@ -14,8 +14,8 @@ VADisplay vaGetDisplay (
);
#if ANDROID
#include <ui/Surface.h>
class
Surface
;
//
#include <ui/Surface.h>
//
class Surface;
/*
* Output rendering
...
...
@@ -28,7 +28,7 @@ class Surface;
VAStatus
vaPutSurface
(
VADisplay
dpy
,
VASurfaceID
surface
,
Surface
*
draw
,
/* Android Window/Surface */
void
*
draw
,
/* Android Window/Surface */
short
srcx
,
short
srcy
,
unsigned
short
srcw
,
...
...
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