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
f349eef0
Commit
f349eef0
authored
Apr 17, 2013
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stream: add explicit controls for titles and seekpoints
parent
766ba5cc
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
38 additions
and
21 deletions
+38
-21
include/vlc_stream.h
include/vlc_stream.h
+5
-0
src/input/input.c
src/input/input.c
+8
-12
src/input/stream.c
src/input/stream.c
+19
-9
src/input/stream_demux.c
src/input/stream_demux.c
+3
-0
src/input/stream_memory.c
src/input/stream_memory.c
+3
-0
No files found.
include/vlc_stream.h
View file @
f349eef0
...
...
@@ -109,8 +109,13 @@ enum stream_query_e
STREAM_UPDATE_SIZE
,
/* */
STREAM_GET_TITLE_INFO
=
0x102
,
/**< arg1=input_title_t*** arg2=int* res=can fail */
STREAM_RESERVED_FOR_GET_META_DO_NOT_USE
,
STREAM_GET_CONTENT_TYPE
,
/**< arg1= char ** res=can fail */
STREAM_SET_PAUSE_STATE
=
0x200
,
/**< arg1= bool res=can fail */
STREAM_SET_TITLE
,
/**< arg1= int res=can fail */
STREAM_SET_SEEKPOINT
,
/**< arg1= int res=can fail */
/* XXX only data read through stream_Read/Block will be recorded */
STREAM_SET_RECORD_STATE
,
/**< arg1=bool, arg2=const char *psz_ext (if arg1 is true) res=can fail */
...
...
src/input/input.c
View file @
f349eef0
...
...
@@ -1920,7 +1920,7 @@ static bool Control( input_thread_t *p_input,
DEMUX_SET_TITLE
,
i_title
);
else
stream_Control
(
p_input
->
p
->
input
.
p_stream
,
STREAM_CONTROL_ACCESS
,
ACCESS
_SET_TITLE
,
i_title
);
STREAM
_SET_TITLE
,
i_title
);
input_SendEventTitle
(
p_input
,
i_title
);
break
;
}
...
...
@@ -1978,8 +1978,7 @@ static bool Control( input_thread_t *p_input,
DEMUX_SET_SEEKPOINT
,
i_seekpoint
);
else
stream_Control
(
p_input
->
p
->
input
.
p_stream
,
STREAM_CONTROL_ACCESS
,
ACCESS_SET_SEEKPOINT
,
i_seekpoint
);
STREAM_SET_SEEKPOINT
,
i_seekpoint
);
input_SendEventSeekpoint
(
p_input
,
i_title
,
i_seekpoint
);
break
;
}
...
...
@@ -2433,15 +2432,6 @@ static int InputSourceInit( input_thread_t *p_input,
/* Get infos from access */
if
(
!
p_input
->
b_preparsing
)
{
in
->
b_title_demux
=
false
;
if
(
access_Control
(
p_access
,
ACCESS_GET_TITLE_INFO
,
&
in
->
title
,
&
in
->
i_title
,
&
in
->
i_title_offset
,
&
in
->
i_seekpoint_offset
)
)
{
TAB_INIT
(
in
->
i_title
,
in
->
title
);
}
access_Control
(
p_access
,
ACCESS_GET_PTS_DELAY
,
&
i_pts_delay
);
}
...
...
@@ -2532,6 +2522,12 @@ static int InputSourceInit( input_thread_t *p_input,
stream_Control
(
in
->
p_stream
,
STREAM_CAN_SEEK
,
&
b
);
var_SetBool
(
p_input
,
"can-seek"
,
b
);
in
->
b_title_demux
=
false
;
if
(
stream_Control
(
in
->
p_stream
,
STREAM_GET_TITLE_INFO
,
&
in
->
title
,
&
in
->
i_title
,
&
in
->
i_title_offset
,
&
in
->
i_seekpoint_offset
)
)
TAB_INIT
(
in
->
i_title
,
in
->
title
);
}
in
->
p_demux
=
demux_New
(
p_input
,
p_input
,
psz_access
,
psz_demux
,
...
...
src/input/stream.c
View file @
f349eef0
...
...
@@ -549,7 +549,6 @@ static int AStreamControl( stream_t *s, int i_query, va_list args )
access_t
*
p_access
=
p_sys
->
p_access
;
uint64_t
*
pi_64
,
i_64
;
int
i_int
;
switch
(
i_query
)
{
...
...
@@ -595,32 +594,43 @@ static int AStreamControl( stream_t *s, int i_query, va_list args )
case
STREAM_CONTROL_ACCESS
:
{
i_int
=
(
int
)
va_arg
(
args
,
int
);
i
nt
i
_int
=
(
int
)
va_arg
(
args
,
int
);
if
(
i_int
!=
ACCESS_SET_PRIVATE_ID_STATE
&&
i_int
!=
ACCESS_SET_PRIVATE_ID_CA
&&
i_int
!=
ACCESS_GET_PRIVATE_ID_STATE
&&
i_int
!=
ACCESS_SET_TITLE
&&
i_int
!=
ACCESS_SET_SEEKPOINT
)
i_int
!=
ACCESS_GET_PRIVATE_ID_STATE
)
{
msg_Err
(
s
,
"Hey, what are you thinking ?"
"DON'T USE STREAM_CONTROL_ACCESS !!!"
);
return
VLC_EGENERIC
;
}
int
i_ret
=
access_vaControl
(
p_access
,
i_int
,
args
);
if
(
i_int
==
ACCESS_SET_TITLE
||
i_int
==
ACCESS_SET_SEEKPOINT
)
AStreamControlReset
(
s
);
return
i_ret
;
return
access_vaControl
(
p_access
,
i_int
,
args
);
}
case
STREAM_UPDATE_SIZE
:
AStreamControlUpdate
(
s
);
return
VLC_SUCCESS
;
case
STREAM_GET_TITLE_INFO
:
return
access_vaControl
(
p_access
,
ACCESS_GET_TITLE_INFO
,
args
);
case
STREAM_GET_CONTENT_TYPE
:
return
access_vaControl
(
p_access
,
ACCESS_GET_CONTENT_TYPE
,
args
);
case
STREAM_SET_PAUSE_STATE
:
return
access_vaControl
(
p_access
,
ACCESS_SET_PAUSE_STATE
,
args
);
case
STREAM_SET_TITLE
:
{
int
ret
=
access_vaControl
(
p_access
,
ACCESS_SET_TITLE
,
args
);
if
(
ret
==
VLC_SUCCESS
)
AStreamControlReset
(
s
);
return
ret
;
}
case
STREAM_SET_SEEKPOINT
:
{
int
ret
=
access_vaControl
(
p_access
,
ACCESS_SET_SEEKPOINT
,
args
);
if
(
ret
==
VLC_SUCCESS
)
AStreamControlReset
(
s
);
return
ret
;
}
case
STREAM_SET_RECORD_STATE
:
default:
...
...
src/input/stream_demux.c
View file @
f349eef0
...
...
@@ -297,8 +297,11 @@ static int DStreamControl( stream_t *s, int i_query, va_list args )
}
case
STREAM_CONTROL_ACCESS
:
case
STREAM_GET_TITLE_INFO
:
case
STREAM_GET_CONTENT_TYPE
:
case
STREAM_SET_PAUSE_STATE
:
case
STREAM_SET_TITLE
:
case
STREAM_SET_SEEKPOINT
:
case
STREAM_SET_RECORD_STATE
:
return
VLC_EGENERIC
;
...
...
src/input/stream_memory.c
View file @
f349eef0
...
...
@@ -122,7 +122,10 @@ static int Control( stream_t *s, int i_query, va_list args )
p_sys
->
i_pos
=
i_64
;
break
;
case
STREAM_GET_TITLE_INFO
:
case
STREAM_GET_CONTENT_TYPE
:
case
STREAM_SET_TITLE
:
case
STREAM_SET_SEEKPOINT
:
return
VLC_EGENERIC
;
case
STREAM_SET_PAUSE_STATE
:
...
...
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