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
6672975c
Commit
6672975c
authored
Nov 03, 2014
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wayland: fix attaching and detaching protocol-side buffer objects
parent
bfe3ffd1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
3 deletions
+19
-3
modules/video_output/wayland/shm.c
modules/video_output/wayland/shm.c
+19
-3
No files found.
modules/video_output/wayland/shm.c
View file @
6672975c
...
...
@@ -61,12 +61,10 @@ struct vout_display_sys_t
static
void
PictureDestroy
(
picture_t
*
pic
)
{
struct
wl_buffer
*
buf
=
(
struct
wl_buffer
*
)
pic
->
p_sys
;
const
long
pagemask
=
sysconf
(
_SC_PAGE_SIZE
)
-
1
;
size_t
picsize
=
pic
->
p
[
0
].
i_pitch
*
pic
->
p
[
0
].
i_lines
;
munmap
(
pic
->
p
[
0
].
p_pixels
,
(
picsize
+
pagemask
)
&
~
pagemask
);
wl_buffer_destroy
(
buf
);
/* XXX: what if wl_display is already gone? */
free
(
pic
);
}
...
...
@@ -83,6 +81,22 @@ static const struct wl_buffer_listener buffer_cbs =
buffer_release_cb
,
};
static
void
PictureAttach
(
void
*
data
,
picture_t
*
pic
)
{
struct
wl_buffer
*
buf
=
(
struct
wl_buffer
*
)
pic
->
p_sys
;
wl_buffer_add_listener
(
buf
,
&
buffer_cbs
,
pic
);
(
void
)
data
;
}
static
void
PictureDetach
(
void
*
data
,
picture_t
*
pic
)
{
struct
wl_buffer
*
buf
=
(
struct
wl_buffer
*
)
pic
->
p_sys
;
wl_buffer_destroy
(
buf
);
(
void
)
data
;
}
static
picture_pool_t
*
Pool
(
vout_display_t
*
vd
,
unsigned
req
)
{
vout_display_sys_t
*
sys
=
vd
->
sys
;
...
...
@@ -175,7 +189,6 @@ static picture_pool_t *Pool(vout_display_t *vd, unsigned req)
break
;
}
wl_buffer_add_listener
(
buf
,
&
buffer_cbs
,
pic
);
pics
[
count
++
]
=
pic
;
}
...
...
@@ -194,6 +207,8 @@ static picture_pool_t *Pool(vout_display_t *vd, unsigned req)
picture_Release
(
pics
[
--
count
]);
return
NULL
;
}
picture_pool_Enum
(
sys
->
pool
,
PictureAttach
,
NULL
);
return
sys
->
pool
;
}
...
...
@@ -234,6 +249,7 @@ static void ResetPictures(vout_display_t *vd)
if
(
sys
->
pool
==
NULL
)
return
;
picture_pool_Enum
(
sys
->
pool
,
PictureDetach
,
NULL
);
picture_pool_Release
(
sys
->
pool
);
sys
->
pool
=
NULL
;
}
...
...
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