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
e827c773
Commit
e827c773
authored
Nov 29, 2008
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improved current times in regard to es_out timeshift.
parent
1f8343b8
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
77 additions
and
39 deletions
+77
-39
src/input/es_out.c
src/input/es_out.c
+11
-0
src/input/es_out.h
src/input/es_out.h
+8
-0
src/input/es_out_timeshift.c
src/input/es_out_timeshift.c
+34
-5
src/input/event.c
src/input/event.c
+7
-6
src/input/event.h
src/input/event.h
+1
-8
src/input/input.c
src/input/input.c
+16
-20
No files found.
src/input/es_out.c
View file @
e827c773
...
...
@@ -2307,6 +2307,17 @@ static int EsOutControlLocked( es_out_t *out, int i_query, va_list args )
EsOutFrameNext
(
out
);
return
VLC_SUCCESS
;
case
ES_OUT_SET_TIMES
:
{
double
f_position
=
(
double
)
va_arg
(
args
,
double
);
mtime_t
i_time
=
(
mtime_t
)
va_arg
(
args
,
mtime_t
);
mtime_t
i_length
=
(
mtime_t
)
va_arg
(
args
,
mtime_t
);
/* TODO handle es_out buffering */
input_SendEventTimes
(
p_sys
->
p_input
,
f_position
,
i_time
,
i_length
);
return
VLC_SUCCESS
;
}
default:
msg_Err
(
p_sys
->
p_input
,
"unknown query in es_out_Control"
);
return
VLC_EGENERIC
;
...
...
src/input/es_out.h
View file @
e827c773
...
...
@@ -71,6 +71,9 @@ enum es_out_query_private_e
/* Set next frame */
ES_OUT_SET_FRAME_NEXT
,
/* res=can fail */
/* Set position/time/length */
ES_OUT_SET_TIMES
,
/* arg1=double f_position arg2=mtime_t i_time arg3=mtime_t i_length res=cannot fail */
};
static
inline
mtime_t
es_out_GetWakeup
(
es_out_t
*
p_out
)
...
...
@@ -121,6 +124,11 @@ static inline int es_out_SetFrameNext( es_out_t *p_out )
{
return
es_out_Control
(
p_out
,
ES_OUT_SET_FRAME_NEXT
);
}
static
inline
void
es_out_SetTimes
(
es_out_t
*
p_out
,
double
f_position
,
mtime_t
i_time
,
mtime_t
i_length
)
{
int
i_ret
=
es_out_Control
(
p_out
,
ES_OUT_SET_TIMES
,
f_position
,
i_time
,
i_length
);
assert
(
!
i_ret
);
}
es_out_t
*
input_EsOutNew
(
input_thread_t
*
,
int
i_rate
);
...
...
src/input/es_out_timeshift.c
View file @
e827c773
...
...
@@ -121,6 +121,13 @@ typedef struct attribute_packed
es_out_id_t
*
p_es
;
es_format_t
*
p_fmt
;
}
es_fmt
;
struct
{
/* FIXME Really too big (double make the whole thing too big) */
double
f_position
;
mtime_t
i_time
;
mtime_t
i_length
;
}
times
;
};
}
ts_cmd_control_t
;
...
...
@@ -595,6 +602,7 @@ static int ControlLocked( es_out_t *p_out, int i_query, va_list args )
case
ES_OUT_SET_ES_DEFAULT
:
case
ES_OUT_SET_ES_STATE
:
case
ES_OUT_SET_ES_FMT
:
case
ES_OUT_SET_TIMES
:
{
ts_cmd_t
cmd
;
if
(
CmdInitControl
(
&
cmd
,
i_query
,
args
,
p_sys
->
b_delayed
)
)
...
...
@@ -1377,6 +1385,17 @@ static int CmdInitControl( ts_cmd_t *p_cmd, int i_query, va_list args, bool b_co
}
break
;
}
case
ES_OUT_SET_TIMES
:
{
double
f_position
=
(
double
)
va_arg
(
args
,
double
);
mtime_t
i_time
=
(
mtime_t
)
va_arg
(
args
,
mtime_t
);
mtime_t
i_length
=
(
mtime_t
)
va_arg
(
args
,
mtime_t
);
p_cmd
->
control
.
times
.
f_position
=
f_position
;
p_cmd
->
control
.
times
.
i_time
=
i_time
;
p_cmd
->
control
.
times
.
i_length
=
i_length
;
break
;
}
default:
assert
(
0
);
...
...
@@ -1405,16 +1424,19 @@ static int CmdExecuteControl( es_out_t *p_out, ts_cmd_t *p_cmd )
return
es_out_Control
(
p_out
,
i_query
,
p_cmd
->
control
.
i_i64
);
case
ES_OUT_SET_GROUP_PCR
:
/* arg1= int i_group, arg2=int64_t i_pcr(microsecond!)*/
return
es_out_Control
(
p_out
,
i_query
,
p_cmd
->
control
.
int_i64
.
i_int
,
p_cmd
->
control
.
int_i64
.
i_i64
);
return
es_out_Control
(
p_out
,
i_query
,
p_cmd
->
control
.
int_i64
.
i_int
,
p_cmd
->
control
.
int_i64
.
i_i64
);
case
ES_OUT_RESET_PCR
:
/* no arg */
return
es_out_Control
(
p_out
,
i_query
);
case
ES_OUT_SET_GROUP_META
:
/* arg1=int i_group arg2=vlc_meta_t* */
return
es_out_Control
(
p_out
,
i_query
,
p_cmd
->
control
.
int_meta
.
i_int
,
p_cmd
->
control
.
int_meta
.
p_meta
);
return
es_out_Control
(
p_out
,
i_query
,
p_cmd
->
control
.
int_meta
.
i_int
,
p_cmd
->
control
.
int_meta
.
p_meta
);
case
ES_OUT_SET_GROUP_EPG
:
/* arg1=int i_group arg2=vlc_epg_t* */
return
es_out_Control
(
p_out
,
i_query
,
p_cmd
->
control
.
int_epg
.
i_int
,
p_cmd
->
control
.
int_epg
.
p_epg
);
return
es_out_Control
(
p_out
,
i_query
,
p_cmd
->
control
.
int_epg
.
i_int
,
p_cmd
->
control
.
int_epg
.
p_epg
);
/* Modified control */
case
ES_OUT_SET_ES
:
/* arg1= es_out_id_t* */
...
...
@@ -1423,10 +1445,17 @@ static int CmdExecuteControl( es_out_t *p_out, ts_cmd_t *p_cmd )
return
es_out_Control
(
p_out
,
i_query
,
p_cmd
->
control
.
p_es
->
p_es
);
case
ES_OUT_SET_ES_STATE
:
/* arg1= es_out_id_t* arg2=bool */
return
es_out_Control
(
p_out
,
i_query
,
p_cmd
->
control
.
es_bool
.
p_es
->
p_es
,
p_cmd
->
control
.
es_bool
.
b_bool
);
return
es_out_Control
(
p_out
,
i_query
,
p_cmd
->
control
.
es_bool
.
p_es
->
p_es
,
p_cmd
->
control
.
es_bool
.
b_bool
);
case
ES_OUT_SET_ES_FMT
:
/* arg1= es_out_id_t* arg2=es_format_t* */
return
es_out_Control
(
p_out
,
i_query
,
p_cmd
->
control
.
es_fmt
.
p_es
->
p_es
,
p_cmd
->
control
.
es_fmt
.
p_fmt
);
return
es_out_Control
(
p_out
,
i_query
,
p_cmd
->
control
.
es_fmt
.
p_es
->
p_es
,
p_cmd
->
control
.
es_fmt
.
p_fmt
);
case
ES_OUT_SET_TIMES
:
return
es_out_Control
(
p_out
,
i_query
,
p_cmd
->
control
.
times
.
f_position
,
p_cmd
->
control
.
times
.
i_time
,
p_cmd
->
control
.
times
.
i_length
);
default:
assert
(
0
);
...
...
src/input/event.c
View file @
e827c773
...
...
@@ -38,22 +38,23 @@ static void Trigger( input_thread_t *p_input, int i_type );
/*****************************************************************************
* Event for input.c
*****************************************************************************/
void
input_SendEventTimes
(
input_thread_t
*
p_input
,
const
input_event_times_t
*
p_times
)
void
input_SendEventTimes
(
input_thread_t
*
p_input
,
double
f_position
,
mtime_t
i_time
,
mtime_t
i_length
)
{
vlc_value_t
val
;
/* */
val
.
f_float
=
p_times
->
f_position
;
val
.
f_float
=
f_position
;
var_Change
(
p_input
,
"position"
,
VLC_VAR_SETVALUE
,
&
val
,
NULL
);
/* */
val
.
i_time
=
p_times
->
i_time
;
val
.
i_time
=
i_time
;
var_Change
(
p_input
,
"time"
,
VLC_VAR_SETVALUE
,
&
val
,
NULL
);
/* FIXME ugly + what about meta change event ? */
if
(
var_GetTime
(
p_input
,
"length"
)
!=
p_times
->
i_length
)
input_item_SetDuration
(
p_input
->
p
->
input
.
p_item
,
p_times
->
i_length
);
val
.
i_time
=
p_times
->
i_length
;
if
(
var_GetTime
(
p_input
,
"length"
)
!=
i_length
)
input_item_SetDuration
(
p_input
->
p
->
input
.
p_item
,
i_length
);
val
.
i_time
=
i_length
;
var_Change
(
p_input
,
"length"
,
VLC_VAR_SETVALUE
,
&
val
,
NULL
);
Trigger
(
p_input
,
INPUT_EVENT_TIMES
);
...
...
src/input/event.h
View file @
e827c773
...
...
@@ -33,14 +33,7 @@
/*****************************************************************************
* Event for input.c
*****************************************************************************/
typedef
struct
{
double
f_position
;
mtime_t
i_time
;
mtime_t
i_length
;
}
input_event_times_t
;
void
input_SendEventTimes
(
input_thread_t
*
p_input
,
const
input_event_times_t
*
p_times
);
void
input_SendEventTimes
(
input_thread_t
*
p_input
,
double
f_position
,
mtime_t
i_time
,
mtime_t
i_length
);
void
input_SendEventStatistics
(
input_thread_t
*
p_input
);
void
input_SendEventRate
(
input_thread_t
*
p_input
,
int
i_rate
);
void
input_SendEventAudioDelay
(
input_thread_t
*
p_input
,
mtime_t
i_delay
);
...
...
src/input/input.c
View file @
e827c773
...
...
@@ -644,26 +644,24 @@ static void MainLoopDemux( input_thread_t *p_input, bool *pb_changed, mtime_t *p
*/
static
void
MainLoopInterface
(
input_thread_t
*
p_input
)
{
input_event_times_t
ev
;
ev
.
f_position
=
0
.
0
;
ev
.
i_time
=
0
;
ev
.
i_length
=
0
;
double
f_position
=
0
.
0
;
mtime_t
i_time
=
0
;
mtime_t
i_length
=
0
;
/* update input status variables */
if
(
demux_Control
(
p_input
->
p
->
input
.
p_demux
,
DEMUX_GET_POSITION
,
&
ev
.
f_position
)
)
ev
.
f_position
=
0
.
0
;
DEMUX_GET_POSITION
,
&
f_position
)
)
f_position
=
0
.
0
;
if
(
demux_Control
(
p_input
->
p
->
input
.
p_demux
,
DEMUX_GET_TIME
,
&
ev
.
i_time
)
)
ev
.
i_time
=
0
;
DEMUX_GET_TIME
,
&
i_time
)
)
i_time
=
0
;
if
(
demux_Control
(
p_input
->
p
->
input
.
p_demux
,
DEMUX_GET_LENGTH
,
&
ev
.
i_length
)
)
ev
.
i_length
=
0
;
DEMUX_GET_LENGTH
,
&
i_length
)
)
i_length
=
0
;
input_SendEventTimes
(
p_input
,
&
ev
);
es_out_SetTimes
(
p_input
->
p
->
p_es_out
,
f_position
,
i_time
,
i_length
);
}
/**
...
...
@@ -1165,15 +1163,13 @@ static int Init( input_thread_t * p_input )
/* Load master infos */
/* Init length */
input_event_times_t
ev_times
;
ev_times
.
f_position
=
0
;
ev_times
.
i_time
=
0
;
mtime_t
i_length
;
if
(
demux_Control
(
p_input
->
p
->
input
.
p_demux
,
DEMUX_GET_LENGTH
,
&
ev_times
.
i_length
)
)
ev_times
.
i_length
=
0
;
if
(
ev_times
.
i_length
<=
0
)
ev_times
.
i_length
=
input_item_GetDuration
(
p_input
->
p
->
input
.
p_item
);
input_SendEventTimes
(
p_input
,
&
ev_times
);
&
i_length
)
)
i_length
=
0
;
if
(
i_length
<=
0
)
i_length
=
input_item_GetDuration
(
p_input
->
p
->
input
.
p_item
);
input_SendEventTimes
(
p_input
,
0
.
0
,
0
,
i_length
);
StartTitle
(
p_input
);
...
...
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