Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Steve Lhomme
VLC
Commits
3f6f97f1
Commit
3f6f97f1
authored
Mar 05, 2005
by
gbazin
Browse files
* include/video_output.h, ALL: changed api for vout_Request()/vout_Create() to be more flexible.
parent
286a9420
Changes
18
Hide whitespace changes
Inline
Side-by-side
include/video_output.h
View file @
3f6f97f1
...
...
@@ -121,6 +121,10 @@ struct vout_thread_t
picture_heap_t
output
;
/**< direct buffers */
vlc_bool_t
b_direct
;
/**< rendered are like direct ? */
vout_chroma_t
chroma
;
/**< translation tables */
video_format_t
fmt_render
;
/* render format (from the decoder) */
video_format_t
fmt_in
;
/* input (modified render) format */
video_format_t
fmt_out
;
/* output format (for the video output) */
/**@}*/
/* Picture heap */
...
...
@@ -194,10 +198,10 @@ struct vout_thread_t
/*****************************************************************************
* Prototypes
*****************************************************************************/
#define vout_Request(a,b,c
,d,e,f
) __vout_Request(VLC_OBJECT(a),b,c
,d,e,f
)
VLC_EXPORT
(
vout_thread_t
*
,
__vout_Request
,
(
vlc_object_t
*
,
vout_thread_t
*
,
unsigned
int
,
unsigned
int
,
uint32_t
,
unsigned
int
)
);
#define vout_Create(a,b
,c,d,e
) __vout_Create(VLC_OBJECT(a),b
,c,d,e
)
VLC_EXPORT
(
vout_thread_t
*
,
__vout_Create
,
(
vlc_object_t
*
,
unsigned
int
,
unsigned
int
,
uint32_t
,
unsigned
int
)
);
#define vout_Request(a,b,c) __vout_Request(VLC_OBJECT(a),b,c)
VLC_EXPORT
(
vout_thread_t
*
,
__vout_Request
,
(
vlc_object_t
*
,
vout_thread_t
*
,
video_format_t
*
)
);
#define vout_Create(a,b) __vout_Create(VLC_OBJECT(a),b)
VLC_EXPORT
(
vout_thread_t
*
,
__vout_Create
,
(
vlc_object_t
*
,
video_format_t
*
)
);
VLC_EXPORT
(
void
,
vout_Destroy
,
(
vout_thread_t
*
)
);
VLC_EXPORT
(
int
,
vout_VarCallback
,
(
vlc_object_t
*
,
const
char
*
,
vlc_value_t
,
vlc_value_t
,
void
*
)
);
...
...
modules/codec/ffmpeg/video.c
View file @
3f6f97f1
...
...
@@ -169,6 +169,8 @@ static inline picture_t *ffmpeg_NewPictBuf( decoder_t *p_dec,
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
;
#else
p_dec
->
fmt_out
.
video
.
i_aspect
=
VOUT_ASPECT_FACTOR
*
p_context
->
aspect_ratio
;
...
...
modules/video_filter/adjust.c
View file @
3f6f97f1
...
...
@@ -150,6 +150,7 @@ static int Init( vout_thread_t *p_vout )
{
int
i_index
;
picture_t
*
p_pic
;
video_format_t
fmt
=
{
0
};
I_OUTPUTPICTURES
=
0
;
...
...
@@ -159,12 +160,18 @@ static int Init( vout_thread_t *p_vout )
p_vout
->
output
.
i_height
=
p_vout
->
render
.
i_height
;
p_vout
->
output
.
i_aspect
=
p_vout
->
render
.
i_aspect
;
fmt
.
i_width
=
fmt
.
i_visible_width
=
p_vout
->
render
.
i_width
;
fmt
.
i_height
=
fmt
.
i_visible_height
=
p_vout
->
render
.
i_height
;
fmt
.
i_x_offset
=
fmt
.
i_y_offset
=
0
;
fmt
.
i_chroma
=
p_vout
->
render
.
i_chroma
;
fmt
.
i_aspect
=
p_vout
->
render
.
i_aspect
;
fmt
.
i_sar_num
=
p_vout
->
render
.
i_aspect
*
fmt
.
i_height
/
fmt
.
i_width
;
fmt
.
i_sar_den
=
VOUT_ASPECT_FACTOR
;
/* Try to open the real video output */
msg_Dbg
(
p_vout
,
"spawning the real video output"
);
p_vout
->
p_sys
->
p_vout
=
vout_Create
(
p_vout
,
p_vout
->
render
.
i_width
,
p_vout
->
render
.
i_height
,
p_vout
->
render
.
i_chroma
,
p_vout
->
render
.
i_aspect
);
p_vout
->
p_sys
->
p_vout
=
vout_Create
(
p_vout
,
&
fmt
);
/* Everything failed */
if
(
p_vout
->
p_sys
->
p_vout
==
NULL
)
...
...
modules/video_filter/clone.c
View file @
3f6f97f1
...
...
@@ -205,6 +205,7 @@ static int Init( vout_thread_t *p_vout )
int
i_index
,
i_vout
;
picture_t
*
p_pic
;
char
*
psz_default_vout
;
video_format_t
fmt
=
{
0
};
I_OUTPUTPICTURES
=
0
;
...
...
@@ -214,6 +215,14 @@ static int Init( vout_thread_t *p_vout )
p_vout
->
output
.
i_height
=
p_vout
->
render
.
i_height
;
p_vout
->
output
.
i_aspect
=
p_vout
->
render
.
i_aspect
;
fmt
.
i_width
=
fmt
.
i_visible_width
=
p_vout
->
render
.
i_width
;
fmt
.
i_height
=
fmt
.
i_visible_height
=
p_vout
->
render
.
i_height
;
fmt
.
i_x_offset
=
fmt
.
i_y_offset
=
0
;
fmt
.
i_chroma
=
p_vout
->
render
.
i_chroma
;
fmt
.
i_aspect
=
p_vout
->
render
.
i_aspect
;
fmt
.
i_sar_num
=
p_vout
->
render
.
i_aspect
*
fmt
.
i_height
/
fmt
.
i_width
;
fmt
.
i_sar_den
=
VOUT_ASPECT_FACTOR
;
/* Try to open the real video output */
msg_Dbg
(
p_vout
,
"spawning the real video outputs"
);
...
...
@@ -227,9 +236,7 @@ static int Init( vout_thread_t *p_vout )
"default"
,
8
)
)
)
{
p_vout
->
p_sys
->
pp_vout
[
i_vout
]
=
vout_Create
(
p_vout
,
p_vout
->
render
.
i_width
,
p_vout
->
render
.
i_height
,
p_vout
->
render
.
i_chroma
,
p_vout
->
render
.
i_aspect
);
vout_Create
(
p_vout
,
&
fmt
);
}
else
{
...
...
@@ -237,9 +244,7 @@ static int Init( vout_thread_t *p_vout )
config_PutPsz
(
p_vout
,
"vout"
,
p_vout
->
p_sys
->
ppsz_vout_list
[
i_vout
]
);
p_vout
->
p_sys
->
pp_vout
[
i_vout
]
=
vout_Create
(
p_vout
,
p_vout
->
render
.
i_width
,
p_vout
->
render
.
i_height
,
p_vout
->
render
.
i_chroma
,
p_vout
->
render
.
i_aspect
);
vout_Create
(
p_vout
,
&
fmt
);
/* Reset the default value */
config_PutPsz
(
p_vout
,
"vout"
,
psz_default_vout
);
...
...
modules/video_filter/crop.c
View file @
3f6f97f1
...
...
@@ -134,6 +134,7 @@ static int Init( vout_thread_t *p_vout )
int
i_index
;
char
*
psz_var
;
picture_t
*
p_pic
;
video_format_t
fmt
=
{
0
};
I_OUTPUTPICTURES
=
0
;
...
...
@@ -247,10 +248,16 @@ static int Init( vout_thread_t *p_vout )
*
p_vout
->
output
.
i_height
/
p_vout
->
p_sys
->
i_height
*
p_vout
->
p_sys
->
i_width
/
p_vout
->
output
.
i_width
;
fmt
.
i_width
=
fmt
.
i_visible_width
=
p_vout
->
p_sys
->
i_width
;
fmt
.
i_height
=
fmt
.
i_visible_height
=
p_vout
->
p_sys
->
i_height
;
fmt
.
i_x_offset
=
fmt
.
i_y_offset
=
0
;
fmt
.
i_chroma
=
p_vout
->
render
.
i_chroma
;
fmt
.
i_aspect
=
p_vout
->
p_sys
->
i_aspect
;
fmt
.
i_sar_num
=
p_vout
->
p_sys
->
i_aspect
*
fmt
.
i_height
/
fmt
.
i_width
;
fmt
.
i_sar_den
=
VOUT_ASPECT_FACTOR
;
/* Try to open the real video output */
p_vout
->
p_sys
->
p_vout
=
vout_Create
(
p_vout
,
p_vout
->
p_sys
->
i_width
,
p_vout
->
p_sys
->
i_height
,
p_vout
->
render
.
i_chroma
,
p_vout
->
p_sys
->
i_aspect
);
p_vout
->
p_sys
->
p_vout
=
vout_Create
(
p_vout
,
&
fmt
);
if
(
p_vout
->
p_sys
->
p_vout
==
NULL
)
{
msg_Err
(
p_vout
,
"failed to create vout"
);
...
...
@@ -310,6 +317,8 @@ static void Destroy( vlc_object_t *p_this )
*****************************************************************************/
static
int
Manage
(
vout_thread_t
*
p_vout
)
{
video_format_t
fmt
=
{
0
};
if
(
!
p_vout
->
p_sys
->
b_changed
)
{
return
VLC_SUCCESS
;
...
...
@@ -317,9 +326,15 @@ static int Manage( vout_thread_t *p_vout )
vout_Destroy
(
p_vout
->
p_sys
->
p_vout
);
p_vout
->
p_sys
->
p_vout
=
vout_Create
(
p_vout
,
p_vout
->
p_sys
->
i_width
,
p_vout
->
p_sys
->
i_height
,
p_vout
->
render
.
i_chroma
,
p_vout
->
p_sys
->
i_aspect
);
fmt
.
i_width
=
fmt
.
i_visible_width
=
p_vout
->
p_sys
->
i_width
;
fmt
.
i_height
=
fmt
.
i_visible_height
=
p_vout
->
p_sys
->
i_height
;
fmt
.
i_x_offset
=
fmt
.
i_y_offset
=
0
;
fmt
.
i_chroma
=
p_vout
->
render
.
i_chroma
;
fmt
.
i_aspect
=
p_vout
->
p_sys
->
i_aspect
;
fmt
.
i_sar_num
=
p_vout
->
p_sys
->
i_aspect
*
fmt
.
i_height
/
fmt
.
i_width
;
fmt
.
i_sar_den
=
VOUT_ASPECT_FACTOR
;
p_vout
->
p_sys
->
p_vout
=
vout_Create
(
p_vout
,
&
fmt
);
if
(
p_vout
->
p_sys
->
p_vout
==
NULL
)
{
msg_Err
(
p_vout
,
"failed to create vout"
);
...
...
modules/video_filter/deinterlace.c
View file @
3f6f97f1
...
...
@@ -320,9 +320,18 @@ static int Init( vout_thread_t *p_vout )
static
vout_thread_t
*
SpawnRealVout
(
vout_thread_t
*
p_vout
)
{
vout_thread_t
*
p_real_vout
=
NULL
;
video_format_t
fmt
=
{
0
};
msg_Dbg
(
p_vout
,
"spawning the real video output"
);
fmt
.
i_width
=
fmt
.
i_visible_width
=
p_vout
->
output
.
i_width
;
fmt
.
i_height
=
fmt
.
i_visible_height
=
p_vout
->
output
.
i_height
;
fmt
.
i_x_offset
=
fmt
.
i_y_offset
=
0
;
fmt
.
i_chroma
=
p_vout
->
output
.
i_chroma
;
fmt
.
i_aspect
=
p_vout
->
output
.
i_aspect
;
fmt
.
i_sar_num
=
p_vout
->
output
.
i_aspect
*
fmt
.
i_height
/
fmt
.
i_width
;
fmt
.
i_sar_den
=
VOUT_ASPECT_FACTOR
;
switch
(
p_vout
->
render
.
i_chroma
)
{
case
VLC_FOURCC
(
'I'
,
'4'
,
'2'
,
'0'
):
...
...
@@ -332,28 +341,21 @@ static vout_thread_t *SpawnRealVout( vout_thread_t *p_vout )
{
case
DEINTERLACE_MEAN
:
case
DEINTERLACE_DISCARD
:
p_real_vout
=
vout_Create
(
p_vout
,
p_vout
->
output
.
i_width
,
p_vout
->
output
.
i_height
/
2
,
p_vout
->
output
.
i_chroma
,
p_vout
->
output
.
i_aspect
);
fmt
.
i_height
=
fmt
.
i_visible_height
=
p_vout
->
output
.
i_height
/
2
;
p_real_vout
=
vout_Create
(
p_vout
,
&
fmt
);
break
;
case
DEINTERLACE_BOB
:
case
DEINTERLACE_BLEND
:
case
DEINTERLACE_LINEAR
:
p_real_vout
=
vout_Create
(
p_vout
,
p_vout
->
output
.
i_width
,
p_vout
->
output
.
i_height
,
p_vout
->
output
.
i_chroma
,
p_vout
->
output
.
i_aspect
);
p_real_vout
=
vout_Create
(
p_vout
,
&
fmt
);
break
;
}
break
;
case
VLC_FOURCC
(
'I'
,
'4'
,
'2'
,
'2'
):
p_real_vout
=
vout_Create
(
p_vout
,
p_vout
->
output
.
i_width
,
p_vout
->
output
.
i_height
,
VLC_FOURCC
(
'I'
,
'4'
,
'2'
,
'0'
),
p_vout
->
output
.
i_aspect
);
fmt
.
i_chroma
=
VLC_FOURCC
(
'I'
,
'4'
,
'2'
,
'0'
);
p_real_vout
=
vout_Create
(
p_vout
,
&
fmt
);
break
;
default:
...
...
modules/video_filter/distort.c
View file @
3f6f97f1
...
...
@@ -165,6 +165,7 @@ static int Init( vout_thread_t *p_vout )
{
int
i_index
;
picture_t
*
p_pic
;
video_format_t
fmt
=
{
0
};
I_OUTPUTPICTURES
=
0
;
...
...
@@ -174,12 +175,18 @@ static int Init( vout_thread_t *p_vout )
p_vout
->
output
.
i_height
=
p_vout
->
render
.
i_height
;
p_vout
->
output
.
i_aspect
=
p_vout
->
render
.
i_aspect
;
fmt
.
i_width
=
fmt
.
i_visible_width
=
p_vout
->
render
.
i_width
;
fmt
.
i_height
=
fmt
.
i_visible_height
=
p_vout
->
render
.
i_height
;
fmt
.
i_x_offset
=
fmt
.
i_y_offset
=
0
;
fmt
.
i_chroma
=
p_vout
->
render
.
i_chroma
;
fmt
.
i_aspect
=
p_vout
->
render
.
i_aspect
;
fmt
.
i_sar_num
=
p_vout
->
render
.
i_aspect
*
fmt
.
i_height
/
fmt
.
i_width
;
fmt
.
i_sar_den
=
VOUT_ASPECT_FACTOR
;
/* Try to open the real video output */
msg_Dbg
(
p_vout
,
"spawning the real video output"
);
p_vout
->
p_sys
->
p_vout
=
vout_Create
(
p_vout
,
p_vout
->
render
.
i_width
,
p_vout
->
render
.
i_height
,
p_vout
->
render
.
i_chroma
,
p_vout
->
render
.
i_aspect
);
p_vout
->
p_sys
->
p_vout
=
vout_Create
(
p_vout
,
&
fmt
);
/* Everything failed */
if
(
p_vout
->
p_sys
->
p_vout
==
NULL
)
...
...
modules/video_filter/invert.c
View file @
3f6f97f1
...
...
@@ -111,6 +111,7 @@ static int Init( vout_thread_t *p_vout )
{
int
i_index
;
picture_t
*
p_pic
;
video_format_t
fmt
=
{
0
};
I_OUTPUTPICTURES
=
0
;
...
...
@@ -120,12 +121,18 @@ static int Init( vout_thread_t *p_vout )
p_vout
->
output
.
i_height
=
p_vout
->
render
.
i_height
;
p_vout
->
output
.
i_aspect
=
p_vout
->
render
.
i_aspect
;
fmt
.
i_width
=
fmt
.
i_visible_width
=
p_vout
->
render
.
i_width
;
fmt
.
i_height
=
fmt
.
i_visible_height
=
p_vout
->
render
.
i_height
;
fmt
.
i_x_offset
=
fmt
.
i_y_offset
=
0
;
fmt
.
i_chroma
=
p_vout
->
render
.
i_chroma
;
fmt
.
i_aspect
=
p_vout
->
render
.
i_aspect
;
fmt
.
i_sar_num
=
p_vout
->
render
.
i_aspect
*
fmt
.
i_height
/
fmt
.
i_width
;
fmt
.
i_sar_den
=
VOUT_ASPECT_FACTOR
;
/* Try to open the real video output */
msg_Dbg
(
p_vout
,
"spawning the real video output"
);
p_vout
->
p_sys
->
p_vout
=
vout_Create
(
p_vout
,
p_vout
->
render
.
i_width
,
p_vout
->
render
.
i_height
,
p_vout
->
render
.
i_chroma
,
p_vout
->
render
.
i_aspect
);
p_vout
->
p_sys
->
p_vout
=
vout_Create
(
p_vout
,
&
fmt
);
/* Everything failed */
if
(
p_vout
->
p_sys
->
p_vout
==
NULL
)
...
...
modules/video_filter/logo.c
View file @
3f6f97f1
...
...
@@ -211,6 +211,7 @@ static int Init( vout_thread_t *p_vout )
vout_sys_t
*
p_sys
=
p_vout
->
p_sys
;
picture_t
*
p_pic
;
int
i_index
;
video_format_t
fmt
=
{
0
};
I_OUTPUTPICTURES
=
0
;
...
...
@@ -220,6 +221,14 @@ static int Init( vout_thread_t *p_vout )
p_vout
->
output
.
i_height
=
p_vout
->
render
.
i_height
;
p_vout
->
output
.
i_aspect
=
p_vout
->
render
.
i_aspect
;
fmt
.
i_width
=
fmt
.
i_visible_width
=
p_vout
->
render
.
i_width
;
fmt
.
i_height
=
fmt
.
i_visible_height
=
p_vout
->
render
.
i_height
;
fmt
.
i_x_offset
=
fmt
.
i_y_offset
=
0
;
fmt
.
i_chroma
=
p_vout
->
render
.
i_chroma
;
fmt
.
i_aspect
=
p_vout
->
render
.
i_aspect
;
fmt
.
i_sar_num
=
p_vout
->
render
.
i_aspect
*
fmt
.
i_height
/
fmt
.
i_width
;
fmt
.
i_sar_den
=
VOUT_ASPECT_FACTOR
;
/* Load the video blending filter */
p_sys
->
p_blend
=
vlc_object_create
(
p_vout
,
sizeof
(
filter_t
)
);
vlc_object_attach
(
p_sys
->
p_blend
,
p_vout
);
...
...
@@ -280,9 +289,7 @@ static int Init( vout_thread_t *p_vout )
/* Try to open the real video output */
msg_Dbg
(
p_vout
,
"spawning the real video output"
);
p_sys
->
p_vout
=
vout_Create
(
p_vout
,
p_vout
->
render
.
i_width
,
p_vout
->
render
.
i_height
,
p_vout
->
render
.
i_chroma
,
p_vout
->
render
.
i_aspect
);
p_sys
->
p_vout
=
vout_Create
(
p_vout
,
&
fmt
);
/* Everything failed */
if
(
p_sys
->
p_vout
==
NULL
)
...
...
modules/video_filter/motionblur.c
View file @
3f6f97f1
...
...
@@ -129,6 +129,7 @@ static int Init( vout_thread_t *p_vout )
{
int
i_index
;
picture_t
*
p_pic
;
video_format_t
fmt
=
{
0
};
I_OUTPUTPICTURES
=
0
;
...
...
@@ -153,14 +154,20 @@ static int Init( vout_thread_t *p_vout )
msg_Dbg
(
p_vout
,
"spawning the real video output"
);
fmt
.
i_width
=
fmt
.
i_visible_width
=
p_vout
->
output
.
i_width
;
fmt
.
i_height
=
fmt
.
i_visible_height
=
p_vout
->
output
.
i_height
;
fmt
.
i_x_offset
=
fmt
.
i_y_offset
=
0
;
fmt
.
i_chroma
=
p_vout
->
output
.
i_chroma
;
fmt
.
i_aspect
=
p_vout
->
output
.
i_aspect
;
fmt
.
i_sar_num
=
p_vout
->
output
.
i_aspect
*
fmt
.
i_height
/
fmt
.
i_width
;
fmt
.
i_sar_den
=
VOUT_ASPECT_FACTOR
;
switch
(
p_vout
->
render
.
i_chroma
)
{
case
VLC_FOURCC
(
'I'
,
'4'
,
'2'
,
'0'
):
case
VLC_FOURCC
(
'I'
,
'Y'
,
'U'
,
'V'
):
case
VLC_FOURCC
(
'Y'
,
'V'
,
'1'
,
'2'
):
p_vout
->
p_sys
->
p_vout
=
vout_Create
(
p_vout
,
p_vout
->
output
.
i_width
,
p_vout
->
output
.
i_height
,
p_vout
->
output
.
i_chroma
,
p_vout
->
output
.
i_aspect
);
p_vout
->
p_sys
->
p_vout
=
vout_Create
(
p_vout
,
&
fmt
);
break
;
default:
break
;
...
...
modules/video_filter/motiondetect.c
View file @
3f6f97f1
...
...
@@ -211,6 +211,7 @@ static int Init( vout_thread_t *p_vout )
{
int
i_index
;
picture_t
*
p_pic
;
video_format_t
fmt
=
{
0
};
I_OUTPUTPICTURES
=
0
;
...
...
@@ -220,12 +221,18 @@ static int Init( vout_thread_t *p_vout )
p_vout
->
output
.
i_height
=
p_vout
->
render
.
i_height
;
p_vout
->
output
.
i_aspect
=
p_vout
->
render
.
i_aspect
;
fmt
.
i_width
=
fmt
.
i_visible_width
=
p_vout
->
render
.
i_width
;
fmt
.
i_height
=
fmt
.
i_visible_height
=
p_vout
->
render
.
i_height
;
fmt
.
i_x_offset
=
fmt
.
i_y_offset
=
0
;
fmt
.
i_chroma
=
p_vout
->
render
.
i_chroma
;
fmt
.
i_aspect
=
p_vout
->
render
.
i_aspect
;
fmt
.
i_sar_num
=
p_vout
->
render
.
i_aspect
*
fmt
.
i_height
/
fmt
.
i_width
;
fmt
.
i_sar_den
=
VOUT_ASPECT_FACTOR
;
/* Try to open the real video output */
msg_Dbg
(
p_vout
,
"spawning the real video output"
);
p_vout
->
p_sys
->
p_vout
=
vout_Create
(
p_vout
,
p_vout
->
render
.
i_width
,
p_vout
->
render
.
i_height
,
p_vout
->
render
.
i_chroma
,
p_vout
->
render
.
i_aspect
);
p_vout
->
p_sys
->
p_vout
=
vout_Create
(
p_vout
,
&
fmt
);
/* Everything failed */
if
(
p_vout
->
p_sys
->
p_vout
==
NULL
)
...
...
modules/video_filter/transform.c
View file @
3f6f97f1
...
...
@@ -180,6 +180,7 @@ static int Init( vout_thread_t *p_vout )
{
int
i_index
;
picture_t
*
p_pic
;
video_format_t
fmt
=
{
0
};
I_OUTPUTPICTURES
=
0
;
...
...
@@ -189,23 +190,31 @@ static int Init( vout_thread_t *p_vout )
p_vout
->
output
.
i_height
=
p_vout
->
render
.
i_height
;
p_vout
->
output
.
i_aspect
=
p_vout
->
render
.
i_aspect
;
fmt
.
i_width
=
fmt
.
i_visible_width
=
p_vout
->
render
.
i_width
;
fmt
.
i_height
=
fmt
.
i_visible_height
=
p_vout
->
render
.
i_height
;
fmt
.
i_x_offset
=
fmt
.
i_y_offset
=
0
;
fmt
.
i_chroma
=
p_vout
->
render
.
i_chroma
;
fmt
.
i_aspect
=
p_vout
->
render
.
i_aspect
;
fmt
.
i_sar_num
=
p_vout
->
render
.
i_aspect
*
fmt
.
i_height
/
fmt
.
i_width
;
fmt
.
i_sar_den
=
VOUT_ASPECT_FACTOR
;
/* Try to open the real video output */
msg_Dbg
(
p_vout
,
"spawning the real video output"
);
if
(
p_vout
->
p_sys
->
b_rotation
)
{
p_vout
->
p_sys
->
p_vout
=
vout_Create
(
p_vout
,
p_vout
->
render
.
i_height
,
p_vout
->
render
.
i_width
,
p_vout
->
render
.
i_chroma
,
(
uint64_t
)
VOUT_ASPECT_FACTOR
*
(
uint64_t
)
VOUT_ASPECT_FACTOR
/
(
uint64_t
)
p_vout
->
render
.
i_aspect
);
fmt
.
i_width
=
fmt
.
i_visible_width
=
p_vout
->
render
.
i_height
;
fmt
.
i_height
=
fmt
.
i_visible_height
=
p_vout
->
render
.
i_width
;
fmt
.
i_aspect
=
VOUT_ASPECT_FACTOR
*
(
uint64_t
)
VOUT_ASPECT_FACTOR
/
p_vout
->
render
.
i_aspect
;
fmt
.
i_sar_num
=
VOUT_ASPECT_FACTOR
;
fmt
.
i_sar_den
=
p_vout
->
render
.
i_aspect
*
fmt
.
i_height
/
fmt
.
i_width
;
p_vout
->
p_sys
->
p_vout
=
vout_Create
(
p_vout
,
&
fmt
);
}
else
{
p_vout
->
p_sys
->
p_vout
=
vout_Create
(
p_vout
,
p_vout
->
render
.
i_width
,
p_vout
->
render
.
i_height
,
p_vout
->
render
.
i_chroma
,
p_vout
->
render
.
i_aspect
);
p_vout
->
p_sys
->
p_vout
=
vout_Create
(
p_vout
,
&
fmt
);
}
/* Everything failed */
...
...
modules/video_filter/wall.c
View file @
3f6f97f1
...
...
@@ -229,6 +229,7 @@ static int Init( vout_thread_t *p_vout )
int
i_index
,
i_row
,
i_col
,
i_width
,
i_height
,
i_left
,
i_top
;
unsigned
int
i_target_width
,
i_target_height
;
picture_t
*
p_pic
;
video_format_t
fmt
=
{
0
};
int
i_aspect
=
4
*
VOUT_ASPECT_FACTOR
/
3
;
int
i_align
=
0
;
unsigned
int
i_hstart
,
i_hend
,
i_vstart
,
i_vend
;
...
...
@@ -269,6 +270,14 @@ static int Init( vout_thread_t *p_vout )
p_vout
->
output
.
i_aspect
=
p_vout
->
render
.
i_aspect
;
var_Create
(
p_vout
,
"align"
,
VLC_VAR_INTEGER
);
fmt
.
i_width
=
fmt
.
i_visible_width
=
p_vout
->
render
.
i_width
;
fmt
.
i_height
=
fmt
.
i_visible_height
=
p_vout
->
render
.
i_height
;
fmt
.
i_x_offset
=
fmt
.
i_y_offset
=
0
;
fmt
.
i_chroma
=
p_vout
->
render
.
i_chroma
;
fmt
.
i_aspect
=
p_vout
->
render
.
i_aspect
;
fmt
.
i_sar_num
=
p_vout
->
render
.
i_aspect
*
fmt
.
i_height
/
fmt
.
i_width
;
fmt
.
i_sar_den
=
VOUT_ASPECT_FACTOR
;
w1
=
p_vout
->
output
.
i_width
/
p_vout
->
p_sys
->
i_col
;
w1
&=
~
1
;
h1
=
w1
*
VOUT_ASPECT_FACTOR
/
i_aspect
&~
1
;
...
...
@@ -394,12 +403,14 @@ static int Init( vout_thread_t *p_vout )
var_SetInteger
(
p_vout
,
"video-x"
,
i_left
+
i_xpos
-
i_width
);
var_SetInteger
(
p_vout
,
"video-y"
,
i_top
+
i_ypos
);
fmt
.
i_width
=
fmt
.
i_visible_width
=
i_width
;
fmt
.
i_height
=
fmt
.
i_visible_height
=
i_height
;
fmt
.
i_aspect
=
i_aspect
*
i_target_height
/
i_height
*
i_width
/
i_target_width
;
p_vout
->
p_sys
->
pp_vout
[
p_vout
->
p_sys
->
i_vout
].
p_vout
=
vout_Create
(
p_vout
,
i_width
,
i_height
,
p_vout
->
render
.
i_chroma
,
i_aspect
*
i_target_height
/
i_height
*
i_width
/
i_target_width
);
if
(
p_vout
->
p_sys
->
pp_vout
[
p_vout
->
p_sys
->
i_vout
].
p_vout
==
NULL
)
vout_Create
(
p_vout
,
&
fmt
);
if
(
!
p_vout
->
p_sys
->
pp_vout
[
p_vout
->
p_sys
->
i_vout
].
p_vout
)
{
msg_Err
(
p_vout
,
"failed to get %ix%i vout threads"
,
p_vout
->
p_sys
->
i_col
,
p_vout
->
p_sys
->
i_row
);
...
...
modules/visualization/goom.c
View file @
3f6f97f1
...
...
@@ -131,6 +131,7 @@ static int Open( vlc_object_t *p_this )
aout_filter_sys_t
*
p_sys
;
goom_thread_t
*
p_thread
;
vlc_value_t
width
,
height
;
video_format_t
fmt
=
{
0
};
if
(
p_filter
->
input
.
i_format
!=
VLC_FOURCC
(
'f'
,
'l'
,
'3'
,
'2'
)
||
p_filter
->
output
.
i_format
!=
VLC_FOURCC
(
'f'
,
'l'
,
'3'
,
'2'
)
)
...
...
@@ -160,10 +161,13 @@ static int Open( vlc_object_t *p_this )
var_Create
(
p_thread
,
"goom-height"
,
VLC_VAR_INTEGER
|
VLC_VAR_DOINHERIT
);
var_Get
(
p_thread
,
"goom-height"
,
&
height
);
p_thread
->
p_vout
=
vout_Request
(
p_filter
,
NULL
,
width
.
i_int
,
height
.
i_int
,
VLC_FOURCC
(
'R'
,
'V'
,
'3'
,
'2'
),
VOUT_ASPECT_FACTOR
*
width
.
i_int
/
height
.
i_int
);
fmt
.
i_width
=
fmt
.
i_visible_width
=
width
.
i_int
;
fmt
.
i_height
=
fmt
.
i_visible_height
=
height
.
i_int
;
fmt
.
i_chroma
=
VLC_FOURCC
(
'R'
,
'V'
,
'3'
,
'2'
);
fmt
.
i_aspect
=
VOUT_ASPECT_FACTOR
*
width
.
i_int
/
height
.
i_int
;
fmt
.
i_sar_num
=
fmt
.
i_sar_den
=
1
;
p_thread
->
p_vout
=
vout_Request
(
p_filter
,
NULL
,
&
fmt
);
if
(
p_thread
->
p_vout
==
NULL
)
{
msg_Err
(
p_filter
,
"no suitable vout module"
);
...
...
@@ -386,7 +390,7 @@ static void Close( vlc_object_t *p_this )
vlc_thread_join
(
p_sys
->
p_thread
);
/* Free data */
vout_Request
(
p_filter
,
p_sys
->
p_thread
->
p_vout
,
0
,
0
,
0
,
0
);
vout_Request
(
p_filter
,
p_sys
->
p_thread
->
p_vout
,
0
);
vlc_mutex_destroy
(
&
p_sys
->
p_thread
->
lock
);
vlc_cond_destroy
(
&
p_sys
->
p_thread
->
wait
);
vlc_object_detach
(
p_sys
->
p_thread
);
...
...
modules/visualization/visual/visual.c
View file @
3f6f97f1
...
...
@@ -132,6 +132,7 @@ static int Open( vlc_object_t *p_this )
vlc_value_t
val
;
char
*
psz_effects
,
*
psz_parser
;
video_format_t
fmt
=
{
0
};
if
(
(
p_filter
->
input
.
i_format
!=
VLC_FOURCC
(
'f'
,
'l'
,
'3'
,
'2'
)
&&
p_filter
->
input
.
i_format
!=
VLC_FOURCC
(
'f'
,
'i'
,
'3'
,
'2'
)
)
)
...
...
@@ -246,12 +247,13 @@ static int Open( vlc_object_t *p_this )
}
/* Open the video output */
p_sys
->
p_vout
=
vout_Request
(
p_filter
,
NULL
,
p_sys
->
i_width
,
p_sys
->
i_height
,
VLC_FOURCC
(
'I'
,
'4'
,
'2'
,
'0'
),
VOUT_ASPECT_FACTOR
*
p_sys
->
i_width
/
p_sys
->
i_height
)
;
fmt
.
i_width
=
fmt
.
i_visible_width
=
p_sys
->
i_width
;
fmt
.
i_height
=
fmt
.
i_visible_height
=
p_sys
->
i_height
;
fmt
.
i_chroma
=
VLC_FOURCC
(
'I'
,
'4'
,
'2'
,
'0'
);
fmt
.
i_aspect
=
VOUT_ASPECT_FACTOR
*
p_sys
->
i_width
/
p_sys
->
i_height
;
fmt
.
i_sar_num
=
fmt
.
i_sar_den
=
1
;
p_sys
->
p_vout
=
vout_Request
(
p_filter
,
NULL
,
&
fmt
);
if
(
p_sys
->
p_vout
==
NULL
)
{
msg_Err
(
p_filter
,
"no suitable vout module"
);
...
...
@@ -329,7 +331,7 @@ static void Close( vlc_object_t *p_this )
if
(
p_filter
->
p_sys
->
p_vout
)
{
vout_Request
(
p_filter
,
p_filter
->
p_sys
->
p_vout
,
0
,
0
,
0
,
0
);
vout_Request
(
p_filter
,
p_filter
->
p_sys
->
p_vout
,
0
);
}
/* Free the list */
...
...
src/input/decoder.c
View file @
3f6f97f1
...
...
@@ -779,7 +779,7 @@ static void DeleteDecoder( decoder_t * p_dec )
#undef p_pic
/* We are about to die. Reattach video output to p_vlc. */
vout_Request
(
p_dec
,
p_dec
->
p_owner
->
p_vout
,
0
,
0
,
0
,
0
);
vout_Request
(
p_dec
,
p_dec
->
p_owner
->
p_vout
,
0
);
}
if
(
p_dec
->
p_owner
->
p_sout_input
)
...
...
@@ -885,15 +885,35 @@ static picture_t *vout_new_buffer( decoder_t *p_dec )
return
NULL
;
}
if
(
!
p_dec
->
fmt_out
.
video
.
i_sar_num
||
!
p_dec
->
fmt_out
.
video
.
i_sar_den
)
{
p_dec
->
fmt_out
.
video
.
i_sar_num
=
p_dec
->
fmt_out
.
video
.
i_aspect
*
p_dec
->
fmt_out
.
video
.
i_height
;
p_dec
->
fmt_out
.
video
.
i_sar_den
=
VOUT_ASPECT_FACTOR
*
p_dec
->
fmt_out
.
video
.
i_width
;
}
vlc_reduce
(
&
p_dec
->
fmt_out
.
video
.
i_sar_num
,
&
p_dec
->
fmt_out
.
video
.
i_sar_den
,
p_dec
->
fmt_out
.
video
.
i_sar_num
,
p_dec
->
fmt_out
.
video
.
i_sar_den
,
0
);
if
(
!
p_dec
->
fmt_out
.
video
.
i_visible_width
||
!
p_dec
->
fmt_out
.
video
.
i_visible_height
)
{
p_dec
->
fmt_out
.
video
.
i_visible_width
=
p_dec
->
fmt_out
.
video
.
i_width
;
p_dec
->
fmt_out
.
video
.
i_visible_height
=
p_dec
->
fmt_out
.
video
.
i_height
;
}
p_dec
->
fmt_out
.
video
.
i_chroma
=
p_dec
->
fmt_out
.
i_codec
;
p_sys
->
video
=
p_dec
->
fmt_out
.
video
;
p_sys
->
p_vout
=
vout_Request
(
p_dec
,
p_sys
->
p_vout
,
p_sys
->
video
.
i_width
,
p_sys
->
video
.
i_height
,
p_sys
->
video
.
i_chroma
,
p_sys
->
video
.
i_aspect
);
&
p_dec
->
fmt_out
.
video
);
if
(
p_sys
->
p_vout
==
NULL
)
{