Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
ee961d8f
Commit
ee961d8f
authored
Sep 13, 2014
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec: pass AVCodecContext to VA destroy callback
parent
f8fa5d73
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
22 additions
and
19 deletions
+22
-19
modules/codec/avcodec/dxva2.c
modules/codec/avcodec/dxva2.c
+4
-3
modules/codec/avcodec/va.c
modules/codec/avcodec/va.c
+5
-4
modules/codec/avcodec/va.h
modules/codec/avcodec/va.h
+1
-1
modules/codec/avcodec/vaapi.c
modules/codec/avcodec/vaapi.c
+2
-1
modules/codec/avcodec/vda.c
modules/codec/avcodec/vda.c
+5
-5
modules/codec/avcodec/video.c
modules/codec/avcodec/video.c
+3
-3
modules/hw/vdpau/avcodec.c
modules/hw/vdpau/avcodec.c
+2
-2
No files found.
modules/codec/avcodec/dxva2.c
View file @
ee961d8f
...
...
@@ -52,7 +52,7 @@
#include "../../video_chroma/copy.h"
static
int
Open
(
vlc_va_t
*
,
AVCodecContext
*
,
const
es_format_t
*
);
static
void
Close
(
vlc_va_t
*
);
static
void
Close
(
vlc_va_t
*
,
AVCodecContext
*
);
vlc_module_begin
()
set_description
(
N_
(
"DirectX Video Acceleration (DXVA) 2.0"
))
...
...
@@ -463,10 +463,11 @@ static void Release(void *opaque, uint8_t *data)
(
void
)
data
;
}
static
void
Close
(
vlc_va_t
*
va
)
static
void
Close
(
vlc_va_t
*
va
,
AVCodecContext
*
ctx
)
{
vlc_va_sys_t
*
sys
=
va
->
sys
;
(
void
)
ctx
;
DxDestroyVideoConversion
(
sys
);
DxDestroyVideoDecoder
(
sys
);
DxDestroyVideoService
(
sys
);
...
...
@@ -540,7 +541,7 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, const es_format_t *fmt)
return
VLC_SUCCESS
;
error:
Close
(
va
);
Close
(
va
,
ctx
);
return
VLC_EGENERIC
;
}
/* */
...
...
modules/codec/avcodec/va.c
View file @
ee961d8f
...
...
@@ -41,9 +41,10 @@ static int vlc_va_Start(void *func, va_list ap)
static
void
vlc_va_Stop
(
void
*
func
,
va_list
ap
)
{
vlc_va_t
*
va
=
va_arg
(
ap
,
vlc_va_t
*
);
void
(
*
close
)(
vlc_va_t
*
)
=
func
;
AVCodecContext
*
ctx
=
va_arg
(
ap
,
AVCodecContext
*
);
void
(
*
close
)(
vlc_va_t
*
,
AVCodecContext
*
)
=
func
;
close
(
va
);
close
(
va
,
ctx
);
}
vlc_va_t
*
vlc_va_New
(
vlc_object_t
*
obj
,
AVCodecContext
*
avctx
,
...
...
@@ -63,8 +64,8 @@ vlc_va_t *vlc_va_New(vlc_object_t *obj, AVCodecContext *avctx,
return
va
;
}
void
vlc_va_Delete
(
vlc_va_t
*
va
)
void
vlc_va_Delete
(
vlc_va_t
*
va
,
AVCodecContext
*
avctx
)
{
vlc_module_unload
(
va
->
module
,
vlc_va_Stop
,
va
);
vlc_module_unload
(
va
->
module
,
vlc_va_Stop
,
va
,
avctx
);
vlc_object_release
(
va
);
}
modules/codec/avcodec/va.h
View file @
ee961d8f
...
...
@@ -124,6 +124,6 @@ static inline int vlc_va_Extract(vlc_va_t *va, picture_t *dst, void *opaque,
* Destroys a libavcodec hardware acceleration back-end.
* All allocated surfaces shall have been released beforehand.
*/
void
vlc_va_Delete
(
vlc_va_t
*
);
void
vlc_va_Delete
(
vlc_va_t
*
,
AVCodecContext
*
);
#endif
modules/codec/avcodec/vaapi.c
View file @
ee961d8f
...
...
@@ -416,10 +416,11 @@ static int Setup( vlc_va_t *va, void **pp_hw_ctx, vlc_fourcc_t *pi_chroma,
return
VLC_EGENERIC
;
}
static
void
Delete
(
vlc_va_t
*
va
)
static
void
Delete
(
vlc_va_t
*
va
,
AVCodecContext
*
avctx
)
{
vlc_va_sys_t
*
sys
=
va
->
sys
;
(
void
)
avctx
;
if
(
sys
->
i_surface_width
||
sys
->
i_surface_height
)
DestroySurfaces
(
sys
);
...
...
modules/codec/avcodec/vda.c
View file @
ee961d8f
...
...
@@ -154,7 +154,7 @@ static int Open( vlc_va_t *external, AVCodecContext *ctx,
return
VLC_SUCCESS
;
}
static
void
Close
(
vlc_va_t
*
external
)
static
void
Close
(
vlc_va_t
*
external
,
AVCodecContext
*
ctx
)
{
vlc_va_vda_t
*
p_va
=
vlc_va_vda_Get
(
external
);
...
...
@@ -166,6 +166,7 @@ static void Close( vlc_va_t *external )
CopyCleanCache
(
&
p_va
->
image_cache
);
free
(
p_va
);
(
void
)
ctx
;
}
static
int
Setup
(
vlc_va_t
*
external
,
void
**
pp_hw_ctx
,
vlc_fourcc_t
*
pi_chroma
,
...
...
@@ -367,11 +368,10 @@ static int Open( vlc_va_t *external, AVCodecContext *avctx,
return
VLC_SUCCESS
;
}
static
void
Close
(
vlc_va_t
*
external
)
static
void
Close
(
vlc_va_t
*
external
,
AVCodecContext
*
avctx
)
{
vlc_va_vda_t
*
p_va
=
vlc_va_vda_Get
(
external
);
av_vda_default_free
(
p_va
->
avctx
);
av_vda_default_free
(
avctx
);
(
void
)
external
;
}
static
int
Setup
(
vlc_va_t
*
external
,
void
**
pp_hw_ctx
,
vlc_fourcc_t
*
pi_chroma
,
...
...
modules/codec/avcodec/video.c
View file @
ee961d8f
...
...
@@ -823,7 +823,7 @@ void EndVideoDec( decoder_t *p_dec )
avcodec_free_frame
(
&
p_sys
->
p_ff_pic
);
if
(
p_sys
->
p_va
)
vlc_va_Delete
(
p_sys
->
p_va
);
vlc_va_Delete
(
p_sys
->
p_va
,
p_sys
->
p_context
);
vlc_sem_destroy
(
&
p_sys
->
sem_mt
);
}
...
...
@@ -1323,7 +1323,7 @@ static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *p_context,
vlc_va_t
*
p_va
=
p_sys
->
p_va
;
if
(
p_va
!=
NULL
)
vlc_va_Delete
(
p_va
);
vlc_va_Delete
(
p_va
,
p_context
);
/* Enumerate available formats */
bool
can_hwaccel
=
false
;
...
...
@@ -1383,7 +1383,7 @@ static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *p_context,
return
pi_fmt
[
i
];
}
vlc_va_Delete
(
p_va
);
vlc_va_Delete
(
p_va
,
p_context
);
end:
/* Fallback to default behaviour */
...
...
modules/hw/vdpau/avcodec.c
View file @
ee961d8f
...
...
@@ -39,7 +39,7 @@
#include "../../codec/avcodec/va.h"
static
int
Open
(
vlc_va_t
*
,
AVCodecContext
*
,
const
es_format_t
*
);
static
void
Close
(
vlc_va_t
*
);
static
void
Close
(
vlc_va_t
*
,
AVCodecContext
*
);
vlc_module_begin
()
set_description
(
N_
(
"VDPAU video decoder"
))
...
...
@@ -293,7 +293,7 @@ error:
return
VLC_EGENERIC
;
}
static
void
Close
(
vlc_va_t
*
va
)
static
void
Close
(
vlc_va_t
*
va
,
AVCodecContext
*
avctx
)
{
vlc_va_sys_t
*
sys
=
va
->
sys
;
...
...
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