5 #include <vlc_common.h>
8 #include <vlc_filter.h>
10 #include <vlc_codec.h>
12 #include <vlc_picture_fifo.h>
14 /*100ms is around the limit where people are noticing lipsync issues*/
15 #define MASTER_SYNC_MAX_DRIFT 100000
17 struct sout_stream_sys_t
19 sout_stream_id_t *id_video;
24 picture_fifo_t *pp_pics;
28 vlc_fourcc_t i_acodec; /* codec audio (0 if not transcode) */
29 audio_sample_format_t fmt_audio;
32 config_chain_t *p_audio_cfg;
33 uint32_t i_sample_rate;
40 vlc_fourcc_t i_vcodec; /* codec video (0 if not transcode) */
41 video_format_t fmt_input_video;
43 config_chain_t *p_video_cfg;
47 unsigned int i_width, i_maxwidth;
48 unsigned int i_height, i_maxheight;
50 char *psz_deinterlace;
51 config_chain_t *p_deinterlace_cfg;
59 vlc_fourcc_t i_scodec; /* codec spu (0 if not transcode) */
62 config_chain_t *p_spu_cfg;
64 filter_t *p_spu_blend;
67 vlc_fourcc_t i_osdcodec; /* codec osd menu (0 if not transcode) */
69 config_chain_t *p_osd_cfg;
70 bool b_osd; /* true when osd es is registered */
74 mtime_t i_master_drift;
79 struct sout_stream_id_t
83 /* id of the out stream */
93 filter_chain_t *p_f_chain; /**< Video filters */
94 filter_chain_t *p_uf_chain; /**< User-specified video filters */
96 struct aout_filters *p_af_chain; /**< Audio filters */
100 encoder_t *p_encoder;
103 date_t interpolated_pts; /**< Incoming calculated PTS */
104 date_t next_output_pts; /**< output calculated PTS */
105 int i_output_frame_interval;
106 int i_input_frame_interval;
111 int transcode_osd_new( sout_stream_t *p_stream, sout_stream_id_t *id );
112 void transcode_osd_close( sout_stream_t *p_stream, sout_stream_id_t *id);
113 int transcode_osd_process( sout_stream_t *p_stream, sout_stream_id_t *id,
114 block_t *in, block_t **out );
115 bool transcode_osd_add ( sout_stream_t *, es_format_t *, sout_stream_id_t *);
119 int transcode_spu_new ( sout_stream_t *, sout_stream_id_t * );
120 void transcode_spu_close ( sout_stream_t *, sout_stream_id_t * );
121 int transcode_spu_process( sout_stream_t *, sout_stream_id_t *,
122 block_t *, block_t ** );
123 bool transcode_spu_add ( sout_stream_t *, es_format_t *, sout_stream_id_t *);
127 int transcode_audio_new ( sout_stream_t *, sout_stream_id_t * );
128 void transcode_audio_close ( sout_stream_id_t * );
129 int transcode_audio_process( sout_stream_t *, sout_stream_id_t *,
130 block_t *, block_t ** );
131 bool transcode_audio_add ( sout_stream_t *, es_format_t *,
136 int transcode_video_new ( sout_stream_t *, sout_stream_id_t * );
137 void transcode_video_close ( sout_stream_t *, sout_stream_id_t * );
138 int transcode_video_process( sout_stream_t *, sout_stream_id_t *,
139 block_t *, block_t ** );
140 bool transcode_video_add ( sout_stream_t *, es_format_t *,