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
b7f9a4c0
Commit
b7f9a4c0
authored
Jul 09, 2015
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remoteosd: cleanup initialization
parent
a45052aa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
31 deletions
+22
-31
modules/video_filter/remoteosd.c
modules/video_filter/remoteosd.c
+22
-31
No files found.
modules/video_filter/remoteosd.c
View file @
b7f9a4c0
...
...
@@ -194,6 +194,8 @@ static void vnc_encrypt_bytes( unsigned char *bytes, char *passwd );
*****************************************************************************/
struct
filter_sys_t
{
vlc_mutex_t
lock
;
/* To lock for read/write on picture */
bool
b_need_update
;
/* VNC picture is updated, do update the OSD*/
uint8_t
i_alpha
;
/* alpha transparency value */
...
...
@@ -201,10 +203,6 @@ struct filter_sys_t
char
*
psz_passwd
;
/* VNC password */
bool
b_vnc_key_events
;
/* Send KeyEvents ? */
vlc_mutex_t
lock
;
/* To lock for read/write on picture */
picture_t
*
p_pic
;
/* The picture with OSD data from VNC */
int
i_socket
;
/* Socket used for VNC */
...
...
@@ -212,6 +210,7 @@ struct filter_sys_t
uint16_t
i_vnc_width
;
/* The with of the VNC screen */
uint16_t
i_vnc_height
;
/* The height of the VNC screen */
bool
b_vnc_key_events
;
/* Send KeyEvents ? */
bool
b_alpha_from_vnc
;
/* Special ffnetdev alpha feature enabled ? */
char
read_buffer
[
READ_BUFFER_SIZE
];
...
...
@@ -227,46 +226,36 @@ struct filter_sys_t
static
int
CreateFilter
(
vlc_object_t
*
p_this
)
{
filter_t
*
p_filter
=
(
filter_t
*
)
p_this
;
filter_sys_t
*
p_sys
=
NULL
;
msg_Dbg
(
p_filter
,
"Creating vnc osd filter..."
);
p_filter
->
p_sys
=
p_sys
=
calloc
(
1
,
sizeof
(
*
p_sys
)
);
if
(
!
p_filter
->
p_sys
)
filter_sys_t
*
p_sys
=
malloc
(
sizeof
(
*
p_sys
)
);
if
(
unlikely
(
p_sys
==
NULL
)
)
return
VLC_ENOMEM
;
/* Populating struct */
vlc_mutex_init
(
&
p_sys
->
lock
);
p_sys
->
i_socket
=
-
1
;
p_sys
->
b_need_update
=
false
;
p_sys
->
psz_host
=
var_InheritString
(
p_this
,
RMTOSD_CFG
"host"
);
p_sys
->
psz_passwd
=
var_InheritString
(
p_this
,
RMTOSD_CFG
"password"
);
p_sys
->
i_alpha
=
var_InheritInteger
(
p_this
,
RMTOSD_CFG
"alpha"
);
p_sys
->
p_pic
=
NULL
;
p_sys
->
i_socket
=
-
1
;
memset
(
p_sys
->
ar_color_table_yuv
,
255
,
sizeof
(
p_sys
->
ar_color_table_yuv
)
);
p_sys
->
psz_host
=
var_CreateGetString
(
p_this
,
RMTOSD_CFG
"host"
);
if
(
EMPTY_STR
(
p_sys
->
psz_host
)
)
if
(
p_sys
->
psz_host
==
NULL
)
{
msg_Err
(
p_filter
,
"unable to get vnc host"
);
goto
error
;
}
p_sys
->
psz_passwd
=
var_CreateGetString
(
p_this
,
RMTOSD_CFG
"password"
);
if
(
!
p_sys
->
psz_passwd
)
if
(
p_sys
->
psz_passwd
==
NULL
)
{
msg_Err
(
p_filter
,
"unable to get vnc password"
);
goto
error
;
}
p_sys
->
i_alpha
=
var_CreateGetIntegerCommand
(
p_this
,
RMTOSD_CFG
"alpha"
);
memset
(
p_sys
->
ar_color_table_yuv
,
255
,
sizeof
(
p_sys
->
ar_color_table_yuv
)
);
/* Keep track of OSD Events */
p_sys
->
b_need_update
=
false
;
/* Attach subpicture source callback */
p_filter
->
pf_sub_source
=
Filter
;
es_format_Init
(
&
p_filter
->
fmt_out
,
SPU_ES
,
VLC_CODEC_SPU
);
p_filter
->
fmt_out
.
i_priority
=
ES_PRIORITY_SELECTABLE_MIN
;
p_filter
->
p_sys
=
p_sys
;
vlc_gcrypt_init
();
...
...
@@ -278,6 +267,12 @@ static int CreateFilter ( vlc_object_t *p_this )
goto
error
;
}
/* Attach subpicture source callback */
p_filter
->
pf_sub_source
=
Filter
;
es_format_Init
(
&
p_filter
->
fmt_out
,
SPU_ES
,
VLC_CODEC_SPU
);
p_filter
->
fmt_out
.
i_priority
=
ES_PRIORITY_SELECTABLE_MIN
;
if
(
var_InheritBool
(
p_this
,
RMTOSD_CFG
"mouse-events"
)
)
p_filter
->
pf_sub_mouse
=
MouseEvent
;
...
...
@@ -317,10 +312,6 @@ static void DestroyFilter( vlc_object_t *p_this )
vlc_cancel
(
p_sys
->
worker_thread
);
vlc_join
(
p_sys
->
worker_thread
,
NULL
);
var_Destroy
(
p_this
,
RMTOSD_CFG
"host"
);
var_Destroy
(
p_this
,
RMTOSD_CFG
"password"
);
var_Destroy
(
p_this
,
RMTOSD_CFG
"alpha"
);
vlc_mutex_destroy
(
&
p_sys
->
lock
);
free
(
p_sys
->
psz_host
);
free
(
p_sys
->
psz_passwd
);
...
...
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