Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
21e8f62d
Commit
21e8f62d
authored
Mar 04, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
XCB: use pf_render for image conversion (instead of pf_display)
parent
677088de
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
19 deletions
+27
-19
modules/video_output/xcb/xcb.c
modules/video_output/xcb/xcb.c
+27
-19
No files found.
modules/video_output/xcb/xcb.c
View file @
21e8f62d
...
@@ -88,6 +88,7 @@ struct vout_sys_t
...
@@ -88,6 +88,7 @@ struct vout_sys_t
static
int
Init
(
vout_thread_t
*
);
static
int
Init
(
vout_thread_t
*
);
static
void
Deinit
(
vout_thread_t
*
);
static
void
Deinit
(
vout_thread_t
*
);
static
void
Render
(
vout_thread_t
*
,
picture_t
*
);
static
void
Display
(
vout_thread_t
*
,
picture_t
*
);
static
void
Display
(
vout_thread_t
*
,
picture_t
*
);
static
int
Manage
(
vout_thread_t
*
);
static
int
Manage
(
vout_thread_t
*
);
...
@@ -234,6 +235,7 @@ static int Open (vlc_object_t *obj)
...
@@ -234,6 +235,7 @@ static int Open (vlc_object_t *obj)
vout
->
pf_init
=
Init
;
vout
->
pf_init
=
Init
;
vout
->
pf_end
=
Deinit
;
vout
->
pf_end
=
Deinit
;
vout
->
pf_render
=
Render
;
vout
->
pf_display
=
Display
;
vout
->
pf_display
=
Display
;
vout
->
pf_manage
=
Manage
;
vout
->
pf_manage
=
Manage
;
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
...
@@ -261,9 +263,10 @@ static void Close (vlc_object_t *obj)
...
@@ -261,9 +263,10 @@ static void Close (vlc_object_t *obj)
struct
picture_sys_t
struct
picture_sys_t
{
{
xcb_connection_t
*
conn
;
xcb_connection_t
*
conn
;
/* Shared connection to X server */
xcb_image_t
*
image
;
xcb_image_t
*
image
;
/* Picture buffer */
xcb_shm_seg_t
segment
;
xcb_image_t
*
native
;
/* Rendered picture buffer (in X server format) */
xcb_shm_seg_t
segment
;
/* Shared memory segment X ID */
};
};
static
void
PictureRelease
(
picture_t
*
pic
);
static
void
PictureRelease
(
picture_t
*
pic
);
...
@@ -345,14 +348,11 @@ static int PictureInit (vout_thread_t *vout, picture_t *pic)
...
@@ -345,14 +348,11 @@ static int PictureInit (vout_thread_t *vout, picture_t *pic)
goto
error
;
goto
error
;
}
}
if
(
shm
!=
SHM_ERR
&&
xcb_image_native
(
p_sys
->
conn
,
img
,
0
)
==
NULL
)
if
(
shm
!=
SHM_ERR
&&
xcb_image_native
(
p_sys
->
conn
,
img
,
0
)
==
NULL
)
{
msg_Warn
(
vout
,
"incompatible X server image format"
);
msg_Err
(
vout
,
"incompatible X server image format"
);
xcb_image_destroy
(
img
);
goto
error
;
}
priv
->
conn
=
p_sys
->
conn
;
priv
->
conn
=
p_sys
->
conn
;
priv
->
image
=
img
;
priv
->
image
=
img
;
priv
->
native
=
NULL
;
pic
->
p_sys
=
priv
;
pic
->
p_sys
=
priv
;
pic
->
p
->
p_pixels
=
img
->
data
;
pic
->
p
->
p_pixels
=
img
->
data
;
pic
->
pf_release
=
(
shm
!=
SHM_ERR
)
?
PictureShmRelease
pic
->
pf_release
=
(
shm
!=
SHM_ERR
)
?
PictureShmRelease
...
@@ -376,6 +376,8 @@ static void PictureRelease (picture_t *pic)
...
@@ -376,6 +376,8 @@ static void PictureRelease (picture_t *pic)
{
{
struct
picture_sys_t
*
p_sys
=
pic
->
p_sys
;
struct
picture_sys_t
*
p_sys
=
pic
->
p_sys
;
if
((
p_sys
->
native
!=
NULL
)
&&
(
p_sys
->
native
!=
p_sys
->
image
))
xcb_image_destroy
(
p_sys
->
native
);
xcb_image_destroy
(
p_sys
->
image
);
xcb_image_destroy
(
p_sys
->
image
);
free
(
p_sys
);
free
(
p_sys
);
}
}
...
@@ -506,6 +508,20 @@ static void Deinit (vout_thread_t *vout)
...
@@ -506,6 +508,20 @@ static void Deinit (vout_thread_t *vout)
p_sys
->
embed
=
NULL
;
p_sys
->
embed
=
NULL
;
}
}
/**
* Prepares an image ahead of display.
*/
static
void
Render
(
vout_thread_t
*
vout
,
picture_t
*
pic
)
{
vout_sys_t
*
p_sys
=
vout
->
p_sys
;
picture_sys_t
*
priv
=
pic
->
p_sys
;
if
((
priv
->
native
!=
NULL
)
&&
(
priv
->
native
!=
priv
->
image
))
xcb_image_destroy
(
priv
->
native
);
priv
->
native
=
xcb_image_native
(
p_sys
->
conn
,
priv
->
image
,
1
);
}
/**
/**
* Sends an image to the X server.
* Sends an image to the X server.
*/
*/
...
@@ -513,9 +529,9 @@ static void Display (vout_thread_t *vout, picture_t *pic)
...
@@ -513,9 +529,9 @@ static void Display (vout_thread_t *vout, picture_t *pic)
{
{
vout_sys_t
*
p_sys
=
vout
->
p_sys
;
vout_sys_t
*
p_sys
=
vout
->
p_sys
;
picture_sys_t
*
priv
=
pic
->
p_sys
;
picture_sys_t
*
priv
=
pic
->
p_sys
;
xcb_image_t
*
img
=
priv
->
image
;
xcb_image_t
*
img
=
priv
->
image
,
*
native
=
priv
->
native
;
if
(
img
->
base
==
NULL
)
if
(
(
native
==
img
)
&&
(
img
->
base
==
NULL
)
)
{
{
xcb_shm_segment_info_t
info
=
{
xcb_shm_segment_info_t
info
=
{
.
shmseg
=
priv
->
segment
,
.
shmseg
=
priv
->
segment
,
...
@@ -527,16 +543,8 @@ static void Display (vout_thread_t *vout, picture_t *pic)
...
@@ -527,16 +543,8 @@ static void Display (vout_thread_t *vout, picture_t *pic)
0
,
0
,
0
,
0
,
img
->
width
,
img
->
height
,
0
);
0
,
0
,
0
,
0
,
img
->
width
,
img
->
height
,
0
);
}
}
else
else
{
if
(
native
!=
NULL
)
xcb_image_t
*
native
=
xcb_image_native
(
p_sys
->
conn
,
img
,
1
);
if
(
native
==
NULL
)
return
;
xcb_image_put
(
p_sys
->
conn
,
p_sys
->
window
,
p_sys
->
gc
,
native
,
0
,
0
,
0
);
xcb_image_put
(
p_sys
->
conn
,
p_sys
->
window
,
p_sys
->
gc
,
native
,
0
,
0
,
0
);
if
(
native
!=
img
)
xcb_image_destroy
(
native
);
}
xcb_flush
(
p_sys
->
conn
);
xcb_flush
(
p_sys
->
conn
);
}
}
...
...
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