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
bf445475
Commit
bf445475
authored
Apr 22, 2015
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec: provide default implementation for HW picture release callback
parent
1b927cdd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
41 deletions
+19
-41
modules/codec/avcodec/vda.c
modules/codec/avcodec/vda.c
+2
-22
modules/codec/avcodec/video.c
modules/codec/avcodec/video.c
+16
-12
modules/hw/vdpau/avcodec.c
modules/hw/vdpau/avcodec.c
+1
-7
No files found.
modules/codec/avcodec/vda.c
View file @
bf445475
...
...
@@ -49,7 +49,6 @@ static void Close( vlc_va_t * , AVCodecContext *);
static
int
Setup
(
vlc_va_t
*
,
AVCodecContext
*
,
vlc_fourcc_t
*
);
static
int
Get
(
vlc_va_t
*
,
picture_t
*
,
uint8_t
**
);
static
int
Extract
(
vlc_va_t
*
,
picture_t
*
,
uint8_t
*
);
static
void
Release
(
void
*
,
uint8_t
*
);
static
void
vda_Copy422YpCbCr8
(
picture_t
*
p_pic
,
CVPixelBufferRef
buffer
)
...
...
@@ -144,7 +143,7 @@ static int Open( vlc_va_t *va, AVCodecContext *ctx,
va
->
pix_fmt
=
PIX_FMT_VDA_VLD
;
va
->
setup
=
Setup
;
va
->
get
=
Get
;
va
->
release
=
Release
;
va
->
release
=
NULL
;
va
->
extract
=
Extract
;
return
VLC_SUCCESS
;
...
...
@@ -299,18 +298,6 @@ static int Extract( vlc_va_t *va, picture_t *p_picture, uint8_t *data )
return
VLC_SUCCESS
;
}
static
void
Release
(
void
*
opaque
,
uint8_t
*
data
)
{
#if 0
CVPixelBufferRef cv_buffer = ( CVPixelBufferRef )p_ff->data[3];
if ( cv_buffer )
CVPixelBufferRelease( cv_buffer );
#endif
picture_Release
(
opaque
);
(
void
)
data
;
}
#else
vlc_module_begin
()
...
...
@@ -329,7 +316,7 @@ static int Open( vlc_va_t *va, AVCodecContext *avctx, const es_format_t *fmt )
va
->
pix_fmt
=
AV_PIX_FMT_VDA
;
va
->
setup
=
Setup
;
va
->
get
=
Get
;
va
->
release
=
Release
;
va
->
release
=
NULL
;
va
->
extract
=
Extract
;
msg_Dbg
(
va
,
"VDA decoder Open success!"
);
...
...
@@ -383,11 +370,4 @@ static int Extract( vlc_va_t *va, picture_t *p_picture, uint8_t *data )
return
VLC_SUCCESS
;
}
static
void
Release
(
void
*
opaque
,
uint8_t
*
data
)
{
picture_Release
(
opaque
);
(
void
)
data
;
}
#endif
modules/codec/avcodec/video.c
View file @
bf445475
...
...
@@ -945,6 +945,14 @@ static void ffmpeg_InitCodec( decoder_t *p_dec )
}
}
static
void
lavc_ReleaseFrame
(
void
*
opaque
,
uint8_t
*
data
)
{
picture_t
*
picture
=
opaque
;
picture_Release
(
picture
);
(
void
)
data
;
}
static
int
lavc_va_GetFrame
(
struct
AVCodecContext
*
ctx
,
AVFrame
*
frame
,
int
flags
)
{
...
...
@@ -971,10 +979,14 @@ static int lavc_va_GetFrame(struct AVCodecContext *ctx, AVFrame *frame,
* data[3] actually contains the format-specific surface handle. */
frame
->
data
[
3
]
=
frame
->
data
[
0
];
frame
->
buf
[
0
]
=
av_buffer_create
(
frame
->
data
[
0
],
0
,
va
->
release
,
pic
,
0
);
void
(
*
release
)(
void
*
,
uint8_t
*
)
=
va
->
release
;
if
(
va
->
release
==
NULL
)
release
=
lavc_ReleaseFrame
;
frame
->
buf
[
0
]
=
av_buffer_create
(
frame
->
data
[
0
],
0
,
release
,
pic
,
0
);
if
(
unlikely
(
frame
->
buf
[
0
]
==
NULL
))
{
vlc_va_Release
(
va
,
pic
,
frame
->
data
[
0
]);
release
(
pic
,
frame
->
data
[
0
]);
return
-
1
;
}
...
...
@@ -984,14 +996,6 @@ static int lavc_va_GetFrame(struct AVCodecContext *ctx, AVFrame *frame,
return
0
;
}
static
void
lavc_dr_ReleaseFrame
(
void
*
opaque
,
uint8_t
*
data
)
{
picture_t
*
picture
=
opaque
;
picture_Release
(
picture
);
(
void
)
data
;
}
static
picture_t
*
lavc_dr_GetFrame
(
struct
AVCodecContext
*
ctx
,
AVFrame
*
frame
,
int
flags
)
{
...
...
@@ -1054,11 +1058,11 @@ static picture_t *lavc_dr_GetFrame(struct AVCodecContext *ctx,
uint8_t
*
data
=
pic
->
p
[
i
].
p_pixels
;
int
size
=
pic
->
p
[
i
].
i_pitch
*
pic
->
p
[
i
].
i_lines
;
frame
->
buf
[
i
]
=
av_buffer_create
(
data
,
size
,
lavc_
dr_
ReleaseFrame
,
frame
->
buf
[
i
]
=
av_buffer_create
(
data
,
size
,
lavc_ReleaseFrame
,
picture_Hold
(
pic
),
0
);
if
(
unlikely
(
frame
->
buf
[
i
]
==
NULL
))
{
lavc_
dr_
ReleaseFrame
(
pic
,
data
);
lavc_ReleaseFrame
(
pic
,
data
);
goto
error
;
}
}
...
...
modules/hw/vdpau/avcodec.c
View file @
bf445475
...
...
@@ -146,12 +146,6 @@ static int Lock(vlc_va_t *va, picture_t *pic, uint8_t **data)
return
VLC_SUCCESS
;
}
static
void
Unlock
(
void
*
opaque
,
uint8_t
*
data
)
{
picture_Release
(
opaque
);
(
void
)
data
;
}
static
int
Copy
(
vlc_va_t
*
va
,
picture_t
*
pic
,
uint8_t
*
data
)
{
(
void
)
va
;
(
void
)
pic
;
(
void
)
data
;
...
...
@@ -389,7 +383,7 @@ static int Open(vlc_va_t *va, AVCodecContext *avctx, const es_format_t *fmt)
va
->
pix_fmt
=
AV_PIX_FMT_VDPAU
;
va
->
setup
=
Setup
;
va
->
get
=
Lock
;
va
->
release
=
Unlock
;
va
->
release
=
NULL
;
va
->
extract
=
Copy
;
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