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
c136bb81
Commit
c136bb81
authored
Oct 13, 2008
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added control code for "frame-next" variable.
It is ignored.
parent
e2fb80c6
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
126 additions
and
47 deletions
+126
-47
src/input/es_out.c
src/input/es_out.c
+32
-0
src/input/es_out.h
src/input/es_out.h
+1
-0
src/input/input.c
src/input/input.c
+73
-47
src/input/input_internal.h
src/input/input_internal.h
+2
-0
src/input/var.c
src/input/var.c
+18
-0
No files found.
src/input/es_out.c
View file @
c136bb81
...
@@ -544,6 +544,38 @@ bool input_EsOutIsBuffering( es_out_t *out )
...
@@ -544,6 +544,38 @@ bool input_EsOutIsBuffering( es_out_t *out )
{
{
return
out
->
p_sys
->
b_buffering
;
return
out
->
p_sys
->
b_buffering
;
}
}
void
input_EsOutFrameNext
(
es_out_t
*
out
)
{
es_out_sys_t
*
p_sys
=
out
->
p_sys
;
es_out_id_t
*
p_es_video
=
NULL
;
for
(
int
i
=
0
;
i
<
p_sys
->
i_es
;
i
++
)
{
es_out_id_t
*
p_es
=
p_sys
->
es
[
i
];
if
(
p_es
->
fmt
.
i_cat
==
VIDEO_ES
&&
p_es
->
p_dec
)
{
p_es_video
=
p_es
;
break
;
}
}
if
(
!
p_es_video
)
{
msg_Warn
(
p_sys
->
p_input
,
"No video track selected, ignoring 'frame next'"
);
return
;
}
#if 0
input_DecoderFrameNext( p_es_video->p_dec );
if( !p_sys->b_buffering )
{
TODO();
}
#endif
msg_Err
(
out
->
p_sys
->
p_input
,
"TODO input_EsOutFrameNext"
);
}
/*****************************************************************************
/*****************************************************************************
*
*
...
...
src/input/es_out.h
View file @
c136bb81
...
@@ -42,5 +42,6 @@ void input_EsOutChangePause( es_out_t *, bool b_paused, mtime_t i_date );
...
@@ -42,5 +42,6 @@ void input_EsOutChangePause( es_out_t *, bool b_paused, mtime_t i_date );
void
input_EsOutChangePosition
(
es_out_t
*
);
void
input_EsOutChangePosition
(
es_out_t
*
);
bool
input_EsOutDecodersIsEmpty
(
es_out_t
*
);
bool
input_EsOutDecodersIsEmpty
(
es_out_t
*
);
bool
input_EsOutIsBuffering
(
es_out_t
*
);
bool
input_EsOutIsBuffering
(
es_out_t
*
);
void
input_EsOutFrameNext
(
es_out_t
*
);
#endif
#endif
src/input/input.c
View file @
c136bb81
...
@@ -1485,6 +1485,58 @@ static void ControlReduce( input_thread_t *p_input )
...
@@ -1485,6 +1485,58 @@ static void ControlReduce( input_thread_t *p_input )
}
}
}
}
}
}
/* Pause input */
static
void
ControlPause
(
input_thread_t
*
p_input
,
mtime_t
i_control_date
)
{
int
i_ret
;
int
i_state
;
if
(
p_input
->
p
->
input
.
p_access
)
i_ret
=
access_Control
(
p_input
->
p
->
input
.
p_access
,
ACCESS_SET_PAUSE_STATE
,
true
);
else
i_ret
=
demux_Control
(
p_input
->
p
->
input
.
p_demux
,
DEMUX_SET_PAUSE_STATE
,
true
);
i_state
=
PAUSE_S
;
if
(
i_ret
)
{
msg_Warn
(
p_input
,
"cannot set pause state"
);
i_state
=
p_input
->
i_state
;
}
/* Switch to new state */
input_ChangeStateWithVarCallback
(
p_input
,
i_state
,
false
);
/* */
if
(
!
i_ret
)
input_EsOutChangePause
(
p_input
->
p
->
p_es_out
,
true
,
i_control_date
);
}
static
void
ControlUnpause
(
input_thread_t
*
p_input
,
mtime_t
i_control_date
)
{
int
i_ret
;
if
(
p_input
->
p
->
input
.
p_access
)
i_ret
=
access_Control
(
p_input
->
p
->
input
.
p_access
,
ACCESS_SET_PAUSE_STATE
,
false
);
else
i_ret
=
demux_Control
(
p_input
->
p
->
input
.
p_demux
,
DEMUX_SET_PAUSE_STATE
,
false
);
if
(
i_ret
)
{
/* FIXME What to do ? */
msg_Warn
(
p_input
,
"cannot unset pause -> EOF"
);
vlc_mutex_unlock
(
&
p_input
->
p
->
lock_control
);
input_ControlPush
(
p_input
,
INPUT_CONTROL_SET_DIE
,
NULL
);
vlc_mutex_lock
(
&
p_input
->
p
->
lock_control
);
}
/* Switch to play */
input_ChangeStateWithVarCallback
(
p_input
,
PLAYING_S
,
false
);
/* */
if
(
!
i_ret
)
input_EsOutChangePause
(
p_input
->
p
->
p_es_out
,
false
,
i_control_date
);
}
static
bool
Control
(
input_thread_t
*
p_input
,
int
i_type
,
static
bool
Control
(
input_thread_t
*
p_input
,
int
i_type
,
vlc_value_t
val
)
vlc_value_t
val
)
...
@@ -1608,61 +1660,16 @@ static bool Control( input_thread_t *p_input, int i_type,
...
@@ -1608,61 +1660,16 @@ static bool Control( input_thread_t *p_input, int i_type,
if
(
(
val
.
i_int
==
PLAYING_S
&&
p_input
->
i_state
==
PAUSE_S
)
||
if
(
(
val
.
i_int
==
PLAYING_S
&&
p_input
->
i_state
==
PAUSE_S
)
||
(
val
.
i_int
==
PAUSE_S
&&
p_input
->
i_state
==
PAUSE_S
)
)
(
val
.
i_int
==
PAUSE_S
&&
p_input
->
i_state
==
PAUSE_S
)
)
{
{
int
i_ret
;
ControlUnpause
(
p_input
,
i_control_date
);
if
(
p_input
->
p
->
input
.
p_access
)
i_ret
=
access_Control
(
p_input
->
p
->
input
.
p_access
,
ACCESS_SET_PAUSE_STATE
,
false
);
else
i_ret
=
demux_Control
(
p_input
->
p
->
input
.
p_demux
,
DEMUX_SET_PAUSE_STATE
,
false
);
if
(
i_ret
)
{
/* FIXME What to do ? */
msg_Warn
(
p_input
,
"cannot unset pause -> EOF"
);
vlc_mutex_unlock
(
&
p_input
->
p
->
lock_control
);
input_ControlPush
(
p_input
,
INPUT_CONTROL_SET_DIE
,
NULL
);
vlc_mutex_lock
(
&
p_input
->
p
->
lock_control
);
}
b_force_update
=
true
;
b_force_update
=
true
;
/* Switch to play */
input_ChangeStateWithVarCallback
(
p_input
,
PLAYING_S
,
false
);
/* */
if
(
!
i_ret
)
input_EsOutChangePause
(
p_input
->
p
->
p_es_out
,
false
,
i_control_date
);
}
}
else
if
(
val
.
i_int
==
PAUSE_S
&&
p_input
->
i_state
==
PLAYING_S
&&
else
if
(
val
.
i_int
==
PAUSE_S
&&
p_input
->
i_state
==
PLAYING_S
&&
p_input
->
p
->
b_can_pause
)
p_input
->
p
->
b_can_pause
)
{
{
int
i_ret
,
state
;
ControlPause
(
p_input
,
i_control_date
);
if
(
p_input
->
p
->
input
.
p_access
)
i_ret
=
access_Control
(
p_input
->
p
->
input
.
p_access
,
ACCESS_SET_PAUSE_STATE
,
true
);
else
i_ret
=
demux_Control
(
p_input
->
p
->
input
.
p_demux
,
DEMUX_SET_PAUSE_STATE
,
true
);
b_force_update
=
true
;
b_force_update
=
true
;
if
(
i_ret
)
{
msg_Warn
(
p_input
,
"cannot set pause state"
);
state
=
p_input
->
i_state
;
}
else
{
state
=
PAUSE_S
;
}
/* Switch to new state */
input_ChangeStateWithVarCallback
(
p_input
,
state
,
false
);
/* */
if
(
!
i_ret
)
input_EsOutChangePause
(
p_input
->
p
->
p_es_out
,
true
,
i_control_date
);
}
}
else
if
(
val
.
i_int
==
PAUSE_S
&&
!
p_input
->
p
->
b_can_pause
)
else
if
(
val
.
i_int
==
PAUSE_S
&&
!
p_input
->
p
->
b_can_pause
)
{
{
...
@@ -2031,6 +2038,25 @@ static bool Control( input_thread_t *p_input, int i_type,
...
@@ -2031,6 +2038,25 @@ static bool Control( input_thread_t *p_input, int i_type,
}
}
break
;
break
;
case
INPUT_CONTROL_SET_FRAME_NEXT
:
if
(
!
p_input
->
p
->
b_can_pause
)
break
;
if
(
p_input
->
i_state
==
PAUSE_S
)
{
input_EsOutFrameNext
(
p_input
->
p
->
p_es_out
);
}
else
if
(
p_input
->
i_state
==
PLAYING_S
)
{
ControlPause
(
p_input
,
i_control_date
);
}
else
{
msg_Err
(
p_input
,
"invalid state for frame next"
);
}
b_force_update
=
true
;
break
;
case
INPUT_CONTROL_SET_BOOKMARK
:
case
INPUT_CONTROL_SET_BOOKMARK
:
default:
default:
msg_Err
(
p_input
,
"not yet implemented"
);
msg_Err
(
p_input
,
"not yet implemented"
);
...
...
src/input/input_internal.h
View file @
c136bb81
...
@@ -193,6 +193,8 @@ enum input_control_e
...
@@ -193,6 +193,8 @@ enum input_control_e
INPUT_CONTROL_ADD_SUBTITLE
,
INPUT_CONTROL_ADD_SUBTITLE
,
INPUT_CONTROL_SET_RECORD_STATE
,
INPUT_CONTROL_SET_RECORD_STATE
,
INPUT_CONTROL_SET_FRAME_NEXT
,
};
};
/* Internal helpers */
/* Internal helpers */
...
...
src/input/var.c
View file @
c136bb81
...
@@ -64,6 +64,9 @@ static int BookmarkCallback( vlc_object_t *p_this, char const *psz_cmd,
...
@@ -64,6 +64,9 @@ static int BookmarkCallback( vlc_object_t *p_this, char const *psz_cmd,
static
int
RecordCallback
(
vlc_object_t
*
p_this
,
char
const
*
psz_cmd
,
static
int
RecordCallback
(
vlc_object_t
*
p_this
,
char
const
*
psz_cmd
,
vlc_value_t
oldval
,
vlc_value_t
newval
,
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
p_data
);
void
*
p_data
);
static
int
FrameNextCallback
(
vlc_object_t
*
p_this
,
char
const
*
psz_cmd
,
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
p_data
);
typedef
struct
typedef
struct
{
{
...
@@ -98,6 +101,7 @@ static const vlc_input_callback_t p_input_callbacks[] =
...
@@ -98,6 +101,7 @@ static const vlc_input_callback_t p_input_callbacks[] =
CALLBACK
(
"audio-es"
,
ESCallback
),
CALLBACK
(
"audio-es"
,
ESCallback
),
CALLBACK
(
"spu-es"
,
ESCallback
),
CALLBACK
(
"spu-es"
,
ESCallback
),
CALLBACK
(
"record"
,
RecordCallback
),
CALLBACK
(
"record"
,
RecordCallback
),
CALLBACK
(
"frame-next"
,
FrameNextCallback
),
CALLBACK
(
NULL
,
NULL
)
CALLBACK
(
NULL
,
NULL
)
};
};
...
@@ -139,6 +143,8 @@ void input_ControlVarInit ( input_thread_t *p_input )
...
@@ -139,6 +143,8 @@ void input_ControlVarInit ( input_thread_t *p_input )
var_Create
(
p_input
,
"rate-faster"
,
VLC_VAR_VOID
);
var_Create
(
p_input
,
"rate-faster"
,
VLC_VAR_VOID
);
var_Create
(
p_input
,
"frame-next"
,
VLC_VAR_VOID
);
/* Position */
/* Position */
var_Create
(
p_input
,
"position"
,
VLC_VAR_FLOAT
);
var_Create
(
p_input
,
"position"
,
VLC_VAR_FLOAT
);
var_Create
(
p_input
,
"position-offset"
,
VLC_VAR_FLOAT
);
var_Create
(
p_input
,
"position-offset"
,
VLC_VAR_FLOAT
);
...
@@ -806,3 +812,15 @@ static int RecordCallback( vlc_object_t *p_this, char const *psz_cmd,
...
@@ -806,3 +812,15 @@ static int RecordCallback( vlc_object_t *p_this, char const *psz_cmd,
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
}
}
static
int
FrameNextCallback
(
vlc_object_t
*
p_this
,
char
const
*
psz_cmd
,
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
p_data
)
{
input_thread_t
*
p_input
=
(
input_thread_t
*
)
p_this
;
VLC_UNUSED
(
psz_cmd
);
VLC_UNUSED
(
oldval
);
VLC_UNUSED
(
p_data
);
input_ControlPush
(
p_input
,
INPUT_CONTROL_SET_FRAME_NEXT
,
NULL
);
return
VLC_SUCCESS
;
}
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