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
5f4d73d1
Commit
5f4d73d1
authored
Nov 18, 2009
by
Gwenole Beauchesne
Committed by
Xiang, Haihao
Nov 18, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup vaCreateImage, make it possible to add formats later
parent
88df301b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
75 additions
and
41 deletions
+75
-41
i965_drv_video/i965_drv_video.c
i965_drv_video/i965_drv_video.c
+71
-35
i965_drv_video/i965_drv_video.h
i965_drv_video/i965_drv_video.h
+2
-4
i965_drv_video/i965_render.c
i965_drv_video/i965_render.c
+2
-2
No files found.
i965_drv_video/i965_drv_video.c
View file @
5f4d73d1
...
@@ -410,11 +410,10 @@ i965_CreateSubpicture(VADriverContextP ctx,
...
@@ -410,11 +410,10 @@ i965_CreateSubpicture(VADriverContextP ctx,
vaStatus
=
VA_STATUS_ERROR_ALLOCATION_FAILED
;
vaStatus
=
VA_STATUS_ERROR_ALLOCATION_FAILED
;
}
}
*
subpicture
=
subpicID
;
*
subpicture
=
subpicID
;
obj_subpic
->
image
=
image
;
obj_subpic
->
image
=
image
;
obj_subpic
->
width
=
obj_image
->
width
;
obj_subpic
->
width
=
obj_image
->
image
.
width
;
obj_subpic
->
height
=
obj_image
->
height
;
obj_subpic
->
height
=
obj_image
->
image
.
height
;
obj_subpic
->
bo
=
obj_image
->
bo
;
obj_subpic
->
bo
=
obj_image
->
bo
;
return
vaStatus
;
return
vaStatus
;
}
}
...
@@ -1119,44 +1118,81 @@ i965_destroy_heap(struct object_heap *heap,
...
@@ -1119,44 +1118,81 @@ i965_destroy_heap(struct object_heap *heap,
}
}
VAStatus
i965_DestroyImage
(
VADriverContextP
ctx
,
VAImageID
image
);
VAStatus
VAStatus
i965_CreateImage
(
VADriverContextP
ctx
,
i965_CreateImage
(
VADriverContextP
ctx
,
VAImageFormat
*
format
,
VAImageFormat
*
format
,
int
width
,
int
width
,
int
height
,
int
height
,
VAImage
*
image
)
/* out */
VAImage
*
out_
image
)
/* out */
{
{
struct
i965_driver_data
*
i965
=
i965_driver_data
(
ctx
);
struct
i965_driver_data
*
i965
=
i965_driver_data
(
ctx
);
VAStatus
va_status
;
struct
object_image
*
obj_image
;
/*we will receive the actual subpicture size from the player,now we assume it is 720*32*/
VAStatus
va_status
=
VA_STATUS_ERROR_OPERATION_FAILED
;
char
subpic_buf
[
width
*
height
];
VAImageID
image_id
;
int
subpic_size
=
720
*
32
;
unsigned
int
width2
,
height2
,
size2
,
size
;
unsigned
int
img_buf_id
;
image
->
image_id
=
NEW_IMAGE_ID
()
;
out_image
->
image_id
=
VA_INVALID_ID
;
struct
object_image
*
obj_image
=
IMAGE
(
image
->
image_id
)
;
out_image
->
buf
=
VA_INVALID_ID
;
/*assume we got IA44 in format[0]*/
image_id
=
NEW_IMAGE_ID
();
image
->
format
=
*
format
;
if
(
image_id
==
VA_INVALID_ID
)
return
VA_STATUS_ERROR_ALLOCATION_FAILED
;
/*create empty buffer*/
va_status
=
i965_CreateBuffer
(
ctx
,
0
,
VAImageBufferType
,
obj_image
=
IMAGE
(
image_id
);
subpic_size
,
1
,
subpic_buf
,
&
img_buf_id
);
if
(
!
obj_image
)
assert
(
VA_STATUS_SUCCESS
==
va_status
);
return
VA_STATUS_ERROR_ALLOCATION_FAILED
;
struct
object_buffer
*
obj_buf
=
BUFFER
(
img_buf_id
);
VAImage
*
const
image
=
&
obj_image
->
image
;
image
->
buf
=
img_buf_id
;
image
->
image_id
=
image_id
;
image
->
width
=
width
;
image
->
buf
=
VA_INVALID_ID
;
image
->
height
=
height
;
size
=
width
*
height
;
obj_image
->
buf
=
img_buf_id
;
width2
=
(
width
+
1
)
/
2
;
obj_image
->
width
=
width
;
height2
=
(
height
+
1
)
/
2
;
obj_image
->
height
=
height
;
size2
=
width2
*
height2
;
obj_image
->
size
=
subpic_size
;
obj_image
->
bo
=
obj_buf
->
buffer_store
->
bo
;
image
->
num_palette_entries
=
0
;
image
->
entry_bytes
=
0
;
memset
(
image
->
component_order
,
0
,
sizeof
(
image
->
component_order
));
switch
(
format
->
fourcc
)
{
case
VA_FOURCC
(
'I'
,
'A'
,
'4'
,
'4'
):
case
VA_FOURCC
(
'A'
,
'I'
,
'4'
,
'4'
):
image
->
num_planes
=
1
;
image
->
pitches
[
0
]
=
width
;
image
->
offsets
[
0
]
=
0
;
image
->
data_size
=
image
->
offsets
[
0
]
+
image
->
pitches
[
0
]
*
height
;
image
->
num_palette_entries
=
16
;
image
->
entry_bytes
=
3
;
image
->
component_order
[
0
]
=
'R'
;
image
->
component_order
[
1
]
=
'G'
;
image
->
component_order
[
2
]
=
'B'
;
break
;
default:
goto
error
;
}
va_status
=
i965_CreateBuffer
(
ctx
,
0
,
VAImageBufferType
,
image
->
data_size
,
1
,
NULL
,
&
image
->
buf
);
if
(
va_status
!=
VA_STATUS_SUCCESS
)
goto
error
;
obj_image
->
bo
=
BUFFER
(
image
->
buf
)
->
buffer_store
->
bo
;
image
->
image_id
=
image_id
;
image
->
format
=
*
format
;
image
->
width
=
width
;
image
->
height
=
height
;
*
out_image
=
*
image
;
return
VA_STATUS_SUCCESS
;
return
VA_STATUS_SUCCESS
;
error:
i965_DestroyImage
(
ctx
,
image_id
);
return
va_status
;
}
}
VAStatus
i965_DeriveImage
(
VADriverContextP
ctx
,
VAStatus
i965_DeriveImage
(
VADriverContextP
ctx
,
...
@@ -1179,9 +1215,9 @@ i965_DestroyImage(VADriverContextP ctx, VAImageID image)
...
@@ -1179,9 +1215,9 @@ i965_DestroyImage(VADriverContextP ctx, VAImageID image)
struct
i965_driver_data
*
i965
=
i965_driver_data
(
ctx
);
struct
i965_driver_data
*
i965
=
i965_driver_data
(
ctx
);
struct
object_image
*
obj_image
=
IMAGE
(
image
);
struct
object_image
*
obj_image
=
IMAGE
(
image
);
if
(
obj_image
&&
obj_image
->
buf
!=
VA_INVALID_ID
)
{
if
(
obj_image
&&
obj_image
->
image
.
buf
!=
VA_INVALID_ID
)
{
i965_DestroyBuffer
(
ctx
,
obj_image
->
buf
);
i965_DestroyBuffer
(
ctx
,
obj_image
->
image
.
buf
);
obj_image
->
buf
=
VA_INVALID_ID
;
obj_image
->
image
.
buf
=
VA_INVALID_ID
;
}
}
i965_destroy_image
(
&
i965
->
image_heap
,
(
struct
object_base
*
)
obj_image
);
i965_destroy_image
(
&
i965
->
image_heap
,
(
struct
object_base
*
)
obj_image
);
...
...
i965_drv_video/i965_drv_video.h
View file @
5f4d73d1
...
@@ -106,13 +106,11 @@ struct object_buffer
...
@@ -106,13 +106,11 @@ struct object_buffer
int
size_element
;
int
size_element
;
VABufferType
type
;
VABufferType
type
;
};
};
struct
object_image
struct
object_image
{
{
struct
object_base
base
;
struct
object_base
base
;
VABufferID
buf
;
VAImage
image
;
int
width
;
int
height
;
int
size
;
dri_bo
*
bo
;
dri_bo
*
bo
;
};
};
...
...
i965_drv_video/i965_render.c
View file @
5f4d73d1
...
@@ -677,8 +677,8 @@ i965_subpic_render_src_surfaces_state(VADriverContextP ctx,
...
@@ -677,8 +677,8 @@ i965_subpic_render_src_surfaces_state(VADriverContextP ctx,
region
=
obj_surface
->
bo
;
region
=
obj_surface
->
bo
;
subpic_region
=
obj_image
->
bo
;
subpic_region
=
obj_image
->
bo
;
/*subpicture surface*/
/*subpicture surface*/
i965_subpic_render_src_surface_state
(
ctx
,
1
,
subpic_region
,
0
,
obj_image
->
width
,
obj_image
->
height
);
i965_subpic_render_src_surface_state
(
ctx
,
1
,
subpic_region
,
0
,
obj_image
->
image
.
width
,
obj_image
->
image
.
height
);
i965_subpic_render_src_surface_state
(
ctx
,
2
,
subpic_region
,
0
,
obj_image
->
width
,
obj_image
->
height
);
i965_subpic_render_src_surface_state
(
ctx
,
2
,
subpic_region
,
0
,
obj_image
->
image
.
width
,
obj_image
->
image
.
height
);
}
}
static
void
static
void
...
...
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