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
19fe6a4c
Commit
19fe6a4c
authored
Apr 06, 2015
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move subpicture_region_Copy to the core
Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
7f649acf
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
31 deletions
+39
-31
include/vlc_subpicture.h
include/vlc_subpicture.h
+8
-0
modules/access/bluray.c
modules/access/bluray.c
+1
-31
src/libvlccore.sym
src/libvlccore.sym
+1
-0
src/misc/subpicture.c
src/misc/subpicture.c
+29
-0
No files found.
include/vlc_subpicture.h
View file @
19fe6a4c
...
@@ -105,6 +105,14 @@ VLC_API void subpicture_region_Delete( subpicture_region_t *p_region );
...
@@ -105,6 +105,14 @@ VLC_API void subpicture_region_Delete( subpicture_region_t *p_region );
*/
*/
VLC_API
void
subpicture_region_ChainDelete
(
subpicture_region_t
*
p_head
);
VLC_API
void
subpicture_region_ChainDelete
(
subpicture_region_t
*
p_head
);
/**
* This function will copy a subpicture region to a new allocated one
* and transfer all the properties
*
* Provided for convenience.
*/
VLC_API
subpicture_region_t
*
subpicture_region_Copy
(
subpicture_region_t
*
p_region
);
/**
/**
*
*
*/
*/
...
...
modules/access/bluray.c
View file @
19fe6a4c
...
@@ -676,36 +676,6 @@ static int subpictureUpdaterValidate(subpicture_t *p_subpic,
...
@@ -676,36 +676,6 @@ static int subpictureUpdaterValidate(subpicture_t *p_subpic,
return
res
;
return
res
;
}
}
/* This should probably be moved to subpictures.c afterward */
static
subpicture_region_t
*
subpicture_region_Clone
(
subpicture_region_t
*
p_region_src
)
{
if
(
!
p_region_src
)
return
NULL
;
subpicture_region_t
*
p_region_dst
=
subpicture_region_New
(
&
p_region_src
->
fmt
);
if
(
unlikely
(
!
p_region_dst
))
return
NULL
;
p_region_dst
->
i_x
=
p_region_src
->
i_x
;
p_region_dst
->
i_y
=
p_region_src
->
i_y
;
p_region_dst
->
i_align
=
p_region_src
->
i_align
;
p_region_dst
->
i_alpha
=
p_region_src
->
i_alpha
;
p_region_dst
->
psz_text
=
p_region_src
->
psz_text
?
strdup
(
p_region_src
->
psz_text
)
:
NULL
;
p_region_dst
->
psz_html
=
p_region_src
->
psz_html
?
strdup
(
p_region_src
->
psz_html
)
:
NULL
;
if
(
p_region_src
->
p_style
!=
NULL
)
{
p_region_dst
->
p_style
=
malloc
(
sizeof
(
*
p_region_dst
->
p_style
));
p_region_dst
->
p_style
=
text_style_Copy
(
p_region_dst
->
p_style
,
p_region_src
->
p_style
);
}
//Palette is already copied by subpicture_region_New, we just have to duplicate p_pixels
for
(
int
i
=
0
;
i
<
p_region_src
->
p_picture
->
i_planes
;
i
++
)
memcpy
(
p_region_dst
->
p_picture
->
p
[
i
].
p_pixels
,
p_region_src
->
p_picture
->
p
[
i
].
p_pixels
,
p_region_src
->
p_picture
->
p
[
i
].
i_lines
*
p_region_src
->
p_picture
->
p
[
i
].
i_pitch
);
return
p_region_dst
;
}
static
void
subpictureUpdaterUpdate
(
subpicture_t
*
p_subpic
,
static
void
subpictureUpdaterUpdate
(
subpicture_t
*
p_subpic
,
const
video_format_t
*
p_fmt_src
,
const
video_format_t
*
p_fmt_src
,
const
video_format_t
*
p_fmt_dst
,
const
video_format_t
*
p_fmt_dst
,
...
@@ -731,7 +701,7 @@ static void subpictureUpdaterUpdate(subpicture_t *p_subpic,
...
@@ -731,7 +701,7 @@ static void subpictureUpdaterUpdate(subpicture_t *p_subpic,
subpicture_region_t
**
p_dst
=
&
p_subpic
->
p_region
;
subpicture_region_t
**
p_dst
=
&
p_subpic
->
p_region
;
while
(
p_src
!=
NULL
)
{
while
(
p_src
!=
NULL
)
{
*
p_dst
=
subpicture_region_C
lone
(
p_src
);
*
p_dst
=
subpicture_region_C
opy
(
p_src
);
if
(
*
p_dst
==
NULL
)
if
(
*
p_dst
==
NULL
)
break
;
break
;
p_dst
=
&
(
*
p_dst
)
->
p_next
;
p_dst
=
&
(
*
p_dst
)
->
p_next
;
...
...
src/libvlccore.sym
View file @
19fe6a4c
...
@@ -415,6 +415,7 @@ subpicture_New
...
@@ -415,6 +415,7 @@ subpicture_New
subpicture_NewFromPicture
subpicture_NewFromPicture
subpicture_Update
subpicture_Update
subpicture_region_ChainDelete
subpicture_region_ChainDelete
subpicture_region_Copy
subpicture_region_Delete
subpicture_region_Delete
subpicture_region_New
subpicture_region_New
vlc_tls_ClientCreate
vlc_tls_ClientCreate
...
...
src/misc/subpicture.c
View file @
19fe6a4c
...
@@ -290,3 +290,32 @@ unsigned picture_BlendSubpicture(picture_t *dst,
...
@@ -290,3 +290,32 @@ unsigned picture_BlendSubpicture(picture_t *dst,
}
}
return
done
;
return
done
;
}
}
subpicture_region_t
*
subpicture_region_Copy
(
subpicture_region_t
*
p_region_src
)
{
if
(
!
p_region_src
)
return
NULL
;
subpicture_region_t
*
p_region_dst
=
subpicture_region_New
(
&
p_region_src
->
fmt
);
if
(
unlikely
(
!
p_region_dst
))
return
NULL
;
p_region_dst
->
i_x
=
p_region_src
->
i_x
;
p_region_dst
->
i_y
=
p_region_src
->
i_y
;
p_region_dst
->
i_align
=
p_region_src
->
i_align
;
p_region_dst
->
i_alpha
=
p_region_src
->
i_alpha
;
p_region_dst
->
psz_text
=
p_region_src
->
psz_text
?
strdup
(
p_region_src
->
psz_text
)
:
NULL
;
p_region_dst
->
psz_html
=
p_region_src
->
psz_html
?
strdup
(
p_region_src
->
psz_html
)
:
NULL
;
if
(
p_region_src
->
p_style
!=
NULL
)
{
p_region_dst
->
p_style
=
malloc
(
sizeof
(
*
p_region_dst
->
p_style
));
p_region_dst
->
p_style
=
text_style_Copy
(
p_region_dst
->
p_style
,
p_region_src
->
p_style
);
}
//Palette is already copied by subpicture_region_New, we just have to duplicate p_pixels
for
(
int
i
=
0
;
i
<
p_region_src
->
p_picture
->
i_planes
;
i
++
)
memcpy
(
p_region_dst
->
p_picture
->
p
[
i
].
p_pixels
,
p_region_src
->
p_picture
->
p
[
i
].
p_pixels
,
p_region_src
->
p_picture
->
p
[
i
].
i_lines
*
p_region_src
->
p_picture
->
p
[
i
].
i_pitch
);
return
p_region_dst
;
}
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