Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mohamed Emad
VLC
Commits
190ae0e0
Commit
190ae0e0
authored
6 years ago
by
François Cartegnie
Browse files
Options
Downloads
Patches
Plain Diff
access: bluray: create overlay in native format
parent
a2e6e104
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/access/bluray.c
+22
-29
22 additions, 29 deletions
modules/access/bluray.c
with
22 additions
and
29 deletions
modules/access/bluray.c
+
22
−
29
View file @
190ae0e0
...
...
@@ -1914,53 +1914,46 @@ static void blurayOverlayProc(void *ptr, const BD_OVERLAY *const overlay)
*/
static
void
blurayInitArgbOverlay
(
demux_t
*
p_demux
,
int
plane
,
int
width
,
int
height
)
{
demux_sys_t
*
p_sys
=
p_demux
->
p_sys
;
blurayInitOverlay
(
p_demux
,
plane
,
width
,
height
);
if
(
!
p_sys
->
bdj
.
p_overlays
[
plane
]
->
p_regions
)
{
video_format_t
fmt
;
video_format_Init
(
&
fmt
,
0
);
video_format_Setup
(
&
fmt
,
VLC_CODEC_RGBA
,
width
,
height
,
width
,
height
,
1
,
1
);
p_sys
->
bdj
.
p_overlays
[
plane
]
->
p_regions
=
subpicture_region_New
(
&
fmt
);
}
}
static
void
blurayDrawArgbOverlay
(
demux_t
*
p_demux
,
const
BD_ARGB_OVERLAY
*
const
ov
)
{
demux_sys_t
*
p_sys
=
p_demux
->
p_sys
;
vlc_mutex_lock
(
&
p_sys
->
bdj
.
p_overlays
[
ov
->
plane
]
->
lock
);
bluray_overlay_t
*
bdov
=
p_sys
->
bdj
.
p_overlays
[
ov
->
plane
];
vlc_mutex_lock
(
&
bdov
->
lock
);
if
(
!
bdov
->
p_regions
)
{
video_format_t
fmt
;
video_format_Init
(
&
fmt
,
0
);
video_format_Setup
(
&
fmt
,
/* ARGB in word order -> byte order */
#ifdef WORDS_BIG_ENDIAN
VLC_CODEC_ARGB
,
#else
VLC_CODEC_BGRA
,
#endif
ov
->
stride
,
bdov
->
height
,
bdov
->
width
,
bdov
->
height
,
1
,
1
);
bdov
->
p_regions
=
subpicture_region_New
(
&
fmt
);
}
/* Find a region to update */
subpicture_region_t
*
p_reg
=
p_sys
->
bdj
.
p_overlays
[
ov
->
plane
]
->
p_regions
;
subpicture_region_t
*
p_reg
=
bdov
->
p_regions
;
if
(
!
p_reg
)
{
vlc_mutex_unlock
(
&
p_sys
->
bdj
.
p_overlays
[
ov
->
plane
]
->
lock
);
vlc_mutex_unlock
(
&
bdov
->
lock
);
return
;
}
/* Now we can update the region */
const
uint32_t
*
src0
=
ov
->
argb
;
uint8_t
*
dst0
=
p_reg
->
p_picture
->
p
[
0
].
p_pixels
+
p_reg
->
p_picture
->
p
[
0
].
i_pitch
*
ov
->
y
+
ov
->
x
*
4
;
memcpy
(
dst0
,
ov
->
argb
,
(
ov
->
stride
*
ov
->
h
-
ov
->
x
)
*
4
);
for
(
int
y
=
0
;
y
<
ov
->
h
;
y
++
)
{
// XXX: add support for this format ? Should be possible with OPENGL/VDPAU/...
// - or add libbluray option to select the format ?
for
(
int
x
=
0
;
x
<
ov
->
w
;
x
++
)
{
dst0
[
x
*
4
]
=
src0
[
x
]
>>
16
;
/* R */
dst0
[
x
*
4
+
1
]
=
src0
[
x
]
>>
8
;
/* G */
dst0
[
x
*
4
+
2
]
=
src0
[
x
];
/* B */
dst0
[
x
*
4
+
3
]
=
src0
[
x
]
>>
24
;
/* A */
}
src0
+=
ov
->
stride
;
dst0
+=
p_reg
->
p_picture
->
p
[
0
].
i_pitch
;
}
vlc_mutex_unlock
(
&
p_sys
->
bdj
.
p_overlays
[
ov
->
plane
]
->
lock
);
vlc_mutex_unlock
(
&
bdov
->
lock
);
/*
* /!\ The region is now stored in our internal list, but not in the subpicture /!\
*/
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment