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
af37ba18
Commit
af37ba18
authored
Jul 18, 2008
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added new picture helpers (picture_Yield, picture_Release,
picture_CopyProperties) and use them inside vlc core.
parent
efa30ea7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
13 deletions
+46
-13
include/vlc_vout.h
include/vlc_vout.h
+33
-0
src/misc/image.c
src/misc/image.c
+13
-13
No files found.
include/vlc_vout.h
View file @
af37ba18
...
@@ -115,6 +115,39 @@ struct picture_t
...
@@ -115,6 +115,39 @@ struct picture_t
struct
picture_t
*
p_next
;
struct
picture_t
*
p_next
;
};
};
/**
* This function will increase the picture reference count.
* It will not have any effect on picture obtained from vout
*/
static
inline
void
picture_Yield
(
picture_t
*
p_picture
)
{
if
(
p_picture
->
pf_release
)
p_picture
->
i_refcount
++
;
}
/**
* This function will release a picture.
* It will not have any effect on picture obtained from vout
*/
static
inline
void
picture_Release
(
picture_t
*
p_picture
)
{
/* FIXME why do we let pf_release handle the i_refcount ? */
if
(
p_picture
->
pf_release
)
p_picture
->
pf_release
(
p_picture
);
}
/**
* This function will copy all picture dynamic properties.
*/
static
inline
void
picture_CopyProperties
(
picture_t
*
p_dst
,
const
picture_t
*
p_src
)
{
p_dst
->
date
=
p_src
->
date
;
p_dst
->
b_force
=
p_src
->
b_force
;
p_dst
->
b_progressive
=
p_src
->
b_progressive
;
p_dst
->
i_nb_fields
=
p_src
->
i_nb_fields
;
p_dst
->
b_top_field_first
=
p_src
->
b_top_field_first
;
}
/**
/**
* Video picture heap, either render (to store pictures used
* Video picture heap, either render (to store pictures used
* by the decoder) or output (to store pictures displayed by the vout plugin)
* by the decoder) or output (to store pictures displayed by the vout plugin)
...
...
src/misc/image.c
View file @
af37ba18
...
@@ -139,8 +139,8 @@ static picture_t *ImageRead( image_handler_t *p_image, block_t *p_block,
...
@@ -139,8 +139,8 @@ static picture_t *ImageRead( image_handler_t *p_image, block_t *p_block,
while
(
(
p_tmp
=
p_image
->
p_dec
->
pf_decode_video
(
p_image
->
p_dec
,
&
p_block
))
while
(
(
p_tmp
=
p_image
->
p_dec
->
pf_decode_video
(
p_image
->
p_dec
,
&
p_block
))
!=
NULL
)
!=
NULL
)
{
{
if
(
p_pic
!=
NULL
)
if
(
p_pic
!=
NULL
)
p
_pic
->
pf_r
elease
(
p_pic
);
p
icture_R
elease
(
p_pic
);
p_pic
=
p_tmp
;
p_pic
=
p_tmp
;
}
}
...
@@ -188,7 +188,7 @@ static picture_t *ImageRead( image_handler_t *p_image, block_t *p_block,
...
@@ -188,7 +188,7 @@ static picture_t *ImageRead( image_handler_t *p_image, block_t *p_block,
if
(
!
p_image
->
p_filter
)
if
(
!
p_image
->
p_filter
)
{
{
p
_pic
->
pf_r
elease
(
p_pic
);
p
icture_R
elease
(
p_pic
);
return
NULL
;
return
NULL
;
}
}
}
}
...
@@ -316,8 +316,8 @@ static block_t *ImageWrite( image_handler_t *p_image, picture_t *p_pic,
...
@@ -316,8 +316,8 @@ static block_t *ImageWrite( image_handler_t *p_image, picture_t *p_pic,
p_image
->
p_filter
->
fmt_out
.
video
=
p_image
->
p_enc
->
fmt_in
.
video
;
p_image
->
p_filter
->
fmt_out
.
video
=
p_image
->
p_enc
->
fmt_in
.
video
;
}
}
if
(
p_pic
->
pf_release
)
picture_Yield
(
p_pic
);
p_pic
->
i_refcount
++
;
p_tmp_pic
=
p_tmp_pic
=
p_image
->
p_filter
->
pf_video_filter
(
p_image
->
p_filter
,
p_pic
);
p_image
->
p_filter
->
pf_video_filter
(
p_image
->
p_filter
,
p_pic
);
...
@@ -446,8 +446,8 @@ static picture_t *ImageConvert( image_handler_t *p_image, picture_t *p_pic,
...
@@ -446,8 +446,8 @@ static picture_t *ImageConvert( image_handler_t *p_image, picture_t *p_pic,
p_image
->
p_filter
->
fmt_out
.
video
=
*
p_fmt_out
;
p_image
->
p_filter
->
fmt_out
.
video
=
*
p_fmt_out
;
}
}
if
(
p_pic
->
pf_release
)
picture_Yield
(
p_pic
);
p_pic
->
i_refcount
++
;
p_pif
=
p_image
->
p_filter
->
pf_video_filter
(
p_image
->
p_filter
,
p_pic
);
p_pif
=
p_image
->
p_filter
->
pf_video_filter
(
p_image
->
p_filter
,
p_pic
);
if
(
p_fmt_in
->
i_chroma
==
p_fmt_out
->
i_chroma
&&
if
(
p_fmt_in
->
i_chroma
==
p_fmt_out
->
i_chroma
&&
...
@@ -455,7 +455,7 @@ static picture_t *ImageConvert( image_handler_t *p_image, picture_t *p_pic,
...
@@ -455,7 +455,7 @@ static picture_t *ImageConvert( image_handler_t *p_image, picture_t *p_pic,
p_fmt_in
->
i_height
==
p_fmt_out
->
i_height
)
p_fmt_in
->
i_height
==
p_fmt_out
->
i_height
)
{
{
/* Duplicate image */
/* Duplicate image */
p
_pif
->
pf_r
elease
(
p_pif
);
/* XXX: Better fix must be possible */
p
icture_R
elease
(
p_pif
);
/* XXX: Better fix must be possible */
p_pif
=
p_image
->
p_filter
->
pf_vout_buffer_new
(
p_image
->
p_filter
);
p_pif
=
p_image
->
p_filter
->
pf_vout_buffer_new
(
p_image
->
p_filter
);
if
(
p_pif
)
vout_CopyPicture
(
p_image
->
p_parent
,
p_pif
,
p_pic
);
if
(
p_pif
)
vout_CopyPicture
(
p_image
->
p_parent
,
p_pif
,
p_pic
);
}
}
...
@@ -493,8 +493,8 @@ static picture_t *ImageFilter( image_handler_t *p_image, picture_t *p_pic,
...
@@ -493,8 +493,8 @@ static picture_t *ImageFilter( image_handler_t *p_image, picture_t *p_pic,
p_image
->
p_filter
->
fmt_out
.
video
=
*
p_fmt
;
p_image
->
p_filter
->
fmt_out
.
video
=
*
p_fmt
;
}
}
if
(
p_pic
->
pf_release
)
picture_Yield
(
p_pic
);
p_pic
->
i_refcount
++
;
return
p_image
->
p_filter
->
pf_video_filter
(
p_image
->
p_filter
,
p_pic
);
return
p_image
->
p_filter
->
pf_video_filter
(
p_image
->
p_filter
,
p_pic
);
}
}
...
@@ -611,13 +611,13 @@ static void video_del_buffer( decoder_t *p_dec, picture_t *p_pic )
...
@@ -611,13 +611,13 @@ static void video_del_buffer( decoder_t *p_dec, picture_t *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_dec
;
p
_pic
->
i_refcount
++
;
p
icture_Yield
(
p_pic
)
;
}
}
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
;
video_release_buffer
(
p_pic
);
picture_Release
(
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