1 #include <vlc_picture_fifo.h>
2 #include <vlc_filter.h>
4 #include "encoder/encoder.h"
6 /*100ms is around the limit where people are noticing lipsync issues*/
7 #define MASTER_SYNC_MAX_DRIFT VLC_TICK_FROM_MS(100)
16 char *psz_deinterlace
;
17 config_chain_t
*p_deinterlace_cfg
;
18 char *psz_spu_sources
;
21 } sout_filters_config_t
;
24 void sout_filters_config_init( sout_filters_config_t
*p_cfg
)
26 memset( p_cfg
, 0, sizeof(*p_cfg
) );
30 void sout_filters_config_clean( sout_filters_config_t
*p_cfg
)
32 free( p_cfg
->psz_filters
);
33 if( p_cfg
->video
.psz_deinterlace
)
35 free( p_cfg
->video
.psz_deinterlace
);
36 config_ChainDestroy( p_cfg
->video
.p_deinterlace_cfg
);
38 free( p_cfg
->video
.psz_spu_sources
);
41 typedef struct sout_stream_id_sys_t sout_stream_id_sys_t
;
45 sout_stream_id_sys_t
*id_video
;
50 transcode_encoder_config_t aenc_cfg
;
51 sout_filters_config_t afilters_cfg
;
54 transcode_encoder_config_t venc_cfg
;
55 sout_filters_config_t vfilters_cfg
;
58 transcode_encoder_config_t senc_cfg
;
62 sout_stream_id_sys_t
*id_master_sync
;
68 struct sout_stream_id_sys_t
73 /* id of the out stream */
75 void *(*pf_transcode_downstream_add
)( sout_stream_t
*,
76 const es_format_t
*orig
,
77 const es_format_t
*current
);
106 int (*pf_drift_validate
)(void *cbdata
, vlc_tick_t
);
110 void (*pf_send_subpicture
)(void *cbdata
, subpicture_t
*);
111 int (*pf_get_output_dimensions
)(void *cbdata
, unsigned *, unsigned *);
112 vlc_tick_t (*pf_get_master_drift
)(void *cbdata
);
121 filter_chain_t
*p_f_chain
; /**< Video filters */
122 filter_chain_t
*p_uf_chain
; /**< User-specified video filters */
123 filter_t
*p_spu_blender
;
125 video_format_t fmt_input_video
;
129 struct aout_filters
*p_af_chain
; /**< Audio filters */
130 audio_format_t fmt_input_audio
;
133 es_format_t decoder_out
; /* only rw from pf_*_format_update() */
134 const sout_filters_config_t
*p_filterscfg
;
137 const transcode_encoder_config_t
*p_enccfg
;
138 transcode_encoder_t
*encoder
;
141 date_t next_input_pts
; /**< Incoming calculated PTS */
142 vlc_tick_t i_drift
; /** how much buffer is ahead of calculated PTS */
149 sout_stream_id_sys_t
*id
;
152 static inline struct decoder_owner
*dec_get_owner( decoder_t
*p_dec
)
154 return container_of( p_dec
, struct decoder_owner
, dec
);
157 static inline void es_format_SetMeta( es_format_t
*p_dst
, const es_format_t
*p_src
)
159 p_dst
->i_group
= p_src
->i_group
;
160 p_dst
->i_id
= p_src
->i_id
;
161 if( p_src
->psz_language
)
163 free( p_dst
->psz_language
);
164 p_dst
->psz_language
= strdup( p_src
->psz_language
);
166 if( p_src
->psz_description
)
168 free( p_dst
->psz_description
);
169 p_dst
->psz_description
= strdup( p_src
->psz_description
);
175 void transcode_spu_clean ( sout_stream_t
*, sout_stream_id_sys_t
* );
176 int transcode_spu_process( sout_stream_t
*, sout_stream_id_sys_t
*,
177 block_t
*, block_t
** );
178 int transcode_spu_init ( sout_stream_t
*, const es_format_t
*, sout_stream_id_sys_t
*);
182 void transcode_audio_clean ( sout_stream_id_sys_t
* );
183 int transcode_audio_process( sout_stream_t
*, sout_stream_id_sys_t
*,
184 block_t
*, block_t
** );
185 int transcode_audio_init ( sout_stream_t
*, const es_format_t
*,
186 sout_stream_id_sys_t
*);
190 void transcode_video_clean ( sout_stream_t
*, sout_stream_id_sys_t
* );
191 int transcode_video_process( sout_stream_t
*, sout_stream_id_sys_t
*,
192 block_t
*, block_t
** );
193 int transcode_video_get_output_dimensions( sout_stream_t
*, sout_stream_id_sys_t
*,
194 unsigned *w
, unsigned *h
);
195 void transcode_video_push_spu( sout_stream_t
*, sout_stream_id_sys_t
*, subpicture_t
* );
196 int transcode_video_init ( sout_stream_t
*, const es_format_t
*,
197 sout_stream_id_sys_t
*);