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