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
bd83a7c2
Commit
bd83a7c2
authored
Aug 24, 2008
by
Antoine Cellerier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Export function to copy pixels between 2 plane_t structures.
parent
b6255f25
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
25 deletions
+30
-25
include/vlc_vout.h
include/vlc_vout.h
+1
-0
src/libvlccore.sym
src/libvlccore.sym
+1
-0
src/video_output/vout_pictures.c
src/video_output/vout_pictures.c
+28
-25
No files found.
include/vlc_vout.h
View file @
bd83a7c2
...
...
@@ -176,6 +176,7 @@ static inline void picture_CopyProperties( picture_t *p_dst, const picture_t *p_
* only the compatible(smaller) part will be copied.
*/
VLC_EXPORT
(
void
,
picture_CopyPixels
,
(
picture_t
*
p_dst
,
const
picture_t
*
p_src
)
);
VLC_EXPORT
(
void
,
plane_CopyPixels
,
(
plane_t
*
p_dst
,
const
plane_t
*
p_src
)
);
/**
* This function will copy both picture dynamic properties and pixels.
...
...
src/libvlccore.sym
View file @
bd83a7c2
...
...
@@ -259,6 +259,7 @@ path_sanitize
picture_CopyPixels
picture_Delete
picture_New
plane_CopyPixels
playlist_Add
playlist_AddExt
playlist_AddInput
...
...
src/video_output/vout_pictures.c
View file @
bd83a7c2
...
...
@@ -1053,34 +1053,37 @@ void picture_CopyPixels( picture_t *p_dst, const picture_t *p_src )
int
i
;
for
(
i
=
0
;
i
<
p_src
->
i_planes
;
i
++
)
{
const
unsigned
i_width
=
__MIN
(
p_dst
->
p
[
i
].
i_visible_pitch
,
p_src
->
p
[
i
].
i_visible_pitch
);
const
unsigned
i_height
=
__MIN
(
p_dst
->
p
[
i
].
i_visible_lines
,
p_src
->
p
[
i
].
i_visible_lines
);
plane_CopyPixels
(
p_dst
->
p
+
i
,
p_src
->
p
+
i
);
}
if
(
p_src
->
p
[
i
].
i_pitch
==
p_dst
->
p
[
i
].
i_pitch
)
{
/* There are margins, but with the same width : perfect ! */
vlc_memcpy
(
p_dst
->
p
[
i
].
p_pixels
,
p_src
->
p
[
i
].
p_pixels
,
p_src
->
p
[
i
].
i_pitch
*
i_height
);
}
else
{
/* We need to proceed line by line */
uint8_t
*
p_in
=
p_src
->
p
[
i
].
p_pixels
;
uint8_t
*
p_out
=
p_dst
->
p
[
i
].
p_pixels
;
int
i_line
;
void
plane_CopyPixels
(
plane_t
*
p_dst
,
const
plane_t
*
p_src
)
{
const
unsigned
i_width
=
__MIN
(
p_dst
->
i_visible_pitch
,
p_src
->
i_visible_pitch
);
const
unsigned
i_height
=
__MIN
(
p_dst
->
i_visible_lines
,
p_src
->
i_visible_lines
);
assert
(
p_in
);
assert
(
p_out
);
if
(
p_src
->
i_pitch
==
p_dst
->
i_pitch
)
{
/* There are margins, but with the same width : perfect ! */
vlc_memcpy
(
p_dst
->
p_pixels
,
p_src
->
p_pixels
,
p_src
->
i_pitch
*
i_height
);
}
else
{
/* We need to proceed line by line */
uint8_t
*
p_in
=
p_src
->
p_pixels
;
uint8_t
*
p_out
=
p_dst
->
p_pixels
;
int
i_line
;
for
(
i_line
=
i_height
;
i_line
--
;
)
{
vlc_memcpy
(
p_out
,
p_in
,
i_width
);
p_in
+=
p_src
->
p
[
i
].
i_pitch
;
p_out
+=
p_dst
->
p
[
i
].
i_pitch
;
}
assert
(
p_in
);
assert
(
p_out
);
for
(
i_line
=
i_height
;
i_line
--
;
)
{
vlc_memcpy
(
p_out
,
p_in
,
i_width
);
p_in
+=
p_src
->
i_pitch
;
p_out
+=
p_dst
->
i_pitch
;
}
}
}
...
...
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