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
792f9eb5
Commit
792f9eb5
authored
Jul 13, 2013
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
XCB: pass shared memory segment XID as parameter of picture allocation
parent
6922be48
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
15 deletions
+10
-15
modules/video_output/xcb/pictures.c
modules/video_output/xcb/pictures.c
+5
-12
modules/video_output/xcb/pictures.h
modules/video_output/xcb/pictures.h
+1
-1
modules/video_output/xcb/x11.c
modules/video_output/xcb/x11.c
+2
-1
modules/video_output/xcb/xvideo.c
modules/video_output/xcb/xvideo.c
+2
-1
No files found.
modules/video_output/xcb/pictures.c
View file @
792f9eb5
...
@@ -71,7 +71,8 @@ bool XCB_shm_Check (vlc_object_t *obj, xcb_connection_t *conn)
...
@@ -71,7 +71,8 @@ bool XCB_shm_Check (vlc_object_t *obj, xcb_connection_t *conn)
* the X server (MIT-SHM extension).
* the X server (MIT-SHM extension).
*/
*/
int
XCB_pictures_Alloc
(
vout_display_t
*
vd
,
picture_resource_t
*
res
,
int
XCB_pictures_Alloc
(
vout_display_t
*
vd
,
picture_resource_t
*
res
,
size_t
size
,
xcb_connection_t
*
conn
,
bool
attach
)
size_t
size
,
xcb_connection_t
*
conn
,
xcb_shm_seg_t
segment
)
{
{
res
->
p_sys
=
malloc
(
sizeof
(
*
res
->
p_sys
));
res
->
p_sys
=
malloc
(
sizeof
(
*
res
->
p_sys
));
if
(
!
res
->
p_sys
)
if
(
!
res
->
p_sys
)
...
@@ -97,15 +98,9 @@ int XCB_pictures_Alloc (vout_display_t *vd, picture_resource_t *res,
...
@@ -97,15 +98,9 @@ int XCB_pictures_Alloc (vout_display_t *vd, picture_resource_t *res,
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
xcb_shm_seg_t
segment
;
if
(
segment
!=
0
)
if
(
attach
)
{
/* Attach the segment to X */
{
xcb_void_cookie_t
ck
=
xcb_shm_attach_checked
(
conn
,
segment
,
id
,
1
);
/* Attach the segment to X */
xcb_void_cookie_t
ck
;
segment
=
xcb_generate_id
(
conn
);
ck
=
xcb_shm_attach_checked
(
conn
,
segment
,
id
,
1
);
switch
(
XCB_error_Check
(
vd
,
conn
,
"shared memory server-side error"
,
switch
(
XCB_error_Check
(
vd
,
conn
,
"shared memory server-side error"
,
ck
))
ck
))
{
{
...
@@ -130,8 +125,6 @@ int XCB_pictures_Alloc (vout_display_t *vd, picture_resource_t *res,
...
@@ -130,8 +125,6 @@ int XCB_pictures_Alloc (vout_display_t *vd, picture_resource_t *res,
segment
=
0
;
segment
=
0
;
}
}
}
}
else
segment
=
0
;
shmctl
(
id
,
IPC_RMID
,
NULL
);
shmctl
(
id
,
IPC_RMID
,
NULL
);
res
->
p_sys
->
segment
=
segment
;
res
->
p_sys
->
segment
=
segment
;
...
...
modules/video_output/xcb/pictures.h
View file @
792f9eb5
...
@@ -37,5 +37,5 @@ struct picture_sys_t
...
@@ -37,5 +37,5 @@ struct picture_sys_t
xcb_shm_seg_t
segment
;
xcb_shm_seg_t
segment
;
};
};
int
XCB_pictures_Alloc
(
vout_display_t
*
,
picture_resource_t
*
,
size_t
size
,
int
XCB_pictures_Alloc
(
vout_display_t
*
,
picture_resource_t
*
,
size_t
size
,
xcb_connection_t
*
,
bool
attach
);
xcb_connection_t
*
,
xcb_shm_seg_t
);
void
XCB_pictures_Free
(
picture_resource_t
*
,
xcb_connection_t
*
);
void
XCB_pictures_Free
(
picture_resource_t
*
,
xcb_connection_t
*
);
modules/video_output/xcb/x11.c
View file @
792f9eb5
...
@@ -384,7 +384,8 @@ static picture_pool_t *Pool (vout_display_t *vd, unsigned requested_count)
...
@@ -384,7 +384,8 @@ static picture_pool_t *Pool (vout_display_t *vd, unsigned requested_count)
res
->
p
->
i_lines
=
pic
->
p
->
i_lines
;
res
->
p
->
i_lines
=
pic
->
p
->
i_lines
;
res
->
p
->
i_pitch
=
pic
->
p
->
i_pitch
;
res
->
p
->
i_pitch
=
pic
->
p
->
i_pitch
;
if
(
XCB_pictures_Alloc
(
vd
,
res
,
res
->
p
->
i_pitch
*
res
->
p
->
i_lines
,
if
(
XCB_pictures_Alloc
(
vd
,
res
,
res
->
p
->
i_pitch
*
res
->
p
->
i_lines
,
sys
->
conn
,
sys
->
shm
))
sys
->
conn
,
sys
->
shm
?
xcb_generate_id
(
sys
->
conn
)
:
0
))
break
;
break
;
pic_array
[
count
]
=
picture_NewFromResource
(
&
vd
->
fmt
,
res
);
pic_array
[
count
]
=
picture_NewFromResource
(
&
vd
->
fmt
,
res
);
if
(
!
pic_array
[
count
])
if
(
!
pic_array
[
count
])
...
...
modules/video_output/xcb/xvideo.c
View file @
792f9eb5
...
@@ -640,6 +640,7 @@ static void PoolAlloc (vout_display_t *vd, unsigned requested_count)
...
@@ -640,6 +640,7 @@ static void PoolAlloc (vout_display_t *vd, unsigned requested_count)
for
(
count
=
0
;
count
<
requested_count
;
count
++
)
for
(
count
=
0
;
count
<
requested_count
;
count
++
)
{
{
picture_resource_t
*
res
=
&
p_sys
->
resource
[
count
];
picture_resource_t
*
res
=
&
p_sys
->
resource
[
count
];
xcb_shm_seg_t
seg
=
p_sys
->
shm
?
xcb_generate_id
(
p_sys
->
conn
)
:
0
;
for
(
unsigned
i
=
0
;
i
<
num_planes
;
i
++
)
for
(
unsigned
i
=
0
;
i
<
num_planes
;
i
++
)
{
{
...
@@ -651,7 +652,7 @@ static void PoolAlloc (vout_display_t *vd, unsigned requested_count)
...
@@ -651,7 +652,7 @@ static void PoolAlloc (vout_display_t *vd, unsigned requested_count)
}
}
if
(
XCB_pictures_Alloc
(
vd
,
res
,
p_sys
->
att
->
data_size
,
if
(
XCB_pictures_Alloc
(
vd
,
res
,
p_sys
->
att
->
data_size
,
p_sys
->
conn
,
p_sys
->
shm
))
p_sys
->
conn
,
seg
))
break
;
break
;
/* Allocate further planes as specified by XVideo */
/* Allocate further planes as specified by XVideo */
...
...
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