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
315f9cd4
Commit
315f9cd4
authored
Nov 22, 2004
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
all: implemented INPUT_ADD_SLAVE.
parent
8abeccdf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
92 additions
and
7 deletions
+92
-7
src/input/control.c
src/input/control.c
+12
-7
src/input/input.c
src/input/input.c
+78
-0
src/input/input_internal.h
src/input/input_internal.h
+2
-0
No files found.
src/input/control.c
View file @
315f9cd4
...
...
@@ -63,6 +63,9 @@ int input_vaControl( input_thread_t *p_input, int i_query, va_list args )
double
f
,
*
pf
;
int64_t
i_64
,
*
pi_64
;
char
*
psz
;
vlc_value_t
val
;
switch
(
i_query
)
{
case
INPUT_GET_POSITION
:
...
...
@@ -279,7 +282,6 @@ int input_vaControl( input_thread_t *p_input, int i_query, va_list args )
UpdateBookmarksOption
(
p_input
);
return
VLC_SUCCESS
;
break
;
case
INPUT_CHANGE_BOOKMARK
:
p_bkmk
=
(
seekpoint_t
*
)
va_arg
(
args
,
seekpoint_t
*
);
...
...
@@ -308,7 +310,6 @@ int input_vaControl( input_thread_t *p_input, int i_query, va_list args )
UpdateBookmarksOption
(
p_input
);
return
VLC_SUCCESS
;
break
;
case
INPUT_DEL_BOOKMARK
:
i_bkmk
=
(
int
)
va_arg
(
args
,
int
);
...
...
@@ -342,7 +343,6 @@ int input_vaControl( input_thread_t *p_input, int i_query, va_list args )
vlc_mutex_unlock
(
&
p_input
->
input
.
p_item
->
lock
);
return
VLC_EGENERIC
;
break
;
case
INPUT_GET_BOOKMARKS
:
ppp_bkmk
=
(
seekpoint_t
***
)
va_arg
(
args
,
seekpoint_t
***
);
...
...
@@ -396,7 +396,6 @@ int input_vaControl( input_thread_t *p_input, int i_query, va_list args )
UpdateBookmarksOption
(
p_input
);
return
VLC_SUCCESS
;
break
;
case
INPUT_SET_BOOKMARK
:
i_bkmk
=
(
int
)
va_arg
(
args
,
int
);
...
...
@@ -469,7 +468,6 @@ int input_vaControl( input_thread_t *p_input, int i_query, va_list args )
vlc_mutex_unlock
(
&
p_input
->
input
.
p_item
->
lock
);
return
VLC_SUCCESS
;
break
;
}
case
INPUT_GET_BYTE_POSITION
:
...
...
@@ -477,14 +475,21 @@ int input_vaControl( input_thread_t *p_input, int i_query, va_list args )
*
pi_64
=
!
p_input
->
input
.
p_stream
?
0
:
stream_Tell
(
p_input
->
input
.
p_stream
);
return
VLC_SUCCESS
;
break
;
case
INPUT_SET_BYTE_SIZE
:
pi_64
=
(
int64_t
*
)
va_arg
(
args
,
int64_t
*
);
*
pi_64
=
!
p_input
->
input
.
p_stream
?
0
:
stream_Size
(
p_input
->
input
.
p_stream
);
return
VLC_SUCCESS
;
break
;
case
INPUT_ADD_SLAVE
:
psz
=
(
char
*
)
va_arg
(
args
,
char
*
);
if
(
psz
&&
*
psz
)
{
val
.
psz_string
=
strdup
(
psz
);
input_ControlPush
(
p_input
,
INPUT_CONTROL_ADD_SLAVE
,
&
val
);
}
return
VLC_SUCCESS
;
default:
msg_Err
(
p_input
,
"unknown query in input_vaControl"
);
...
...
src/input/input.c
View file @
315f9cd4
...
...
@@ -1405,6 +1405,84 @@ static vlc_bool_t Control( input_thread_t *p_input, int i_type,
}
break
;
case
INPUT_CONTROL_ADD_SLAVE
:
if
(
val
.
psz_string
)
{
input_source_t
*
slave
=
InputSourceNew
(
p_input
);
if
(
!
InputSourceInit
(
p_input
,
slave
,
val
.
psz_string
,
NULL
)
)
{
vlc_meta_t
*
p_meta_new
=
NULL
;
vlc_meta_t
*
p_meta
;
int64_t
i_time
;
/* Add the slave */
msg_Dbg
(
p_input
,
"adding %s as slave on the fly"
,
val
.
psz_string
);
/* Set position */
if
(
demux2_Control
(
p_input
->
input
.
p_demux
,
DEMUX_GET_TIME
,
&
i_time
)
)
{
msg_Err
(
p_input
,
"demux doesn't like DEMUX_GET_TIME"
);
InputSourceClean
(
p_input
,
slave
);
free
(
slave
);
break
;
}
if
(
demux2_Control
(
slave
->
p_demux
,
DEMUX_SET_TIME
,
i_time
)
)
{
msg_Err
(
p_input
,
"seek failed for new slave"
);
InputSourceClean
(
p_input
,
slave
);
free
(
slave
);
break
;
}
/* Get meta (access and demux) */
if
(
access2_Control
(
slave
->
p_access
,
ACCESS_GET_META
,
&
p_meta_new
)
)
p_meta_new
=
NULL
;
if
(
!
demux2_Control
(
slave
->
p_demux
,
DEMUX_GET_META
,
&
p_meta
)
)
{
if
(
p_meta_new
)
{
vlc_meta_Merge
(
p_meta_new
,
p_meta
);
vlc_meta_Delete
(
p_meta
);
}
else
{
p_meta_new
=
p_meta
;
}
}
/* Update meta */
if
(
p_meta_new
)
{
if
(
p_input
->
p_meta
)
{
vlc_meta_Merge
(
p_input
->
p_meta
,
p_meta_new
);
vlc_meta_Delete
(
p_meta_new
);
}
else
{
p_input
->
p_meta
=
p_meta_new
;
}
UpdateMeta
(
p_input
);
}
TAB_APPEND
(
p_input
->
i_slave
,
p_input
->
slave
,
slave
);
}
else
{
msg_Warn
(
p_input
,
"failed to add %s as slave"
,
val
.
psz_string
);
}
free
(
val
.
psz_string
);
}
break
;
case
INPUT_CONTROL_SET_BOOKMARK
:
default:
msg_Err
(
p_input
,
"not yet implemented"
);
...
...
src/input/input_internal.h
View file @
315f9cd4
...
...
@@ -56,6 +56,8 @@ enum input_control_e
INPUT_CONTROL_SET_AUDIO_DELAY
,
INPUT_CONTROL_SET_SPU_DELAY
,
INPUT_CONTROL_ADD_SLAVE
,
};
/* Internal helpers */
...
...
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