Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
e110b99a
Commit
e110b99a
authored
May 20, 2008
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use reference counting for pictures
parent
a5ff1f92
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
14 deletions
+12
-14
src/misc/image.c
src/misc/image.c
+12
-14
No files found.
src/misc/image.c
View file @
e110b99a
...
@@ -252,7 +252,6 @@ static block_t *ImageWrite( image_handler_t *p_image, picture_t *p_pic,
...
@@ -252,7 +252,6 @@ static block_t *ImageWrite( image_handler_t *p_image, picture_t *p_pic,
video_format_t
*
p_fmt_out
)
video_format_t
*
p_fmt_out
)
{
{
block_t
*
p_block
;
block_t
*
p_block
;
void
(
*
pf_release
)(
picture_t
*
);
/* Check if we can reuse the current encoder */
/* Check if we can reuse the current encoder */
if
(
p_image
->
p_enc
&&
if
(
p_image
->
p_enc
&&
...
@@ -563,12 +562,11 @@ static const char *Fourcc2Ext( vlc_fourcc_t i_codec )
...
@@ -563,12 +562,11 @@ static const char *Fourcc2Ext( vlc_fourcc_t i_codec )
static
void
video_release_buffer
(
picture_t
*
p_pic
)
static
void
video_release_buffer
(
picture_t
*
p_pic
)
{
{
if
(
p_pic
)
if
(
--
p_pic
->
i_refcount
>
0
)
return
;
{
free
(
p_pic
->
p_data_orig
);
free
(
p_pic
->
p_data_orig
);
free
(
p_pic
->
p_sys
);
free
(
p_pic
->
p_sys
);
free
(
p_pic
);
free
(
p_pic
);
}
}
}
static
picture_t
*
video_new_buffer
(
decoder_t
*
p_dec
)
static
picture_t
*
video_new_buffer
(
decoder_t
*
p_dec
)
...
@@ -588,6 +586,7 @@ static picture_t *video_new_buffer( decoder_t *p_dec )
...
@@ -588,6 +586,7 @@ static picture_t *video_new_buffer( decoder_t *p_dec )
return
0
;
return
0
;
}
}
p_pic
->
i_refcount
=
1
;
p_pic
->
pf_release
=
video_release_buffer
;
p_pic
->
pf_release
=
video_release_buffer
;
p_pic
->
i_status
=
RESERVED_PICTURE
;
p_pic
->
i_status
=
RESERVED_PICTURE
;
p_pic
->
p_sys
=
NULL
;
p_pic
->
p_sys
=
NULL
;
...
@@ -598,22 +597,21 @@ static picture_t *video_new_buffer( decoder_t *p_dec )
...
@@ -598,22 +597,21 @@ static picture_t *video_new_buffer( decoder_t *p_dec )
static
void
video_del_buffer
(
decoder_t
*
p_dec
,
picture_t
*
p_pic
)
static
void
video_del_buffer
(
decoder_t
*
p_dec
,
picture_t
*
p_pic
)
{
{
(
void
)
p_dec
;
(
void
)
p_dec
;
if
(
p_pic
)
{
free
(
p_pic
->
p_data_orig
);
free
(
p_pic
->
p_data_orig
);
free
(
p_pic
->
p_sys
);
free
(
p_pic
->
p_sys
);
free
(
p_pic
);
free
(
p_pic
);
}
}
}
static
void
video_link_picture
(
decoder_t
*
p_dec
,
picture_t
*
p_pic
)
static
void
video_link_picture
(
decoder_t
*
p_dec
,
picture_t
*
p_pic
)
{
{
(
void
)
p_dec
;
(
void
)
p_pic
;
(
void
)
p_dec
;
p_pic
->
i_refcount
++
;
}
}
static
void
video_unlink_picture
(
decoder_t
*
p_dec
,
picture_t
*
p_pic
)
static
void
video_unlink_picture
(
decoder_t
*
p_dec
,
picture_t
*
p_pic
)
{
{
(
void
)
p_dec
;
(
void
)
p_pic
;
(
void
)
p_dec
;
(
void
)
p_pic
;
video_release_buffer
(
p_pic
);
}
}
static
decoder_t
*
CreateDecoder
(
vlc_object_t
*
p_this
,
video_format_t
*
fmt
)
static
decoder_t
*
CreateDecoder
(
vlc_object_t
*
p_this
,
video_format_t
*
fmt
)
...
...
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