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
66f7daf3
Commit
66f7daf3
authored
Feb 08, 2001
by
Christophe Massiot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* Pause function implemented ('p' key).
parent
34337317
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
49 additions
and
12 deletions
+49
-12
include/input_ext-intf.h
include/input_ext-intf.h
+5
-3
plugins/sdl/intf_sdl.c
plugins/sdl/intf_sdl.c
+11
-2
src/input/input.c
src/input/input.c
+7
-1
src/input/input_clock.c
src/input/input_clock.c
+14
-6
src/input/input_ext-intf.c
src/input/input_ext-intf.c
+12
-0
No files found.
include/input_ext-intf.h
View file @
66f7daf3
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
* control the pace of reading.
* control the pace of reading.
*****************************************************************************
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* Copyright (C) 1999, 2000 VideoLAN
* $Id: input_ext-intf.h,v 1.1
5 2001/02/08 07:24:25 sam
Exp $
* $Id: input_ext-intf.h,v 1.1
6 2001/02/08 13:08:02 massiot
Exp $
*
*
* Authors:
* Authors:
*
*
...
@@ -158,6 +158,8 @@ typedef struct stream_descriptor_s
...
@@ -158,6 +158,8 @@ typedef struct stream_descriptor_s
/* New status and rate requested by the interface */
/* New status and rate requested by the interface */
int
i_new_status
,
i_new_rate
;
int
i_new_status
,
i_new_rate
;
vlc_cond_t
stream_wait
;
/* interface -> input in case of a
* status change request */
/* Demultiplexer data */
/* Demultiplexer data */
void
*
p_demux_data
;
void
*
p_demux_data
;
...
@@ -299,7 +301,7 @@ typedef struct input_config_s
...
@@ -299,7 +301,7 @@ typedef struct input_config_s
*****************************************************************************/
*****************************************************************************/
struct
input_thread_s
*
input_CreateThread
(
struct
playlist_item_s
*
,
struct
input_thread_s
*
input_CreateThread
(
struct
playlist_item_s
*
,
int
*
pi_status
);
int
*
pi_status
);
void
input_DestroyThread
(
struct
input_thread_s
*
,
void
input_DestroyThread
(
struct
input_thread_s
*
,
int
*
pi_status
);
int
*
pi_status
);
void
input_Play
(
struct
input_thread_s
*
);
void
input_Play
(
struct
input_thread_s
*
);
void
input_Pause
(
struct
input_thread_s
*
);
void
input_Forward
(
struct
input_thread_s
*
,
int
);
void
input_Forward
(
struct
input_thread_s
*
,
int
);
plugins/sdl/intf_sdl.c
View file @
66f7daf3
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* intf_sdl.c: SDL interface plugin
* intf_sdl.c: SDL interface plugin
*****************************************************************************
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* Copyright (C) 1999, 2000 VideoLAN
* $Id: intf_sdl.c,v 1.3
0 2001/02/08 04:43:27 sam
Exp $
* $Id: intf_sdl.c,v 1.3
1 2001/02/08 13:08:02 massiot
Exp $
*
*
* Authors:
* Authors:
*
*
...
@@ -145,13 +145,22 @@ void intf_SDLManage( intf_thread_t *p_intf )
...
@@ -145,13 +145,22 @@ void intf_SDLManage( intf_thread_t *p_intf )
/* FIXME : this is temporary */
/* FIXME : this is temporary */
case
SDLK_p
:
case
SDLK_p
:
input_Play
(
p_intf
->
p_input
);
if
(
p_intf
->
p_input
->
stream
.
control
.
i_status
==
PLAYING_S
)
{
input_Pause
(
p_intf
->
p_input
);
}
else
{
input_Play
(
p_intf
->
p_input
);
}
break
;
break
;
case
SDLK_a
:
case
SDLK_a
:
i_rate
=
p_intf
->
p_input
->
stream
.
control
.
i_rate
/
2
;
i_rate
=
p_intf
->
p_input
->
stream
.
control
.
i_rate
/
2
;
if
(
i_rate
>=
MINIMAL_RATE
)
if
(
i_rate
>=
MINIMAL_RATE
)
{
input_Forward
(
p_intf
->
p_input
,
i_rate
);
input_Forward
(
p_intf
->
p_input
,
i_rate
);
}
break
;
break
;
case
SDLK_z
:
case
SDLK_z
:
...
...
src/input/input.c
View file @
66f7daf3
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
* decoders.
* decoders.
*****************************************************************************
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: input.c,v 1.7
6 2001/02/08 07:24:25 sam
Exp $
* $Id: input.c,v 1.7
7 2001/02/08 13:08:02 massiot
Exp $
*
*
* Authors:
* Authors:
*
*
...
@@ -119,6 +119,7 @@ input_thread_t *input_CreateThread ( playlist_item_t *p_item, int *pi_status )
...
@@ -119,6 +119,7 @@ input_thread_t *input_CreateThread ( playlist_item_t *p_item, int *pi_status )
/* Create thread and set locks. */
/* Create thread and set locks. */
vlc_mutex_init
(
&
p_input
->
stream
.
stream_lock
);
vlc_mutex_init
(
&
p_input
->
stream
.
stream_lock
);
vlc_cond_init
(
&
p_input
->
stream
.
stream_wait
);
vlc_mutex_init
(
&
p_input
->
stream
.
control
.
control_lock
);
vlc_mutex_init
(
&
p_input
->
stream
.
control
.
control_lock
);
if
(
vlc_thread_create
(
&
p_input
->
thread_id
,
"input"
,
(
void
*
)
RunThread
,
if
(
vlc_thread_create
(
&
p_input
->
thread_id
,
"input"
,
(
void
*
)
RunThread
,
(
void
*
)
p_input
)
)
(
void
*
)
p_input
)
)
...
@@ -161,6 +162,11 @@ void input_DestroyThread( input_thread_t *p_input, int *pi_status )
...
@@ -161,6 +162,11 @@ void input_DestroyThread( input_thread_t *p_input, int *pi_status )
/* Request thread destruction */
/* Request thread destruction */
p_input
->
b_die
=
1
;
p_input
->
b_die
=
1
;
/* Make the thread exit of an eventual vlc_cond_wait() */
vlc_mutex_lock
(
&
p_input
->
stream
.
stream_lock
);
vlc_cond_signal
(
&
p_input
->
stream
.
stream_wait
);
vlc_mutex_unlock
(
&
p_input
->
stream
.
stream_lock
);
/* If status is NULL, wait until thread has been destroyed */
/* If status is NULL, wait until thread has been destroyed */
if
(
pi_status
==
NULL
)
if
(
pi_status
==
NULL
)
{
{
...
...
src/input/input_clock.c
View file @
66f7daf3
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* input_clock.c: Clock/System date convertions, stream management
* input_clock.c: Clock/System date convertions, stream management
*****************************************************************************
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* Copyright (C) 1999, 2000 VideoLAN
* $Id: input_clock.c,v 1.
4 2001/02/07 17:56:21
massiot Exp $
* $Id: input_clock.c,v 1.
5 2001/02/08 13:08:03
massiot Exp $
*
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
*
...
@@ -217,15 +217,23 @@ void input_ClockManageRef( input_thread_t * p_input,
...
@@ -217,15 +217,23 @@ void input_ClockManageRef( input_thread_t * p_input,
vlc_mutex_lock
(
&
p_input
->
stream
.
stream_lock
);
vlc_mutex_lock
(
&
p_input
->
stream
.
stream_lock
);
if
(
p_input
->
stream
.
i_new_status
!=
UNDEF_S
)
if
(
p_input
->
stream
.
i_new_status
!=
UNDEF_S
)
{
{
/* For the moment, only PLAYING_S and FORWARD_S are
if
(
p_input
->
stream
.
i_new_status
==
PAUSE_S
)
* supported. */
{
input_ClockNewRef
(
p_input
,
p_pgrm
,
i_clock
,
vlc_cond_wait
(
&
p_input
->
stream
.
stream_wait
,
ClockToSysdate
(
p_input
,
p_pgrm
,
i_clock
)
);
&
p_input
->
stream
.
stream_lock
);
input_ClockNewRef
(
p_input
,
p_pgrm
,
i_clock
,
mdate
()
);
}
else
{
input_ClockNewRef
(
p_input
,
p_pgrm
,
i_clock
,
ClockToSysdate
(
p_input
,
p_pgrm
,
i_clock
)
);
}
vlc_mutex_lock
(
&
p_input
->
stream
.
control
.
control_lock
);
vlc_mutex_lock
(
&
p_input
->
stream
.
control
.
control_lock
);
p_input
->
stream
.
control
.
i_status
=
p_input
->
stream
.
i_new_status
;
p_input
->
stream
.
control
.
i_status
=
p_input
->
stream
.
i_new_status
;
if
(
p_input
->
stream
.
control
.
i_status
!=
PLAYING_S
)
if
(
p_input
->
stream
.
control
.
i_status
!=
PLAYING_S
&&
p_input
->
stream
.
control
.
i_status
!=
PAUSE_S
)
{
{
p_input
->
stream
.
control
.
i_rate
=
p_input
->
stream
.
i_new_rate
;
p_input
->
stream
.
control
.
i_rate
=
p_input
->
stream
.
i_new_rate
;
p_input
->
stream
.
control
.
b_mute
=
1
;
p_input
->
stream
.
control
.
b_mute
=
1
;
...
...
src/input/input_ext-intf.c
View file @
66f7daf3
...
@@ -46,6 +46,7 @@ void input_Play( input_thread_t * p_input )
...
@@ -46,6 +46,7 @@ void input_Play( input_thread_t * p_input )
intf_Msg
(
"input: playing at normal rate"
);
intf_Msg
(
"input: playing at normal rate"
);
vlc_mutex_lock
(
&
p_input
->
stream
.
stream_lock
);
vlc_mutex_lock
(
&
p_input
->
stream
.
stream_lock
);
p_input
->
stream
.
i_new_status
=
PLAYING_S
;
p_input
->
stream
.
i_new_status
=
PLAYING_S
;
vlc_cond_signal
(
&
p_input
->
stream
.
stream_wait
);
vlc_mutex_unlock
(
&
p_input
->
stream
.
stream_lock
);
vlc_mutex_unlock
(
&
p_input
->
stream
.
stream_lock
);
}
}
...
@@ -74,6 +75,17 @@ void input_Forward( input_thread_t * p_input, int i_rate )
...
@@ -74,6 +75,17 @@ void input_Forward( input_thread_t * p_input, int i_rate )
vlc_mutex_lock
(
&
p_input
->
stream
.
stream_lock
);
vlc_mutex_lock
(
&
p_input
->
stream
.
stream_lock
);
p_input
->
stream
.
i_new_status
=
FORWARD_S
;
p_input
->
stream
.
i_new_status
=
FORWARD_S
;
p_input
->
stream
.
i_new_rate
=
i_rate
;
p_input
->
stream
.
i_new_rate
=
i_rate
;
vlc_cond_signal
(
&
p_input
->
stream
.
stream_wait
);
vlc_mutex_unlock
(
&
p_input
->
stream
.
stream_lock
);
vlc_mutex_unlock
(
&
p_input
->
stream
.
stream_lock
);
}
}
/*****************************************************************************
* input_Pause: temporarily stops the reading of the stream
*****************************************************************************/
void
input_Pause
(
input_thread_t
*
p_input
)
{
vlc_mutex_lock
(
&
p_input
->
stream
.
stream_lock
);
p_input
->
stream
.
i_new_status
=
PAUSE_S
;
vlc_cond_signal
(
&
p_input
->
stream
.
stream_wait
);
vlc_mutex_unlock
(
&
p_input
->
stream
.
stream_lock
);
}
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