transcode: destroy spu on transcode_spu_close
[vlc/solaris.git] / modules / stream_out / transcode / transcode.h
blobcde007298faa7012dba83d7e73614c451dcfc460
1 #ifdef HAVE_CONFIG_H
2 #include "config.h"
3 #endif
5 #include <vlc_common.h>
7 #include <vlc_sout.h>
8 #include <vlc_filter.h>
9 #include <vlc_es.h>
10 #include <vlc_codec.h>
13 #define PICTURE_RING_SIZE 64
14 #define SUBPICTURE_RING_SIZE 20
16 #define MASTER_SYNC_MAX_DRIFT 100000
18 struct sout_stream_sys_t
20 VLC_COMMON_MEMBERS
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 bool b_error;
30 /* Audio */
31 vlc_fourcc_t i_acodec; /* codec audio (0 if not transcode) */
32 char *psz_aenc;
33 char *psz_alang;
34 config_chain_t *p_audio_cfg;
35 uint32_t i_sample_rate;
36 uint32_t i_channels;
37 int i_abitrate;
39 char *psz_af;
41 /* Video */
42 vlc_fourcc_t i_vcodec; /* codec video (0 if not transcode) */
43 char *psz_venc;
44 config_chain_t *p_video_cfg;
45 int i_vbitrate;
46 double f_scale;
47 double f_fps;
48 unsigned int i_width, i_maxwidth;
49 unsigned int i_height, i_maxheight;
50 bool b_deinterlace;
51 char *psz_deinterlace;
52 config_chain_t *p_deinterlace_cfg;
53 int i_threads;
54 bool b_high_priority;
55 bool b_hurry_up;
57 char *psz_vf2;
59 /* SPU */
60 vlc_fourcc_t i_scodec; /* codec spu (0 if not transcode) */
61 char *psz_senc;
62 bool b_soverlay;
63 config_chain_t *p_spu_cfg;
64 spu_t *p_spu;
66 /* OSD Menu */
67 vlc_fourcc_t i_osdcodec; /* codec osd menu (0 if not transcode) */
68 char *psz_osdenc;
69 config_chain_t *p_osd_cfg;
70 bool b_osd; /* true when osd es is registered */
72 /* Sync */
73 bool b_master_sync;
74 mtime_t i_master_drift;
77 struct sout_stream_id_t
79 bool b_transcode;
81 /* id of the out stream */
82 void *id;
84 /* Decoder */
85 decoder_t *p_decoder;
87 /* Filters */
88 filter_chain_t *p_f_chain;
89 /* User specified filters */
90 filter_chain_t *p_uf_chain;
92 /* Encoder */
93 encoder_t *p_encoder;
95 /* Sync */
96 date_t interpolated_pts;
99 /* OSD */
101 int transcode_osd_new( sout_stream_t *p_stream, sout_stream_id_t *id );
102 void transcode_osd_close( sout_stream_t *p_stream, sout_stream_id_t *id);
103 int transcode_osd_process( sout_stream_t *p_stream, sout_stream_id_t *id,
104 block_t *in, block_t **out );
105 bool transcode_osd_add ( sout_stream_t *, es_format_t *, sout_stream_id_t *);
107 /* SPU */
109 int transcode_spu_new ( sout_stream_t *, sout_stream_id_t * );
110 void transcode_spu_close ( sout_stream_t *, sout_stream_id_t * );
111 int transcode_spu_process( sout_stream_t *, sout_stream_id_t *,
112 block_t *, block_t ** );
113 bool transcode_spu_add ( sout_stream_t *, es_format_t *, sout_stream_id_t *);
115 /* AUDIO */
117 int transcode_audio_new ( sout_stream_t *, sout_stream_id_t * );
118 void transcode_audio_close ( sout_stream_id_t * );
119 int transcode_audio_process( sout_stream_t *, sout_stream_id_t *,
120 block_t *, block_t ** );
121 bool transcode_audio_add ( sout_stream_t *, es_format_t *,
122 sout_stream_id_t *);
124 /* VIDEO */
126 int transcode_video_new ( sout_stream_t *, sout_stream_id_t * );
127 void transcode_video_close ( sout_stream_t *, sout_stream_id_t * );
128 int transcode_video_process( sout_stream_t *, sout_stream_id_t *,
129 block_t *, block_t ** );
130 bool transcode_video_add ( sout_stream_t *, es_format_t *,
131 sout_stream_id_t *);