Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
77193c7b
Commit
77193c7b
authored
Jul 14, 2013
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
XCB: develop picture free function
parent
e1ee8b06
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
12 deletions
+15
-12
modules/video_output/xcb/pictures.c
modules/video_output/xcb/pictures.c
+4
-7
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
+6
-2
modules/video_output/xcb/xvideo.c
modules/video_output/xcb/xvideo.c
+4
-2
No files found.
modules/video_output/xcb/pictures.c
View file @
77193c7b
...
@@ -147,16 +147,13 @@ int XCB_pictures_Alloc (vout_display_t *vd, picture_resource_t *res,
...
@@ -147,16 +147,13 @@ int XCB_pictures_Alloc (vout_display_t *vd, picture_resource_t *res,
/**
/**
* Release picture private data: detach the shared memory segment.
* Release picture private data: detach the shared memory segment.
*/
*/
void
XCB_pictures_Free
(
picture_resource_t
*
res
,
xcb_connection_t
*
conn
)
void
XCB_pictures_Free
(
void
*
mem
)
{
{
#ifdef HAVE_SYS_SHM_H
#ifdef HAVE_SYS_SHM_H
xcb_shm_seg_t
segment
=
res
->
p_sys
->
segment
;
if
(
mem
!=
NULL
)
shmdt
(
mem
);
if
(
conn
!=
NULL
&&
segment
!=
0
)
xcb_shm_detach
(
conn
,
segment
);
shmdt
(
res
->
p
->
p_pixels
);
#else
#else
free
(
res
->
p
->
p_pixels
);
free
(
mem
);
#endif
#endif
}
}
modules/video_output/xcb/pictures.h
View file @
77193c7b
...
@@ -38,4 +38,4 @@ struct picture_sys_t
...
@@ -38,4 +38,4 @@ struct picture_sys_t
};
};
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
*
,
xcb_shm_seg_t
);
xcb_connection_t
*
,
xcb_shm_seg_t
);
void
XCB_pictures_Free
(
picture_resource_t
*
,
xcb_connection_t
*
);
void
XCB_pictures_Free
(
void
*
);
modules/video_output/xcb/x11.c
View file @
77193c7b
...
@@ -396,7 +396,9 @@ static picture_pool_t *Pool (vout_display_t *vd, unsigned requested_count)
...
@@ -396,7 +396,9 @@ static picture_pool_t *Pool (vout_display_t *vd, unsigned requested_count)
pic_array
[
count
]
=
picture_NewFromResource
(
&
vd
->
fmt
,
res
);
pic_array
[
count
]
=
picture_NewFromResource
(
&
vd
->
fmt
,
res
);
if
(
!
pic_array
[
count
])
if
(
!
pic_array
[
count
])
{
{
XCB_pictures_Free
(
res
,
sys
->
conn
);
XCB_pictures_Free
(
res
->
p
->
p_pixels
);
if
(
res
->
p_sys
->
segment
)
xcb_shm_detach
(
sys
->
conn
,
res
->
p_sys
->
segment
);
memset
(
res
,
0
,
sizeof
(
*
res
));
memset
(
res
,
0
,
sizeof
(
*
res
));
break
;
break
;
}
}
...
@@ -576,7 +578,9 @@ static void ResetPictures (vout_display_t *vd)
...
@@ -576,7 +578,9 @@ static void ResetPictures (vout_display_t *vd)
if
(
!
res
->
p
->
p_pixels
)
if
(
!
res
->
p
->
p_pixels
)
break
;
break
;
XCB_pictures_Free
(
res
,
sys
->
conn
);
XCB_pictures_Free
(
res
->
p
->
p_pixels
);
if
(
res
->
p_sys
->
segment
)
xcb_shm_detach
(
sys
->
conn
,
res
->
p_sys
->
segment
);
}
}
picture_pool_Delete
(
sys
->
pool
);
picture_pool_Delete
(
sys
->
pool
);
sys
->
pool
=
NULL
;
sys
->
pool
=
NULL
;
...
...
modules/video_output/xcb/xvideo.c
View file @
77193c7b
...
@@ -606,7 +606,7 @@ static void Close (vlc_object_t *obj)
...
@@ -606,7 +606,7 @@ static void Close (vlc_object_t *obj)
if
(
!
res
->
p
->
p_pixels
)
if
(
!
res
->
p
->
p_pixels
)
break
;
break
;
XCB_pictures_Free
(
res
,
NULL
);
XCB_pictures_Free
(
res
->
p
->
p_pixels
);
}
}
picture_pool_Delete
(
p_sys
->
pool
);
picture_pool_Delete
(
p_sys
->
pool
);
}
}
...
@@ -670,7 +670,9 @@ static void PoolAlloc (vout_display_t *vd, unsigned requested_count)
...
@@ -670,7 +670,9 @@ static void PoolAlloc (vout_display_t *vd, unsigned requested_count)
pic_array
[
count
]
=
picture_NewFromResource
(
&
vd
->
fmt
,
res
);
pic_array
[
count
]
=
picture_NewFromResource
(
&
vd
->
fmt
,
res
);
if
(
!
pic_array
[
count
])
if
(
!
pic_array
[
count
])
{
{
XCB_pictures_Free
(
res
,
p_sys
->
conn
);
XCB_pictures_Free
(
res
->
p
->
p_pixels
);
if
(
res
->
p_sys
->
segment
)
xcb_shm_detach
(
p_sys
->
conn
,
res
->
p_sys
->
segment
);
memset
(
res
,
0
,
sizeof
(
*
res
));
memset
(
res
,
0
,
sizeof
(
*
res
));
break
;
break
;
}
}
...
...
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