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
2c73cfb4
Commit
2c73cfb4
authored
Nov 02, 2008
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved input_EsOutSetRecord/input_EsOutSetDelay to es_out_Control.
parent
b0bcb74c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
122 additions
and
97 deletions
+122
-97
src/input/es_out.c
src/input/es_out.c
+103
-88
src/input/es_out.h
src/input/es_out.h
+14
-2
src/input/input.c
src/input/input.c
+5
-7
No files found.
src/input/es_out.c
View file @
2c73cfb4
...
...
@@ -161,10 +161,11 @@ static es_out_id_t *EsOutAdd ( es_out_t *, es_format_t * );
static
int
EsOutSend
(
es_out_t
*
,
es_out_id_t
*
,
block_t
*
);
static
void
EsOutDel
(
es_out_t
*
,
es_out_id_t
*
);
static
int
EsOutControl
(
es_out_t
*
,
int
i_query
,
va_list
);
static
void
EsOutDelete
(
es_out_t
*
out
);
static
void
EsOutDelete
(
es_out_t
*
);
static
void
EsOutSelect
(
es_out_t
*
out
,
es_out_id_t
*
es
,
bool
b_force
);
static
void
EsOutSelect
(
es_out_t
*
,
es_out_id_t
*
es
,
bool
b_force
);
static
void
EsOutAddInfo
(
es_out_t
*
,
es_out_id_t
*
es
);
static
int
EsOutSetRecord
(
es_out_t
*
,
bool
b_record
);
static
bool
EsIsSelected
(
es_out_id_t
*
es
);
static
void
EsSelect
(
es_out_t
*
out
,
es_out_id_t
*
es
);
...
...
@@ -320,91 +321,6 @@ void input_EsOutChangeRate( es_out_t *out, int i_rate )
EsOutProgramsChangeRate
(
out
);
}
int
input_EsOutSetRecord
(
es_out_t
*
out
,
bool
b_record
)
{
es_out_sys_t
*
p_sys
=
out
->
p_sys
;
input_thread_t
*
p_input
=
p_sys
->
p_input
;
assert
(
(
b_record
&&
!
p_sys
->
p_sout_record
)
||
(
!
b_record
&&
p_sys
->
p_sout_record
)
);
if
(
b_record
)
{
char
*
psz_path
=
var_CreateGetString
(
p_input
,
"input-record-path"
);
if
(
!
psz_path
||
*
psz_path
==
'\0'
)
{
free
(
psz_path
);
psz_path
=
strdup
(
config_GetHomeDir
()
);
}
char
*
psz_sout
=
NULL
;
// TODO conf
if
(
!
psz_sout
&&
psz_path
)
{
char
*
psz_file
=
input_CreateFilename
(
VLC_OBJECT
(
p_input
),
psz_path
,
INPUT_RECORD_PREFIX
,
NULL
);
if
(
psz_file
)
{
if
(
asprintf
(
&
psz_sout
,
"#record{dst-prefix='%s'}"
,
psz_file
)
<
0
)
psz_sout
=
NULL
;
free
(
psz_file
);
}
}
free
(
psz_path
);
if
(
!
psz_sout
)
return
VLC_EGENERIC
;
#ifdef ENABLE_SOUT
p_sys
->
p_sout_record
=
sout_NewInstance
(
p_input
,
psz_sout
);
#endif
free
(
psz_sout
);
if
(
!
p_sys
->
p_sout_record
)
return
VLC_EGENERIC
;
for
(
int
i
=
0
;
i
<
p_sys
->
i_es
;
i
++
)
{
es_out_id_t
*
p_es
=
p_sys
->
es
[
i
];
if
(
!
p_es
->
p_dec
||
p_es
->
p_master
)
continue
;
p_es
->
p_dec_record
=
input_DecoderNew
(
p_input
,
&
p_es
->
fmt
,
p_es
->
p_pgrm
->
p_clock
,
p_sys
->
p_sout_record
);
if
(
p_es
->
p_dec_record
&&
p_sys
->
b_buffering
)
input_DecoderStartBuffering
(
p_es
->
p_dec_record
);
}
}
else
{
for
(
int
i
=
0
;
i
<
p_sys
->
i_es
;
i
++
)
{
es_out_id_t
*
p_es
=
p_sys
->
es
[
i
];
if
(
!
p_es
->
p_dec_record
)
continue
;
input_DecoderDelete
(
p_es
->
p_dec_record
);
p_es
->
p_dec_record
=
NULL
;
}
#ifdef ENABLE_SOUT
sout_DeleteInstance
(
p_sys
->
p_sout_record
);
#endif
p_sys
->
p_sout_record
=
NULL
;
}
return
VLC_SUCCESS
;
}
void
input_EsOutSetDelay
(
es_out_t
*
out
,
int
i_cat
,
int64_t
i_delay
)
{
es_out_sys_t
*
p_sys
=
out
->
p_sys
;
if
(
i_cat
==
AUDIO_ES
)
p_sys
->
i_audio_delay
=
i_delay
;
else
if
(
i_cat
==
SPU_ES
)
p_sys
->
i_spu_delay
=
i_delay
;
for
(
int
i
=
0
;
i
<
p_sys
->
i_es
;
i
++
)
EsOutDecoderChangeDelay
(
out
,
p_sys
->
es
[
i
]
);
}
void
input_EsOutChangePause
(
es_out_t
*
out
,
bool
b_paused
,
mtime_t
i_date
)
{
es_out_sys_t
*
p_sys
=
out
->
p_sys
;
...
...
@@ -558,7 +474,7 @@ static void EsOutDelete( es_out_t *out )
int
i
;
if
(
p_sys
->
p_sout_record
)
input_
EsOutSetRecord
(
out
,
false
);
EsOutSetRecord
(
out
,
false
);
for
(
i
=
0
;
i
<
p_sys
->
i_es
;
i
++
)
{
...
...
@@ -666,6 +582,93 @@ static bool EsOutDecodersIsEmpty( es_out_t *out )
return
true
;
}
static
void
EsOutSetDelay
(
es_out_t
*
out
,
int
i_cat
,
int64_t
i_delay
)
{
es_out_sys_t
*
p_sys
=
out
->
p_sys
;
if
(
i_cat
==
AUDIO_ES
)
p_sys
->
i_audio_delay
=
i_delay
;
else
if
(
i_cat
==
SPU_ES
)
p_sys
->
i_spu_delay
=
i_delay
;
for
(
int
i
=
0
;
i
<
p_sys
->
i_es
;
i
++
)
EsOutDecoderChangeDelay
(
out
,
p_sys
->
es
[
i
]
);
}
static
int
EsOutSetRecord
(
es_out_t
*
out
,
bool
b_record
)
{
es_out_sys_t
*
p_sys
=
out
->
p_sys
;
input_thread_t
*
p_input
=
p_sys
->
p_input
;
assert
(
(
b_record
&&
!
p_sys
->
p_sout_record
)
||
(
!
b_record
&&
p_sys
->
p_sout_record
)
);
if
(
b_record
)
{
char
*
psz_path
=
var_CreateGetString
(
p_input
,
"input-record-path"
);
if
(
!
psz_path
||
*
psz_path
==
'\0'
)
{
free
(
psz_path
);
psz_path
=
strdup
(
config_GetHomeDir
()
);
}
char
*
psz_sout
=
NULL
;
// TODO conf
if
(
!
psz_sout
&&
psz_path
)
{
char
*
psz_file
=
input_CreateFilename
(
VLC_OBJECT
(
p_input
),
psz_path
,
INPUT_RECORD_PREFIX
,
NULL
);
if
(
psz_file
)
{
if
(
asprintf
(
&
psz_sout
,
"#record{dst-prefix='%s'}"
,
psz_file
)
<
0
)
psz_sout
=
NULL
;
free
(
psz_file
);
}
}
free
(
psz_path
);
if
(
!
psz_sout
)
return
VLC_EGENERIC
;
#ifdef ENABLE_SOUT
p_sys
->
p_sout_record
=
sout_NewInstance
(
p_input
,
psz_sout
);
#endif
free
(
psz_sout
);
if
(
!
p_sys
->
p_sout_record
)
return
VLC_EGENERIC
;
for
(
int
i
=
0
;
i
<
p_sys
->
i_es
;
i
++
)
{
es_out_id_t
*
p_es
=
p_sys
->
es
[
i
];
if
(
!
p_es
->
p_dec
||
p_es
->
p_master
)
continue
;
p_es
->
p_dec_record
=
input_DecoderNew
(
p_input
,
&
p_es
->
fmt
,
p_es
->
p_pgrm
->
p_clock
,
p_sys
->
p_sout_record
);
if
(
p_es
->
p_dec_record
&&
p_sys
->
b_buffering
)
input_DecoderStartBuffering
(
p_es
->
p_dec_record
);
}
}
else
{
for
(
int
i
=
0
;
i
<
p_sys
->
i_es
;
i
++
)
{
es_out_id_t
*
p_es
=
p_sys
->
es
[
i
];
if
(
!
p_es
->
p_dec_record
)
continue
;
input_DecoderDelete
(
p_es
->
p_dec_record
);
p_es
->
p_dec_record
=
NULL
;
}
#ifdef ENABLE_SOUT
sout_DeleteInstance
(
p_sys
->
p_sout_record
);
#endif
p_sys
->
p_sout_record
=
NULL
;
}
return
VLC_SUCCESS
;
}
static
void
EsOutDecodersStopBuffering
(
es_out_t
*
out
,
bool
b_forced
)
{
...
...
@@ -2316,6 +2319,18 @@ static int EsOutControlLocked( es_out_t *out, int i_query, va_list args )
*
pb
=
EsOutDecodersIsEmpty
(
out
);
return
VLC_SUCCESS
;
case
ES_OUT_SET_DELAY
:
{
const
int
i_cat
=
(
int
)
va_arg
(
args
,
int
);
const
mtime_t
i_delay
=
(
mtime_t
)
va_arg
(
args
,
mtime_t
);
EsOutSetDelay
(
out
,
i_cat
,
i_delay
);
return
VLC_SUCCESS
;
}
case
ES_OUT_SET_RECORD_STATE
:
b
=
(
bool
)
va_arg
(
args
,
int
);
return
EsOutSetRecord
(
out
,
b
);
default:
msg_Err
(
p_sys
->
p_input
,
"unknown query in es_out_Control"
);
return
VLC_EGENERIC
;
...
...
src/input/es_out.h
View file @
2c73cfb4
...
...
@@ -46,6 +46,12 @@ enum es_out_query_private_e
/* Check if es_out has still data to play */
ES_OUT_GET_EMPTY
,
/* arg1=bool* res=cannot fail */
/* */
ES_OUT_SET_DELAY
,
/* arg1=es_category_e, res=can fail */
/* */
ES_OUT_SET_RECORD_STATE
,
/* arg1=bool res=can fail */
};
static
inline
mtime_t
es_out_GetWakeup
(
es_out_t
*
p_out
)
...
...
@@ -72,11 +78,17 @@ static inline bool es_out_GetEmpty( es_out_t *p_out )
assert
(
!
i_ret
);
return
b
;
}
static
inline
int
es_out_SetDelay
(
es_out_t
*
p_out
,
int
i_cat
,
mtime_t
i_delay
)
{
return
es_out_Control
(
p_out
,
ES_OUT_SET_DELAY
,
i_cat
,
i_delay
);
}
static
inline
int
es_out_SetRecordState
(
es_out_t
*
p_out
,
bool
b_record
)
{
return
es_out_Control
(
p_out
,
ES_OUT_SET_RECORD_STATE
,
b_record
);
}
es_out_t
*
input_EsOutNew
(
input_thread_t
*
,
int
i_rate
);
void
input_EsOutSetDelay
(
es_out_t
*
,
int
i_cat
,
int64_t
);
int
input_EsOutSetRecord
(
es_out_t
*
,
bool
b_record
);
void
input_EsOutChangeRate
(
es_out_t
*
,
int
);
void
input_EsOutChangePause
(
es_out_t
*
,
bool
b_paused
,
mtime_t
i_date
);
void
input_EsOutChangePosition
(
es_out_t
*
);
...
...
src/input/input.c
View file @
2c73cfb4
...
...
@@ -1813,14 +1813,12 @@ static bool Control( input_thread_t *p_input, int i_type,
break
;
case
INPUT_CONTROL_SET_AUDIO_DELAY
:
input_EsOutSetDelay
(
p_input
->
p
->
p_es_out
,
AUDIO_ES
,
val
.
i_time
);
if
(
!
es_out_SetDelay
(
p_input
->
p
->
p_es_out
,
AUDIO_ES
,
val
.
i_time
)
)
var_Change
(
p_input
,
"audio-delay"
,
VLC_VAR_SETVALUE
,
&
val
,
NULL
);
break
;
case
INPUT_CONTROL_SET_SPU_DELAY
:
input_EsOutSetDelay
(
p_input
->
p
->
p_es_out
,
SPU_ES
,
val
.
i_time
);
if
(
!
es_out_SetDelay
(
p_input
->
p
->
p_es_out
,
SPU_ES
,
val
.
i_time
)
)
var_Change
(
p_input
,
"spu-delay"
,
VLC_VAR_SETVALUE
,
&
val
,
NULL
);
break
;
...
...
@@ -2031,7 +2029,7 @@ static bool Control( input_thread_t *p_input, int i_type,
}
else
{
if
(
input_EsOutSetRecord
(
p_input
->
p
->
p_es_out
,
val
.
b_bool
)
)
if
(
es_out_SetRecordState
(
p_input
->
p
->
p_es_out
,
val
.
b_bool
)
)
val
.
b_bool
=
false
;
}
p_input
->
p
->
b_recording
=
val
.
b_bool
;
...
...
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