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
1b025556
Commit
1b025556
authored
Aug 28, 2008
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a INPUT_CONTROL_RESTART_ES and use it in video_output.
This removes the need for suxor_thread_t.
parent
f259d0a2
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
56 additions
and
84 deletions
+56
-84
include/vlc_es_out.h
include/vlc_es_out.h
+1
-0
include/vlc_input.h
include/vlc_input.h
+3
-0
include/vlc_plugin.h
include/vlc_plugin.h
+2
-2
src/input/control.c
src/input/control.c
+5
-0
src/input/es_out.c
src/input/es_out.c
+37
-37
src/input/input.c
src/input/input.c
+6
-2
src/input/input_internal.h
src/input/input_internal.h
+1
-0
src/video_output/video_output.c
src/video_output/video_output.c
+1
-43
No files found.
include/vlc_es_out.h
View file @
1b025556
...
...
@@ -55,6 +55,7 @@ enum es_out_query_e
/* set ES selected for the es category (audio/video/spu) */
ES_OUT_SET_ES
,
/* arg1= es_out_id_t* */
ES_OUT_RESTART_ES
,
/* arg1= es_out_id_t* */
/* set 'default' tag on ES (copied across from container) */
ES_OUT_SET_DEFAULT
,
/* arg1= es_out_id_t* */
...
...
include/vlc_input.h
View file @
1b025556
...
...
@@ -529,6 +529,9 @@ enum input_query_e
/* On the fly record while playing */
INPUT_SET_RECORD_STATE
,
/* arg1=bool res=can fail */
INPUT_GET_RECORD_STATE
,
/* arg1=bool* res=can fail */
/* ES */
INPUT_RESTART_ES
,
/* arg1=int (-AUDIO/VIDEO/SPU_ES for the whole category) */
};
VLC_EXPORT
(
int
,
input_vaControl
,(
input_thread_t
*
,
int
i_query
,
va_list
)
);
...
...
include/vlc_plugin.h
View file @
1b025556
...
...
@@ -39,8 +39,8 @@
/**
* Current plugin ABI version
*/
# define MODULE_SYMBOL 1_0_0
a
# define MODULE_SUFFIX "__1_0_0
a
"
# define MODULE_SYMBOL 1_0_0
b
# define MODULE_SUFFIX "__1_0_0
b
"
/*****************************************************************************
* Add a few defines. You do not want to read this section. Really.
...
...
src/input/control.c
View file @
1b025556
...
...
@@ -609,6 +609,11 @@ int input_vaControl( input_thread_t *p_input, int i_query, va_list args )
*
pb_bool
=
var_GetBool
(
p_input
,
"record"
);
return
VLC_SUCCESS
;
case
INPUT_RESTART_ES
:
val
.
i_int
=
(
int
)
va_arg
(
args
,
int
);
input_ControlPush
(
p_input
,
INPUT_CONTROL_RESTART_ES
,
&
val
);
return
VLC_SUCCESS
;
default:
msg_Err
(
p_input
,
"unknown query in input_vaControl"
);
return
VLC_EGENERIC
;
...
...
src/input/es_out.c
View file @
1b025556
...
...
@@ -1769,50 +1769,26 @@ static int EsOutControl( es_out_t *out, int i_query, va_list args )
return
VLC_SUCCESS
;
case
ES_OUT_SET_ES
:
case
ES_OUT_RESTART_ES
:
{
int
i_cat
;
es
=
(
es_out_id_t
*
)
va_arg
(
args
,
es_out_id_t
*
);
/* Special case NULL, NULL+i_cat */
if
(
es
==
NULL
)
{
for
(
i
=
0
;
i
<
p_sys
->
i_es
;
i
++
)
{
if
(
EsIsSelected
(
p_sys
->
es
[
i
]
)
)
EsUnselect
(
out
,
p_sys
->
es
[
i
],
p_sys
->
es
[
i
]
->
p_pgrm
==
p_sys
->
p_pgrm
);
}
}
i_cat
=
UNKNOWN_ES
;
else
if
(
es
==
(
es_out_id_t
*
)((
uint8_t
*
)
NULL
+
AUDIO_ES
)
)
{
for
(
i
=
0
;
i
<
p_sys
->
i_es
;
i
++
)
{
if
(
p_sys
->
es
[
i
]
->
fmt
.
i_cat
==
AUDIO_ES
&&
EsIsSelected
(
p_sys
->
es
[
i
]
)
)
EsUnselect
(
out
,
p_sys
->
es
[
i
],
p_sys
->
es
[
i
]
->
p_pgrm
==
p_sys
->
p_pgrm
);
}
}
i_cat
=
AUDIO_ES
;
else
if
(
es
==
(
es_out_id_t
*
)((
uint8_t
*
)
NULL
+
VIDEO_ES
)
)
{
for
(
i
=
0
;
i
<
p_sys
->
i_es
;
i
++
)
{
if
(
p_sys
->
es
[
i
]
->
fmt
.
i_cat
==
VIDEO_ES
&&
EsIsSelected
(
p_sys
->
es
[
i
]
)
)
EsUnselect
(
out
,
p_sys
->
es
[
i
],
p_sys
->
es
[
i
]
->
p_pgrm
==
p_sys
->
p_pgrm
);
}
}
i_cat
=
VIDEO_ES
;
else
if
(
es
==
(
es_out_id_t
*
)((
uint8_t
*
)
NULL
+
SPU_ES
)
)
{
for
(
i
=
0
;
i
<
p_sys
->
i_es
;
i
++
)
{
if
(
p_sys
->
es
[
i
]
->
fmt
.
i_cat
==
SPU_ES
&&
EsIsSelected
(
p_sys
->
es
[
i
]
)
)
EsUnselect
(
out
,
p_sys
->
es
[
i
],
p_sys
->
es
[
i
]
->
p_pgrm
==
p_sys
->
p_pgrm
);
}
}
i_cat
=
SPU_ES
;
else
i_cat
=
-
1
;
for
(
i
=
0
;
i
<
p_sys
->
i_es
;
i
++
)
{
for
(
i
=
0
;
i
<
p_sys
->
i_es
;
i
++
)
if
(
i_cat
==
-
1
)
{
if
(
es
==
p_sys
->
es
[
i
]
)
{
...
...
@@ -1820,13 +1796,37 @@ static int EsOutControl( es_out_t *out, int i_query, va_list args )
break
;
}
}
else
{
if
(
i_cat
==
UNKNOWN_ES
||
p_sys
->
es
[
i
]
->
fmt
.
i_cat
==
i_cat
)
{
if
(
EsIsSelected
(
p_sys
->
es
[
i
]
)
)
{
if
(
i_query
==
ES_OUT_RESTART_ES
)
{
if
(
p_sys
->
es
[
i
]
->
p_dec
)
{
EsDestroyDecoder
(
out
,
p_sys
->
es
[
i
]
);
EsCreateDecoder
(
out
,
p_sys
->
es
[
i
]
);
}
}
else
{
EsUnselect
(
out
,
p_sys
->
es
[
i
],
p_sys
->
es
[
i
]
->
p_pgrm
==
p_sys
->
p_pgrm
);
}
}
}
}
}
if
(
i_query
==
ES_OUT_SET_ES
)
{
vlc_event_t
event
;
event
.
type
=
vlc_InputSelectedStreamChanged
;
vlc_event_send
(
&
p_sys
->
p_input
->
p
->
event_manager
,
&
event
);
}
return
VLC_SUCCESS
;
}
case
ES_OUT_SET_DEFAULT
:
{
...
...
src/input/input.c
View file @
1b025556
...
...
@@ -1747,8 +1747,12 @@ static bool Control( input_thread_t *p_input, int i_type,
case
INPUT_CONTROL_SET_ES
:
/* No need to force update, es_out does it if needed */
es_out_Control
(
p_input
->
p
->
p_es_out
,
ES_OUT_SET_ES
,
input_EsOutGetFromID
(
p_input
->
p
->
p_es_out
,
val
.
i_int
)
);
input_EsOutGetFromID
(
p_input
->
p
->
p_es_out
,
val
.
i_int
)
);
break
;
case
INPUT_CONTROL_RESTART_ES
:
es_out_Control
(
p_input
->
p
->
p_es_out
,
ES_OUT_RESTART_ES
,
input_EsOutGetFromID
(
p_input
->
p
->
p_es_out
,
val
.
i_int
)
);
break
;
case
INPUT_CONTROL_SET_AUDIO_DELAY
:
...
...
src/input/input_internal.h
View file @
1b025556
...
...
@@ -189,6 +189,7 @@ enum input_control_e
INPUT_CONTROL_SET_BOOKMARK
,
INPUT_CONTROL_SET_ES
,
INPUT_CONTROL_RESTART_ES
,
INPUT_CONTROL_SET_AUDIO_DELAY
,
INPUT_CONTROL_SET_SPU_DELAY
,
...
...
src/video_output/video_output.c
View file @
1b025556
...
...
@@ -1370,35 +1370,6 @@ static void PictureHeapFixRgb( picture_heap_t *p_heap )
VideoFormatExportRgb
(
&
fmt
,
p_heap
);
}
/*****************************************************************************
* Helper thread for object variables callbacks.
* Only used to avoid deadlocks when using the video embedded mode.
*****************************************************************************/
typedef
struct
suxor_thread_t
{
VLC_COMMON_MEMBERS
input_thread_t
*
p_input
;
}
suxor_thread_t
;
static
void
*
SuxorRestartVideoES
(
vlc_object_t
*
p_vlc_t
)
{
suxor_thread_t
*
p_this
=
(
suxor_thread_t
*
)
p_vlc_t
;
int
canc
=
vlc_savecancel
();
/* Now restart current video stream */
int
val
=
var_GetInteger
(
p_this
->
p_input
,
"video-es"
);
if
(
val
>=
0
)
{
var_SetInteger
(
p_this
->
p_input
,
"video-es"
,
-
VIDEO_ES
);
var_SetInteger
(
p_this
->
p_input
,
"video-es"
,
val
);
}
vlc_object_release
(
p_this
->
p_input
);
vlc_object_release
(
p_this
);
vlc_restorecancel
(
canc
);
return
NULL
;
}
/*****************************************************************************
* object variables callbacks: a bunch of object variables are used by the
* interfaces to interact with the vout.
...
...
@@ -1484,20 +1455,7 @@ static int FilterCallback( vlc_object_t *p_this, char const *psz_cmd,
var_Set
(
p_input
,
"vout-filter"
,
val
);
/* Now restart current video stream */
var_Get
(
p_input
,
"video-es"
,
&
val
);
if
(
val
.
i_int
>=
0
)
{
static
const
char
typename
[]
=
"kludge"
;
suxor_thread_t
*
p_suxor
=
vlc_custom_create
(
p_vout
,
sizeof
(
suxor_thread_t
),
VLC_OBJECT_GENERIC
,
typename
);
p_suxor
->
p_input
=
p_input
;
p_vout
->
b_filter_change
=
true
;
vlc_object_yield
(
p_input
);
vlc_thread_create
(
p_suxor
,
"suxor"
,
SuxorRestartVideoES
,
VLC_THREAD_PRIORITY_LOW
,
false
);
}
input_Control
(
p_input
,
INPUT_RESTART_ES
,
-
VIDEO_ES
);
vlc_object_release
(
p_input
);
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