2 * Copyright (C) <2004> Wim Taymans <wim@fluendo.com>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
21 #ifndef __SMOKECODEC_H__
22 #define __SMOKECODEC_H__
27 #endif /* __cplusplus */
30 typedef struct _SmokeCodecInfo SmokeCodecInfo;
33 SMOKECODEC_WRONGVERSION = -5,
34 SMOKECODEC_WRONGSIZE = -4,
35 SMOKECODEC_ERROR = -3,
36 SMOKECODEC_NOMEM = -2,
37 SMOKECODEC_NULLPTR = -1,
42 SMOKECODEC_KEYFRAME = (1<<0),
43 SMOKECODEC_MOTION_VECTORS = (1<<1)
46 #define SMOKECODEC_ID_STRING "smoke"
49 SMOKECODEC_TYPE_ID = 0x80,
50 SMOKECODEC_TYPE_COMMENT = 0x81,
51 SMOKECODEC_TYPE_EXTRA = 0x83,
52 SMOKECODEC_TYPE_DATA = 0x40
56 int smokecodec_encode_new (SmokeCodecInfo **info,
57 const unsigned int width,
58 const unsigned int height,
59 const unsigned int fps_num,
60 const unsigned int fps_denom);
62 int smokecodec_decode_new (SmokeCodecInfo **info);
64 int smokecodec_info_free (SmokeCodecInfo * info);
67 SmokeCodecResult smokecodec_set_quality (SmokeCodecInfo *info,
68 const unsigned int min,
69 const unsigned int max);
70 SmokeCodecResult smokecodec_get_quality (SmokeCodecInfo *info,
74 SmokeCodecResult smokecodec_set_threshold (SmokeCodecInfo *info,
75 const unsigned int threshold);
76 SmokeCodecResult smokecodec_get_threshold (SmokeCodecInfo *info,
77 unsigned int *threshold);
79 SmokeCodecResult smokecodec_set_bitrate (SmokeCodecInfo *info,
80 const unsigned int bitrate);
81 SmokeCodecResult smokecodec_get_bitrate (SmokeCodecInfo *info,
82 unsigned int *bitrate);
85 SmokeCodecResult smokecodec_encode_id (SmokeCodecInfo *info,
87 unsigned int *outsize);
89 SmokeCodecResult smokecodec_encode (SmokeCodecInfo *info,
90 const unsigned char *in,
91 SmokeCodecFlags flags,
93 unsigned int *outsize);
96 SmokeCodecResult smokecodec_parse_id (SmokeCodecInfo *info,
97 const unsigned char *in,
98 const unsigned int insize);
100 SmokeCodecResult smokecodec_parse_header (SmokeCodecInfo *info,
101 const unsigned char *in,
102 const unsigned int insize,
103 SmokeCodecFlags *flags,
105 unsigned int *height,
106 unsigned int *fps_num,
107 unsigned int *fps_denom);
109 SmokeCodecResult smokecodec_decode (SmokeCodecInfo *info,
110 const unsigned char *in,
111 const unsigned int insize,
116 #endif /* __cplusplus */
119 #endif /* __SMOKECODEC_H__ */