1 /*****************************************************************************
3 *****************************************************************************
4 * Copyright (C) 2002 VideoLAN
5 * $Id: encoder.h,v 1.1 2003/01/22 10:41:57 fenrir Exp $
7 * Authors: Laurent Aimar <fenrir@via.ecp.fr>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
22 *****************************************************************************/
26 typedef struct encoder_sys_t encoder_sys_t;
28 typedef struct video_encoder_s
34 vlc_fourcc_t i_codec; /* in */
35 vlc_fourcc_t i_chroma; /* in/out */
36 int i_width; /* in/out */
37 int i_height; /* in/out */
38 int i_aspect; /* in/out */
40 size_t i_buffer_size; /* in/out */
44 int (*pf_init) ( struct video_encoder_s *p_enc );
45 int (*pf_encode) ( struct video_encoder_s *p_enc, picture_t *p_pic, void *p_data, size_t *pi_data );
46 void (*pf_end) ( struct video_encoder_s *p_enc );
53 * = at loading a video decoder must
54 * * see if i_codec is supporte, if not => failling
55 * * modify i_width/i_height/i_chroma/i_aspect if required (for example,
56 * if a video codec required %8 size)
57 * * init/check the library
58 * * set pf_init, pf_encode and pf_end
59 * * set i_buffer_size to the max buffer size required to output a single frame
62 * * start encoding processing
63 * * doesn't change any parameters (i_chroma/i_width/i_height/i_aspect)
64 * * check for passed parameters (no one for the moment)
67 * * encode a single frame
68 * * doesn't change any parameters (...)
69 * * doesn't look for passed paramters
72 * * end the encoding process
73 * * revert all that pf_init (and pf_encode) has done (memory...)
75 * = at unloading, a video decoder must revert all that was done while loading
77 * XXX: pf_init/pf_end could be called multiple time without the plugin unloaded.
78 * XXX: all memory allocated by video encoder MUST be unallocated by video encoder