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
56933e8e
Commit
56933e8e
authored
Feb 09, 2012
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TS mux: cosmetics, align case on switch
parent
279ec69a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
122 additions
and
124 deletions
+122
-124
modules/mux/mpeg/ts.c
modules/mux/mpeg/ts.c
+122
-124
No files found.
modules/mux/mpeg/ts.c
View file @
56933e8e
...
@@ -889,23 +889,23 @@ static int Control( sout_mux_t *p_mux, int i_query, va_list args )
...
@@ -889,23 +889,23 @@ static int Control( sout_mux_t *p_mux, int i_query, va_list args )
switch
(
i_query
)
switch
(
i_query
)
{
{
case
MUX_CAN_ADD_STREAM_WHILE_MUXING
:
case
MUX_CAN_ADD_STREAM_WHILE_MUXING
:
pb_bool
=
(
bool
*
)
va_arg
(
args
,
bool
*
);
pb_bool
=
(
bool
*
)
va_arg
(
args
,
bool
*
);
*
pb_bool
=
true
;
*
pb_bool
=
true
;
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
case
MUX_GET_ADD_STREAM_WAIT
:
case
MUX_GET_ADD_STREAM_WAIT
:
pb_bool
=
(
bool
*
)
va_arg
(
args
,
bool
*
);
pb_bool
=
(
bool
*
)
va_arg
(
args
,
bool
*
);
*
pb_bool
=
false
;
*
pb_bool
=
false
;
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
case
MUX_GET_MIME
:
case
MUX_GET_MIME
:
ppsz
=
(
char
**
)
va_arg
(
args
,
char
**
);
ppsz
=
(
char
**
)
va_arg
(
args
,
char
**
);
*
ppsz
=
strdup
(
"video/mpeg"
);
/* FIXME not sure */
*
ppsz
=
strdup
(
"video/mpeg"
);
/* FIXME not sure */
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
default:
default:
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
}
}
...
@@ -939,124 +939,122 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
...
@@ -939,124 +939,122 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
/* All others fields depand on codec */
/* All others fields depand on codec */
switch
(
p_input
->
p_fmt
->
i_cat
)
switch
(
p_input
->
p_fmt
->
i_cat
)
{
{
case
VIDEO_ES
:
case
VIDEO_ES
:
switch
(
p_input
->
p_fmt
->
i_codec
)
switch
(
p_input
->
p_fmt
->
i_codec
)
{
{
case
VLC_CODEC_MPGV
:
case
VLC_CODEC_MPGV
:
/* TODO: do we need to check MPEG-I/II ? */
/* TODO: do we need to check MPEG-I/II ? */
p_stream
->
i_stream_type
=
0x02
;
p_stream
->
i_stream_type
=
0x02
;
p_stream
->
i_stream_id
=
0xe0
;
p_stream
->
i_stream_id
=
0xe0
;
break
;
case
VLC_CODEC_MP4V
:
p_stream
->
i_stream_type
=
0x10
;
p_stream
->
i_stream_id
=
0xe0
;
p_stream
->
i_es_id
=
p_stream
->
i_pid
;
break
;
case
VLC_CODEC_H264
:
p_stream
->
i_stream_type
=
0x1b
;
p_stream
->
i_stream_id
=
0xe0
;
break
;
/* XXX dirty dirty but somebody want that:
* using crapy MS-codec XXX */
/* I didn't want to do that :P */
case
VLC_CODEC_H263I
:
case
VLC_CODEC_H263
:
case
VLC_CODEC_WMV3
:
case
VLC_CODEC_WMV2
:
case
VLC_CODEC_WMV1
:
case
VLC_CODEC_DIV3
:
case
VLC_CODEC_DIV2
:
case
VLC_CODEC_DIV1
:
case
VLC_CODEC_MJPG
:
p_stream
->
i_stream_type
=
0xa0
;
/* private */
p_stream
->
i_stream_id
=
0xa0
;
/* beurk */
p_stream
->
i_bih_codec
=
p_input
->
p_fmt
->
i_codec
;
p_stream
->
i_bih_width
=
p_input
->
p_fmt
->
video
.
i_width
;
p_stream
->
i_bih_height
=
p_input
->
p_fmt
->
video
.
i_height
;
break
;
case
VLC_CODEC_DIRAC
:
/* stream_id makes use of stream_id_extension */
p_stream
->
i_stream_id
=
(
PES_EXTENDED_STREAM_ID
<<
8
)
|
0x60
;
p_stream
->
i_stream_type
=
0xd1
;
break
;
default:
free
(
p_stream
);
return
VLC_EGENERIC
;
}
p_sys
->
i_video_bound
++
;
break
;
break
;
case
VLC_CODEC_MP4V
:
case
AUDIO_ES
:
p_stream
->
i_stream_type
=
0x10
;
switch
(
p_input
->
p_fmt
->
i_codec
)
p_stream
->
i_stream_id
=
0xe0
;
{
p_stream
->
i_es_id
=
p_stream
->
i_pid
;
case
VLC_CODEC_MPGA
:
break
;
p_stream
->
i_stream_type
=
case
VLC_CODEC_H264
:
p_input
->
p_fmt
->
audio
.
i_rate
>=
32000
?
0x03
:
0x04
;
p_stream
->
i_stream_type
=
0x1b
;
p_stream
->
i_stream_id
=
0xc0
;
p_stream
->
i_stream_id
=
0xe0
;
break
;
break
;
case
VLC_CODEC_A52
:
/* XXX dirty dirty but somebody want crapy MS-codec XXX */
p_stream
->
i_stream_type
=
0x81
;
case
VLC_CODEC_H263I
:
p_stream
->
i_stream_id
=
0xbd
;
case
VLC_CODEC_H263
:
break
;
case
VLC_CODEC_WMV3
:
case
VLC_CODEC_EAC3
:
case
VLC_CODEC_WMV2
:
p_stream
->
i_stream_type
=
0x06
;
case
VLC_CODEC_WMV1
:
p_stream
->
i_stream_id
=
0xbd
;
case
VLC_CODEC_DIV3
:
break
;
case
VLC_CODEC_DIV2
:
case
VLC_CODEC_DVD_LPCM
:
case
VLC_CODEC_DIV1
:
p_stream
->
i_stream_type
=
0x83
;
case
VLC_CODEC_MJPG
:
p_stream
->
i_stream_id
=
0xbd
;
p_stream
->
i_stream_type
=
0xa0
;
/* private */
break
;
p_stream
->
i_stream_id
=
0xa0
;
/* beurk */
case
VLC_CODEC_DTS
:
p_stream
->
i_bih_codec
=
p_input
->
p_fmt
->
i_codec
;
p_stream
->
i_stream_type
=
0x06
;
p_stream
->
i_bih_width
=
p_input
->
p_fmt
->
video
.
i_width
;
p_stream
->
i_stream_id
=
0xbd
;
p_stream
->
i_bih_height
=
p_input
->
p_fmt
->
video
.
i_height
;
break
;
case
VLC_CODEC_MP4A
:
/* XXX: make that configurable in some way when LOAS
* is implemented for AAC in TS */
//p_stream->i_stream_type = 0x11; /* LOAS/LATM */
p_stream
->
i_stream_type
=
0x0f
;
/* ADTS */
p_stream
->
i_stream_id
=
0xc0
;
p_sys
->
i_mpeg4_streams
++
;
p_stream
->
i_es_id
=
p_stream
->
i_pid
;
break
;
default:
free
(
p_stream
);
return
VLC_EGENERIC
;
}
p_sys
->
i_audio_bound
++
;
break
;
break
;
case
VLC_CODEC_DIRAC
:
/* stream_id makes use of stream_id_extension */
p_stream
->
i_stream_id
=
(
PES_EXTENDED_STREAM_ID
<<
8
)
|
0x60
;
p_stream
->
i_stream_type
=
0xd1
;
break
;
default:
free
(
p_stream
);
return
VLC_EGENERIC
;
}
p_sys
->
i_video_bound
++
;
break
;
case
SPU_ES
:
case
AUDIO_ES
:
switch
(
p_input
->
p_fmt
->
i_codec
)
switch
(
p_input
->
p_fmt
->
i_codec
)
{
{
case
VLC_CODEC_SPU
:
case
VLC_CODEC_MPGA
:
p_stream
->
i_stream_type
=
0x82
;
p_stream
->
i_stream_type
=
p_stream
->
i_stream_id
=
0xbd
;
p_input
->
p_fmt
->
audio
.
i_rate
>=
32000
?
0x03
:
0x04
;
break
;
p_stream
->
i_stream_id
=
0xc0
;
case
VLC_CODEC_SUBT
:
break
;
p_stream
->
i_stream_type
=
0x12
;
case
VLC_CODEC_A52
:
p_stream
->
i_stream_id
=
0xfa
;
p_stream
->
i_stream_type
=
0x81
;
p_sys
->
i_mpeg4_streams
++
;
p_stream
->
i_stream_id
=
0xbd
;
p_stream
->
i_es_id
=
p_stream
->
i_pid
;
break
;
break
;
case
VLC_CODEC_EAC3
:
case
VLC_CODEC_DVBS
:
p_stream
->
i_stream_type
=
0x06
;
p_stream
->
i_stream_type
=
0x06
;
p_stream
->
i_stream_id
=
0xbd
;
p_stream
->
i_es_id
=
p_input
->
p_fmt
->
subs
.
dvb
.
i_id
;
break
;
p_stream
->
i_stream_id
=
0xbd
;
case
VLC_CODEC_DVD_LPCM
:
break
;
p_stream
->
i_stream_type
=
0x83
;
case
VLC_CODEC_TELETEXT
:
p_stream
->
i_stream_id
=
0xbd
;
p_stream
->
i_stream_type
=
0x06
;
p_stream
->
i_stream_id
=
0xbd
;
/* FIXME */
break
;
default:
free
(
p_stream
);
return
VLC_EGENERIC
;
}
break
;
break
;
case
VLC_CODEC_DTS
:
p_stream
->
i_stream_type
=
0x06
;
p_stream
->
i_stream_id
=
0xbd
;
break
;
case
VLC_CODEC_MP4A
:
/* XXX: make that configurable in some way when LOAS
* is implemented for AAC in TS */
//p_stream->i_stream_type = 0x11; /* LOAS/LATM */
p_stream
->
i_stream_type
=
0x0f
;
/* ADTS */
p_stream
->
i_stream_id
=
0xc0
;
p_sys
->
i_mpeg4_streams
++
;
p_stream
->
i_es_id
=
p_stream
->
i_pid
;
break
;
default:
free
(
p_stream
);
return
VLC_EGENERIC
;
}
p_sys
->
i_audio_bound
++
;
break
;
case
SPU_ES
:
switch
(
p_input
->
p_fmt
->
i_codec
)
{
case
VLC_CODEC_SPU
:
p_stream
->
i_stream_type
=
0x82
;
p_stream
->
i_stream_id
=
0xbd
;
break
;
case
VLC_CODEC_SUBT
:
p_stream
->
i_stream_type
=
0x12
;
p_stream
->
i_stream_id
=
0xfa
;
p_sys
->
i_mpeg4_streams
++
;
p_stream
->
i_es_id
=
p_stream
->
i_pid
;
break
;
case
VLC_CODEC_DVBS
:
p_stream
->
i_stream_type
=
0x06
;
p_stream
->
i_es_id
=
p_input
->
p_fmt
->
subs
.
dvb
.
i_id
;
p_stream
->
i_stream_id
=
0xbd
;
break
;
case
VLC_CODEC_TELETEXT
:
p_stream
->
i_stream_type
=
0x06
;
p_stream
->
i_stream_id
=
0xbd
;
/* FIXME */
break
;
default:
default:
free
(
p_stream
);
free
(
p_stream
);
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
break
;
default:
free
(
p_stream
);
return
VLC_EGENERIC
;
}
}
p_stream
->
i_langs
=
1
+
p_input
->
p_fmt
->
i_extra_languages
;
p_stream
->
i_langs
=
1
+
p_input
->
p_fmt
->
i_extra_languages
;
...
...
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