#include <vlc_aout.h>
#include <vlc_sout.h>
#include <vlc_codec.h>
-#include <vlc_osd.h>
+#include <vlc_spu.h>
#include <vlc_meta.h>
#include <vlc_dialog.h>
+#include <vlc_modules.h>
#include "audio_output/aout_internal.h"
#include "stream_output/stream_output.h"
p_subpic->i_start - SPU_MAX_PREPARE_TIME );
if( !b_reject )
- spu_DisplaySubpicture( vout_GetSpu( p_vout ), p_subpic );
+ vout_PutSubpicture( p_vout, p_subpic );
else
subpicture_Delete( p_subpic );
p_vout = input_resource_HoldVout( p_input->p->p_resource );
if( p_vout && p_owner->p_spu_vout == p_vout )
- spu_Control( vout_GetSpu( p_vout ), SPU_CHANNEL_CLEAR,
- p_owner->i_spu_channel );
+ vout_FlushSubpictureChannel( p_vout, p_owner->i_spu_channel );
if( p_vout )
vlc_object_release( p_vout );
vout_Reset( p_owner->p_vout );
/* */
- input_resource_RequestVout( p_owner->p_input->p->p_resource, p_owner->p_vout, NULL, true );
+ input_resource_RequestVout( p_owner->p_input->p->p_resource, p_owner->p_vout, NULL, 0, true );
input_SendEventVout( p_owner->p_input );
}
if( p_vout )
{
if( p_owner->p_spu_vout == p_vout )
- spu_Control( vout_GetSpu( p_vout ), SPU_CHANNEL_CLEAR, p_owner->i_spu_channel );
+ vout_FlushSubpictureChannel( p_vout, p_owner->i_spu_channel );
vlc_object_release( p_vout );
}
}
decoder_t *p_dec = p_private;
input_thread_t *p_input = p_dec->p_owner->p_input;
- p_vout = input_resource_RequestVout( p_input->p->p_resource, p_vout, p_fmt, b_recyle );
+ p_vout = input_resource_RequestVout( p_input->p->p_resource, p_vout, p_fmt, 1, b_recyle );
input_SendEventVout( p_input );
return p_vout;
if( p_owner->p_vout == NULL ||
p_dec->fmt_out.video.i_width != p_owner->video.i_width ||
p_dec->fmt_out.video.i_height != p_owner->video.i_height ||
- p_dec->fmt_out.video.i_chroma != p_owner->video.i_chroma ||
+ p_dec->fmt_out.video.i_visible_width != p_owner->video.i_visible_width ||
+ p_dec->fmt_out.video.i_visible_height != p_owner->video.i_visible_height ||
+ p_dec->fmt_out.video.i_x_offset != p_owner->video.i_x_offset ||
+ p_dec->fmt_out.video.i_y_offset != p_owner->video.i_y_offset ||
+ p_dec->fmt_out.i_codec != p_owner->video.i_chroma ||
(int64_t)p_dec->fmt_out.video.i_sar_num * p_owner->video.i_sar_den !=
(int64_t)p_dec->fmt_out.video.i_sar_den * p_owner->video.i_sar_num )
{
return NULL;
}
- if( !p_dec->fmt_out.video.i_visible_width ||
- !p_dec->fmt_out.video.i_visible_height )
+ video_format_t fmt = p_dec->fmt_out.video;
+ fmt.i_chroma = p_dec->fmt_out.i_codec;
+ p_owner->video = fmt;
+
+ if( !fmt.i_visible_width || !fmt.i_visible_height )
{
if( p_dec->fmt_in.video.i_visible_width &&
p_dec->fmt_in.video.i_visible_height )
{
- p_dec->fmt_out.video.i_visible_width =
- p_dec->fmt_in.video.i_visible_width;
- p_dec->fmt_out.video.i_visible_height =
- p_dec->fmt_in.video.i_visible_height;
+ fmt.i_visible_width = p_dec->fmt_in.video.i_visible_width;
+ fmt.i_visible_height = p_dec->fmt_in.video.i_visible_height;
}
else
{
- 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;
+ fmt.i_visible_width = fmt.i_width;
+ fmt.i_visible_height = fmt.i_height;
}
}
- if( p_dec->fmt_out.video.i_visible_height == 1088 &&
+ if( fmt.i_visible_height == 1088 &&
var_CreateGetBool( p_dec, "hdtv-fix" ) )
{
- p_dec->fmt_out.video.i_visible_height = 1080;
- if( !(p_dec->fmt_out.video.i_sar_num % 136))
+ fmt.i_visible_height = 1080;
+ if( !(fmt.i_sar_num % 136))
{
- p_dec->fmt_out.video.i_sar_num *= 135;
- p_dec->fmt_out.video.i_sar_den *= 136;
+ fmt.i_sar_num *= 135;
+ fmt.i_sar_den *= 136;
}
msg_Warn( p_dec, "Fixing broken HDTV stream (display_height=1088)");
}
- if( !p_dec->fmt_out.video.i_sar_num ||
- !p_dec->fmt_out.video.i_sar_den )
+ if( !fmt.i_sar_num || !fmt.i_sar_den )
{
- p_dec->fmt_out.video.i_sar_num = 1;
- p_dec->fmt_out.video.i_sar_den = 1;
+ fmt.i_sar_num = 1;
+ fmt.i_sar_den = 1;
}
- vlc_ureduce( &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, 50000 );
-
- p_dec->fmt_out.video.i_chroma = p_dec->fmt_out.i_codec;
- p_owner->video = p_dec->fmt_out.video;
+ vlc_ureduce( &fmt.i_sar_num, &fmt.i_sar_den,
+ fmt.i_sar_num, fmt.i_sar_den, 50000 );
vlc_mutex_lock( &p_owner->lock );
p_owner->p_vout = NULL;
vlc_mutex_unlock( &p_owner->lock );
+ unsigned dpb_size;
+ switch( p_dec->fmt_in.i_codec )
+ {
+ case VLC_CODEC_H264:
+ case VLC_CODEC_DIRAC: /* FIXME valid ? */
+ dpb_size = 18;
+ break;
+ case VLC_CODEC_VP5:
+ case VLC_CODEC_VP6:
+ case VLC_CODEC_VP6F:
+ case VLC_CODEC_VP8:
+ dpb_size = 3;
+ break;
+ default:
+ dpb_size = 2;
+ break;
+ }
p_vout = input_resource_RequestVout( p_owner->p_input->p->p_resource,
- p_vout, &p_dec->fmt_out.video, true );
-
+ p_vout, &fmt,
+ dpb_size + 1 + DECODER_MAX_BUFFERING_COUNT,
+ true );
vlc_mutex_lock( &p_owner->lock );
p_owner->p_vout = p_vout;
vlc_mutex_unlock( &p_owner->lock );
- spu_Control( vout_GetSpu( p_vout ), SPU_CHANNEL_REGISTER,
- &p_owner->i_spu_channel );
+ p_owner->i_spu_channel = vout_RegisterSubpictureChannel( p_vout );
p_owner->i_spu_order = 0;
p_owner->p_spu_vout = p_vout;
}