Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Jean-Baptiste Kempf
vlc
Commits
b3b7f62c
Commit
b3b7f62c
authored
Apr 23, 2018
by
Romain Vimont
Committed by
Jean-Baptiste Kempf
Apr 26, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: replace decoder_sys_t* by void*
See #17078 Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
238459bf
Changes
31
Hide whitespace changes
Inline
Side-by-side
Showing
31 changed files
with
152 additions
and
99 deletions
+152
-99
include/vlc_codec.h
include/vlc_codec.h
+1
-1
modules/codec/aom.c
modules/codec/aom.c
+2
-1
modules/codec/avcodec/subtitle.c
modules/codec/avcodec/subtitle.c
+3
-1
modules/codec/avcodec/video.c
modules/codec/avcodec/video.c
+11
-8
modules/codec/cc.c
modules/codec/cc.c
+2
-1
modules/codec/crystalhd.c
modules/codec/crystalhd.c
+6
-5
modules/codec/cvdsub.c
modules/codec/cvdsub.c
+3
-1
modules/codec/flac.c
modules/codec/flac.c
+7
-6
modules/codec/kate.c
modules/codec/kate.c
+6
-3
modules/codec/oggspots.c
modules/codec/oggspots.c
+2
-1
modules/codec/opus.c
modules/codec/opus.c
+1
-1
modules/codec/png.c
modules/codec/png.c
+3
-2
modules/codec/rawvideo.c
modules/codec/rawvideo.c
+1
-1
modules/codec/scte18.c
modules/codec/scte18.c
+3
-1
modules/codec/speex.c
modules/codec/speex.c
+6
-5
modules/codec/spudec/spudec.c
modules/codec/spudec/spudec.c
+4
-1
modules/codec/stl.c
modules/codec/stl.c
+6
-4
modules/codec/textst.c
modules/codec/textst.c
+9
-6
modules/codec/theora.c
modules/codec/theora.c
+9
-5
modules/codec/ttml/substtml.c
modules/codec/ttml/substtml.c
+3
-2
modules/codec/videotoolbox.m
modules/codec/videotoolbox.m
+9
-5
modules/codec/vorbis.c
modules/codec/vorbis.c
+6
-3
modules/codec/vpx.c
modules/codec/vpx.c
+2
-1
modules/codec/webvtt/subsvtt.c
modules/codec/webvtt/subsvtt.c
+15
-9
modules/packetizer/avparser.c
modules/packetizer/avparser.c
+5
-4
modules/packetizer/copy.c
modules/packetizer/copy.c
+11
-8
modules/packetizer/h264.c
modules/packetizer/h264.c
+3
-2
modules/packetizer/hevc.c
modules/packetizer/hevc.c
+3
-2
modules/packetizer/mpeg4audio.c
modules/packetizer/mpeg4audio.c
+3
-2
modules/packetizer/mpeg4video.c
modules/packetizer/mpeg4video.c
+6
-6
modules/packetizer/mpegaudio.c
modules/packetizer/mpegaudio.c
+1
-1
No files found.
include/vlc_codec.h
View file @
b3b7f62c
...
...
@@ -56,7 +56,7 @@ struct decoder_t
/* Module properties */
module_t
*
p_module
;
decoder_sys_t
*
p_sys
;
void
*
p_sys
;
/* Input format ie from demuxer (XXX: a lot of field could be invalid) */
es_format_t
fmt_in
;
...
...
modules/codec/aom.c
View file @
b3b7f62c
...
...
@@ -149,7 +149,8 @@ static vlc_fourcc_t FindVlcChroma( struct aom_image *img )
****************************************************************************/
static
int
Decode
(
decoder_t
*
dec
,
block_t
*
block
)
{
aom_codec_ctx_t
*
ctx
=
&
dec
->
p_sys
->
ctx
;
decoder_sys_t
*
p_sys
=
dec
->
p_sys
;
aom_codec_ctx_t
*
ctx
=
&
p_sys
->
ctx
;
if
(
!
block
)
/* No Drain */
return
VLCDEC_SUCCESS
;
...
...
modules/codec/avcodec/subtitle.c
View file @
b3b7f62c
...
...
@@ -317,12 +317,14 @@ static subpicture_t *ConvertSubtitle(decoder_t *dec, AVSubtitle *ffsub, mtime_t
if
(
!
spu
)
return
NULL
;
decoder_sys_t
*
p_sys
=
dec
->
p_sys
;
//msg_Err(dec, "%lld %d %d",
// pts, ffsub->start_display_time, ffsub->end_display_time);
spu
->
i_start
=
pts
+
ffsub
->
start_display_time
*
INT64_C
(
1000
);
spu
->
i_stop
=
pts
+
ffsub
->
end_display_time
*
INT64_C
(
1000
);
spu
->
b_absolute
=
true
;
/* We have offset and size for subtitle */
spu
->
b_ephemer
=
dec
->
p_sys
->
b_need_ephemer
;
spu
->
b_ephemer
=
p_sys
->
b_need_ephemer
;
/* We only show subtitle for i_stop time only */
if
(
avctx
->
coded_width
!=
0
&&
avctx
->
coded_height
!=
0
)
{
...
...
modules/codec/avcodec/video.c
View file @
b3b7f62c
...
...
@@ -337,15 +337,17 @@ static int lavc_UpdateVideoFormat(decoder_t *dec, AVCodecContext *ctx,
if
(
val
)
return
val
;
decoder_sys_t
*
p_sys
=
dec
->
p_sys
;
/* always have date in fields/ticks units */
if
(
dec
->
p_sys
->
pts
.
i_divider_num
)
date_Change
(
&
dec
->
p_sys
->
pts
,
fmt_out
.
i_frame_rate
*
__MAX
(
ctx
->
ticks_per_frame
,
1
),
fmt_out
.
i_frame_rate_base
);
if
(
p_sys
->
pts
.
i_divider_num
)
date_Change
(
&
p_sys
->
pts
,
fmt_out
.
i_frame_rate
*
__MAX
(
ctx
->
ticks_per_frame
,
1
),
fmt_out
.
i_frame_rate_base
);
else
date_Init
(
&
dec
->
p_sys
->
pts
,
fmt_out
.
i_frame_rate
*
__MAX
(
ctx
->
ticks_per_frame
,
1
),
fmt_out
.
i_frame_rate_base
);
date_Init
(
&
p_sys
->
pts
,
fmt_out
.
i_frame_rate
*
__MAX
(
ctx
->
ticks_per_frame
,
1
),
fmt_out
.
i_frame_rate_base
);
fmt_out
.
p_palette
=
dec
->
fmt_out
.
video
.
p_palette
;
dec
->
fmt_out
.
video
.
p_palette
=
NULL
;
...
...
@@ -1373,7 +1375,8 @@ static int lavc_va_GetFrame(struct AVCodecContext *ctx, AVFrame *frame,
picture_t
*
pic
)
{
decoder_t
*
dec
=
ctx
->
opaque
;
vlc_va_t
*
va
=
dec
->
p_sys
->
p_va
;
decoder_sys_t
*
p_sys
=
dec
->
p_sys
;
vlc_va_t
*
va
=
p_sys
->
p_va
;
if
(
vlc_va_Get
(
va
,
pic
,
&
frame
->
data
[
0
]))
{
...
...
modules/codec/cc.c
View file @
b3b7f62c
...
...
@@ -502,6 +502,7 @@ static subpicture_t *Subtitle( decoder_t *p_dec, eia608_t *h, mtime_t i_pts )
p_spu
->
b_absolute
=
false
;
subpicture_updater_sys_t
*
p_spu_sys
=
p_spu
->
updater
.
p_sys
;
decoder_sys_t
*
p_dec_sys
=
p_dec
->
p_sys
;
/* Set first region defaults */
/* The "leavetext" alignment is a special mode where the subpicture
...
...
@@ -512,7 +513,7 @@ static subpicture_t *Subtitle( decoder_t *p_dec, eia608_t *h, mtime_t i_pts )
/* Set style defaults (will be added to segments if none set) */
p_spu_sys
->
p_default_style
->
i_style_flags
|=
STYLE_MONOSPACED
;
if
(
p_dec
->
p
_sys
->
b_opaque
)
if
(
p_dec_sys
->
b_opaque
)
{
p_spu_sys
->
p_default_style
->
i_background_alpha
=
STYLE_ALPHA_OPAQUE
>>
1
;
p_spu_sys
->
p_default_style
->
i_features
|=
STYLE_HAS_BACKGROUND_ALPHA
;
...
...
modules/codec/crystalhd.c
View file @
b3b7f62c
...
...
@@ -183,8 +183,8 @@ static int OpenDecoder( vlc_object_t *p_this )
p_sys
->
i_nal_size
=
4
;
// assume 4 byte start codes
p_sys
->
i_sps_pps_size
=
0
;
p_sys
->
p_sps_pps_buf
=
NULL
;
p_
dec
->
p_sys
->
p_pic
=
NULL
;
p_
dec
->
p_sys
->
proc_out
=
NULL
;
p_
sys
->
p_pic
=
NULL
;
p_
sys
->
proc_out
=
NULL
;
/* Win32 code *
* We cannot link and ship BCM dll, even with LGPL license (too big)
...
...
@@ -392,7 +392,8 @@ static BC_STATUS ourCallback(void *shnd, uint32_t width, uint32_t height, uint32
VLC_UNUSED
(
width
);
VLC_UNUSED
(
height
);
VLC_UNUSED
(
stride
);
decoder_t
*
p_dec
=
(
decoder_t
*
)
shnd
;
BC_DTS_PROC_OUT
*
proc_out
=
p_dec
->
p_sys
->
proc_out
;
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
BC_DTS_PROC_OUT
*
proc_out
=
p_sys
->
proc_out
;
BC_DTS_PROC_OUT
*
proc_in
=
(
BC_DTS_PROC_OUT
*
)
pOut
;
/* Direct Rendering */
...
...
@@ -401,11 +402,11 @@ static BC_STATUS ourCallback(void *shnd, uint32_t width, uint32_t height, uint32
!
(
proc_in
->
PicInfo
.
flags
&
VDEC_FLAG_FIELDPAIR
)
)
{
if
(
!
decoder_UpdateVideoFormat
(
p_dec
)
)
p_
dec
->
p_
sys
->
p_pic
=
decoder_NewPicture
(
p_dec
);
p_sys
->
p_pic
=
decoder_NewPicture
(
p_dec
);
}
/* */
picture_t
*
p_pic
=
p_
dec
->
p_
sys
->
p_pic
;
picture_t
*
p_pic
=
p_sys
->
p_pic
;
if
(
!
p_pic
)
return
BC_STS_ERROR
;
...
...
modules/codec/cvdsub.c
View file @
b3b7f62c
...
...
@@ -139,8 +139,10 @@ static int PacketizerOpen( vlc_object_t *p_this )
if
(
DecoderOpen
(
p_this
)
!=
VLC_SUCCESS
)
return
VLC_EGENERIC
;
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
p_dec
->
fmt_out
.
i_codec
=
VLC_CODEC_CVD
;
p_
dec
->
p_
sys
->
b_packetizer
=
true
;
p_sys
->
b_packetizer
=
true
;
return
VLC_SUCCESS
;
}
...
...
modules/codec/flac.c
View file @
b3b7f62c
...
...
@@ -394,6 +394,7 @@ static void DecoderErrorCallback( const FLAC__StreamDecoder *decoder,
{
VLC_UNUSED
(
decoder
);
decoder_t
*
p_dec
=
(
decoder_t
*
)
client_data
;
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
switch
(
status
)
{
...
...
@@ -416,7 +417,7 @@ static void DecoderErrorCallback( const FLAC__StreamDecoder *decoder,
msg_Err
(
p_dec
,
"got decoder error: %d"
,
status
);
}
FLAC__stream_decoder_flush
(
p_
dec
->
p_
sys
->
p_flac
);
FLAC__stream_decoder_flush
(
p_sys
->
p_flac
);
return
;
}
/*****************************************************************************
...
...
@@ -626,7 +627,7 @@ static void Flush( decoder_t *p_dec )
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
if
(
p_sys
->
b_stream_info
)
FLAC__stream_decoder_flush
(
p_
dec
->
p_
sys
->
p_flac
);
FLAC__stream_decoder_flush
(
p_sys
->
p_flac
);
date_Set
(
&
p_sys
->
end_date
,
0
);
}
...
...
@@ -671,18 +672,18 @@ static int DecodeBlock( decoder_t *p_dec, block_t *p_block )
{
decoder_state_error
(
p_dec
,
FLAC__stream_decoder_get_state
(
p_sys
->
p_flac
)
);
FLAC__stream_decoder_flush
(
p_
dec
->
p_
sys
->
p_flac
);
FLAC__stream_decoder_flush
(
p_sys
->
p_flac
);
}
/* If the decoder is in the "aborted" state,
* FLAC__stream_decoder_process_single() won't return an error. */
switch
(
FLAC__stream_decoder_get_state
(
p_
dec
->
p_
sys
->
p_flac
)
)
switch
(
FLAC__stream_decoder_get_state
(
p_sys
->
p_flac
)
)
{
case
FLAC__STREAM_DECODER_ABORTED
:
FLAC__stream_decoder_flush
(
p_
dec
->
p_
sys
->
p_flac
);
FLAC__stream_decoder_flush
(
p_sys
->
p_flac
);
break
;
case
FLAC__STREAM_DECODER_END_OF_STREAM
:
FLAC__stream_decoder_reset
(
p_
dec
->
p_
sys
->
p_flac
);
FLAC__stream_decoder_reset
(
p_sys
->
p_flac
);
break
;
default:
break
;
...
...
modules/codec/kate.c
View file @
b3b7f62c
...
...
@@ -436,12 +436,13 @@ static int OpenDecoder( vlc_object_t *p_this )
static
int
OpenPacketizer
(
vlc_object_t
*
p_this
)
{
decoder_t
*
p_dec
=
(
decoder_t
*
)
p_this
;
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
int
i_ret
=
OpenDecoder
(
p_this
);
if
(
i_ret
==
VLC_SUCCESS
)
{
p_
dec
->
p_
sys
->
b_packetizer
=
true
;
p_sys
->
b_packetizer
=
true
;
p_dec
->
fmt_out
.
i_codec
=
VLC_CODEC_KATE
;
}
...
...
@@ -1247,9 +1248,11 @@ static void ParseKateComments( decoder_t *p_dec )
char
*
psz_name
,
*
psz_value
,
*
psz_comment
;
int
i
=
0
;
while
(
i
<
p_dec
->
p_sys
->
kc
.
comments
)
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
while
(
i
<
p_sys
->
kc
.
comments
)
{
psz_comment
=
strdup
(
p_
dec
->
p_
sys
->
kc
.
user_comments
[
i
]
);
psz_comment
=
strdup
(
p_sys
->
kc
.
user_comments
[
i
]
);
if
(
!
psz_comment
)
break
;
psz_name
=
psz_comment
;
...
...
modules/codec/oggspots.c
View file @
b3b7f62c
...
...
@@ -138,11 +138,12 @@ static int OpenDecoder(vlc_object_t* p_this)
static
int
OpenPacketizer
(
vlc_object_t
*
p_this
)
{
decoder_t
*
p_dec
=
(
decoder_t
*
)
p_this
;
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
int
i_ret
=
OpenDecoder
(
p_this
);
if
(
i_ret
==
VLC_SUCCESS
)
{
p_
dec
->
p_
sys
->
b_packetizer
=
true
;
p_sys
->
b_packetizer
=
true
;
p_dec
->
fmt_out
.
i_codec
=
VLC_CODEC_OGGSPOTS
;
}
...
...
modules/codec/opus.c
View file @
b3b7f62c
...
...
@@ -177,7 +177,7 @@ static int OpenDecoder( vlc_object_t *p_this )
/* Allocate the memory needed to store the decoder's structure */
if
(
(
p_dec
->
p_sys
=
p_sys
=
malloc
(
sizeof
(
decoder_sys_t
))
)
==
NULL
)
return
VLC_ENOMEM
;
p_
dec
->
p_
sys
->
b_has_headers
=
false
;
p_sys
->
b_has_headers
=
false
;
date_Set
(
&
p_sys
->
end_date
,
0
);
...
...
modules/codec/png.c
View file @
b3b7f62c
...
...
@@ -116,11 +116,12 @@ static int OpenDecoder( vlc_object_t *p_this )
}
/* Allocate the memory needed to store the decoder's structure */
p_dec
->
p_sys
=
malloc
(
sizeof
(
decoder_sys_t
)
);
decoder_sys_t
*
p_sys
=
malloc
(
sizeof
(
decoder_sys_t
)
);
if
(
p_dec
->
p_sys
==
NULL
)
return
VLC_ENOMEM
;
p_dec
->
p_sys
=
p_sys
;
p_
dec
->
p_
sys
->
p_obj
=
p_this
;
p_sys
->
p_obj
=
p_this
;
/* Set output properties */
p_dec
->
fmt_out
.
i_codec
=
VLC_CODEC_RGBA
;
...
...
modules/codec/rawvideo.c
View file @
b3b7f62c
...
...
@@ -244,7 +244,7 @@ static int DecodeFrame( decoder_t *p_dec, block_t *p_block )
FillPicture
(
p_dec
,
p_block
,
p_pic
);
/* Date management: 1 frame per packet */
p_pic
->
date
=
date_Get
(
&
p_
dec
->
p_
sys
->
pts
);
p_pic
->
date
=
date_Get
(
&
p_sys
->
pts
);
date_Increment
(
&
p_sys
->
pts
,
1
);
if
(
p_block
->
i_flags
&
BLOCK_FLAG_INTERLACED_MASK
)
...
...
modules/codec/scte18.c
View file @
b3b7f62c
...
...
@@ -178,7 +178,9 @@ static int Decode( decoder_t *p_dec, block_t *p_block )
if
(
p_block
->
i_flags
&
(
BLOCK_FLAG_CORRUPTED
))
goto
exit
;
scte18_cea_t
*
p_cea
=
scte18_cea_Decode
(
p_dec
->
p_sys
->
p_handle
,
p_block
);
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
scte18_cea_t
*
p_cea
=
scte18_cea_Decode
(
p_sys
->
p_handle
,
p_block
);
if
(
p_cea
)
{
p_spu
=
decoder_NewSubpictureText
(
p_dec
);
...
...
modules/codec/speex.c
View file @
b3b7f62c
...
...
@@ -216,10 +216,10 @@ static int OpenDecoder( vlc_object_t *p_this )
/* Allocate the memory needed to store the decoder's structure */
if
(
(
p_dec
->
p_sys
=
p_sys
=
malloc
(
sizeof
(
decoder_sys_t
))
)
==
NULL
)
return
VLC_ENOMEM
;
p_
dec
->
p_
sys
->
bits
.
buf_size
=
0
;
p_
dec
->
p_
sys
->
b_packetizer
=
false
;
p_
dec
->
p_
sys
->
rtp_rate
=
p_dec
->
fmt_in
.
audio
.
i_rate
;
p_
dec
->
p_
sys
->
b_has_headers
=
false
;
p_sys
->
bits
.
buf_size
=
0
;
p_sys
->
b_packetizer
=
false
;
p_sys
->
rtp_rate
=
p_dec
->
fmt_in
.
audio
.
i_rate
;
p_sys
->
b_has_headers
=
false
;
date_Set
(
&
p_sys
->
end_date
,
0
);
...
...
@@ -255,12 +255,13 @@ static int OpenDecoder( vlc_object_t *p_this )
static
int
OpenPacketizer
(
vlc_object_t
*
p_this
)
{
decoder_t
*
p_dec
=
(
decoder_t
*
)
p_this
;
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
int
i_ret
=
OpenDecoder
(
p_this
);
if
(
i_ret
==
VLC_SUCCESS
)
{
p_
dec
->
p_
sys
->
b_packetizer
=
true
;
p_sys
->
b_packetizer
=
true
;
p_dec
->
fmt_out
.
i_codec
=
VLC_CODEC_SPEEX
;
}
...
...
modules/codec/spudec/spudec.c
View file @
b3b7f62c
...
...
@@ -113,8 +113,11 @@ static int PacketizerOpen( vlc_object_t *p_this )
{
return
VLC_EGENERIC
;
}
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
p_dec
->
pf_packetize
=
Packetize
;
p_
dec
->
p_
sys
->
b_packetizer
=
true
;
p_sys
->
b_packetizer
=
true
;
es_format_Copy
(
&
p_dec
->
fmt_out
,
&
p_dec
->
fmt_in
);
p_dec
->
fmt_out
.
i_codec
=
VLC_CODEC_SPU
;
...
...
modules/codec/stl.c
View file @
b3b7f62c
...
...
@@ -381,6 +381,8 @@ static int Decode(decoder_t *p_dec, block_t *p_block)
if
(
p_block
==
NULL
)
/* No Drain */
return
VLCDEC_SUCCESS
;
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
if
(
p_block
->
i_buffer
<
STL_TTI_SIZE
)
p_block
->
i_flags
|=
BLOCK_FLAG_CORRUPTED
;
...
...
@@ -395,11 +397,11 @@ static int Decode(decoder_t *p_dec, block_t *p_block)
}
}
const
char
*
psz_charset
=
cct_nums
[
p_
dec
->
p_
sys
->
cct
-
CCT_BEGIN
].
str
;
const
char
*
psz_charset
=
cct_nums
[
p_sys
->
cct
-
CCT_BEGIN
].
str
;
for
(
size_t
i
=
0
;
i
<
p_block
->
i_buffer
/
STL_TTI_SIZE
;
i
++
)
{
stl_sg_t
*
p_group
=
&
p_
dec
->
p_
sys
->
groups
[
p_block
->
p_buffer
[
0
]];
if
(
ParseTTI
(
p_group
,
&
p_block
->
p_buffer
[
i
*
STL_TTI_SIZE
],
psz_charset
,
p_
dec
->
p_
sys
->
i_fps
)
&&
stl_sg_t
*
p_group
=
&
p_sys
->
groups
[
p_block
->
p_buffer
[
0
]];
if
(
ParseTTI
(
p_group
,
&
p_block
->
p_buffer
[
i
*
STL_TTI_SIZE
],
psz_charset
,
p_sys
->
i_fps
)
&&
p_group
->
p_segment
!=
NULL
)
{
/* output */
...
...
@@ -426,7 +428,7 @@ static int Decode(decoder_t *p_dec, block_t *p_block)
}
}
ResetGroups
(
p_
dec
->
p_
sys
);
ResetGroups
(
p_sys
);
block_Release
(
p_block
);
return
VLCDEC_SUCCESS
;
...
...
modules/codec/textst.c
View file @
b3b7f62c
...
...
@@ -64,7 +64,7 @@ vlc_module_end()
static
size_t
textst_FillRegion
(
decoder_t
*
p_dec
,
const
uint8_t
*
p_data
,
size_t
i_data
,
subpicture_updater_sys_region_t
*
p_region
)
{
VLC_UNUSED
(
p_dec
)
;
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
text_segment_t
**
pp_last
=
&
p_region
->
p_segments
;
text_style_t
*
p_style
=
NULL
;
...
...
@@ -122,8 +122,8 @@ static size_t textst_FillRegion(decoder_t *p_dec, const uint8_t *p_data, size_t
p_style
->
i_style_flags
|=
STYLE_ITALIC
;
if
(
p_data
[
0
]
&
0x04
)
p_style
->
i_style_flags
|=
STYLE_OUTLINE
;
p_style
->
i_outline_color
=
p_
dec
->
p_
sys
->
palette
[
p_data
[
1
]]
&
0x00FFFFFF
;
p_style
->
i_outline_alpha
=
p_
dec
->
p_
sys
->
palette
[
p_data
[
1
]]
>>
24
;
p_style
->
i_outline_color
=
p_sys
->
palette
[
p_data
[
1
]]
&
0x00FFFFFF
;
p_style
->
i_outline_alpha
=
p_sys
->
palette
[
p_data
[
1
]]
>>
24
;
p_style
->
i_features
|=
STYLE_HAS_FLAGS
|
STYLE_HAS_OUTLINE_ALPHA
|
STYLE_HAS_OUTLINE_COLOR
;
//p_data[2] outline__thickness
}
...
...
@@ -136,8 +136,8 @@ static size_t textst_FillRegion(decoder_t *p_dec, const uint8_t *p_data, size_t
case
BD_TEXTST_DATA_FONT_COLOR
:
if
(
i_data
>
1
&&
(
p_style
||
(
p_style
=
text_style_Create
(
STYLE_NO_DEFAULTS
))))
{
p_style
->
i_font_color
=
p_
dec
->
p_
sys
->
palette
[
p_data
[
1
]]
&
0x00FFFFFF
;
p_style
->
i_font_alpha
=
p_
dec
->
p_
sys
->
palette
[
p_data
[
1
]]
>>
24
;
p_style
->
i_font_color
=
p_sys
->
palette
[
p_data
[
1
]]
&
0x00FFFFFF
;
p_style
->
i_font_alpha
=
p_sys
->
palette
[
p_data
[
1
]]
>>
24
;
p_style
->
i_features
|=
STYLE_HAS_FONT_ALPHA
|
STYLE_HAS_FONT_COLOR
;
}
break
;
...
...
@@ -171,13 +171,16 @@ static size_t textst_Decode_palette(decoder_t *p_dec, const uint8_t *p_data, siz
{
if
(
i_data
<
2
)
return
i_data
;
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
uint16_t
i_size
=
GetWBE
(
&
p_data
[
0
]);
p_data
+=
2
;
i_data
-=
2
;
i_size
=
i_data
=
__MIN
(
i_data
,
i_size
);
while
(
i_data
>
4
)
{
p_
dec
->
p_
sys
->
palette
[
p_data
[
0
]]
=
/* YCrCbT to ARGB */
p_sys
->
palette
[
p_data
[
0
]]
=
/* YCrCbT to ARGB */
(
(
uint32_t
)((
float
)
p_data
[
1
]
+
1
.
402
f
*
(
p_data
[
2
]
-
128
))
<<
16
)
|
(
(
uint32_t
)((
float
)
p_data
[
1
]
-
0
.
34414
*
(
p_data
[
3
]
-
128
)
-
0
.
71414
*
(
p_data
[
2
]
-
128
))
<<
8
)
|
(
(
uint32_t
)((
float
)
p_data
[
1
]
+
1
.
722
*
(
p_data
[
3
]
-
128
))
)
|
...
...
modules/codec/theora.c
View file @
b3b7f62c
...
...
@@ -159,7 +159,7 @@ static int OpenDecoder( vlc_object_t *p_this )
/* Allocate the memory needed to store the decoder's structure */
if
(
(
p_dec
->
p_sys
=
p_sys
=
malloc
(
sizeof
(
*
p_sys
))
)
==
NULL
)
return
VLC_ENOMEM
;
p_
dec
->
p_
sys
->
b_packetizer
=
false
;
p_sys
->
b_packetizer
=
false
;
p_sys
->
b_has_headers
=
false
;
p_sys
->
i_pts
=
VLC_TS_INVALID
;
p_sys
->
b_decoded_first_keyframe
=
false
;
...
...
@@ -183,12 +183,13 @@ static int OpenDecoder( vlc_object_t *p_this )
static
int
OpenPacketizer
(
vlc_object_t
*
p_this
)
{
decoder_t
*
p_dec
=
(
decoder_t
*
)
p_this
;
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
int
i_ret
=
OpenDecoder
(
p_this
);
if
(
i_ret
==
VLC_SUCCESS
)
{
p_
dec
->
p_
sys
->
b_packetizer
=
true
;
p_sys
->
b_packetizer
=
true
;
p_dec
->
fmt_out
.
i_codec
=
VLC_CODEC_THEORA
;
}
...
...
@@ -550,6 +551,9 @@ static void ParseTheoraComments( decoder_t *p_dec )
{
char
*
psz_name
,
*
psz_value
,
*
psz_comment
;
int
i
=
0
;
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
/* Regarding the th_comment structure: */
/* The metadata is stored as a series of (tag, value) pairs, in
...
...
@@ -565,14 +569,14 @@ static void ParseTheoraComments( decoder_t *p_dec )
the bitstream format itself treats them as 8-bit clean vectors,
possibly containing null characters, and so the length array
should be treated as their authoritative length. */
while
(
i
<
p_
dec
->
p_
sys
->
tc
.
comments
)
while
(
i
<
p_sys
->
tc
.
comments
)
{
int
clen
=
p_
dec
->
p_
sys
->
tc
.
comment_lengths
[
i
];
int
clen
=
p_sys
->
tc
.
comment_lengths
[
i
];
if
(
clen
<=
0
||
clen
>=
INT_MAX
)
{
i
++
;
continue
;
}
psz_comment
=
(
char
*
)
malloc
(
clen
+
1
);
if
(
!
psz_comment
)
break
;
memcpy
(
(
void
*
)
psz_comment
,
(
void
*
)
p_
dec
->
p_
sys
->
tc
.
user_comments
[
i
],
clen
+
1
);
memcpy
(
(
void
*
)
psz_comment
,
(
void
*
)
p_sys
->
tc
.
user_comments
[
i
],
clen
+
1
);
psz_name
=
psz_comment
;
psz_value
=
strchr
(
psz_comment
,
'='
);
if
(
psz_value
)
...
...
modules/codec/ttml/substtml.c
View file @
b3b7f62c
...
...
@@ -1107,6 +1107,7 @@ static int ParseBlock( decoder_t *p_dec, const block_t *p_block )
subpicture_updater_sys_t
*
p_spu_sys
=
p_spu
->
updater
.
p_sys
;
subpicture_updater_sys_region_t
*
p_updtregion
=
NULL
;
decoder_sys_t
*
p_dec_sys
=
p_dec
->
p_sys
;
/* Create region update info from each ttml region */
for
(
ttml_region_t
*
p_region
=
p_regions
;
...
...
@@ -1125,8 +1126,8 @@ static int ParseBlock( decoder_t *p_dec, const block_t *p_block )
}
/* broken legacy align var (can't handle center...). Will change only regions content. */
if
(
p_dec
->
p
_sys
->
i_align
&
SUBPICTURE_ALIGN_MASK
)
p_spu_sys
->
region
.
inner_align
=
p_dec
->
p
_sys
->
i_align
;
if
(
p_dec_sys
->
i_align
&
SUBPICTURE_ALIGN_MASK
)
p_spu_sys
->
region
.
inner_align
=
p_dec_sys
->
i_align
;
p_spu_sys
->
margin_ratio
=
0
.
0
;
...
...
modules/codec/videotoolbox.m
View file @
b3b7f62c
...
...
@@ -1615,13 +1615,15 @@ static CFMutableDictionaryRef ESDSExtradataInfoCreate(decoder_t *p_dec,
static int ConfigureVout(decoder_t *p_dec)
{
decoder_sys_t *p_sys = p_dec->p_sys;
/* return our proper VLC internal state */
p_dec->fmt_out.video = p_dec->fmt_in.video;
p_dec->fmt_out.video.p_palette = NULL;
p_dec->fmt_out.i_codec = 0;
if(p_
dec->p_
sys->pf_configure_vout &&
!p_
dec->p_
sys->pf_configure_vout(p_dec))
if(p_sys->pf_configure_vout &&
!p_sys->pf_configure_vout(p_dec))
return VLC_EGENERIC;
if (!p_dec->fmt_out.video.i_sar_num || !p_dec->fmt_out.video.i_sar_den)
...
...
@@ -1667,11 +1669,12 @@ static CMSampleBufferRef VTSampleBufferCreate(decoder_t *p_dec,
CMFormatDescriptionRef fmt_desc,
block_t *p_block)
{
decoder_sys_t *p_sys = p_dec->p_sys;
OSStatus status;
CMBlockBufferRef block_buf = NULL;
CMSampleBufferRef sample_buf = NULL;
CMTime pts;
if(!p_
dec->p_
sys->b_poc_based_reorder && p_block->i_pts == VLC_TS_INVALID)
if(!p_sys->b_poc_based_reorder && p_block->i_pts == VLC_TS_INVALID)
pts = CMTimeMake(p_block->i_dts, CLOCK_FREQ);
else
pts = CMTimeMake(p_block->i_pts, CLOCK_FREQ);
...
...
@@ -2029,6 +2032,7 @@ skip:
static int UpdateVideoFormat(decoder_t *p_dec, CVPixelBufferRef imageBuffer)
{
decoder_sys_t *p_sys = p_dec->p_sys;
NSDictionary *attachmentDict =
(__bridge NSDictionary *)CVBufferGetAttachments(imageBuffer, kCVAttachmentMode_ShouldPropagate);
...
...
@@ -2088,13 +2092,13 @@ static int UpdateVideoFormat(decoder_t *p_dec, CVPixelBufferRef imageBuffer)
assert
(
CVPixelBufferIsPlanar
(
imageBuffer
)
==
false
)
;
break
;
default
:
p
_
dec
->
p
_
sys
->
vtsession
_
status
=
VTSESSION
_
STATUS
_
ABORT
;
p
_
sys
->
vtsession
_
status
=
VTSESSION
_
STATUS
_
ABORT
;
return
-
1
;
}
p
_
dec
->
fmt
_
out
.
video
.
i
_
chroma
=
p
_
dec
->
fmt
_
out
.
i
_
codec
;
if
(
decoder
_
UpdateVideoFormat
(
p
_
dec
)
!=
0
)
{
p
_
dec
->
p
_
sys
->
vtsession
_
status
=
VTSESSION
_
STATUS
_
ABORT
;
p
_
sys
->
vtsession
_
status
=
VTSESSION
_
STATUS
_
ABORT
;
return
-
1
;
}
return
0
;
...
...
modules/codec/vorbis.c
View file @
b3b7f62c
...
...
@@ -271,12 +271,13 @@ static int OpenDecoder( vlc_object_t *p_this )
static
int
OpenPacketizer
(
vlc_object_t
*
p_this
)
{
decoder_t
*
p_dec
=
(
decoder_t
*
)
p_this
;
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
int
i_ret
=
OpenDecoder
(
p_this
);
if
(
i_ret
==
VLC_SUCCESS
)
{
p_
dec
->
p_
sys
->
b_packetizer
=
true
;
p_sys
->
b_packetizer
=
true
;
p_dec
->
fmt_out
.
i_codec
=
VLC_CODEC_VORBIS
;
}
...
...
@@ -608,9 +609,11 @@ static void ParseVorbisComments( decoder_t *p_dec )
char
*
psz_name
,
*
psz_value
,
*
psz_comment
;
int
i
=
0
;
while
(
i
<
p_dec
->
p_sys
->
vc
.
comments
)
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
while
(
i
<
p_sys
->
vc
.
comments
)
{
psz_comment
=
strdup
(
p_
dec
->
p_
sys
->
vc
.
user_comments
[
i
]
);
psz_comment
=
strdup
(
p_sys
->
vc
.
user_comments
[
i
]
);
if
(
!
psz_comment
)
break
;
psz_name
=
psz_comment
;
...
...
modules/codec/vpx.c
View file @
b3b7f62c
...
...
@@ -161,7 +161,8 @@ static vlc_fourcc_t FindVlcChroma( struct vpx_image *img )
****************************************************************************/
static
int
Decode
(
decoder_t
*
dec
,
block_t
*
block
)
{
struct
vpx_codec_ctx
*
ctx
=
&
dec
->
p_sys
->
ctx
;
decoder_sys_t
*
p_sys
=
dec
->
p_sys
;
struct
vpx_codec_ctx
*
ctx
=
&
p_sys
->
ctx
;
if
(
block
==
NULL
)
/* No Drain */
return
VLCDEC_SUCCESS
;
...
...
modules/codec/webvtt/subsvtt.c
View file @
b3b7f62c
...
...
@@ -862,7 +862,8 @@ static void webvtt_domnode_SelectNodesInTree( decoder_t *p_dec, const vlc_css_se
static
void
webvtt_domnode_SelectRuleNodes
(
decoder_t
*
p_dec
,
const
vlc_css_rule_t
*
p_rule
,
mtime_t
i_playbacktime
,
vlc_array_t
*
p_results
)
{
const
webvtt_dom_node_t
*
p_cues
=
p_dec
->
p_sys
->
p_root
->
p_child
;
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
const
webvtt_dom_node_t
*
p_cues
=
p_sys
->
p_root
->
p_child
;
for
(
const
vlc_css_selector_t
*
p_sel
=
p_rule
->
p_selectors
;
p_sel
;
p_sel
=
p_sel
->
p_next
)
{
vlc_array_t
tempresults
;
...
...
@@ -1309,6 +1310,7 @@ static text_style_t * ComputeStyle( decoder_t *p_dec, const webvtt_dom_node_t *p
text_style_t
*
p_style
=
NULL
;
text_style_t
*
p_dfltstyle
=
NULL
;
mtime_t
i_tagtime
=
-
1
;
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
for
(
const
webvtt_dom_node_t
*
p_node
=
p_leaf
;
p_node
;
p_node
=
p_node
->
p_parent
)
{
...
...
@@ -1364,7 +1366,7 @@ static text_style_t * ComputeStyle( decoder_t *p_dec, const webvtt_dom_node_t *p
else
if
(
!
strcmp
(
p_tagnode
->
psz_tag
,
"v"
)
&&
p_tagnode
->
psz_attrs
)
{
#ifdef HAVE_CSS
if
(
p_
dec
->
p_
sys
->
p_css_rules
==
NULL
)
/* Only auto style when no CSS sheet */
if
(
p_sys
->
p_css_rules
==
NULL
)
/* Only auto style when no CSS sheet */
#endif
{
if
(
p_style
||
(
p_style
=
text_style_Create
(
STYLE_NO_DEFAULTS
))
)
...
...
@@ -1714,13 +1716,14 @@ static void RenderRegions( decoder_t *p_dec, mtime_t i_start, mtime_t i_stop )
{
subpicture_t
*
p_spu
=
NULL
;
subpicture_updater_sys_region_t
*
p_updtregion
=
NULL
;
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
#ifdef HAVE_CSS
ApplyCSSRules
(
p_dec
,
p_
dec
->
p_
sys
->
p_css_rules
,
i_start
);
ApplyCSSRules
(
p_dec
,
p_sys
->
p_css_rules
,
i_start
);
#endif
const
webvtt_dom_cue_t
*
p_rlcue
=
NULL
;
for
(
const
webvtt_dom_node_t
*
p_node
=
p_
dec
->
p_
sys
->
p_root
->
p_child
;
for
(
const
webvtt_dom_node_t
*
p_node
=
p_sys
->
p_root
->
p_child
;
p_node
;
p_node
=
p_node
->
p_next
)
{
if
(
p_node
->
type
==
NODE_REGION
)
...
...
@@ -1879,6 +1882,7 @@ static int ProcessISOBMFF( decoder_t *p_dec,
const
uint8_t
*
p_buffer
,
size_t
i_buffer
,
mtime_t
i_start
,
mtime_t
i_stop
)
{
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
mp4_box_iterator_t
it
;
mp4_box_iterator_Init
(
&
it
,
p_buffer
,
i_buffer
);
while
(
mp4_box_iterator_Next
(
&
it
)
)
...
...
@@ -1916,7 +1920,7 @@ static int ProcessISOBMFF( decoder_t *p_dec,
free
(
psz
);
}
webvtt_region_t
*
p_region
=
webvtt_region_GetByID
(
p_
dec
->
p_
sys
,
webvtt_region_t
*
p_region
=
webvtt_region_GetByID
(
p_sys
,
p_cue
->
settings
.
psz_region
);
if
(
p_region
)
{
...
...
@@ -1925,8 +1929,8 @@ static int ProcessISOBMFF( decoder_t *p_dec,
}
else
{
webvtt_domnode_AppendLast
(
&
p_
dec
->
p_
sys
->
p_root
->
p_child
,
p_cue
);
p_cue
->
p_parent
=
(
webvtt_dom_node_t
*
)
p_
dec
->
p_
sys
->
p_root
;
webvtt_domnode_AppendLast
(
&
p_sys
->
p_root
->
p_child
,
p_cue
);