]> git.sesse.net Git - vlc/blob - modules/stream_out/transcode/transcode.h
transcode: reinit filter-chain when aspect-ratio changes
[vlc] / modules / stream_out / transcode / transcode.h
1 #ifdef HAVE_CONFIG_H
2 #include "config.h"
3 #endif
4
5 #include <vlc_common.h>
6
7 #include <vlc_sout.h>
8 #include <vlc_filter.h>
9 #include <vlc_es.h>
10 #include <vlc_codec.h>
11
12 #include <vlc_picture_fifo.h>
13
14 #define MASTER_SYNC_MAX_DRIFT 100000
15
16 struct sout_stream_sys_t
17 {
18     sout_stream_id_t *id_video;
19     block_t         *p_buffers;
20     vlc_mutex_t     lock_out;
21     vlc_cond_t      cond;
22     bool            b_abort;
23     picture_fifo_t *pp_pics;
24     vlc_thread_t    thread;
25
26     /* Audio */
27     vlc_fourcc_t    i_acodec;   /* codec audio (0 if not transcode) */
28     char            *psz_aenc;
29     char            *psz_alang;
30     config_chain_t  *p_audio_cfg;
31     uint32_t        i_sample_rate;
32     uint32_t        i_channels;
33     int             i_abitrate;
34
35     char            *psz_af;
36
37     /* Video */
38     vlc_fourcc_t    i_vcodec;   /* codec video (0 if not transcode) */
39     video_format_t  fmt_input_video;
40     char            *psz_venc;
41     config_chain_t  *p_video_cfg;
42     int             i_vbitrate;
43     double          f_scale;
44     double          f_fps;
45     unsigned int    i_width, i_maxwidth;
46     unsigned int    i_height, i_maxheight;
47     bool            b_deinterlace;
48     char            *psz_deinterlace;
49     config_chain_t  *p_deinterlace_cfg;
50     int             i_threads;
51     bool            b_high_priority;
52     bool            b_hurry_up;
53
54     char            *psz_vf2;
55
56     /* SPU */
57     vlc_fourcc_t    i_scodec;   /* codec spu (0 if not transcode) */
58     char            *psz_senc;
59     bool            b_soverlay;
60     config_chain_t  *p_spu_cfg;
61     spu_t           *p_spu;
62     filter_t        *p_spu_blend;
63
64     /* OSD Menu */
65     vlc_fourcc_t    i_osdcodec; /* codec osd menu (0 if not transcode) */
66     char            *psz_osdenc;
67     config_chain_t  *p_osd_cfg;
68     bool            b_osd;   /* true when osd es is registered */
69
70     /* Sync */
71     bool            b_master_sync;
72     mtime_t         i_master_drift;
73 };
74
75 struct sout_stream_id_t
76 {
77     bool            b_transcode;
78
79     /* id of the out stream */
80     void *id;
81
82     /* Decoder */
83     decoder_t       *p_decoder;
84
85     /* Filters */
86     filter_chain_t  *p_f_chain;
87     /* User specified filters */
88     filter_chain_t  *p_uf_chain;
89
90     /* Encoder */
91     encoder_t       *p_encoder;
92
93     /* Sync */
94     date_t          interpolated_pts;
95 };
96
97 /* OSD */
98
99 int transcode_osd_new( sout_stream_t *p_stream, sout_stream_id_t *id );
100 void transcode_osd_close( sout_stream_t *p_stream, sout_stream_id_t *id);
101 int transcode_osd_process( sout_stream_t *p_stream, sout_stream_id_t *id,
102                                   block_t *in, block_t **out );
103 bool transcode_osd_add    ( sout_stream_t *, es_format_t *, sout_stream_id_t *);
104
105 /* SPU */
106
107 int  transcode_spu_new    ( sout_stream_t *, sout_stream_id_t * );
108 void transcode_spu_close  ( sout_stream_t *, sout_stream_id_t * );
109 int  transcode_spu_process( sout_stream_t *, sout_stream_id_t *,
110                                    block_t *, block_t ** );
111 bool transcode_spu_add    ( sout_stream_t *, es_format_t *, sout_stream_id_t *);
112
113 /* AUDIO */
114
115 int  transcode_audio_new    ( sout_stream_t *, sout_stream_id_t * );
116 void transcode_audio_close  ( sout_stream_id_t * );
117 int  transcode_audio_process( sout_stream_t *, sout_stream_id_t *,
118                                      block_t *, block_t ** );
119 bool transcode_audio_add    ( sout_stream_t *, es_format_t *,
120                                 sout_stream_id_t *);
121
122 /* VIDEO */
123
124 int  transcode_video_new    ( sout_stream_t *, sout_stream_id_t * );
125 void transcode_video_close  ( sout_stream_t *, sout_stream_id_t * );
126 int  transcode_video_process( sout_stream_t *, sout_stream_id_t *,
127                                      block_t *, block_t ** );
128 bool transcode_video_add    ( sout_stream_t *, es_format_t *,
129                                 sout_stream_id_t *);