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
6ae6943b
Commit
6ae6943b
authored
Mar 08, 2012
by
Hugo Beauzée-Luyssen
Committed by
Jean-Baptiste Kempf
Mar 08, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bluray: Handle mouse events
Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
70d36ebb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
1 deletion
+35
-1
modules/access/bluray.c
modules/access/bluray.c
+35
-1
No files found.
modules/access/bluray.c
View file @
6ae6943b
...
...
@@ -39,6 +39,7 @@
#include <vlc_vout.h>
/* vout_PutSubpicture / subpicture_t */
#include <libbluray/bluray.h>
#include <libbluray/keys.h>
#include <libbluray/meta_data.h>
#include <libbluray/overlay.h>
...
...
@@ -126,6 +127,9 @@ static int bluraySetTitle(demux_t *p_demux, int i_title);
static
void
blurayOverlayProc
(
void
*
ptr
,
const
BD_OVERLAY
*
const
overlay
);
static
int
onMouseEvent
(
vlc_object_t
*
p_vout
,
const
char
*
psz_var
,
vlc_value_t
old
,
vlc_value_t
val
,
void
*
p_data
);
#define FROM_TICKS(a) (a*CLOCK_FREQ / INT64_C(90000))
#define TO_TICKS(a) (a*INT64_C(90000)/CLOCK_FREQ)
#define CUR_LENGTH p_sys->pp_title[p_demux->info.i_title]->i_length
...
...
@@ -304,8 +308,11 @@ static void blurayClose( vlc_object_t *object )
assert
(
p_sys
->
bluray
);
bd_close
(
p_sys
->
bluray
);
if
(
p_sys
->
p_vout
!=
NULL
)
if
(
p_sys
->
p_vout
!=
NULL
)
{
var_DelCallback
(
p_sys
->
p_vout
,
"mouse-moved"
,
&
onMouseEvent
,
p_demux
);
var_DelCallback
(
p_sys
->
p_vout
,
"mouse-clicked"
,
&
onMouseEvent
,
p_demux
);
vlc_object_release
(
p_sys
->
p_vout
);
}
if
(
p_sys
->
p_input
!=
NULL
)
vlc_object_release
(
p_sys
->
p_input
);
if
(
p_sys
->
p_parser
)
...
...
@@ -412,6 +419,29 @@ static void subpictureUpdaterDestroy(subpicture_t *p_subpic)
vlc_gc_decref
(
p_subpic
->
updater
.
p_sys
->
p_overlay
);
}
/*****************************************************************************
* User input events:
*****************************************************************************/
static
int
onMouseEvent
(
vlc_object_t
*
p_vout
,
const
char
*
psz_var
,
vlc_value_t
old
,
vlc_value_t
val
,
void
*
p_data
)
{
demux_t
*
p_demux
=
(
demux_t
*
)
p_data
;
demux_sys_t
*
p_sys
=
p_demux
->
p_sys
;
mtime_t
now
=
mdate
();
VLC_UNUSED
(
old
);
VLC_UNUSED
(
p_vout
);
if
(
psz_var
[
6
]
==
'm'
)
//Mouse moved
bd_mouse_select
(
p_sys
->
bluray
,
now
,
val
.
coords
.
x
,
val
.
coords
.
y
);
else
if
(
psz_var
[
6
]
==
'c'
)
{
bd_mouse_select
(
p_sys
->
bluray
,
now
,
val
.
coords
.
x
,
val
.
coords
.
y
);
bd_user_input
(
p_sys
->
bluray
,
now
,
BD_VK_MOUSE_ACTIVATE
);
}
else
{
assert
(
0
);
}
return
VLC_SUCCESS
;
}
/*****************************************************************************
* libbluray overlay handling:
*****************************************************************************/
...
...
@@ -442,6 +472,8 @@ static void blurayCloseAllOverlays(demux_t *p_demux)
p_sys
->
p_overlays
[
i
]
=
NULL
;
}
}
var_DelCallback
(
p_sys
->
p_vout
,
"mouse-moved"
,
&
onMouseEvent
,
p_demux
);
var_DelCallback
(
p_sys
->
p_vout
,
"mouse-clicked"
,
&
onMouseEvent
,
p_demux
);
vlc_object_release
(
p_sys
->
p_vout
);
p_sys
->
p_vout
=
NULL
;
}
...
...
@@ -960,6 +992,8 @@ static int blurayDemux(demux_t *p_demux)
if
(
p_sys
->
p_vout
==
NULL
)
p_sys
->
p_vout
=
input_GetVout
(
p_sys
->
p_input
);
if
(
p_sys
->
p_vout
!=
NULL
)
{
var_AddCallback
(
p_sys
->
p_vout
,
"mouse-moved"
,
&
onMouseEvent
,
p_demux
);
var_AddCallback
(
p_sys
->
p_vout
,
"mouse-clicked"
,
&
onMouseEvent
,
p_demux
);
bluraySendOverlayToVout
(
p_demux
);
}
}
else
...
...
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