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
a5b262e2
Commit
a5b262e2
authored
Feb 08, 2016
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vmem: lock pictures before creating pool
parent
f33d8151
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
25 deletions
+5
-25
modules/video_output/vmem.c
modules/video_output/vmem.c
+5
-25
No files found.
modules/video_output/vmem.c
View file @
a5b262e2
...
@@ -105,22 +105,9 @@ typedef unsigned (*vlc_format_cb)(void **, char *, unsigned *, unsigned *,
...
@@ -105,22 +105,9 @@ typedef unsigned (*vlc_format_cb)(void **, char *, unsigned *, unsigned *,
unsigned
*
,
unsigned
*
);
unsigned
*
,
unsigned
*
);
static
picture_pool_t
*
Pool
(
vout_display_t
*
,
unsigned
);
static
picture_pool_t
*
Pool
(
vout_display_t
*
,
unsigned
);
static
void
Prepare
(
vout_display_t
*
,
picture_t
*
,
subpicture_t
*
);
static
void
Display
(
vout_display_t
*
,
picture_t
*
,
subpicture_t
*
);
static
void
Display
(
vout_display_t
*
,
picture_t
*
,
subpicture_t
*
);
static
int
Control
(
vout_display_t
*
,
int
,
va_list
);
static
int
Control
(
vout_display_t
*
,
int
,
va_list
);
static
void
Lock
(
void
*
data
,
picture_t
*
pic
)
{
vout_display_sys_t
*
sys
=
data
;
picture_sys_t
*
picsys
=
pic
->
p_sys
;
void
*
planes
[
PICTURE_PLANE_MAX
];
picsys
->
id
=
sys
->
lock
(
sys
->
opaque
,
planes
);
for
(
int
i
=
0
;
i
<
pic
->
i_planes
;
i
++
)
pic
->
p
[
i
].
p_pixels
=
planes
[
i
];
}
static
void
Unlock
(
void
*
data
,
picture_t
*
pic
)
static
void
Unlock
(
void
*
data
,
picture_t
*
pic
)
{
{
vout_display_sys_t
*
sys
=
data
;
vout_display_sys_t
*
sys
=
data
;
...
@@ -247,7 +234,7 @@ static int Open(vlc_object_t *object)
...
@@ -247,7 +234,7 @@ static int Open(vlc_object_t *object)
vd
->
fmt
=
fmt
;
vd
->
fmt
=
fmt
;
vd
->
info
=
info
;
vd
->
info
=
info
;
vd
->
pool
=
Pool
;
vd
->
pool
=
Pool
;
vd
->
prepare
=
Prepare
;
vd
->
prepare
=
NULL
;
vd
->
display
=
Display
;
vd
->
display
=
Display
;
vd
->
control
=
Control
;
vd
->
control
=
Control
;
vd
->
manage
=
NULL
;
vd
->
manage
=
NULL
;
...
@@ -298,10 +285,12 @@ static picture_pool_t *Pool(vout_display_t *vd, unsigned count)
...
@@ -298,10 +285,12 @@ static picture_pool_t *Pool(vout_display_t *vd, unsigned count)
picsys
->
id
=
NULL
;
picsys
->
id
=
NULL
;
picture_resource_t
rsc
=
{
.
p_sys
=
picsys
};
picture_resource_t
rsc
=
{
.
p_sys
=
picsys
};
void
*
planes
[
PICTURE_PLANE_MAX
];
picsys
->
id
=
sys
->
lock
(
sys
->
opaque
,
planes
);
for
(
unsigned
i
=
0
;
i
<
PICTURE_PLANE_MAX
;
i
++
)
{
for
(
unsigned
i
=
0
;
i
<
PICTURE_PLANE_MAX
;
i
++
)
{
/* vmem-lock is responsible for the allocation */
rsc
.
p
[
i
].
p_pixels
=
planes
[
i
];
rsc
.
p
[
i
].
p_pixels
=
NULL
;
rsc
.
p
[
i
].
i_lines
=
sys
->
lines
[
i
];
rsc
.
p
[
i
].
i_lines
=
sys
->
lines
[
i
];
rsc
.
p
[
i
].
i_pitch
=
sys
->
pitches
[
i
];
rsc
.
p
[
i
].
i_pitch
=
sys
->
pitches
[
i
];
}
}
...
@@ -321,17 +310,9 @@ static picture_pool_t *Pool(vout_display_t *vd, unsigned count)
...
@@ -321,17 +310,9 @@ static picture_pool_t *Pool(vout_display_t *vd, unsigned count)
picture_Release
(
pictures
[
i
]);
picture_Release
(
pictures
[
i
]);
}
}
picture_pool_Enum
(
sys
->
pool
,
Lock
,
sys
);
return
sys
->
pool
;
return
sys
->
pool
;
}
}
static
void
Prepare
(
vout_display_t
*
vd
,
picture_t
*
pic
,
subpicture_t
*
subpic
)
{
Unlock
(
vd
->
sys
,
pic
);
VLC_UNUSED
(
subpic
);
}
static
void
Display
(
vout_display_t
*
vd
,
picture_t
*
pic
,
subpicture_t
*
subpic
)
static
void
Display
(
vout_display_t
*
vd
,
picture_t
*
pic
,
subpicture_t
*
subpic
)
{
{
vout_display_sys_t
*
sys
=
vd
->
sys
;
vout_display_sys_t
*
sys
=
vd
->
sys
;
...
@@ -339,7 +320,6 @@ static void Display(vout_display_t *vd, picture_t *pic, subpicture_t *subpic)
...
@@ -339,7 +320,6 @@ static void Display(vout_display_t *vd, picture_t *pic, subpicture_t *subpic)
if
(
sys
->
display
!=
NULL
)
if
(
sys
->
display
!=
NULL
)
sys
->
display
(
sys
->
opaque
,
pic
->
p_sys
->
id
);
sys
->
display
(
sys
->
opaque
,
pic
->
p_sys
->
id
);
Lock
(
sys
,
pic
);
picture_Release
(
pic
);
picture_Release
(
pic
);
VLC_UNUSED
(
subpic
);
VLC_UNUSED
(
subpic
);
}
}
...
...
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