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
5dfce5ed
Commit
5dfce5ed
authored
Nov 03, 2014
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vmem: unlock picture in prepare, get rid of lock/unlock
parent
d7d0b381
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
47 deletions
+46
-47
modules/video_output/vmem.c
modules/video_output/vmem.c
+46
-47
No files found.
modules/video_output/vmem.c
View file @
5dfce5ed
...
...
@@ -105,11 +105,37 @@ typedef unsigned (*vlc_format_cb)(void **, char *, unsigned *, unsigned *,
unsigned
*
,
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
int
Control
(
vout_display_t
*
,
int
,
va_list
);
static
int
Lock
(
picture_t
*
);
static
void
Unlock
(
picture_t
*
);
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
)
{
vout_display_sys_t
*
sys
=
data
;
picture_sys_t
*
picsys
=
pic
->
p_sys
;
void
*
planes
[
PICTURE_PLANE_MAX
];
assert
(
!
picture_IsReferenced
(
pic
));
for
(
int
i
=
0
;
i
<
pic
->
i_planes
;
i
++
)
planes
[
i
]
=
pic
->
p
[
i
].
p_pixels
;
if
(
sys
->
unlock
!=
NULL
)
sys
->
unlock
(
sys
->
opaque
,
picsys
->
id
,
planes
);
}
/*****************************************************************************
* Open: allocates video thread
...
...
@@ -221,7 +247,7 @@ static int Open(vlc_object_t *object)
vd
->
fmt
=
fmt
;
vd
->
info
=
info
;
vd
->
pool
=
Pool
;
vd
->
prepare
=
NULL
;
vd
->
prepare
=
Prepare
;
vd
->
display
=
Display
;
vd
->
control
=
Control
;
vd
->
manage
=
NULL
;
...
...
@@ -240,11 +266,12 @@ static void Close(vlc_object_t *object)
if
(
sys
->
cleanup
)
sys
->
cleanup
(
sys
->
opaque
);
picture_pool_Enum
(
sys
->
pool
,
Unlock
,
sys
);
picture_pool_Release
(
sys
->
pool
);
free
(
sys
);
}
/* */
static
picture_pool_t
*
Pool
(
vout_display_t
*
vd
,
unsigned
count
)
{
vout_display_sys_t
*
sys
=
vd
->
sys
;
...
...
@@ -285,65 +312,37 @@ static picture_pool_t *Pool(vout_display_t *vd, unsigned count)
}
/* */
picture_pool_configuration_t
pool
;
memset
(
&
pool
,
0
,
sizeof
(
pool
));
pool
.
picture_count
=
count
;
pool
.
picture
=
pictures
;
pool
.
lock
=
Lock
;
pool
.
unlock
=
Unlock
;
sys
->
pool
=
picture_pool_NewExtended
(
&
pool
);
sys
->
pool
=
picture_pool_New
(
count
,
pictures
);
if
(
!
sys
->
pool
)
{
for
(
unsigned
i
=
0
;
i
<
count
;
i
++
)
picture_Release
(
pictures
[
i
]);
}
picture_pool_Enum
(
sys
->
pool
,
Lock
,
sys
);
return
sys
->
pool
;
}
static
void
Display
(
vout_display_t
*
vd
,
picture_t
*
picture
,
subpicture_t
*
subpicture
)
static
void
Prepare
(
vout_display_t
*
vd
,
picture_t
*
pic
,
subpicture_t
*
subpic
)
{
vout_display_sys_t
*
sys
=
vd
->
sys
;
void
*
id
=
picture
->
p_sys
->
id
;
assert
(
!
picture_IsReferenced
(
picture
));
picture_Release
(
picture
);
if
(
sys
->
display
!=
NULL
)
sys
->
display
(
sys
->
opaque
,
id
);
VLC_UNUSED
(
subpicture
);
Unlock
(
vd
->
sys
,
pic
);
VLC_UNUSED
(
subpic
);
}
static
int
Control
(
vout_display_t
*
vd
,
int
query
,
va_list
args
)
{
(
void
)
vd
;
(
void
)
query
;
(
void
)
args
;
return
VLC_EGENERIC
;
}
/* */
static
int
Lock
(
picture_t
*
picture
)
static
void
Display
(
vout_display_t
*
vd
,
picture_t
*
pic
,
subpicture_t
*
subpic
)
{
picture_sys_t
*
picsys
=
picture
->
p_sys
;
vout_display_sys_t
*
sys
=
picsys
->
sys
;
void
*
planes
[
PICTURE_PLANE_MAX
];
picsys
->
id
=
sys
->
lock
(
sys
->
opaque
,
planes
);
vout_display_sys_t
*
sys
=
vd
->
sys
;
for
(
int
i
=
0
;
i
<
picture
->
i_planes
;
i
++
)
picture
->
p
[
i
].
p_pixels
=
planes
[
i
]
;
if
(
sys
->
display
!=
NULL
)
sys
->
display
(
sys
->
opaque
,
pic
->
p_sys
->
id
)
;
return
VLC_SUCCESS
;
Lock
(
sys
,
pic
);
picture_Release
(
pic
);
VLC_UNUSED
(
subpic
);
}
static
void
Unlock
(
picture_t
*
picture
)
static
int
Control
(
vout_display_t
*
vd
,
int
query
,
va_list
args
)
{
picture_sys_t
*
picsys
=
picture
->
p_sys
;
vout_display_sys_t
*
sys
=
picsys
->
sys
;
void
*
planes
[
PICTURE_PLANE_MAX
];
for
(
int
i
=
0
;
i
<
picture
->
i_planes
;
i
++
)
planes
[
i
]
=
picture
->
p
[
i
].
p_pixels
;
if
(
sys
->
unlock
!=
NULL
)
sys
->
unlock
(
sys
->
opaque
,
picsys
->
id
,
planes
);
(
void
)
vd
;
(
void
)
query
;
(
void
)
args
;
return
VLC_EGENERIC
;
}
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