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