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
Issues
13
Issues
13
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
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
GSoC
GSoC2018
macOS
vlc
Commits
d466fd41
Commit
d466fd41
authored
Dec 16, 2009
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed es_format_t::i_aspect.
It was duplicated with es_format_t::i_sar_num/den.
parent
deca66fb
Changes
85
Show whitespace changes
Inline
Side-by-side
Showing
85 changed files
with
363 additions
and
397 deletions
+363
-397
include/vlc_es.h
include/vlc_es.h
+0
-1
modules/access/dshow/dshow.cpp
modules/access/dshow/dshow.cpp
+2
-1
modules/access/dvdnav.c
modules/access/dvdnav.c
+0
-17
modules/access/dvdread.c
modules/access/dvdread.c
+41
-13
modules/access/imem.c
modules/access/imem.c
+0
-1
modules/access/qtcapture.m
modules/access/qtcapture.m
+2
-2
modules/access/screen/screen.c
modules/access/screen/screen.c
+2
-2
modules/access/v4l.c
modules/access/v4l.c
+2
-1
modules/access/v4l2.c
modules/access/v4l2.c
+2
-1
modules/codec/avcodec/encoder.c
modules/codec/avcodec/encoder.c
+2
-7
modules/codec/avcodec/subtitle.c
modules/codec/avcodec/subtitle.c
+0
-1
modules/codec/avcodec/video.c
modules/codec/avcodec/video.c
+10
-16
modules/codec/cc.c
modules/codec/cc.c
+0
-1
modules/codec/cdg.c
modules/codec/cdg.c
+2
-2
modules/codec/cvdsub.c
modules/codec/cvdsub.c
+2
-1
modules/codec/dirac.c
modules/codec/dirac.c
+2
-3
modules/codec/dmo/dmo.c
modules/codec/dmo/dmo.c
+6
-4
modules/codec/dvbsub.c
modules/codec/dvbsub.c
+4
-2
modules/codec/fake.c
modules/codec/fake.c
+4
-3
modules/codec/invmem.c
modules/codec/invmem.c
+2
-1
modules/codec/kate.c
modules/codec/kate.c
+2
-2
modules/codec/libmpeg2.c
modules/codec/libmpeg2.c
+14
-17
modules/codec/png.c
modules/codec/png.c
+2
-1
modules/codec/quicktime.c
modules/codec/quicktime.c
+2
-1
modules/codec/rawvideo.c
modules/codec/rawvideo.c
+5
-5
modules/codec/realvideo.c
modules/codec/realvideo.c
+4
-2
modules/codec/schroedinger.c
modules/codec/schroedinger.c
+2
-6
modules/codec/sdl_image.c
modules/codec/sdl_image.c
+2
-2
modules/codec/spudec/parse.c
modules/codec/spudec/parse.c
+2
-1
modules/codec/subtitles/subsdec.c
modules/codec/subtitles/subsdec.c
+0
-1
modules/codec/subtitles/subsusf.c
modules/codec/subtitles/subsusf.c
+0
-2
modules/codec/svcdsub.c
modules/codec/svcdsub.c
+2
-1
modules/codec/tarkin.c
modules/codec/tarkin.c
+2
-2
modules/codec/telx.c
modules/codec/telx.c
+0
-1
modules/codec/theora.c
modules/codec/theora.c
+8
-11
modules/codec/x264.c
modules/codec/x264.c
+5
-8
modules/codec/zvbi.c
modules/codec/zvbi.c
+4
-2
modules/demux/asf/asf.c
modules/demux/asf/asf.c
+2
-3
modules/demux/avformat/mux.c
modules/demux/avformat/mux.c
+2
-5
modules/demux/mkv/matroska_segment_parse.cpp
modules/demux/mkv/matroska_segment_parse.cpp
+4
-1
modules/demux/mp4/mp4.c
modules/demux/mp4/mp4.c
+4
-2
modules/demux/nuv.c
modules/demux/nuv.c
+2
-1
modules/demux/rawvid.c
modules/demux/rawvid.c
+14
-11
modules/gui/fbosd.c
modules/gui/fbosd.c
+17
-13
modules/misc/freetype.c
modules/misc/freetype.c
+0
-2
modules/misc/quartztext.c
modules/misc/quartztext.c
+0
-1
modules/misc/stats/decoder.c
modules/misc/stats/decoder.c
+2
-1
modules/misc/svg.c
modules/misc/svg.c
+2
-1
modules/mux/asf.c
modules/mux/asf.c
+6
-5
modules/mux/mp4.c
modules/mux/mp4.c
+12
-9
modules/packetizer/h264.c
modules/packetizer/h264.c
+9
-5
modules/packetizer/mpegvideo.c
modules/packetizer/mpegvideo.c
+5
-3
modules/packetizer/vc1.c
modules/packetizer/vc1.c
+2
-1
modules/stream_out/mosaic_bridge.c
modules/stream_out/mosaic_bridge.c
+10
-15
modules/stream_out/transcode/video.c
modules/stream_out/transcode/video.c
+21
-17
modules/video_filter/audiobargraph_v.c
modules/video_filter/audiobargraph_v.c
+0
-1
modules/video_filter/canvas.c
modules/video_filter/canvas.c
+17
-8
modules/video_filter/crop.c
modules/video_filter/crop.c
+5
-7
modules/video_filter/deinterlace.c
modules/video_filter/deinterlace.c
+0
-1
modules/video_filter/dynamicoverlay/dynamicoverlay_commands.c
...les/video_filter/dynamicoverlay/dynamicoverlay_commands.c
+2
-2
modules/video_filter/logo.c
modules/video_filter/logo.c
+0
-1
modules/video_filter/marq.c
modules/video_filter/marq.c
+0
-1
modules/video_filter/osdmenu.c
modules/video_filter/osdmenu.c
+0
-2
modules/video_filter/remoteosd.c
modules/video_filter/remoteosd.c
+0
-1
modules/video_filter/rss.c
modules/video_filter/rss.c
+0
-1
modules/video_filter/transform.c
modules/video_filter/transform.c
+0
-3
modules/video_filter/wall.c
modules/video_filter/wall.c
+2
-2
modules/video_filter/wrapper.c
modules/video_filter/wrapper.c
+0
-5
modules/video_output/msw/common_vo.c
modules/video_output/msw/common_vo.c
+0
-1
modules/video_output/omapfb.c
modules/video_output/omapfb.c
+3
-1
modules/video_output/opengl.c
modules/video_output/opengl.c
+2
-3
modules/video_output/wrapper.c
modules/video_output/wrapper.c
+6
-6
modules/visualization/goom.c
modules/visualization/goom.c
+0
-1
modules/visualization/visual/visual.c
modules/visualization/visual/visual.c
+0
-1
src/input/decoder.c
src/input/decoder.c
+4
-6
src/misc/es_format.c
src/misc/es_format.c
+0
-5
src/misc/image.c
src/misc/image.c
+11
-6
src/osd/osd_text.c
src/osd/osd_text.c
+0
-1
src/osd/osd_widgets.c
src/osd/osd_widgets.c
+0
-1
src/video_output/display.c
src/video_output/display.c
+0
-3
src/video_output/video_output.c
src/video_output/video_output.c
+39
-60
src/video_output/video_text.c
src/video_output/video_text.c
+0
-1
src/video_output/vout_intf.c
src/video_output/vout_intf.c
+12
-10
src/video_output/vout_pictures.c
src/video_output/vout_pictures.c
+3
-4
src/video_output/vout_subpictures.c
src/video_output/vout_subpictures.c
+2
-11
No files found.
include/vlc_es.h
View file @
d466fd41
...
...
@@ -105,7 +105,6 @@ struct audio_format_t
struct
video_format_t
{
vlc_fourcc_t
i_chroma
;
/**< picture chroma */
unsigned
int
i_aspect
;
/**< aspect ratio */
unsigned
int
i_width
;
/**< picture width */
unsigned
int
i_height
;
/**< picture height */
...
...
modules/access/dshow/dshow.cpp
View file @
d466fd41
...
...
@@ -647,7 +647,8 @@ static int DemuxOpen( vlc_object_t *p_this )
fmt
.
video
.
i_width
=
p_stream
->
header
.
video
.
bmiHeader
.
biWidth
;
fmt
.
video
.
i_height
=
p_stream
->
header
.
video
.
bmiHeader
.
biHeight
;
fmt
.
video
.
i_aspect
=
4
*
VOUT_ASPECT_FACTOR
/
3
;
fmt
.
video
.
i_sar_num
=
4
*
fmt
.
video
.
i_height
;
fmt
.
video
.
i_sar_den
=
4
*
fmt
.
video
.
i_width
;
if
(
!
p_stream
->
header
.
video
.
bmiHeader
.
biCompression
)
{
...
...
modules/access/dvdnav.c
View file @
d466fd41
...
...
@@ -139,8 +139,6 @@ struct demux_sys_t
bool
b_spu_change
;
/* */
int
i_aspect
;
int
i_title
;
input_title_t
**
title
;
...
...
@@ -228,7 +226,6 @@ static int Open( vlc_object_t *p_this )
p_sys
->
b_reset_pcr
=
false
;
ps_track_init
(
p_sys
->
tk
);
p_sys
->
i_aspect
=
-
1
;
p_sys
->
i_mux_rate
=
0
;
p_sys
->
i_pgc_length
=
0
;
p_sys
->
b_spu_change
=
false
;
...
...
@@ -728,10 +725,6 @@ static int Demux( demux_t *p_demux )
msg_Dbg
(
p_demux
,
" - vtsN=%d"
,
event
->
new_vtsN
);
msg_Dbg
(
p_demux
,
" - domain=%d"
,
event
->
new_domain
);
/* dvdnav_get_video_aspect / dvdnav_get_video_scale_permission */
/* TODO check if we always have VTS and CELL */
p_sys
->
i_aspect
=
dvdnav_get_video_aspect
(
p_sys
->
dvdnav
);
/* reset PCR */
es_out_Control
(
p_demux
->
out
,
ES_OUT_RESET_PCR
);
...
...
@@ -1183,16 +1176,6 @@ static void ESNew( demux_t *p_demux, int i_id )
/* Add a new ES */
if
(
tk
->
fmt
.
i_cat
==
VIDEO_ES
)
{
switch
(
p_sys
->
i_aspect
)
{
case
1
:
tk
->
fmt
.
video
.
i_aspect
=
VOUT_ASPECT_FACTOR
;
break
;
case
2
:
tk
->
fmt
.
video
.
i_aspect
=
VOUT_ASPECT_FACTOR
*
4
/
3
;
break
;
case
3
:
tk
->
fmt
.
video
.
i_aspect
=
VOUT_ASPECT_FACTOR
*
16
/
9
;
break
;
case
4
:
tk
->
fmt
.
video
.
i_aspect
=
VOUT_ASPECT_FACTOR
*
221
/
10
;
break
;
default:
tk
->
fmt
.
video
.
i_aspect
=
0
;
break
;
}
b_select
=
true
;
}
else
if
(
tk
->
fmt
.
i_cat
==
AUDIO_ES
)
...
...
modules/access/dvdread.c
View file @
d466fd41
...
...
@@ -172,7 +172,8 @@ struct demux_sys_t
input_title_t
**
titles
;
/* Video */
int
i_aspect
;
int
i_sar_num
;
int
i_sar_den
;
/* SPU */
uint32_t
clut
[
16
];
...
...
@@ -266,7 +267,8 @@ static int Open( vlc_object_t *p_this )
DEMUX_INIT_COMMON
();
p_sys
=
p_demux
->
p_sys
;
ps_track_init
(
p_sys
->
tk
);
p_sys
->
i_aspect
=
-
1
;
p_sys
->
i_sar_num
=
0
;
p_sys
->
i_sar_den
=
0
;
p_sys
->
i_title_cur_time
=
(
mtime_t
)
0
;
p_sys
->
i_cell_cur_time
=
(
mtime_t
)
0
;
p_sys
->
i_cell_duration
=
(
mtime_t
)
0
;
...
...
@@ -713,16 +715,8 @@ static void ESNew( demux_t *p_demux, int i_id, int i_lang )
/* Add a new ES */
if
(
tk
->
fmt
.
i_cat
==
VIDEO_ES
)
{
switch
(
p_sys
->
i_aspect
)
{
case
1
:
tk
->
fmt
.
video
.
i_aspect
=
VOUT_ASPECT_FACTOR
;
break
;
case
2
:
tk
->
fmt
.
video
.
i_aspect
=
VOUT_ASPECT_FACTOR
*
4
/
3
;
break
;
case
3
:
tk
->
fmt
.
video
.
i_aspect
=
VOUT_ASPECT_FACTOR
*
16
/
9
;
break
;
case
4
:
tk
->
fmt
.
video
.
i_aspect
=
VOUT_ASPECT_FACTOR
*
221
/
10
;
break
;
default:
tk
->
fmt
.
video
.
i_aspect
=
0
;
break
;
}
tk
->
fmt
.
video
.
i_sar_num
=
p_sys
->
i_sar_num
;
tk
->
fmt
.
video
.
i_sar_den
=
p_sys
->
i_sar_den
;
}
else
if
(
tk
->
fmt
.
i_cat
==
AUDIO_ES
)
{
...
...
@@ -906,7 +900,41 @@ static int DvdReadSetArea( demux_t *p_demux, int i_title, int i_chapter,
ESNew
(
p_demux
,
0xe0
,
0
);
/* Video, FIXME ? */
p_sys
->
i_aspect
=
p_vts
->
vtsi_mat
->
vts_video_attr
.
display_aspect_ratio
;
const
video_attr_t
*
p_attr
=
&
p_vts
->
vtsi_mat
->
vts_video_attr
;
int
i_video_height
=
p_attr
->
video_format
!=
0
?
576
:
480
;
int
i_video_width
;
switch
(
p_attr
->
picture_size
)
{
case
0
:
i_video_width
=
720
;
break
;
case
1
:
i_video_width
=
704
;
break
;
case
2
:
i_video_width
=
352
;
break
;
default:
case
3
:
i_video_width
=
352
;
i_video_height
/=
2
;
break
;
}
switch
(
p_attr
->
display_aspect_ratio
)
{
case
0
:
p_sys
->
i_sar_num
=
4
*
i_video_height
;
p_sys
->
i_sar_den
=
3
*
i_video_width
;
break
;
case
3
:
p_sys
->
i_sar_num
=
16
*
i_video_height
;
p_sys
->
i_sar_den
=
9
*
i_video_width
;
break
;
default:
p_sys
->
i_sar_num
=
0
;
p_sys
->
i_sar_den
=
0
;
break
;
}
#define audio_control \
p_sys->p_vts_file->vts_pgcit->pgci_srp[pgc_id-1].pgc->audio_control[i-1]
...
...
modules/access/imem.c
View file @
d466fd41
...
...
@@ -254,7 +254,6 @@ static int Open(vlc_object_t *object)
fmt
.
video
.
i_height
=
var_CreateGetInteger
(
demux
,
"imem-height"
);
unsigned
num
,
den
;
if
(
!
var_CreateGetRational
(
demux
,
&
num
,
&
den
,
"imem-dar"
)
&&
num
>
0
&&
den
>
0
)
{
fmt
.
video
.
i_aspect
=
VOUT_ASPECT_FACTOR
*
num
/
den
;
if
(
fmt
.
video
.
i_width
>
0
&&
fmt
.
video
.
i_height
>
0
)
{
fmt
.
video
.
i_sar_num
=
num
*
fmt
.
video
.
i_height
;
fmt
.
video
.
i_sar_den
=
den
*
fmt
.
video
.
i_width
;
...
...
modules/access/qtcapture.m
View file @
d466fd41
...
...
@@ -195,7 +195,6 @@ static int Open( vlc_object_t *p_this )
int
i
;
int
i_width
;
int
i_height
;
int
i_aspect
;
int
result
=
0
;
/* Only when selected */
...
...
@@ -285,7 +284,8 @@ static int Open( vlc_object_t *p_this )
fmt
.
video
.
i_height
=
p_sys
->
height
=
encoded_size
.
height
;
if
(
par_size
.
width
!=
encoded_size
.
width
)
{
fmt
.
video
.
i_aspect
=
par_size
.
width
*
VOUT_ASPECT_FACTOR
/
encoded_size
.
width
;
fmt
.
video
.
i_sar_num
=
(
int64_t
)
encoded_size
.
height
*
par_size
.
width
/
encoded_size
.
width
;
fmt
.
video
.
i_sar_den
=
encoded_size
.
width
;
}
NSLog
(
@"encoded_size %d %d"
,
(
int
)
encoded_size
.
width
,
(
int
)
encoded_size
.
height
);
...
...
modules/access/screen/screen.c
View file @
d466fd41
...
...
@@ -340,8 +340,8 @@ void RenderCursor( demux_t *p_demux, int i_x, int i_y,
p_sys
->
fmt
.
video
.
i_chroma
,
p_sys
->
fmt
.
video
.
i_width
,
p_sys
->
fmt
.
video
.
i_height
,
p_sys
->
fmt
.
video
.
i_
aspect
*
p_sys
->
fmt
.
video
.
i_height
,
VOUT_ASPECT_FACTOR
*
p_sys
->
fmt
.
video
.
i_width
);
p_sys
->
fmt
.
video
.
i_
sar_num
,
p_sys
->
fmt
.
video
.
i_sar_den
);
if
(
!
p_sys
->
p_blend
)
{
p_sys
->
p_blend
=
vlc_object_create
(
p_demux
,
sizeof
(
filter_t
)
);
...
...
modules/access/v4l.c
View file @
d466fd41
...
...
@@ -360,7 +360,8 @@ static int Open( vlc_object_t *p_this )
es_format_Init
(
&
fmt
,
VIDEO_ES
,
p_sys
->
i_fourcc
);
fmt
.
video
.
i_width
=
p_sys
->
i_width
;
fmt
.
video
.
i_height
=
p_sys
->
i_height
;
fmt
.
video
.
i_aspect
=
4
*
VOUT_ASPECT_FACTOR
/
3
;
fmt
.
video
.
i_sar_num
=
4
*
fmt
.
video
.
i_height
;
fmt
.
video
.
i_sar_den
=
3
*
fmt
.
video
.
i_width
;
/* Setup rgb mask for RGB formats */
switch
(
p_sys
->
i_fourcc
)
...
...
modules/access/v4l2.c
View file @
d466fd41
...
...
@@ -2282,7 +2282,8 @@ static int OpenVideoDev( vlc_object_t *p_obj, demux_sys_t *p_sys, bool b_demux )
es_fmt
.
video
.
i_height
=
p_sys
->
i_height
;
/* Get aspect-ratio */
es_fmt
.
video
.
i_aspect
=
p_sys
->
i_aspect
;
es_fmt
.
video
.
i_sar_num
=
p_sys
->
i_aspect
*
es_fmt
.
video
.
i_height
;
es_fmt
.
video
.
i_sar_den
=
VOUT_ASPECT_FACTOR
*
es_fmt
.
video
.
i_width
;
demux_t
*
p_demux
=
(
demux_t
*
)
p_obj
;
msg_Dbg
(
p_demux
,
"added new video es %4.4s %dx%d"
,
...
...
modules/codec/avcodec/encoder.c
View file @
d466fd41
...
...
@@ -386,8 +386,6 @@ int OpenEncoder( vlc_object_t *p_this )
if
(
p_enc
->
fmt_in
.
i_cat
==
VIDEO_ES
)
{
int
i_aspect_num
,
i_aspect_den
;
if
(
!
p_enc
->
fmt_in
.
video
.
i_width
||
!
p_enc
->
fmt_in
.
video
.
i_height
)
{
msg_Warn
(
p_enc
,
"invalid size %ix%i"
,
p_enc
->
fmt_in
.
video
.
i_width
,
...
...
@@ -430,13 +428,10 @@ int OpenEncoder( vlc_object_t *p_this )
p_enc
->
fmt_out
.
i_codec
==
VLC_CODEC_MP1V
)
)
p_context
->
flags
|=
CODEC_FLAG_LOW_DELAY
;
av_reduce
(
&
i_aspect_num
,
&
i_aspect_den
,
p_enc
->
fmt_in
.
video
.
i_aspect
,
VOUT_ASPECT_FACTOR
,
1
<<
30
/* something big */
);
av_reduce
(
&
p_context
->
sample_aspect_ratio
.
num
,
&
p_context
->
sample_aspect_ratio
.
den
,
i_aspect_num
*
(
int64_t
)
p_context
->
height
,
i_aspect_den
*
(
int64_t
)
p_context
->
width
,
1
<<
30
);
p_enc
->
fmt_in
.
video
.
i_sar_num
,
p_enc
->
fmt_in
.
video
.
i_sar_den
,
1
<<
30
);
p_sys
->
i_buffer_out
=
p_context
->
height
*
p_context
->
width
*
3
;
if
(
p_sys
->
i_buffer_out
<
FF_MIN_BUFFER_SIZE
)
...
...
modules/codec/avcodec/subtitle.c
View file @
d466fd41
...
...
@@ -189,7 +189,6 @@ static subpicture_region_t *ConvertRegionRGBA(AVSubtitleRect *ffregion)
video_format_t
fmt
;
memset
(
&
fmt
,
0
,
sizeof
(
fmt
));
fmt
.
i_chroma
=
VLC_FOURCC
(
'R'
,
'G'
,
'B'
,
'A'
);
fmt
.
i_aspect
=
0
;
fmt
.
i_width
=
fmt
.
i_visible_width
=
ffregion
->
w
;
fmt
.
i_height
=
...
...
modules/codec/avcodec/video.c
View file @
d466fd41
...
...
@@ -150,22 +150,20 @@ static inline picture_t *ffmpeg_NewPictBuf( decoder_t *p_dec,
p_dec
->
fmt_out
.
i_codec
=
p_dec
->
fmt_out
.
video
.
i_chroma
;
/* If an aspect-ratio was specified in the input format then force it */
if
(
p_dec
->
fmt_in
.
video
.
i_
aspect
)
if
(
p_dec
->
fmt_in
.
video
.
i_
sar_num
>
0
&&
p_dec
->
fmt_in
.
video
.
i_sar_den
>
0
)
{
p_dec
->
fmt_out
.
video
.
i_aspect
=
p_dec
->
fmt_in
.
video
.
i_aspect
;
p_dec
->
fmt_out
.
video
.
i_sar_num
=
p_dec
->
fmt_in
.
video
.
i_sar_num
;
p_dec
->
fmt_out
.
video
.
i_sar_den
=
p_dec
->
fmt_in
.
video
.
i_sar_den
;
}
else
{
p_dec
->
fmt_out
.
video
.
i_aspect
=
VOUT_ASPECT_FACTOR
*
(
av_q2d
(
p_context
->
sample_aspect_ratio
)
*
p_context
->
width
/
p_context
->
height
);
p_dec
->
fmt_out
.
video
.
i_sar_num
=
p_context
->
sample_aspect_ratio
.
num
;
p_dec
->
fmt_out
.
video
.
i_sar_den
=
p_context
->
sample_aspect_ratio
.
den
;
if
(
p_dec
->
fmt_out
.
video
.
i_aspect
==
0
)
if
(
!
p_dec
->
fmt_out
.
video
.
i_sar_num
||
!
p_dec
->
fmt_out
.
video
.
i_sar_den
)
{
p_dec
->
fmt_out
.
video
.
i_
aspect
=
VOUT_ASPECT_FACTOR
*
p_context
->
width
/
p_context
->
height
;
p_dec
->
fmt_out
.
video
.
i_
sar_num
=
1
;
p_dec
->
fmt_out
.
video
.
i_sar_den
=
1
;
}
}
...
...
@@ -644,22 +642,18 @@ picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
p_sys
->
b_has_b_frames
=
true
;
}
if
(
!
p_dec
->
fmt_in
.
video
.
i_
aspect
)
if
(
!
p_dec
->
fmt_in
.
video
.
i_
sar_num
||
!
p_dec
->
fmt_in
.
video
.
i_sar_den
)
{
/* Fetch again the aspect ratio in case it changed */
p_dec
->
fmt_out
.
video
.
i_aspect
=
VOUT_ASPECT_FACTOR
*
(
av_q2d
(
p_sys
->
p_context
->
sample_aspect_ratio
)
*
p_sys
->
p_context
->
width
/
p_sys
->
p_context
->
height
);
p_dec
->
fmt_out
.
video
.
i_sar_num
=
p_sys
->
p_context
->
sample_aspect_ratio
.
num
;
p_dec
->
fmt_out
.
video
.
i_sar_den
=
p_sys
->
p_context
->
sample_aspect_ratio
.
den
;
if
(
p_dec
->
fmt_out
.
video
.
i_aspect
==
0
)
if
(
!
p_dec
->
fmt_out
.
video
.
i_sar_num
||
!
p_dec
->
fmt_out
.
video
.
i_sar_den
)
{
p_dec
->
fmt_out
.
video
.
i_
aspect
=
VOUT_ASPECT_FACTOR
*
p_sys
->
p_context
->
width
/
p_sys
->
p_context
->
height
;
p_dec
->
fmt_out
.
video
.
i_
sar_num
=
1
;
p_dec
->
fmt_out
.
video
.
i_sar_den
=
1
;
}
}
...
...
modules/codec/cc.c
View file @
d466fd41
...
...
@@ -340,7 +340,6 @@ static subpicture_t *Subtitle( decoder_t *p_dec, char *psz_subtitle, char *psz_h
/* Create a new subpicture region */
memset
(
&
fmt
,
0
,
sizeof
(
video_format_t
)
);
fmt
.
i_chroma
=
VLC_CODEC_TEXT
;
fmt
.
i_aspect
=
0
;
fmt
.
i_width
=
fmt
.
i_height
=
0
;
fmt
.
i_x_offset
=
fmt
.
i_y_offset
=
0
;
p_spu
->
p_region
=
subpicture_region_New
(
&
fmt
);
...
...
modules/codec/cdg.c
View file @
d466fd41
...
...
@@ -116,8 +116,8 @@ static int Open( vlc_object_t *p_this )
p_dec
->
fmt_out
.
i_codec
=
VLC_CODEC_RGB32
;
p_dec
->
fmt_out
.
video
.
i_width
=
CDG_DISPLAY_WIDTH
;
p_dec
->
fmt_out
.
video
.
i_height
=
CDG_DISPLAY_HEIGHT
;
p_dec
->
fmt_out
.
video
.
i_
aspect
=
VOUT_ASPECT_FACTOR
*
p_dec
->
fmt_out
.
video
.
i_width
/
p_dec
->
fmt_out
.
video
.
i_height
;
p_dec
->
fmt_out
.
video
.
i_
sar_num
=
1
;
p_dec
->
fmt_out
.
video
.
i_sar_den
=
1
;
p_dec
->
fmt_out
.
video
.
i_rmask
=
0xff
<<
CDG_COLOR_R_SHIFT
;
p_dec
->
fmt_out
.
video
.
i_gmask
=
0xff
<<
CDG_COLOR_G_SHIFT
;
p_dec
->
fmt_out
.
video
.
i_bmask
=
0xff
<<
CDG_COLOR_B_SHIFT
;
...
...
modules/codec/cvdsub.c
View file @
d466fd41
...
...
@@ -510,7 +510,8 @@ static subpicture_t *DecodePacket( decoder_t *p_dec, block_t *p_data )
/* Create new SPU region */
memset
(
&
fmt
,
0
,
sizeof
(
video_format_t
)
);
fmt
.
i_chroma
=
VLC_CODEC_YUVP
;
fmt
.
i_aspect
=
VOUT_ASPECT_FACTOR
;
fmt
.
i_sar_num
=
1
;
fmt
.
i_sar_den
=
1
;
fmt
.
i_width
=
fmt
.
i_visible_width
=
p_sys
->
i_width
;
fmt
.
i_height
=
fmt
.
i_visible_height
=
p_sys
->
i_height
;
fmt
.
i_x_offset
=
fmt
.
i_y_offset
=
0
;
...
...
modules/codec/dirac.c
View file @
d466fd41
...
...
@@ -506,9 +506,8 @@ static int OpenEncoder( vlc_object_t *p_this )
p_sys
->
ctx
.
src_params
.
frame_rate
.
denominator
=
p_enc
->
fmt_in
.
video
.
i_frame_rate_base
;
unsigned
u_asr_num
,
u_asr_den
;
vlc_ureduce
(
&
u_asr_num
,
&
u_asr_den
,
p_enc
->
fmt_in
.
video
.
i_height
*
p_enc
->
fmt_in
.
video
.
i_aspect
,
p_enc
->
fmt_in
.
video
.
i_width
*
VOUT_ASPECT_FACTOR
,
0
);
p_enc
->
fmt_in
.
video
.
i_sar_num
,
p_enc
->
fmt_in
.
video
.
i_sar_den
,
0
);
p_sys
->
ctx
.
src_params
.
pix_asr
.
numerator
=
u_asr_num
;
p_sys
->
ctx
.
src_params
.
pix_asr
.
denominator
=
u_asr_den
;
...
...
modules/codec/dmo/dmo.c
View file @
d466fd41
...
...
@@ -520,14 +520,16 @@ static int DecOpen( decoder_t *p_dec )
p_dec
->
fmt_out
.
video
.
i_bits_per_pixel
=
i_bpp
;
/* If an aspect-ratio was specified in the input format then force it */
if
(
p_dec
->
fmt_in
.
video
.
i_aspect
)
if
(
p_dec
->
fmt_in
.
video
.
i_sar_num
>
0
&&
p_dec
->
fmt_in
.
video
.
i_sar_den
>
0
)
{
p_dec
->
fmt_out
.
video
.
i_aspect
=
p_dec
->
fmt_in
.
video
.
i_aspect
;
p_dec
->
fmt_out
.
video
.
i_sar_num
=
p_dec
->
fmt_in
.
video
.
i_sar_num
;
p_dec
->
fmt_out
.
video
.
i_sar_den
=
p_dec
->
fmt_in
.
video
.
i_sar_den
;
}
else
{
p_dec
->
fmt_out
.
video
.
i_
aspect
=
VOUT_ASPECT_FACTOR
*
p_dec
->
fmt_out
.
video
.
i_width
/
p_dec
->
fmt_out
.
video
.
i_height
;
p_dec
->
fmt_out
.
video
.
i_
sar_num
=
1
;
p_dec
->
fmt_out
.
video
.
i_sar_den
=
1
;
}
p_bih
=
&
p_vih
->
bmiHeader
;
...
...
modules/codec/dvbsub.c
View file @
d466fd41
...
...
@@ -1582,7 +1582,8 @@ static subpicture_t *render( decoder_t *p_dec )
/* Create new SPU region */
memset
(
&
fmt
,
0
,
sizeof
(
video_format_t
)
);
fmt
.
i_chroma
=
VLC_CODEC_YUVP
;
fmt
.
i_aspect
=
0
;
/* 0 means use aspect ratio of background video */
fmt
.
i_sar_num
=
0
;
/* 0 means use aspect ratio of background video */
fmt
.
i_sar_den
=
1
;
fmt
.
i_width
=
fmt
.
i_visible_width
=
p_region
->
i_width
;
fmt
.
i_height
=
fmt
.
i_visible_height
=
p_region
->
i_height
;
fmt
.
i_x_offset
=
fmt
.
i_y_offset
=
0
;
...
...
@@ -1635,7 +1636,8 @@ static subpicture_t *render( decoder_t *p_dec )
/* Create new SPU region */
memset
(
&
fmt
,
0
,
sizeof
(
video_format_t
)
);
fmt
.
i_chroma
=
VLC_CODEC_TEXT
;
fmt
.
i_aspect
=
VOUT_ASPECT_FACTOR
;
fmt
.
i_sar_num
=
1
;
fmt
.
i_sar_den
=
1
;
fmt
.
i_width
=
fmt
.
i_visible_width
=
p_region
->
i_width
;
fmt
.
i_height
=
fmt
.
i_visible_height
=
p_region
->
i_height
;
fmt
.
i_x_offset
=
fmt
.
i_y_offset
=
0
;
...
...
modules/codec/fake.c
View file @
d466fd41
...
...
@@ -269,12 +269,13 @@ static int OpenDecoder( vlc_object_t *p_this )
if
(
i_aspect
)
{
fmt_out
.
i_aspect
=
i_aspect
;
fmt_out
.
i_sar_num
=
i_aspect
*
fmt_out
.
i_height
;
fmt_out
.
i_sar_den
=
VOUT_ASPECT_FACTOR
*
fmt_out
.
i_width
;
}
else
{
fmt_out
.
i_
aspect
=
fmt_out
.
i_width
*
VOUT_ASPECT_FACTOR
/
fmt_out
.
i_height
;
fmt_out
.
i_
sar_num
=
1
;
fmt_out
.
i_sar_den
=
1
;
}
if
(
var_CreateGetBool
(
p_dec
,
"fake-deinterlace"
)
)
...
...
modules/codec/invmem.c
View file @
d466fd41
...
...
@@ -212,7 +212,8 @@ static int OpenDecoder( vlc_object_t *p_this )
p_dec
->
fmt_out
.
i_codec
=
chroma
;
p_dec
->
fmt_out
.
video
.
i_width
=
p_dec
->
p_sys
->
i_width
;
p_dec
->
fmt_out
.
video
.
i_height
=
p_dec
->
p_sys
->
i_height
;
p_dec
->
fmt_out
.
video
.
i_aspect
=
VOUT_ASPECT_FACTOR
*
p_dec
->
p_sys
->
i_width
/
p_dec
->
p_sys
->
i_height
;
p_dec
->
fmt_out
.
video
.
i_sar_num
=
1
;
p_dec
->
fmt_out
.
video
.
i_sar_den
=
1
;
p_dec
->
fmt_out
.
i_cat
=
VIDEO_ES
;
p_sys
->
i_pitch
=
pitch
;
...
...
modules/codec/kate.c
View file @
d466fd41
...
...
@@ -1332,7 +1332,6 @@ static subpicture_t *SetupSimpleKateSPU( decoder_t *p_dec, subpicture_t *p_spu,
/* create a separate region for the bitmap */
memset
(
&
fmt
,
0
,
sizeof
(
video_format_t
)
);
fmt
.
i_chroma
=
VLC_CODEC_YUVP
;
fmt
.
i_aspect
=
0
;
fmt
.
i_width
=
fmt
.
i_visible_width
=
ev
->
bitmap
->
width
;
fmt
.
i_height
=
fmt
.
i_visible_height
=
ev
->
bitmap
->
height
;
fmt
.
i_x_offset
=
fmt
.
i_y_offset
=
0
;
...
...
@@ -1355,7 +1354,8 @@ static subpicture_t *SetupSimpleKateSPU( decoder_t *p_dec, subpicture_t *p_spu,
/* text region */
fmt
.
i_chroma
=
VLC_CODEC_TEXT
;
fmt
.
i_aspect
=
0
;
fmt
.
i_sar_num
=
0
;
fmt
.
i_sar_den
=
1
;
fmt
.
i_width
=
fmt
.
i_height
=
0
;
fmt
.
i_x_offset
=
fmt
.
i_y_offset
=
0
;
p_spu
->
p_region
=
subpicture_region_New
(
&
fmt
);
...
...
modules/codec/libmpeg2.c
View file @
d466fd41
...
...
@@ -83,7 +83,6 @@ struct decoder_sys_t
* Output properties
*/
decoder_synchro_t
*
p_synchro
;
int
i_aspect
;
int
i_sar_num
;
int
i_sar_den
;
mtime_t
i_last_frame_pts
;
...
...
@@ -173,7 +172,8 @@ static int OpenDecoder( vlc_object_t *p_this )
p_sys
->
i_previous_pts
=
0
;
p_sys
->
i_current_dts
=
0
;
p_sys
->
i_previous_dts
=
0
;
p_sys
->
i_aspect
=
0
;
p_sys
->
i_sar_num
=
0
;
p_sys
->
i_sar_den
=
0
;
p_sys
->
b_garbage_pic
=
false
;
p_sys
->
b_slice_i
=
false
;
p_sys
->
b_second_field
=
false
;
...
...
@@ -281,7 +281,8 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
mpeg2_custom_fbuf
(
p_sys
->
p_mpeg2dec
,
1
);
/* Set the first 2 reference frames */
p_sys
->
i_aspect
=
0
;
p_sys
->
i_sar_num
=
0
;
p_sys
->
i_sar_den
=
0
;
GetAR
(
p_dec
);
for
(
int
i
=
0
;
i
<
2
;
i
++
)
{
...
...
@@ -651,7 +652,6 @@ static picture_t *GetNewPicture( decoder_t *p_dec )
p_dec
->
fmt_out
.
video
.
i_height
=
p_sys
->
p_info
->
sequence
->
height
;
p_dec
->
fmt_out
.
video
.
i_visible_height
=
p_sys
->
p_info
->
sequence
->
picture_height
;
p_dec
->
fmt_out
.
video
.
i_aspect
=
p_sys
->
i_aspect
;
p_dec
->
fmt_out
.
video
.
i_sar_num
=
p_sys
->
i_sar_num
;
p_dec
->
fmt_out
.
video
.
i_sar_den
=
p_sys
->
i_sar_den
;
...
...
@@ -719,24 +719,21 @@ static block_t *GetCc( decoder_t *p_dec, bool pb_present[4] )
static
void
GetAR
(
decoder_t
*
p_dec
)
{
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
int
i_old_aspect
=
p_sys
->
i_aspect
;
int
i_old_sar_num
=
p_sys
->
i_sar_num
;
int
i_old_sar_den
=
p_sys
->
i_sar_den
;
/* Check whether the input gave a particular aspect ratio */
if
(
p_dec
->
fmt_in
.
video
.
i_aspect
)
if
(
p_dec
->
fmt_in
.
video
.
i_sar_num
>
0
&&
p_dec
->
fmt_in
.
video
.
i_sar_den
>
0
)
{
p_sys
->
i_aspect
=
p_dec
->
fmt_in
.
video
.
i_aspect
;
p_sys
->
i_sar_num
=
p_dec
->
fmt_in
.
video
.
i_sar_num
;
p_sys
->
i_sar_den
=
p_dec
->
fmt_in
.
video
.
i_sar_den
;
}
else
{
/* Use the value provided in the MPEG sequence header */
if
(
p_sys
->
p_info
->
sequence
->
pixel_height
>
0
)
{
p_sys
->
i_aspect
=
((
uint64_t
)
p_sys
->
p_info
->
sequence
->
display_width
)
*
p_sys
->
p_info
->
sequence
->
pixel_width
*
VOUT_ASPECT_FACTOR
/
p_sys
->
p_info
->
sequence
->
display_height
/
p_sys
->
p_info
->
sequence
->
pixel_height
;
p_sys
->
i_sar_num
=
p_sys
->
p_info
->
sequence
->
pixel_width
;
p_sys
->
i_sar_den
=
p_sys
->
p_info
->
sequence
->
pixel_height
;
}
...
...
@@ -745,23 +742,23 @@ static void GetAR( decoder_t *p_dec )
/* Invalid aspect, assume 4:3.
* This shouldn't happen and if it does it is a bug
* in libmpeg2 (likely triggered by an invalid stream) */
p_sys
->
i_aspect
=
VOUT_ASPECT_FACTOR
*
4
/
3
;
p_sys
->
i_sar_num
=
p_sys
->
p_info
->
sequence
->
picture_height
*
4
;
p_sys
->
i_sar_den
=
p_sys
->
p_info
->
sequence
->
picture_width
*
3
;
}
}
if
(
p_sys
->
i_aspect
==
i_old_aspect
)
if
(
p_sys
->
i_sar_num
==
i_old_sar_num
&&
p_sys
->
i_sar_den
==
i_old_sar_den
)
return
;
if
(
p_sys
->
p_info
->
sequence
->
frame_period
>
0
)
msg_Dbg
(
p_dec
,
"%dx%d (display %d,%d),
aspect %d,
sar %i:%i, %u.%03u fps"
,
"%dx%d (display %d,%d), sar %i:%i, %u.%03u fps"
,
p_sys
->
p_info
->
sequence
->
picture_width
,
p_sys
->
p_info
->
sequence
->
picture_height
,
p_sys
->
p_info
->
sequence
->
display_width
,
p_sys
->
p_info
->
sequence
->
display_height
,
p_sys
->
i_
aspect
,
p_sys
->
i_
sar_num
,
p_sys
->
i_sar_den
,
p_sys
->
i_sar_num
,
p_sys
->
i_sar_den
,
(
uint32_t
)((
uint64_t
)
1001000000
*
27
/
p_sys
->
p_info
->
sequence
->
frame_period
/
1001
),
(
uint32_t
)((
uint64_t
)
1001000000
*
27
/
...
...
modules/codec/png.c
View file @
d466fd41
...
...
@@ -184,7 +184,8 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
p_dec
->
fmt_out
.
i_codec
=
VLC_CODEC_RGBA
;
p_dec
->
fmt_out
.
video
.
i_width
=
i_width
;
p_dec
->
fmt_out
.
video
.
i_height
=
i_height
;
p_dec
->
fmt_out
.
video
.
i_aspect
=
VOUT_ASPECT_FACTOR
*
i_width
/
i_height
;
p_dec
->
fmt_out
.
video
.
i_sar_num
=
1
;
p_dec
->
fmt_out
.
video
.
i_sar_den
=
1
;
p_dec
->
fmt_out
.
video
.
i_rmask
=
0x000000ff
;
p_dec
->
fmt_out
.
video
.
i_gmask
=
0x0000ff00
;
p_dec
->
fmt_out
.
video
.
i_bmask
=
0x00ff0000
;
...
...
modules/codec/quicktime.c
View file @
d466fd41
...
...
@@ -844,7 +844,8 @@ static int OpenVideo( decoder_t *p_dec )
es_format_Init
(
&
p_dec
->
fmt_out
,
VIDEO_ES
,
VLC_CODEC_YUYV
);
p_dec
->
fmt_out
.
video
.
i_width
=
p_dec
->
fmt_in
.
video
.
i_width
;
p_dec
->
fmt_out
.
video
.
i_height
=
p_dec
->
fmt_in
.
video
.
i_height
;
p_dec
->
fmt_out
.
video
.
i_aspect
=
VOUT_ASPECT_FACTOR
*
p_dec
->
fmt_in
.
video
.
i_width
/
p_dec
->
fmt_in
.
video
.
i_height
;
p_dec
->
fmt_out
.
video
.
i_sar_num
=
1
;
p_dec
->
fmt_out
.
video
.
i_sar_den
=
1
;
vlc_mutex_unlock
(
&
qt_mutex
);
return
VLC_SUCCESS
;
...
...
modules/codec/rawvideo.c
View file @
d466fd41
...
...
@@ -159,15 +159,15 @@ static int OpenDecoder( vlc_object_t *p_this )
video_format_Setup
(
&
p_dec
->
fmt_out
.
video
,
p_dec
->
fmt_in
.
i_codec
,
p_dec
->
fmt_in
.
video
.
i_width
,
p_dec
->
fmt_in
.
video
.
i_height
,
p_dec
->
fmt_in
.
video
.
i_
aspect
*
p_dec
->
fmt_in
.
video
.
i_height
,
VOUT_ASPECT_FACTOR
*
p_dec
->
fmt_in
.
video
.
i_width
);
p_dec
->
fmt_in
.
video
.
i_
sar_num
,
p_dec
->
fmt_in
.
video
.
i_sar_den
);
p_sys
->
i_raw_size
=
p_dec
->
fmt_out
.
video
.
i_bits_per_pixel
*
p_dec
->
fmt_out
.
video
.
i_width
*
p_dec
->
fmt_out
.
video
.
i_height
/
8
;
if
(
!
p_dec
->
fmt_in
.
video
.
i_
aspect
)
if
(
!
p_dec
->
fmt_in
.
video
.
i_
sar_num
||
!
p_dec
->
fmt_in
.
video
.
i_sar_den
)
{
p_dec
->
fmt_out
.
video
.
i_
aspect
=
VOUT_ASPECT_FACTOR
*
p_dec
->
fmt_out
.
video
.
i_width
/
p_dec
->
fmt_out
.
video
.
i_height
;
p_dec
->
fmt_out
.
video
.
i_
sar_num
=
1
;
p_dec
->
fmt_out
.
video
.
i_sar_den
=
1
;
}
/* Set callbacks */
...
...
modules/codec/realvideo.c
View file @
d466fd41
...
...
@@ -355,7 +355,8 @@ static int InitVideo(decoder_t *p_dec)
p_dec
->
fmt_out
.
video
.
i_width
=
p_dec
->
fmt_in
.
video
.
i_width
;
p_dec
->
fmt_out
.
video
.
i_height
=
p_dec
->
fmt_in
.
video
.
i_height
;
p_dec
->
fmt_out
.
video
.
i_aspect
=
VOUT_ASPECT_FACTOR
*
p_dec
->
fmt_in
.
video
.
i_width
/
p_dec
->
fmt_in
.
video
.
i_height
;
p_dec
->
fmt_out
.
video
.
i_sar_num
=
1
;
p_dec
->
fmt_out
.
video
.
i_sar_den
=
1
;
p_sys
->
inited
=
0
;
vlc_mutex_unlock
(
&
rm_mutex
);
...
...
@@ -527,7 +528,8 @@ static picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
p_dec
->
fmt_out
.
video
.
i_visible_height
=
p_dec
->
fmt_in
.
video
.
i_height
=
transform_out
[
4
];
p_dec
->
fmt_out
.
video
.
i_aspect
=
VOUT_ASPECT_FACTOR
*
p_dec
->
fmt_in
.
video
.
i_width
/
p_dec
->
fmt_in
.
video
.
i_height
;
p_dec
->
fmt_out
.
video
.
i_sar_num
=
1
;
p_dec
->
fmt_out
.
video
.
i_sar_den
=
1
;
}
else
{
...
...
modules/codec/schroedinger.c
View file @
d466fd41
...
...
@@ -130,7 +130,6 @@ static int OpenDecoder( vlc_object_t *p_this )
static
void
SetVideoFormat
(
decoder_t
*
p_dec