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
0ea43daa
Commit
0ea43daa
authored
Apr 16, 2010
by
Austin Yuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save
Signed-off-by:
Austin Yuan
<
shengquan.yuan@gmail.com
>
parent
52739317
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
61 additions
and
26 deletions
+61
-26
configure.ac
configure.ac
+1
-0
va/Makefile.am
va/Makefile.am
+1
-1
va/android/va_android.c
va/android/va_android.c
+32
-6
va/va_android.h
va/va_android.h
+27
-19
No files found.
configure.ac
View file @
0ea43daa
...
@@ -119,6 +119,7 @@ AC_OUTPUT([
...
@@ -119,6 +119,7 @@ AC_OUTPUT([
va/Makefile
va/Makefile
va/va_version.h
va/va_version.h
va/x11/Makefile
va/x11/Makefile
va/android/Makefile
dummy_drv_video/Makefile
dummy_drv_video/Makefile
i965_drv_video/Makefile
i965_drv_video/Makefile
i965_drv_video/shaders/Makefile
i965_drv_video/shaders/Makefile
...
...
va/Makefile.am
View file @
0ea43daa
...
@@ -40,7 +40,7 @@ libva_x11_la_LIBADD = $(libvacorelib) x11/libva_x11.la $(LIBVA_LIBS) $(X11_LIBS
...
@@ -40,7 +40,7 @@ libva_x11_la_LIBADD = $(libvacorelib) x11/libva_x11.la $(LIBVA_LIBS) $(X11_LIBS
libva_x11_la_LDFLAGS
=
$(LDADD)
libva_x11_la_LDFLAGS
=
$(LDADD)
libva_x11_la_DEPENDENCIES
=
$(libvacorelib)
x11/libva_x11.la
libva_x11_la_DEPENDENCIES
=
$(libvacorelib)
x11/libva_x11.la
SUBDIRS
=
x11
SUBDIRS
=
x11
android
libva_la_SOURCES
=
va.c va_trace.c
libva_la_SOURCES
=
va.c va_trace.c
...
...
va/android/va_android.c
View file @
0ea43daa
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
#include "va.h"
#include "va.h"
#include "va_backend.h"
#include "va_backend.h"
#include "va_android.h"
#include "va_android.h"
#include "va_dricommon.h"
#include <stdio.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdlib.h>
#include <stdarg.h>
#include <stdarg.h>
...
@@ -36,6 +37,7 @@
...
@@ -36,6 +37,7 @@
#include <fcntl.h>
#include <fcntl.h>
#include <errno.h>
#include <errno.h>
static
VADisplayContextP
pDisplayContexts
=
NULL
;
static
VADisplayContextP
pDisplayContexts
=
NULL
;
static
int
va_DisplayContextIsValid
(
static
int
va_DisplayContextIsValid
(
...
@@ -70,6 +72,7 @@ static void va_DisplayContextDestroy (
...
@@ -70,6 +72,7 @@ static void va_DisplayContextDestroy (
}
}
ctx
=
&
((
*
ctx
)
->
pNext
);
ctx
=
&
((
*
ctx
)
->
pNext
);
}
}
free
(
pDisplayContext
->
pDriverContext
->
dri_state
);
free
(
pDisplayContext
->
pDriverContext
);
free
(
pDisplayContext
->
pDriverContext
);
free
(
pDisplayContext
);
free
(
pDisplayContext
);
}
}
...
@@ -79,8 +82,11 @@ static VAStatus va_DisplayContextGetDriverName (
...
@@ -79,8 +82,11 @@ static VAStatus va_DisplayContextGetDriverName (
VADisplayContextP
pDisplayContext
,
VADisplayContextP
pDisplayContext
,
char
**
driver_name
char
**
driver_name
)
)
{
{
VADriverContextP
ctx
=
pDisplayContext
->
pDriverContext
;
struct
dri_state
*
dri_state
=
(
struct
dri_state
*
)
ctx
->
dri_state
;
char
*
driver_name_env
;
char
*
driver_name_env
;
struct
{
struct
{
unsigned
int
verndor_id
;
unsigned
int
verndor_id
;
unsigned
int
device_id
;
unsigned
int
device_id
;
...
@@ -89,17 +95,29 @@ static VAStatus va_DisplayContextGetDriverName (
...
@@ -89,17 +95,29 @@ static VAStatus va_DisplayContextGetDriverName (
{
0x8086
,
0x4100
,
"pvr"
},
{
0x8086
,
0x4100
,
"pvr"
},
};
};
if
(
driver_name
)
memset
(
dri_state
,
0
,
sizeof
(
*
dri_state
));
*
driver_name
=
NULL
;
dri_state
->
fd
=
drm_open_any_master
();
if
(
dri_state
->
fd
<
0
)
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
);
*
driver_name
=
strdup
(
devices
[
0
].
driver_name
);
dri_state
->
driConnectedFlag
=
VA_DRI2
;
return
VA_STATUS_SUCCESS
;
return
VA_STATUS_SUCCESS
;
}
}
VADisplay
vaGetDisplay
(
VADisplay
vaGetDisplay
(
Display
*
native_dpy
/* implementation specific */
void
*
native_dpy
/* implementation specific */
)
)
{
{
VADisplay
dpy
=
NULL
;
VADisplay
dpy
=
NULL
;
...
@@ -123,9 +141,12 @@ VADisplay vaGetDisplay (
...
@@ -123,9 +141,12 @@ VADisplay vaGetDisplay (
{
{
/* create new entry */
/* create new entry */
VADriverContextP
pDriverContext
;
VADriverContextP
pDriverContext
;
struct
dri_state
*
dri_state
;
pDisplayContext
=
(
VADisplayContextP
)
calloc
(
1
,
sizeof
(
*
pDisplayContext
));
pDisplayContext
=
(
VADisplayContextP
)
calloc
(
1
,
sizeof
(
*
pDisplayContext
));
pDriverContext
=
(
VADriverContextP
)
calloc
(
1
,
sizeof
(
*
pDriverContext
));
pDriverContext
=
(
VADriverContextP
)
calloc
(
1
,
sizeof
(
*
pDriverContext
));
if
(
pDisplayContext
&&
pDriverContext
)
dri_state
=
calloc
(
1
,
sizeof
(
*
dri_state
));
if
(
pDisplayContext
&&
pDriverContext
&&
dri_state
)
{
{
pDisplayContext
->
vadpy_magic
=
VA_DISPLAY_MAGIC
;
pDisplayContext
->
vadpy_magic
=
VA_DISPLAY_MAGIC
;
...
@@ -136,6 +157,7 @@ VADisplay vaGetDisplay (
...
@@ -136,6 +157,7 @@ VADisplay vaGetDisplay (
pDisplayContext
->
vaDestroy
=
va_DisplayContextDestroy
;
pDisplayContext
->
vaDestroy
=
va_DisplayContextDestroy
;
pDisplayContext
->
vaGetDriverName
=
va_DisplayContextGetDriverName
;
pDisplayContext
->
vaGetDriverName
=
va_DisplayContextGetDriverName
;
pDisplayContexts
=
pDisplayContext
;
pDisplayContexts
=
pDisplayContext
;
pDriverContext
->
dri_state
=
dri_state
;
dpy
=
(
VADisplay
)
pDisplayContext
;
dpy
=
(
VADisplay
)
pDisplayContext
;
}
}
else
else
...
@@ -144,6 +166,8 @@ VADisplay vaGetDisplay (
...
@@ -144,6 +166,8 @@ VADisplay vaGetDisplay (
free
(
pDisplayContext
);
free
(
pDisplayContext
);
if
(
pDriverContext
)
if
(
pDriverContext
)
free
(
pDriverContext
);
free
(
pDriverContext
);
if
(
dri_state
)
free
(
dri_state
);
}
}
}
}
...
@@ -160,6 +184,7 @@ static int vaDisplayIsValid(VADisplay dpy)
...
@@ -160,6 +184,7 @@ static int vaDisplayIsValid(VADisplay dpy)
return
pDisplayContext
&&
(
pDisplayContext
->
vadpy_magic
==
VA_DISPLAY_MAGIC
)
&&
pDisplayContext
->
vaIsValid
(
pDisplayContext
);
return
pDisplayContext
&&
(
pDisplayContext
->
vadpy_magic
==
VA_DISPLAY_MAGIC
)
&&
pDisplayContext
->
vaIsValid
(
pDisplayContext
);
}
}
#ifdef ANDROID
VAStatus
vaPutSurface
(
VAStatus
vaPutSurface
(
VADisplay
dpy
,
VADisplay
dpy
,
VASurfaceID
surface
,
VASurfaceID
surface
,
...
@@ -214,3 +239,4 @@ VAStatus vaPutSurfaceBuf (
...
@@ -214,3 +239,4 @@ VAStatus vaPutSurfaceBuf (
return
ctx
->
vtable
.
vaPutSurfaceBuf
(
ctx
,
surface
,
draw
,
data
,
data_len
,
srcx
,
srcy
,
srcw
,
srch
,
return
ctx
->
vtable
.
vaPutSurfaceBuf
(
ctx
,
surface
,
draw
,
data
,
data_len
,
srcx
,
srcy
,
srcw
,
srch
,
destx
,
desty
,
destw
,
desth
,
cliprects
,
number_cliprects
,
flags
);
destx
,
desty
,
destw
,
desth
,
cliprects
,
number_cliprects
,
flags
);
}
}
#endif
va/va_android.h
View file @
0ea43daa
...
@@ -2,13 +2,13 @@
...
@@ -2,13 +2,13 @@
#define _VA_ANDROID_H_
#define _VA_ANDROID_H_
#include <va/va.h>
#include <va/va.h>
#include <ui/Surface.h>
class
Surface
;
#ifdef __cplusplus
#ifdef __cplusplus
extern
"C"
{
extern
"C"
{
#endif
#endif
/*
/*
* Returns a suitable VADisplay for VA API
* Returns a suitable VADisplay for VA API
*/
*/
...
@@ -16,6 +16,11 @@ VADisplay vaGetDisplay (
...
@@ -16,6 +16,11 @@ VADisplay vaGetDisplay (
void
*
dpy
void
*
dpy
);
);
#ifdef ANDROID
#include <ui/Surface.h>
class
Surface
;
/*
/*
* Output rendering
* Output rendering
* Following is the rendering interface for X windows,
* Following is the rendering interface for X windows,
...
@@ -42,23 +47,26 @@ VAStatus vaPutSurface (
...
@@ -42,23 +47,26 @@ VAStatus vaPutSurface (
);
);
VAStatus
vaPutSurfaceBuf
(
VAStatus
vaPutSurfaceBuf
(
VADriverContextP
ctx
,
VADriverContextP
ctx
,
VASurfaceID
surface
,
VASurfaceID
surface
,
Drawable
draw
,
/* X Drawable */
Drawable
draw
,
/* X Drawable */
unsigned
char
*
data
,
unsigned
char
*
data
,
int
*
data_len
,
int
*
data_len
,
short
srcx
,
short
srcx
,
short
srcy
,
short
srcy
,
unsigned
short
srcw
,
unsigned
short
srcw
,
unsigned
short
srch
,
unsigned
short
srch
,
short
destx
,
short
destx
,
short
desty
,
short
desty
,
unsigned
short
destw
,
unsigned
short
destw
,
unsigned
short
desth
,
unsigned
short
desth
,
VARectangle
*
cliprects
,
/* client supplied clip list */
VARectangle
*
cliprects
,
/* client supplied clip list */
unsigned
int
number_cliprects
,
/* number of clip rects in the clip list */
unsigned
int
number_cliprects
,
/* number of clip rects in the clip list */
unsigned
int
flags
/* de-interlacing flags */
unsigned
int
flags
/* de-interlacing flags */
);
);
#endif
#ifdef __cplusplus
#ifdef __cplusplus
}
}
#endif
#endif
...
...
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