Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
68d6b61e
Commit
68d6b61e
authored
Feb 05, 2010
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Used INPUT_REPLACE_INFOS/INPUT_MERGE_INFOS in es_out (close #3070).
parent
68fe87d7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
71 additions
and
65 deletions
+71
-65
src/input/es_out.c
src/input/es_out.c
+71
-65
No files found.
src/input/es_out.c
View file @
68d6b61e
...
...
@@ -44,6 +44,7 @@
#include "decoder.h"
#include "es_out.h"
#include "event.h"
#include "info.h"
#include "../stream_output/stream_output.h"
...
...
@@ -1166,7 +1167,6 @@ static void EsOutProgramMeta( es_out_t *out, int i_group, const vlc_meta_t *p_me
es_out_sys_t
*
p_sys
=
out
->
p_sys
;
es_out_pgrm_t
*
p_pgrm
;
input_thread_t
*
p_input
=
p_sys
->
p_input
;
char
*
psz_cat
;
const
char
*
psz_title
=
NULL
;
const
char
*
psz_provider
=
NULL
;
int
i
;
...
...
@@ -1228,27 +1228,40 @@ static void EsOutProgramMeta( es_out_t *out, int i_group, const vlc_meta_t *p_me
}
}
psz_cat
=
EsOutProgramGetMetaName
(
p_pgrm
);
if
(
psz_provider
)
/* */
char
**
ppsz_all_keys
=
vlc_meta_CopyExtraNames
(
p_meta
);
info_category_t
*
p_cat
=
NULL
;
if
(
psz_provider
||
*
ppsz_all_keys
[
0
]
)
{
if
(
p_sys
->
p_pgrm
==
p_pgrm
)
{
input_item_SetPublisher
(
p_input
->
p
->
p_item
,
psz_provider
);
input_SendEventMeta
(
p_input
);
}
input_Control
(
p_input
,
INPUT_ADD_INFO
,
psz_cat
,
vlc_meta_TypeToLocalizedString
(
vlc_meta_Publisher
),
psz_provider
);
char
*
psz_cat
=
EsOutProgramGetMetaName
(
p_pgrm
);
if
(
psz_cat
)
p_cat
=
info_category_New
(
psz_cat
);
free
(
psz_cat
);
}
char
**
ppsz_all_keys
=
vlc_meta_CopyExtraNames
(
p_meta
);
for
(
i
=
0
;
ppsz_all_keys
[
i
];
i
++
)
{
i
nput_Control
(
p_input
,
INPUT_ADD_INFO
,
psz_cat
,
vlc_gettext
(
ppsz_all_keys
[
i
])
,
vlc_meta_GetExtra
(
p_meta
,
ppsz_all_keys
[
i
]
)
);
i
f
(
p_cat
)
info_category_AddInfo
(
p_cat
,
vlc_gettext
(
ppsz_all_keys
[
i
]),
"%s"
,
vlc_meta_GetExtra
(
p_meta
,
ppsz_all_keys
[
i
]
)
);
free
(
ppsz_all_keys
[
i
]
);
}
free
(
ppsz_all_keys
);
free
(
psz_cat
);
if
(
psz_provider
)
{
if
(
p_sys
->
p_pgrm
==
p_pgrm
)
{
input_item_SetPublisher
(
p_input
->
p
->
p_item
,
psz_provider
);
input_SendEventMeta
(
p_input
);
}
if
(
p_cat
)
info_category_AddInfo
(
p_cat
,
vlc_meta_TypeToLocalizedString
(
vlc_meta_Publisher
),
"%s"
,
psz_provider
);
}
if
(
p_cat
)
input_Control
(
p_input
,
INPUT_MERGE_INFOS
,
p_cat
);
}
static
void
EsOutProgramEpg
(
es_out_t
*
out
,
int
i_group
,
const
vlc_epg_t
*
p_epg
)
...
...
@@ -2789,16 +2802,15 @@ static void EsOutUpdateInfo( es_out_t *out, es_out_id_t *es, const es_format_t *
es_out_sys_t
*
p_sys
=
out
->
p_sys
;
input_thread_t
*
p_input
=
p_sys
->
p_input
;
const
es_format_t
*
p_fmt_es
=
&
es
->
fmt
;
char
*
psz_cat
;
lldiv_t
div
;
/* Create category name */
if
(
asprintf
(
&
psz_cat
,
_
(
"Stream %d"
),
es
->
i_meta_id
)
==
-
1
)
/* Create category */
char
psz_cat
[
128
];
snprintf
(
psz_cat
,
sizeof
(
psz_cat
),
_
(
"Stream %d"
),
es
->
i_meta_id
);
info_category_t
*
p_cat
=
info_category_New
(
psz_cat
);
if
(
!
p_cat
)
return
;
/* Remove previous information */
input_Control
(
p_input
,
INPUT_DEL_INFO
,
psz_cat
,
NULL
);
/* Add informations */
const
char
*
psz_type
;
switch
(
fmt
->
i_cat
)
...
...
@@ -2818,46 +2830,45 @@ static void EsOutUpdateInfo( es_out_t *out, es_out_id_t *es, const es_format_t *
}
if
(
psz_type
)
in
put_Control
(
p_input
,
INPUT_ADD_INFO
,
psz_cat
,
_
(
"Type"
)
,
psz_type
);
in
fo_category_AddInfo
(
p_cat
,
_
(
"Type"
),
"%s"
,
psz_type
);
if
(
es
->
i_meta_id
!=
es
->
i_id
)
in
put_Control
(
p_input
,
INPUT_ADD_INFO
,
psz
_cat
,
_
(
"Original ID"
),
in
fo_category_AddInfo
(
p
_cat
,
_
(
"Original ID"
),
"%d"
,
es
->
i_id
);
const
char
*
psz_codec_description
=
vlc_fourcc_GetDescription
(
p_fmt_es
->
i_cat
,
p_fmt_es
->
i_codec
);
const
vlc_fourcc_t
i_codec_fourcc
=
p_fmt_es
->
i_original_fourcc
?:
p_fmt_es
->
i_codec
;
if
(
psz_codec_description
)
in
put_Control
(
p_input
,
INPUT_ADD_INFO
,
psz_cat
,
_
(
"Codec"
)
,
"%s (%.4s)"
,
psz_codec_description
,
(
char
*
)
&
i_codec_fourcc
);
in
fo_category_AddInfo
(
p_cat
,
_
(
"Codec"
),
"%s (%.4s)"
,
psz_codec_description
,
(
char
*
)
&
i_codec_fourcc
);
else
in
put_Control
(
p_input
,
INPUT_ADD_INFO
,
psz_cat
,
_
(
"Codec"
)
,
"%.4s"
,
(
char
*
)
&
i_codec_fourcc
);
in
fo_category_AddInfo
(
p_cat
,
_
(
"Codec"
),
"%.4s"
,
(
char
*
)
&
i_codec_fourcc
);
if
(
es
->
psz_language
&&
*
es
->
psz_language
)
in
put_Control
(
p_input
,
INPUT_ADD_INFO
,
psz_cat
,
_
(
"Language"
)
,
"%s"
,
es
->
psz_language
);
in
fo_category_AddInfo
(
p_cat
,
_
(
"Language"
),
"%s"
,
es
->
psz_language
);
if
(
fmt
->
psz_description
&&
*
fmt
->
psz_description
)
in
put_Control
(
p_input
,
INPUT_ADD_INFO
,
psz_cat
,
_
(
"Description"
)
,
"%s"
,
fmt
->
psz_description
);
in
fo_category_AddInfo
(
p_cat
,
_
(
"Description"
),
"%s"
,
fmt
->
psz_description
);
switch
(
fmt
->
i_cat
)
{
case
AUDIO_ES
:
input_Control
(
p_input
,
INPUT_ADD_INFO
,
psz_cat
,
_
(
"Type"
),
_
(
"Audio"
)
);
info_category_AddInfo
(
p_cat
,
_
(
"Type"
),
_
(
"Audio"
)
);
if
(
fmt
->
audio
.
i_physical_channels
&
AOUT_CHAN_PHYSMASK
)
in
put_Control
(
p_input
,
INPUT_ADD_INFO
,
psz_cat
,
_
(
"Channels"
)
,
"%s"
,
_
(
aout_FormatPrintChannels
(
&
fmt
->
audio
)
)
);
in
fo_category_AddInfo
(
p_cat
,
_
(
"Channels"
),
"%s"
,
_
(
aout_FormatPrintChannels
(
&
fmt
->
audio
)
)
);
else
if
(
fmt
->
audio
.
i_channels
>
0
)
in
put_Control
(
p_input
,
INPUT_ADD_INFO
,
psz_cat
,
_
(
"Channels"
)
,
"%u"
,
fmt
->
audio
.
i_channels
);
in
fo_category_AddInfo
(
p_cat
,
_
(
"Channels"
),
"%u"
,
fmt
->
audio
.
i_channels
);
if
(
fmt
->
audio
.
i_rate
>
0
)
{
in
put_Control
(
p_input
,
INPUT_ADD_INFO
,
psz_cat
,
_
(
"Sample rate
"
),
_
(
"%u Hz"
),
fmt
->
audio
.
i_rate
);
in
fo_category_AddInfo
(
p_cat
,
_
(
"Sample rate"
),
_
(
"%u Hz
"
),
fmt
->
audio
.
i_rate
);
/* FIXME that should be removed or improved ! (used by text/strings.c) */
var_SetInteger
(
p_input
,
"sample-rate"
,
fmt
->
audio
.
i_rate
);
}
...
...
@@ -2866,14 +2877,13 @@ static void EsOutUpdateInfo( es_out_t *out, es_out_id_t *es, const es_format_t *
if
(
i_bitspersample
<=
0
)
i_bitspersample
=
aout_BitsPerSample
(
p_fmt_es
->
i_codec
);
if
(
i_bitspersample
>
0
)
input_Control
(
p_input
,
INPUT_ADD_INFO
,
psz_cat
,
_
(
"Bits per sample"
),
"%u"
,
i_bitspersample
);
info_category_AddInfo
(
p_cat
,
_
(
"Bits per sample"
),
"%u"
,
i_bitspersample
);
if
(
fmt
->
i_bitrate
>
0
)
{
in
put_Control
(
p_input
,
INPUT_ADD_INFO
,
psz_cat
,
_
(
"Bitrate
"
),
_
(
"%u kb/s"
),
fmt
->
i_bitrate
/
1000
);
in
fo_category_AddInfo
(
p_cat
,
_
(
"Bitrate"
),
_
(
"%u kb/s
"
),
fmt
->
i_bitrate
/
1000
);
/* FIXME that should be removed or improved ! (used by text/strings.c) */
var_SetInteger
(
p_input
,
"bit-rate"
,
fmt
->
i_bitrate
);
}
...
...
@@ -2887,26 +2897,23 @@ static void EsOutUpdateInfo( es_out_t *out, es_out_id_t *es, const es_format_t *
psz_name
=
_
(
"Track replay gain"
);
else
psz_name
=
_
(
"Album replay gain"
);
in
put_Control
(
p_input
,
INPUT_ADD_INFO
,
psz_cat
,
psz_name
,
_
(
"%.2f dB"
),
p_rg
->
pf_gain
[
i
]
);
in
fo_category_AddInfo
(
p_cat
,
psz_name
,
_
(
"%.2f dB"
)
,
p_rg
->
pf_gain
[
i
]
);
}
break
;
case
VIDEO_ES
:
input_Control
(
p_input
,
INPUT_ADD_INFO
,
psz_cat
,
_
(
"Type"
),
_
(
"Video"
)
);
info_category_AddInfo
(
p_cat
,
_
(
"Type"
),
_
(
"Video"
)
);
if
(
fmt
->
video
.
i_width
>
0
&&
fmt
->
video
.
i_height
>
0
)
input_Control
(
p_input
,
INPUT_ADD_INFO
,
psz_cat
,
_
(
"Resolution"
),
"%ux%u"
,
fmt
->
video
.
i_width
,
fmt
->
video
.
i_height
);
info_category_AddInfo
(
p_cat
,
_
(
"Resolution"
),
"%ux%u"
,
fmt
->
video
.
i_width
,
fmt
->
video
.
i_height
);
if
(
fmt
->
video
.
i_visible_width
>
0
&&
fmt
->
video
.
i_visible_height
>
0
)
input_Control
(
p_input
,
INPUT_ADD_INFO
,
psz_cat
,
_
(
"Display resolution"
),
"%ux%u"
,
fmt
->
video
.
i_visible_width
,
fmt
->
video
.
i_visible_height
);
info_category_AddInfo
(
p_cat
,
_
(
"Display resolution"
),
"%ux%u"
,
fmt
->
video
.
i_visible_width
,
fmt
->
video
.
i_visible_height
);
if
(
fmt
->
video
.
i_frame_rate
>
0
&&
fmt
->
video
.
i_frame_rate_base
>
0
)
{
...
...
@@ -2914,18 +2921,16 @@ static void EsOutUpdateInfo( es_out_t *out, es_out_id_t *es, const es_format_t *
fmt
->
video
.
i_frame_rate_base
*
1000000
,
1000000
);
if
(
div
.
rem
>
0
)
input_Control
(
p_input
,
INPUT_ADD_INFO
,
psz_cat
,
_
(
"Frame rate"
),
"%"
PRId64
".%06u"
,
div
.
quot
,
(
unsigned
int
)
div
.
rem
);
info_category_AddInfo
(
p_cat
,
_
(
"Frame rate"
),
"%"
PRId64
".%06u"
,
div
.
quot
,
(
unsigned
int
)
div
.
rem
);
else
in
put_Control
(
p_input
,
INPUT_ADD_INFO
,
psz_cat
,
_
(
"Frame rate"
),
"%"
PRId64
,
div
.
quot
);
in
fo_category_AddInfo
(
p_cat
,
_
(
"Frame rate"
),
"%"
PRId64
,
div
.
quot
);
}
break
;
case
SPU_ES
:
input_Control
(
p_input
,
INPUT_ADD_INFO
,
psz_cat
,
_
(
"Type"
),
_
(
"Subtitle"
)
);
info_category_AddInfo
(
p_cat
,
_
(
"Type"
),
_
(
"Subtitle"
)
);
break
;
default:
...
...
@@ -2942,12 +2947,13 @@ static void EsOutUpdateInfo( es_out_t *out, es_out_id_t *es, const es_format_t *
const
char
*
psz_value
=
vlc_meta_GetExtra
(
p_meta
,
psz_key
);
if
(
psz_value
)
in
put_Control
(
p_input
,
INPUT_ADD_INFO
,
psz_cat
,
vlc_gettext
(
psz_key
),
vlc_gettext
(
psz_value
)
);
in
fo_category_AddInfo
(
p_cat
,
vlc_gettext
(
psz_key
),
"%s"
,
vlc_gettext
(
psz_value
)
);
free
(
psz_key
);
}
free
(
ppsz_all_keys
);
}
free
(
psz
_cat
);
/* */
input_Control
(
p_input
,
INPUT_REPLACE_INFOS
,
p
_cat
);
}
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