Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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
vlc-2-2
Commits
61bbaab0
Commit
61bbaab0
authored
Jul 25, 2013
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec: rationalize hwaccel copy/extract callback prototype
parent
eae355f6
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
26 additions
and
20 deletions
+26
-20
modules/codec/avcodec/dxva2.c
modules/codec/avcodec/dxva2.c
+4
-2
modules/codec/avcodec/hwdummy.c
modules/codec/avcodec/hwdummy.c
+4
-4
modules/codec/avcodec/va.h
modules/codec/avcodec/va.h
+4
-3
modules/codec/avcodec/vaapi.c
modules/codec/avcodec/vaapi.c
+5
-4
modules/codec/avcodec/vda.c
modules/codec/avcodec/vda.c
+4
-3
modules/codec/avcodec/video.c
modules/codec/avcodec/video.c
+2
-1
modules/hw/vdpau/avcodec.c
modules/hw/vdpau/avcodec.c
+3
-3
No files found.
modules/codec/avcodec/dxva2.c
View file @
61bbaab0
...
...
@@ -362,10 +362,11 @@ ok:
return
VLC_SUCCESS
;
}
static
int
Extract
(
vlc_va_t
*
external
,
picture_t
*
picture
,
AVFrame
*
ff
)
static
int
Extract
(
vlc_va_t
*
external
,
picture_t
*
picture
,
void
*
opaque
,
uint8_t
*
data
)
{
vlc_va_dxva2_t
*
va
=
vlc_va_dxva2_Get
(
external
);
LPDIRECT3DSURFACE9
d3d
=
(
LPDIRECT3DSURFACE9
)(
uintptr_t
)
ff
->
data
[
3
]
;
LPDIRECT3DSURFACE9
d3d
=
(
LPDIRECT3DSURFACE9
)(
uintptr_t
)
data
;
if
(
!
va
->
surface_cache
.
buffer
)
return
VLC_EGENERIC
;
...
...
@@ -423,6 +424,7 @@ static int Extract(vlc_va_t *external, picture_t *picture, AVFrame *ff)
/* */
IDirect3DSurface9_UnlockRect
(
d3d
);
(
void
)
opaque
;
return
VLC_SUCCESS
;
}
...
...
modules/codec/avcodec/hwdummy.c
View file @
61bbaab0
...
...
@@ -82,12 +82,12 @@ static VdpStatus Render(VdpDecoder decoder, VdpVideoSurface target,
return
VDP_STATUS_OK
;
}
static
int
Copy
(
vlc_va_t
*
va
,
picture_t
*
pic
,
AVFrame
*
ff
)
static
int
Copy
(
vlc_va_t
*
va
,
picture_t
*
pic
,
void
*
opaque
,
uint8_t
*
data
)
{
(
void
)
va
;
(
void
)
ff
;
(
void
)
va
;
assert
((
uintptr_t
)
ff
->
data
[
3
]
==
DATA
_MAGIC
);
assert
((
uintptr_t
)
ff
->
opaque
==
OPAQUE
_MAGIC
);
assert
((
uintptr_t
)
opaque
==
OPAQUE
_MAGIC
);
assert
((
uintptr_t
)
data
==
DATA
_MAGIC
);
/* Put some dummy picture content */
memset
(
pic
->
p
[
0
].
p_pixels
,
0xF0
,
...
...
modules/codec/avcodec/va.h
View file @
61bbaab0
...
...
@@ -39,7 +39,7 @@ struct vlc_va_t {
int
width
,
int
height
);
int
(
*
get
)(
vlc_va_t
*
,
void
**
opaque
,
uint8_t
**
data
);
void
(
*
release
)(
void
*
opaque
,
uint8_t
*
surface
);
int
(
*
extract
)(
vlc_va_t
*
,
picture_t
*
dst
,
AVFrame
*
src
);
int
(
*
extract
)(
vlc_va_t
*
,
picture_t
*
dst
,
void
*
opaque
,
uint8_t
*
data
);
};
/**
...
...
@@ -115,9 +115,10 @@ static inline void vlc_va_Release(vlc_va_t *va, void *opaque, uint8_t *data)
*
* @param frame libavcodec frame previously allocated by vlc_va_Get()
*/
static
inline
int
vlc_va_Extract
(
vlc_va_t
*
va
,
picture_t
*
dst
,
AVFrame
*
src
)
static
inline
int
vlc_va_Extract
(
vlc_va_t
*
va
,
picture_t
*
dst
,
void
*
opaque
,
uint8_t
*
data
)
{
return
va
->
extract
(
va
,
dst
,
src
);
return
va
->
extract
(
va
,
dst
,
opaque
,
data
);
}
/**
...
...
modules/codec/avcodec/vaapi.c
View file @
61bbaab0
...
...
@@ -399,11 +399,12 @@ static int Setup( vlc_va_t *va, void **pp_hw_ctx, vlc_fourcc_t *pi_chroma,
return
VLC_EGENERIC
;
}
static
int
Extract
(
vlc_va_t
*
va
,
picture_t
*
p_picture
,
AVFrame
*
p_ff
)
static
int
Extract
(
vlc_va_t
*
va
,
picture_t
*
p_picture
,
void
*
opaque
,
uint8_t
*
data
)
{
vlc_va_sys_t
*
sys
=
va
->
sys
;
VASurfaceID
i_surface_id
=
(
VASurfaceID
)(
uintptr_t
)
p_ff
->
data
[
3
];
VASurfaceID
i_surface_id
=
(
VASurfaceID
)(
uintptr_t
)
data
;
#if VA_CHECK_VERSION(0,31,0)
if
(
vaSyncSurface
(
sys
->
p_display
,
i_surface_id
)
)
...
...
@@ -473,7 +474,7 @@ static int Extract( vlc_va_t *va, picture_t *p_picture, AVFrame *p_ff )
vaDestroyImage
(
sys
->
p_display
,
sys
->
image
.
image_id
);
sys
->
image
.
image_id
=
VA_INVALID_ID
;
}
(
void
)
opaque
;
return
VLC_SUCCESS
;
}
...
...
modules/codec/avcodec/vda.c
View file @
61bbaab0
...
...
@@ -212,10 +212,11 @@ static int Get( vlc_va_t *external, void **opaque, uint8_t **data )
return
VLC_SUCCESS
;
}
static
int
Extract
(
vlc_va_t
*
external
,
picture_t
*
p_picture
,
AVFrame
*
p_ff
)
static
int
Extract
(
vlc_va_t
*
external
,
picture_t
*
p_picture
,
void
*
opaque
,
uint8_t
*
data
)
{
vlc_va_vda_t
*
p_va
=
vlc_va_vda_Get
(
external
);
CVPixelBufferRef
cv_buffer
=
(
CVPixelBufferRef
)
p_ff
->
data
[
3
]
;
CVPixelBufferRef
cv_buffer
=
(
CVPixelBufferRef
)
data
;
if
(
!
cv_buffer
)
{
...
...
@@ -243,7 +244,7 @@ static int Extract( vlc_va_t *external, picture_t *p_picture, AVFrame *p_ff )
}
else
vda_Copy422YpCbCr8
(
p_picture
,
cv_buffer
);
(
void
)
opaque
;
return
VLC_SUCCESS
;
}
...
...
modules/codec/avcodec/video.c
View file @
61bbaab0
...
...
@@ -859,7 +859,8 @@ static void ffmpeg_CopyPicture( decoder_t *p_dec,
if
(
p_sys
->
p_va
)
{
vlc_va_Extract
(
p_sys
->
p_va
,
p_pic
,
p_ff_pic
);
vlc_va_Extract
(
p_sys
->
p_va
,
p_pic
,
p_ff_pic
->
opaque
,
p_ff_pic
->
data
[
3
]
);
}
else
if
(
FindVlcChroma
(
p_sys
->
p_context
->
pix_fmt
)
)
{
...
...
modules/hw/vdpau/avcodec.c
View file @
61bbaab0
...
...
@@ -93,9 +93,9 @@ static void Unlock(void *opaque, uint8_t *data)
(
void
)
data
;
}
static
int
Copy
(
vlc_va_t
*
va
,
picture_t
*
pic
,
AVFrame
*
ff
)
static
int
Copy
(
vlc_va_t
*
va
,
picture_t
*
pic
,
void
*
opaque
,
uint8_t
*
data
)
{
vlc_vdp_video_field_t
*
field
=
ff
->
opaque
;
vlc_vdp_video_field_t
*
field
=
opaque
;
assert
(
field
!=
NULL
);
field
=
vlc_vdp_video_copy
(
field
);
...
...
@@ -104,7 +104,7 @@ static int Copy(vlc_va_t *va, picture_t *pic, AVFrame *ff)
assert
(
pic
->
context
==
NULL
);
pic
->
context
=
field
;
(
void
)
va
;
(
void
)
va
;
(
void
)
data
;
return
VLC_SUCCESS
;
}
...
...
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