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
73c96a16
Commit
73c96a16
authored
Dec 03, 2008
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed input bookmark thread safety, support and event.
parent
23eae026
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
113 additions
and
124 deletions
+113
-124
include/vlc_input.h
include/vlc_input.h
+4
-2
src/input/control.c
src/input/control.c
+56
-122
src/input/event.c
src/input/event.c
+8
-0
src/input/event.h
src/input/event.h
+6
-0
src/input/input.c
src/input/input.c
+39
-0
No files found.
include/vlc_input.h
View file @
73c96a16
...
@@ -435,7 +435,6 @@ struct input_thread_t
...
@@ -435,7 +435,6 @@ struct input_thread_t
* TODO complete the documentation.
* TODO complete the documentation.
* The read only variables are:
* The read only variables are:
* - "length"
* - "length"
* - "bookmarks"
* - "can-seek" (if you can seek, it doesn't say if 'bar display' has be shown
* - "can-seek" (if you can seek, it doesn't say if 'bar display' has be shown
* or not, for that check position != 0.0)
* or not, for that check position != 0.0)
* - "can-pause"
* - "can-pause"
...
@@ -455,7 +454,7 @@ struct input_thread_t
...
@@ -455,7 +454,7 @@ struct input_thread_t
* - chapter, next-chapter, next-chapter-prev
* - chapter, next-chapter, next-chapter-prev
* - program, audio-es, video-es, spu-es
* - program, audio-es, video-es, spu-es
* - audio-delay, spu-delay
* - audio-delay, spu-delay
* - bookmark
* - bookmark
(bookmark list)
* - record
* - record
* - frame-next
* - frame-next
* - navigation (list of "title %2i")
* - navigation (list of "title %2i")
...
@@ -560,6 +559,9 @@ typedef enum input_event_type_e
...
@@ -560,6 +559,9 @@ typedef enum input_event_type_e
/* "spu-delay" has changed */
/* "spu-delay" has changed */
INPUT_EVENT_SUBTITLE_DELAY
,
INPUT_EVENT_SUBTITLE_DELAY
,
/* "bookmark" has changed */
INPUT_EVENT_BOOKMARK
,
}
input_event_type_e
;
}
input_event_type_e
;
/** @}*/
/** @}*/
...
...
src/input/control.c
View file @
73c96a16
This diff is collapsed.
Click to expand it.
src/input/event.c
View file @
73c96a16
...
@@ -304,6 +304,14 @@ void input_SendEventVout( input_thread_t *p_input )
...
@@ -304,6 +304,14 @@ void input_SendEventVout( input_thread_t *p_input )
Trigger
(
p_input
,
INPUT_EVENT_VOUT
);
Trigger
(
p_input
,
INPUT_EVENT_VOUT
);
}
}
/*****************************************************************************
* Event for control.c/input.c
*****************************************************************************/
void
input_SendEventBookmark
(
input_thread_t
*
p_input
)
{
Trigger
(
p_input
,
INPUT_EVENT_BOOKMARK
);
}
/*****************************************************************************
/*****************************************************************************
*
*
*****************************************************************************/
*****************************************************************************/
...
...
src/input/event.h
View file @
73c96a16
...
@@ -68,5 +68,11 @@ void input_SendEventTeletext( input_thread_t *p_input, int i_id );
...
@@ -68,5 +68,11 @@ void input_SendEventTeletext( input_thread_t *p_input, int i_id );
*****************************************************************************/
*****************************************************************************/
void
input_SendEventVout
(
input_thread_t
*
p_input
);
void
input_SendEventVout
(
input_thread_t
*
p_input
);
/*****************************************************************************
* Event for control.c/input.c
*****************************************************************************/
void
input_SendEventBookmark
(
input_thread_t
*
p_input
);
#endif
#endif
src/input/input.c
View file @
73c96a16
...
@@ -2115,6 +2115,45 @@ static bool Control( input_thread_t *p_input, int i_type,
...
@@ -2115,6 +2115,45 @@ static bool Control( input_thread_t *p_input, int i_type,
break
;
break
;
case
INPUT_CONTROL_SET_BOOKMARK
:
case
INPUT_CONTROL_SET_BOOKMARK
:
{
seekpoint_t
bookmark
;
bookmark
.
i_time_offset
=
-
1
;
bookmark
.
i_byte_offset
=
-
1
;
vlc_mutex_lock
(
&
p_input
->
p
->
p_item
->
lock
);
if
(
val
.
i_int
>=
0
&&
val
.
i_int
<
p_input
->
p
->
i_bookmark
)
{
const
seekpoint_t
*
p_bookmark
=
p_input
->
p
->
pp_bookmark
[
val
.
i_int
];
bookmark
.
i_time_offset
=
p_bookmark
->
i_time_offset
;
bookmark
.
i_byte_offset
=
p_bookmark
->
i_byte_offset
;
}
vlc_mutex_unlock
(
&
p_input
->
p
->
p_item
->
lock
);
if
(
bookmark
.
i_time_offset
<
0
&&
bookmark
.
i_byte_offset
<
0
)
{
msg_Err
(
p_input
,
"invalid bookmark %d"
,
val
.
i_int
);
break
;
}
if
(
bookmark
.
i_time_offset
>=
0
)
{
val
.
i_time
=
bookmark
.
i_time_offset
;
b_force_update
=
Control
(
p_input
,
INPUT_CONTROL_SET_TIME
,
val
);
}
else
if
(
bookmark
.
i_byte_offset
>=
0
&&
p_input
->
p
->
input
.
p_stream
)
{
const
int64_t
i_size
=
stream_Size
(
p_input
->
p
->
input
.
p_stream
);
if
(
i_size
>
0
&&
bookmark
.
i_byte_offset
<=
i_size
)
{
val
.
f_float
=
(
double
)
bookmark
.
i_byte_offset
/
i_size
;
b_force_update
=
Control
(
p_input
,
INPUT_CONTROL_SET_POSITION
,
val
);
}
}
break
;
}
default:
default:
msg_Err
(
p_input
,
"not yet implemented"
);
msg_Err
(
p_input
,
"not yet implemented"
);
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