1992-09-23 11:53:00 -03:00
|
|
|
|
|
|
|
|
|
|
|
/* Cl objects */
|
|
|
|
|
1993-02-16 07:55:17 -04:00
|
|
|
#define CLDEBUG
|
|
|
|
|
1992-09-24 07:37:39 -03:00
|
|
|
#include <stdarg.h>
|
1992-09-23 11:53:00 -03:00
|
|
|
#include <cl.h>
|
1997-08-12 11:58:54 -03:00
|
|
|
#if defined(CL_JPEG_SOFTWARE) && !defined(CL_JPEG_COSMO)
|
|
|
|
#include <dmedia/cl_cosmo.h>
|
|
|
|
#endif
|
1997-01-17 12:00:02 -04:00
|
|
|
#include "Python.h"
|
1992-09-23 11:53:00 -03:00
|
|
|
|
|
|
|
typedef struct {
|
2010-05-09 11:46:46 -03:00
|
|
|
PyObject_HEAD
|
|
|
|
int ob_isCompressor; /* Compressor or Decompressor */
|
|
|
|
CL_Handle ob_compressorHdl;
|
|
|
|
int *ob_paramtypes;
|
|
|
|
int ob_nparams;
|
1992-09-23 11:53:00 -03:00
|
|
|
} clobject;
|
|
|
|
|
2010-05-09 11:46:46 -03:00
|
|
|
static PyObject *ClError; /* exception cl.error */
|
1992-09-24 07:37:39 -03:00
|
|
|
|
|
|
|
static int error_handler_called = 0;
|
|
|
|
|
1993-02-16 07:55:17 -04:00
|
|
|
/*
|
|
|
|
* We want to use the function prototypes that are available in the C
|
|
|
|
* compiler on the SGI. Because of that, we need to declare the first
|
|
|
|
* argument of the compressor and decompressor methods as "object *",
|
|
|
|
* even though they are really "clobject *". Therefore we cast the
|
|
|
|
* argument to the proper type using this macro.
|
|
|
|
*/
|
2010-05-09 11:46:46 -03:00
|
|
|
#define SELF ((clobject *) self)
|
1993-02-16 07:55:17 -04:00
|
|
|
|
1992-12-14 09:17:29 -04:00
|
|
|
/********************************************************************
|
2010-05-09 11:46:46 -03:00
|
|
|
Utility routines.
|
1992-12-14 09:17:29 -04:00
|
|
|
********************************************************************/
|
1992-09-24 07:37:39 -03:00
|
|
|
static void
|
1993-02-04 12:43:28 -04:00
|
|
|
cl_ErrorHandler(CL_Handle handle, int code, const char *fmt, ...)
|
1992-09-24 07:37:39 -03:00
|
|
|
{
|
2010-05-09 11:46:46 -03:00
|
|
|
va_list ap;
|
|
|
|
char errbuf[BUFSIZ]; /* hopefully big enough */
|
|
|
|
char *p;
|
|
|
|
|
|
|
|
if (PyErr_Occurred()) /* don't change existing error */
|
|
|
|
return;
|
|
|
|
error_handler_called = 1;
|
|
|
|
va_start(ap, fmt);
|
|
|
|
vsprintf(errbuf, fmt, ap);
|
|
|
|
va_end(ap);
|
|
|
|
p = &errbuf[strlen(errbuf) - 1]; /* swat the line feed */
|
|
|
|
if (*p == '\n')
|
|
|
|
*p = 0;
|
|
|
|
PyErr_SetString(ClError, errbuf);
|
1992-09-24 07:37:39 -03:00
|
|
|
}
|
|
|
|
|
1992-12-14 09:17:29 -04:00
|
|
|
/*
|
|
|
|
* This assumes that params are always in the range 0 to some maximum.
|
|
|
|
*/
|
|
|
|
static int
|
1993-02-16 07:55:17 -04:00
|
|
|
param_type_is_float(clobject *self, int param)
|
1992-09-25 07:28:20 -03:00
|
|
|
{
|
2010-05-09 11:46:46 -03:00
|
|
|
int bufferlength;
|
|
|
|
|
|
|
|
if (self->ob_paramtypes == NULL) {
|
|
|
|
error_handler_called = 0;
|
|
|
|
bufferlength = clQueryParams(self->ob_compressorHdl, 0, 0);
|
|
|
|
if (error_handler_called)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
self->ob_paramtypes = PyMem_NEW(int, bufferlength);
|
|
|
|
if (self->ob_paramtypes == NULL)
|
|
|
|
return -1;
|
|
|
|
self->ob_nparams = bufferlength / 2;
|
|
|
|
|
|
|
|
(void) clQueryParams(self->ob_compressorHdl,
|
|
|
|
self->ob_paramtypes, bufferlength);
|
|
|
|
if (error_handler_called) {
|
|
|
|
PyMem_DEL(self->ob_paramtypes);
|
|
|
|
self->ob_paramtypes = NULL;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (param < 0 || param >= self->ob_nparams)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
if (self->ob_paramtypes[param*2 + 1] == CL_FLOATING_ENUM_VALUE ||
|
|
|
|
self->ob_paramtypes[param*2 + 1] == CL_FLOATING_RANGE_VALUE)
|
|
|
|
return 1;
|
|
|
|
else
|
|
|
|
return 0;
|
1992-09-25 07:28:20 -03:00
|
|
|
}
|
|
|
|
|
1992-12-14 09:17:29 -04:00
|
|
|
/********************************************************************
|
2010-05-09 11:46:46 -03:00
|
|
|
Single image compression/decompression.
|
1992-12-14 09:17:29 -04:00
|
|
|
********************************************************************/
|
1997-01-17 12:00:02 -04:00
|
|
|
static PyObject *
|
|
|
|
cl_CompressImage(PyObject *self, PyObject *args)
|
1992-09-23 11:53:00 -03:00
|
|
|
{
|
2010-05-09 11:46:46 -03:00
|
|
|
int compressionScheme, width, height, originalFormat;
|
|
|
|
float compressionRatio;
|
|
|
|
int frameBufferSize, compressedBufferSize;
|
|
|
|
char *frameBuffer;
|
|
|
|
PyObject *compressedBuffer;
|
|
|
|
|
|
|
|
if (!PyArg_ParseTuple(args, "iiiifs#", &compressionScheme,
|
|
|
|
&width, &height,
|
|
|
|
&originalFormat, &compressionRatio, &frameBuffer,
|
|
|
|
&frameBufferSize))
|
|
|
|
return NULL;
|
1992-09-23 11:53:00 -03:00
|
|
|
|
1997-01-17 12:00:02 -04:00
|
|
|
retry:
|
2010-05-09 11:46:46 -03:00
|
|
|
compressedBuffer = PyString_FromStringAndSize(NULL, frameBufferSize);
|
|
|
|
if (compressedBuffer == NULL)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
compressedBufferSize = frameBufferSize;
|
|
|
|
error_handler_called = 0;
|
|
|
|
if (clCompressImage(compressionScheme, width, height, originalFormat,
|
|
|
|
compressionRatio, (void *) frameBuffer,
|
|
|
|
&compressedBufferSize,
|
|
|
|
(void *) PyString_AsString(compressedBuffer))
|
|
|
|
== FAILURE || error_handler_called) {
|
|
|
|
Py_DECREF(compressedBuffer);
|
|
|
|
if (!error_handler_called)
|
|
|
|
PyErr_SetString(ClError, "clCompressImage failed");
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (compressedBufferSize > frameBufferSize) {
|
|
|
|
frameBufferSize = compressedBufferSize;
|
|
|
|
Py_DECREF(compressedBuffer);
|
|
|
|
goto retry;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (compressedBufferSize < frameBufferSize)
|
|
|
|
_PyString_Resize(&compressedBuffer, compressedBufferSize);
|
|
|
|
|
|
|
|
return compressedBuffer;
|
1992-12-14 09:17:29 -04:00
|
|
|
}
|
1992-09-23 11:53:00 -03:00
|
|
|
|
1997-01-17 12:00:02 -04:00
|
|
|
static PyObject *
|
|
|
|
cl_DecompressImage(PyObject *self, PyObject *args)
|
1992-09-23 11:53:00 -03:00
|
|
|
{
|
2010-05-09 11:46:46 -03:00
|
|
|
int compressionScheme, width, height, originalFormat;
|
|
|
|
char *compressedBuffer;
|
|
|
|
int compressedBufferSize, frameBufferSize;
|
|
|
|
PyObject *frameBuffer;
|
|
|
|
|
|
|
|
if (!PyArg_ParseTuple(args, "iiiis#", &compressionScheme, &width, &height,
|
|
|
|
&originalFormat, &compressedBuffer,
|
|
|
|
&compressedBufferSize))
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
frameBufferSize = width * height * CL_BytesPerPixel(originalFormat);
|
|
|
|
|
|
|
|
frameBuffer = PyString_FromStringAndSize(NULL, frameBufferSize);
|
|
|
|
if (frameBuffer == NULL)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
error_handler_called = 0;
|
|
|
|
if (clDecompressImage(compressionScheme, width, height, originalFormat,
|
|
|
|
compressedBufferSize, compressedBuffer,
|
|
|
|
(void *) PyString_AsString(frameBuffer))
|
|
|
|
== FAILURE || error_handler_called) {
|
|
|
|
Py_DECREF(frameBuffer);
|
|
|
|
if (!error_handler_called)
|
|
|
|
PyErr_SetString(ClError, "clDecompressImage failed");
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
return frameBuffer;
|
1992-12-14 09:17:29 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/********************************************************************
|
2010-05-09 11:46:46 -03:00
|
|
|
Sequential compression/decompression.
|
1992-12-14 09:17:29 -04:00
|
|
|
********************************************************************/
|
2010-05-09 11:46:46 -03:00
|
|
|
#define CheckCompressor(self) if ((self)->ob_compressorHdl == NULL) { \
|
|
|
|
PyErr_SetString(PyExc_RuntimeError, "(de)compressor not active"); \
|
|
|
|
return NULL; \
|
1997-01-17 12:00:02 -04:00
|
|
|
}
|
1992-09-23 11:53:00 -03:00
|
|
|
|
1997-01-17 12:00:02 -04:00
|
|
|
static PyObject *
|
2002-03-31 10:57:24 -04:00
|
|
|
doClose(clobject *self, int (*close_func)(CL_Handle))
|
1992-09-23 11:53:00 -03:00
|
|
|
{
|
2010-05-09 11:46:46 -03:00
|
|
|
CheckCompressor(self);
|
1992-09-25 07:28:20 -03:00
|
|
|
|
2010-05-09 11:46:46 -03:00
|
|
|
error_handler_called = 0;
|
|
|
|
if ((*close_func)(self->ob_compressorHdl) == FAILURE ||
|
|
|
|
error_handler_called) {
|
|
|
|
if (!error_handler_called)
|
|
|
|
PyErr_SetString(ClError, "close failed");
|
|
|
|
return NULL;
|
|
|
|
}
|
1992-09-23 11:53:00 -03:00
|
|
|
|
2010-05-09 11:46:46 -03:00
|
|
|
self->ob_compressorHdl = NULL;
|
1992-12-14 09:17:29 -04:00
|
|
|
|
2010-05-09 11:46:46 -03:00
|
|
|
if (self->ob_paramtypes)
|
|
|
|
PyMem_DEL(self->ob_paramtypes);
|
|
|
|
self->ob_paramtypes = NULL;
|
1993-02-16 07:55:17 -04:00
|
|
|
|
2010-05-09 11:46:46 -03:00
|
|
|
Py_INCREF(Py_None);
|
|
|
|
return Py_None;
|
1992-09-23 11:53:00 -03:00
|
|
|
}
|
|
|
|
|
1997-01-17 12:00:02 -04:00
|
|
|
static PyObject *
|
2002-03-31 10:57:24 -04:00
|
|
|
clm_CloseCompressor(PyObject *self)
|
1992-09-23 11:53:00 -03:00
|
|
|
{
|
2010-05-09 11:46:46 -03:00
|
|
|
return doClose(SELF, clCloseCompressor);
|
1992-12-14 09:17:29 -04:00
|
|
|
}
|
1992-09-23 11:53:00 -03:00
|
|
|
|
1997-01-17 12:00:02 -04:00
|
|
|
static PyObject *
|
2002-03-31 10:57:24 -04:00
|
|
|
clm_CloseDecompressor(PyObject *self)
|
1992-12-14 09:17:29 -04:00
|
|
|
{
|
2010-05-09 11:46:46 -03:00
|
|
|
return doClose(SELF, clCloseDecompressor);
|
1992-09-23 11:53:00 -03:00
|
|
|
}
|
|
|
|
|
1997-01-17 12:00:02 -04:00
|
|
|
static PyObject *
|
|
|
|
clm_Compress(PyObject *self, PyObject *args)
|
1992-09-23 11:53:00 -03:00
|
|
|
{
|
2010-05-09 11:46:46 -03:00
|
|
|
int numberOfFrames;
|
|
|
|
int frameBufferSize, compressedBufferSize, size;
|
|
|
|
char *frameBuffer;
|
|
|
|
PyObject *data;
|
|
|
|
|
|
|
|
CheckCompressor(SELF);
|
|
|
|
|
|
|
|
if (!PyArg_Parse(args, "(is#)", &numberOfFrames,
|
|
|
|
&frameBuffer, &frameBufferSize))
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
error_handler_called = 0;
|
|
|
|
size = clGetParam(SELF->ob_compressorHdl, CL_COMPRESSED_BUFFER_SIZE);
|
|
|
|
compressedBufferSize = size;
|
|
|
|
if (error_handler_called)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
data = PyString_FromStringAndSize(NULL, size);
|
|
|
|
if (data == NULL)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
error_handler_called = 0;
|
|
|
|
if (clCompress(SELF->ob_compressorHdl, numberOfFrames,
|
|
|
|
(void *) frameBuffer, &compressedBufferSize,
|
|
|
|
(void *) PyString_AsString(data)) == FAILURE ||
|
|
|
|
error_handler_called) {
|
|
|
|
Py_DECREF(data);
|
|
|
|
if (!error_handler_called)
|
|
|
|
PyErr_SetString(ClError, "compress failed");
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (compressedBufferSize < size)
|
|
|
|
if (_PyString_Resize(&data, compressedBufferSize))
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
if (compressedBufferSize > size) {
|
|
|
|
/* we didn't get all "compressed" data */
|
|
|
|
Py_DECREF(data);
|
|
|
|
PyErr_SetString(ClError,
|
|
|
|
"compressed data is more than fitted");
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
return data;
|
1992-09-23 11:53:00 -03:00
|
|
|
}
|
|
|
|
|
1997-01-17 12:00:02 -04:00
|
|
|
static PyObject *
|
|
|
|
clm_Decompress(PyObject *self, PyObject *args)
|
1992-09-23 11:53:00 -03:00
|
|
|
{
|
2010-05-09 11:46:46 -03:00
|
|
|
PyObject *data;
|
|
|
|
int numberOfFrames;
|
|
|
|
char *compressedData;
|
|
|
|
int compressedDataSize, dataSize;
|
|
|
|
|
|
|
|
CheckCompressor(SELF);
|
|
|
|
|
|
|
|
if (!PyArg_Parse(args, "(is#)", &numberOfFrames, &compressedData,
|
|
|
|
&compressedDataSize))
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
error_handler_called = 0;
|
|
|
|
dataSize = clGetParam(SELF->ob_compressorHdl, CL_FRAME_BUFFER_SIZE);
|
|
|
|
if (error_handler_called)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
data = PyString_FromStringAndSize(NULL, dataSize);
|
|
|
|
if (data == NULL)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
error_handler_called = 0;
|
|
|
|
if (clDecompress(SELF->ob_compressorHdl, numberOfFrames,
|
|
|
|
compressedDataSize, (void *) compressedData,
|
|
|
|
(void *) PyString_AsString(data)) == FAILURE ||
|
|
|
|
error_handler_called) {
|
|
|
|
Py_DECREF(data);
|
|
|
|
if (!error_handler_called)
|
|
|
|
PyErr_SetString(ClError, "decompress failed");
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
return data;
|
1992-09-23 11:53:00 -03:00
|
|
|
}
|
|
|
|
|
1997-01-17 12:00:02 -04:00
|
|
|
static PyObject *
|
|
|
|
doParams(clobject *self, PyObject *args, int (*func)(CL_Handle, int *, int),
|
2010-05-09 11:46:46 -03:00
|
|
|
int modified)
|
1992-09-23 11:53:00 -03:00
|
|
|
{
|
2010-05-09 11:46:46 -03:00
|
|
|
PyObject *list, *v;
|
|
|
|
int *PVbuffer;
|
|
|
|
int length;
|
|
|
|
int i;
|
|
|
|
float number;
|
|
|
|
|
|
|
|
CheckCompressor(self);
|
|
|
|
|
|
|
|
if (!PyArg_Parse(args, "O", &list))
|
|
|
|
return NULL;
|
|
|
|
if (!PyList_Check(list)) {
|
|
|
|
PyErr_BadArgument();
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
length = PyList_Size(list);
|
|
|
|
PVbuffer = PyMem_NEW(int, length);
|
|
|
|
if (PVbuffer == NULL)
|
|
|
|
return PyErr_NoMemory();
|
|
|
|
for (i = 0; i < length; i++) {
|
|
|
|
v = PyList_GetItem(list, i);
|
|
|
|
if (PyFloat_Check(v)) {
|
|
|
|
number = PyFloat_AsDouble(v);
|
|
|
|
PVbuffer[i] = CL_TypeIsInt(number);
|
|
|
|
} else if (PyInt_Check(v)) {
|
|
|
|
PVbuffer[i] = PyInt_AsLong(v);
|
|
|
|
if ((i & 1) &&
|
|
|
|
param_type_is_float(self, PVbuffer[i-1]) > 0) {
|
|
|
|
number = PVbuffer[i];
|
|
|
|
PVbuffer[i] = CL_TypeIsInt(number);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
PyMem_DEL(PVbuffer);
|
|
|
|
PyErr_BadArgument();
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
error_handler_called = 0;
|
|
|
|
(*func)(self->ob_compressorHdl, PVbuffer, length);
|
|
|
|
if (error_handler_called) {
|
|
|
|
PyMem_DEL(PVbuffer);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (modified) {
|
|
|
|
for (i = 0; i < length; i++) {
|
|
|
|
if ((i & 1) &&
|
|
|
|
param_type_is_float(self, PVbuffer[i-1]) > 0) {
|
|
|
|
number = CL_TypeIsFloat(PVbuffer[i]);
|
|
|
|
v = PyFloat_FromDouble(number);
|
|
|
|
} else
|
|
|
|
v = PyInt_FromLong(PVbuffer[i]);
|
|
|
|
PyList_SetItem(list, i, v);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
PyMem_DEL(PVbuffer);
|
|
|
|
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
return Py_None;
|
1992-09-23 11:53:00 -03:00
|
|
|
}
|
|
|
|
|
1997-01-17 12:00:02 -04:00
|
|
|
static PyObject *
|
|
|
|
clm_GetParams(PyObject *self, PyObject *args)
|
1992-09-23 11:53:00 -03:00
|
|
|
{
|
2010-05-09 11:46:46 -03:00
|
|
|
return doParams(SELF, args, clGetParams, 1);
|
1992-09-23 11:53:00 -03:00
|
|
|
}
|
|
|
|
|
1997-01-17 12:00:02 -04:00
|
|
|
static PyObject *
|
|
|
|
clm_SetParams(PyObject *self, PyObject *args)
|
1992-09-23 11:53:00 -03:00
|
|
|
{
|
2010-05-09 11:46:46 -03:00
|
|
|
return doParams(SELF, args, clSetParams, 0);
|
1993-02-04 12:43:28 -04:00
|
|
|
}
|
|
|
|
|
1997-01-17 12:00:02 -04:00
|
|
|
static PyObject *
|
|
|
|
do_get(clobject *self, PyObject *args, int (*func)(CL_Handle, int))
|
1993-02-04 12:43:28 -04:00
|
|
|
{
|
2010-05-09 11:46:46 -03:00
|
|
|
int paramID, value;
|
|
|
|
float fvalue;
|
1993-02-04 12:43:28 -04:00
|
|
|
|
2010-05-09 11:46:46 -03:00
|
|
|
CheckCompressor(self);
|
1993-02-04 12:43:28 -04:00
|
|
|
|
2010-05-09 11:46:46 -03:00
|
|
|
if (!PyArg_Parse(args, "i", ¶mID))
|
|
|
|
return NULL;
|
1993-02-04 12:43:28 -04:00
|
|
|
|
2010-05-09 11:46:46 -03:00
|
|
|
error_handler_called = 0;
|
|
|
|
value = (*func)(self->ob_compressorHdl, paramID);
|
|
|
|
if (error_handler_called)
|
|
|
|
return NULL;
|
1993-02-04 12:43:28 -04:00
|
|
|
|
2010-05-09 11:46:46 -03:00
|
|
|
if (param_type_is_float(self, paramID) > 0) {
|
|
|
|
fvalue = CL_TypeIsFloat(value);
|
|
|
|
return PyFloat_FromDouble(fvalue);
|
|
|
|
}
|
1993-02-04 12:43:28 -04:00
|
|
|
|
2010-05-09 11:46:46 -03:00
|
|
|
return PyInt_FromLong(value);
|
1993-02-04 12:43:28 -04:00
|
|
|
}
|
|
|
|
|
1997-01-17 12:00:02 -04:00
|
|
|
static PyObject *
|
|
|
|
clm_GetParam(PyObject *self, PyObject *args)
|
1993-02-04 12:43:28 -04:00
|
|
|
{
|
2010-05-09 11:46:46 -03:00
|
|
|
return do_get(SELF, args, clGetParam);
|
1993-02-04 12:43:28 -04:00
|
|
|
}
|
|
|
|
|
1997-01-17 12:00:02 -04:00
|
|
|
static PyObject *
|
|
|
|
clm_GetDefault(PyObject *self, PyObject *args)
|
1993-02-04 12:43:28 -04:00
|
|
|
{
|
2010-05-09 11:46:46 -03:00
|
|
|
return do_get(SELF, args, clGetDefault);
|
1993-02-04 12:43:28 -04:00
|
|
|
}
|
|
|
|
|
1997-01-17 12:00:02 -04:00
|
|
|
static PyObject *
|
|
|
|
clm_SetParam(PyObject *self, PyObject *args)
|
1993-02-04 12:43:28 -04:00
|
|
|
{
|
2010-05-09 11:46:46 -03:00
|
|
|
int paramID, value;
|
|
|
|
float fvalue;
|
|
|
|
|
|
|
|
CheckCompressor(SELF);
|
|
|
|
|
|
|
|
if (!PyArg_Parse(args, "(ii)", ¶mID, &value)) {
|
|
|
|
PyErr_Clear();
|
|
|
|
if (!PyArg_Parse(args, "(if)", ¶mID, &fvalue)) {
|
|
|
|
PyErr_Clear();
|
|
|
|
PyErr_SetString(PyExc_TypeError,
|
|
|
|
"bad argument list (format '(ii)' or '(if)')");
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
value = CL_TypeIsInt(fvalue);
|
|
|
|
} else {
|
|
|
|
if (param_type_is_float(SELF, paramID) > 0) {
|
|
|
|
fvalue = value;
|
|
|
|
value = CL_TypeIsInt(fvalue);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
error_handler_called = 0;
|
|
|
|
value = clSetParam(SELF->ob_compressorHdl, paramID, value);
|
|
|
|
if (error_handler_called)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
if (param_type_is_float(SELF, paramID) > 0)
|
|
|
|
return PyFloat_FromDouble(CL_TypeIsFloat(value));
|
|
|
|
else
|
|
|
|
return PyInt_FromLong(value);
|
1993-02-04 12:43:28 -04:00
|
|
|
}
|
|
|
|
|
1997-01-17 12:00:02 -04:00
|
|
|
static PyObject *
|
|
|
|
clm_GetParamID(PyObject *self, PyObject *args)
|
1992-12-14 09:17:29 -04:00
|
|
|
{
|
2010-05-09 11:46:46 -03:00
|
|
|
char *name;
|
|
|
|
int value;
|
1992-12-14 09:17:29 -04:00
|
|
|
|
2010-05-09 11:46:46 -03:00
|
|
|
CheckCompressor(SELF);
|
1992-12-14 09:17:29 -04:00
|
|
|
|
2010-05-09 11:46:46 -03:00
|
|
|
if (!PyArg_Parse(args, "s", &name))
|
|
|
|
return NULL;
|
1992-12-14 09:17:29 -04:00
|
|
|
|
2010-05-09 11:46:46 -03:00
|
|
|
error_handler_called = 0;
|
|
|
|
value = clGetParamID(SELF->ob_compressorHdl, name);
|
|
|
|
if (value == FAILURE || error_handler_called) {
|
|
|
|
if (!error_handler_called)
|
|
|
|
PyErr_SetString(ClError, "getparamid failed");
|
|
|
|
return NULL;
|
|
|
|
}
|
1992-12-14 09:17:29 -04:00
|
|
|
|
2010-05-09 11:46:46 -03:00
|
|
|
return PyInt_FromLong(value);
|
1992-09-23 11:53:00 -03:00
|
|
|
}
|
|
|
|
|
1997-01-17 12:00:02 -04:00
|
|
|
static PyObject *
|
2002-03-31 10:57:24 -04:00
|
|
|
clm_QueryParams(PyObject *self)
|
1992-09-23 11:53:00 -03:00
|
|
|
{
|
2010-05-09 11:46:46 -03:00
|
|
|
int bufferlength;
|
|
|
|
int *PVbuffer;
|
|
|
|
PyObject *list;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
CheckCompressor(SELF);
|
|
|
|
|
|
|
|
error_handler_called = 0;
|
|
|
|
bufferlength = clQueryParams(SELF->ob_compressorHdl, 0, 0);
|
|
|
|
if (error_handler_called)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
PVbuffer = PyMem_NEW(int, bufferlength);
|
|
|
|
if (PVbuffer == NULL)
|
|
|
|
return PyErr_NoMemory();
|
|
|
|
|
|
|
|
bufferlength = clQueryParams(SELF->ob_compressorHdl, PVbuffer,
|
|
|
|
bufferlength);
|
|
|
|
if (error_handler_called) {
|
|
|
|
PyMem_DEL(PVbuffer);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
list = PyList_New(bufferlength);
|
|
|
|
if (list == NULL) {
|
|
|
|
PyMem_DEL(PVbuffer);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < bufferlength; i++) {
|
|
|
|
if (i & 1)
|
|
|
|
PyList_SetItem(list, i, PyInt_FromLong(PVbuffer[i]));
|
|
|
|
else if (PVbuffer[i] == 0) {
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
PyList_SetItem(list, i, Py_None);
|
|
|
|
} else
|
|
|
|
PyList_SetItem(list, i,
|
|
|
|
PyString_FromString((char *) PVbuffer[i]));
|
|
|
|
}
|
|
|
|
|
|
|
|
PyMem_DEL(PVbuffer);
|
|
|
|
|
|
|
|
return list;
|
1992-09-23 11:53:00 -03:00
|
|
|
}
|
|
|
|
|
1997-01-17 12:00:02 -04:00
|
|
|
static PyObject *
|
|
|
|
clm_GetMinMax(PyObject *self, PyObject *args)
|
1992-12-14 09:17:29 -04:00
|
|
|
{
|
2010-05-09 11:46:46 -03:00
|
|
|
int param, min, max;
|
|
|
|
float fmin, fmax;
|
1992-12-14 09:17:29 -04:00
|
|
|
|
2010-05-09 11:46:46 -03:00
|
|
|
CheckCompressor(SELF);
|
1992-12-14 09:17:29 -04:00
|
|
|
|
2010-05-09 11:46:46 -03:00
|
|
|
if (!PyArg_Parse(args, "i", ¶m))
|
|
|
|
return NULL;
|
1992-12-14 09:17:29 -04:00
|
|
|
|
2010-05-09 11:46:46 -03:00
|
|
|
clGetMinMax(SELF->ob_compressorHdl, param, &min, &max);
|
1992-12-14 09:17:29 -04:00
|
|
|
|
2010-05-09 11:46:46 -03:00
|
|
|
if (param_type_is_float(SELF, param) > 0) {
|
|
|
|
fmin = CL_TypeIsFloat(min);
|
|
|
|
fmax = CL_TypeIsFloat(max);
|
|
|
|
return Py_BuildValue("(ff)", fmin, fmax);
|
|
|
|
}
|
1992-12-14 09:17:29 -04:00
|
|
|
|
2010-05-09 11:46:46 -03:00
|
|
|
return Py_BuildValue("(ii)", min, max);
|
1992-12-14 09:17:29 -04:00
|
|
|
}
|
|
|
|
|
1997-01-17 12:00:02 -04:00
|
|
|
static PyObject *
|
|
|
|
clm_GetName(PyObject *self, PyObject *args)
|
1992-12-14 09:17:29 -04:00
|
|
|
{
|
2010-05-09 11:46:46 -03:00
|
|
|
int param;
|
|
|
|
char *name;
|
1992-12-14 09:17:29 -04:00
|
|
|
|
2010-05-09 11:46:46 -03:00
|
|
|
CheckCompressor(SELF);
|
1992-12-14 09:17:29 -04:00
|
|
|
|
2010-05-09 11:46:46 -03:00
|
|
|
if (!PyArg_Parse(args, "i", ¶m))
|
|
|
|
return NULL;
|
1992-12-14 09:17:29 -04:00
|
|
|
|
2010-05-09 11:46:46 -03:00
|
|
|
error_handler_called = 0;
|
|
|
|
name = clGetName(SELF->ob_compressorHdl, param);
|
|
|
|
if (name == NULL || error_handler_called) {
|
|
|
|
if (!error_handler_called)
|
|
|
|
PyErr_SetString(ClError, "getname failed");
|
|
|
|
return NULL;
|
|
|
|
}
|
1992-12-14 09:17:29 -04:00
|
|
|
|
2010-05-09 11:46:46 -03:00
|
|
|
return PyString_FromString(name);
|
1992-12-14 09:17:29 -04:00
|
|
|
}
|
|
|
|
|
1997-01-17 12:00:02 -04:00
|
|
|
static PyObject *
|
2002-03-31 10:57:24 -04:00
|
|
|
clm_QuerySchemeFromHandle(PyObject *self)
|
1993-02-16 07:55:17 -04:00
|
|
|
{
|
2010-05-09 11:46:46 -03:00
|
|
|
CheckCompressor(SELF);
|
|
|
|
return PyInt_FromLong(clQuerySchemeFromHandle(SELF->ob_compressorHdl));
|
1993-02-16 07:55:17 -04:00
|
|
|
}
|
|
|
|
|
1997-01-17 12:00:02 -04:00
|
|
|
static PyObject *
|
|
|
|
clm_ReadHeader(PyObject *self, PyObject *args)
|
1992-12-14 09:17:29 -04:00
|
|
|
{
|
2010-05-09 11:46:46 -03:00
|
|
|
char *header;
|
|
|
|
int headerSize;
|
1992-12-14 09:17:29 -04:00
|
|
|
|
2010-05-09 11:46:46 -03:00
|
|
|
CheckCompressor(SELF);
|
1992-12-14 09:17:29 -04:00
|
|
|
|
2010-05-09 11:46:46 -03:00
|
|
|
if (!PyArg_Parse(args, "s#", &header, &headerSize))
|
|
|
|
return NULL;
|
1992-12-14 09:17:29 -04:00
|
|
|
|
2010-05-09 11:46:46 -03:00
|
|
|
return PyInt_FromLong(clReadHeader(SELF->ob_compressorHdl,
|
|
|
|
headerSize, header));
|
1992-12-14 09:17:29 -04:00
|
|
|
}
|
|
|
|
|
1997-01-17 12:00:02 -04:00
|
|
|
static PyMethodDef compressor_methods[] = {
|
2010-05-09 11:46:46 -03:00
|
|
|
{"close", clm_CloseCompressor, METH_NOARGS}, /* alias */
|
|
|
|
{"CloseCompressor", clm_CloseCompressor, METH_NOARGS},
|
|
|
|
{"Compress", clm_Compress, METH_OLDARGS},
|
|
|
|
{"GetDefault", clm_GetDefault, METH_OLDARGS},
|
|
|
|
{"GetMinMax", clm_GetMinMax, METH_OLDARGS},
|
|
|
|
{"GetName", clm_GetName, METH_OLDARGS},
|
|
|
|
{"GetParam", clm_GetParam, METH_OLDARGS},
|
|
|
|
{"GetParamID", clm_GetParamID, METH_OLDARGS},
|
|
|
|
{"GetParams", clm_GetParams, METH_OLDARGS},
|
|
|
|
{"QueryParams", clm_QueryParams, METH_NOARGS},
|
|
|
|
{"QuerySchemeFromHandle",clm_QuerySchemeFromHandle, METH_NOARGS},
|
|
|
|
{"SetParam", clm_SetParam, METH_OLDARGS},
|
|
|
|
{"SetParams", clm_SetParams, METH_OLDARGS},
|
|
|
|
{NULL, NULL} /* sentinel */
|
1992-09-23 11:53:00 -03:00
|
|
|
};
|
|
|
|
|
1997-01-17 12:00:02 -04:00
|
|
|
static PyMethodDef decompressor_methods[] = {
|
2010-05-09 11:46:46 -03:00
|
|
|
{"close", clm_CloseDecompressor, METH_NOARGS}, /* alias */
|
|
|
|
{"CloseDecompressor", clm_CloseDecompressor, METH_NOARGS},
|
|
|
|
{"Decompress", clm_Decompress, METH_OLDARGS},
|
|
|
|
{"GetDefault", clm_GetDefault, METH_OLDARGS},
|
|
|
|
{"GetMinMax", clm_GetMinMax, METH_OLDARGS},
|
|
|
|
{"GetName", clm_GetName, METH_OLDARGS},
|
|
|
|
{"GetParam", clm_GetParam, METH_OLDARGS},
|
|
|
|
{"GetParamID", clm_GetParamID, METH_OLDARGS},
|
|
|
|
{"GetParams", clm_GetParams, METH_OLDARGS},
|
|
|
|
{"ReadHeader", clm_ReadHeader, METH_OLDARGS},
|
|
|
|
{"QueryParams", clm_QueryParams, METH_NOARGS},
|
|
|
|
{"QuerySchemeFromHandle",clm_QuerySchemeFromHandle, METH_NOARGS},
|
|
|
|
{"SetParam", clm_SetParam, METH_OLDARGS},
|
|
|
|
{"SetParams", clm_SetParams, METH_OLDARGS},
|
|
|
|
{NULL, NULL} /* sentinel */
|
1992-09-23 11:53:00 -03:00
|
|
|
};
|
|
|
|
|
|
|
|
static void
|
1997-01-17 12:00:02 -04:00
|
|
|
cl_dealloc(PyObject *self)
|
1992-09-23 11:53:00 -03:00
|
|
|
{
|
2010-05-09 11:46:46 -03:00
|
|
|
if (SELF->ob_compressorHdl) {
|
|
|
|
if (SELF->ob_isCompressor)
|
|
|
|
clCloseCompressor(SELF->ob_compressorHdl);
|
|
|
|
else
|
|
|
|
clCloseDecompressor(SELF->ob_compressorHdl);
|
|
|
|
}
|
|
|
|
PyObject_Del(self);
|
1992-09-23 11:53:00 -03:00
|
|
|
}
|
|
|
|
|
1997-01-17 12:00:02 -04:00
|
|
|
static PyObject *
|
|
|
|
cl_getattr(PyObject *self, char *name)
|
1992-09-23 11:53:00 -03:00
|
|
|
{
|
2010-05-09 11:46:46 -03:00
|
|
|
if (SELF->ob_isCompressor)
|
|
|
|
return Py_FindMethod(compressor_methods, self, name);
|
|
|
|
else
|
|
|
|
return Py_FindMethod(decompressor_methods, self, name);
|
1992-09-23 11:53:00 -03:00
|
|
|
}
|
|
|
|
|
1997-01-17 12:00:02 -04:00
|
|
|
static PyTypeObject Cltype = {
|
2010-05-09 11:46:46 -03:00
|
|
|
PyObject_HEAD_INIT(&PyType_Type)
|
|
|
|
0, /*ob_size*/
|
|
|
|
"cl.cl", /*tp_name*/
|
|
|
|
sizeof(clobject), /*tp_size*/
|
|
|
|
0, /*tp_itemsize*/
|
|
|
|
/* methods */
|
|
|
|
(destructor)cl_dealloc, /*tp_dealloc*/
|
|
|
|
0, /*tp_print*/
|
|
|
|
(getattrfunc)cl_getattr, /*tp_getattr*/
|
|
|
|
0, /*tp_setattr*/
|
|
|
|
0, /*tp_compare*/
|
|
|
|
0, /*tp_repr*/
|
|
|
|
0, /*tp_as_number*/
|
|
|
|
0, /*tp_as_sequence*/
|
|
|
|
0, /*tp_as_mapping*/
|
1992-09-23 11:53:00 -03:00
|
|
|
};
|
|
|
|
|
1997-01-17 12:00:02 -04:00
|
|
|
static PyObject *
|
|
|
|
doOpen(PyObject *self, PyObject *args, int (*open_func)(int, CL_Handle *),
|
1993-02-16 07:55:17 -04:00
|
|
|
int iscompressor)
|
1992-09-23 11:53:00 -03:00
|
|
|
{
|
2010-05-09 11:46:46 -03:00
|
|
|
int scheme;
|
|
|
|
clobject *new;
|
|
|
|
|
|
|
|
if (!PyArg_ParseTuple(args, "i", &scheme))
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
new = PyObject_New(clobject, &Cltype);
|
|
|
|
if (new == NULL)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
new->ob_compressorHdl = NULL;
|
|
|
|
new->ob_isCompressor = iscompressor;
|
|
|
|
new->ob_paramtypes = NULL;
|
|
|
|
|
|
|
|
error_handler_called = 0;
|
|
|
|
if ((*open_func)(scheme, &new->ob_compressorHdl) == FAILURE ||
|
|
|
|
error_handler_called) {
|
|
|
|
Py_DECREF(new);
|
|
|
|
if (!error_handler_called)
|
|
|
|
PyErr_SetString(ClError, "Open(De)Compressor failed");
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
return (PyObject *)new;
|
1992-09-23 11:53:00 -03:00
|
|
|
}
|
|
|
|
|
1997-01-17 12:00:02 -04:00
|
|
|
static PyObject *
|
|
|
|
cl_OpenCompressor(PyObject *self, PyObject *args)
|
1992-09-23 11:53:00 -03:00
|
|
|
{
|
2010-05-09 11:46:46 -03:00
|
|
|
return doOpen(self, args, clOpenCompressor, 1);
|
1992-09-23 11:53:00 -03:00
|
|
|
}
|
|
|
|
|
1997-01-17 12:00:02 -04:00
|
|
|
static PyObject *
|
|
|
|
cl_OpenDecompressor(PyObject *self, PyObject *args)
|
1992-09-29 13:43:43 -03:00
|
|
|
{
|
2010-05-09 11:46:46 -03:00
|
|
|
return doOpen(self, args, clOpenDecompressor, 0);
|
1992-09-29 13:43:43 -03:00
|
|
|
}
|
|
|
|
|
1997-01-17 12:00:02 -04:00
|
|
|
static PyObject *
|
|
|
|
cl_QueryScheme(PyObject *self, PyObject *args)
|
1993-02-04 12:43:28 -04:00
|
|
|
{
|
2010-05-09 11:46:46 -03:00
|
|
|
char *header;
|
|
|
|
int headerlen;
|
|
|
|
int scheme;
|
1993-02-04 12:43:28 -04:00
|
|
|
|
2010-05-09 11:46:46 -03:00
|
|
|
if (!PyArg_ParseTuple(args, "s#", &header, &headerlen))
|
|
|
|
return NULL;
|
1993-02-04 12:43:28 -04:00
|
|
|
|
2010-05-09 11:46:46 -03:00
|
|
|
scheme = clQueryScheme(header);
|
|
|
|
if (scheme < 0) {
|
|
|
|
PyErr_SetString(ClError, "unknown compression scheme");
|
|
|
|
return NULL;
|
|
|
|
}
|
1993-02-04 12:43:28 -04:00
|
|
|
|
2010-05-09 11:46:46 -03:00
|
|
|
return PyInt_FromLong(scheme);
|
1993-02-04 12:43:28 -04:00
|
|
|
}
|
|
|
|
|
1997-01-17 12:00:02 -04:00
|
|
|
static PyObject *
|
|
|
|
cl_QueryMaxHeaderSize(PyObject *self, PyObject *args)
|
1993-02-04 12:43:28 -04:00
|
|
|
{
|
2010-05-09 11:46:46 -03:00
|
|
|
int scheme;
|
1993-02-04 12:43:28 -04:00
|
|
|
|
2010-05-09 11:46:46 -03:00
|
|
|
if (!PyArg_ParseTuple(args, "i", &scheme))
|
|
|
|
return NULL;
|
1993-02-04 12:43:28 -04:00
|
|
|
|
2010-05-09 11:46:46 -03:00
|
|
|
return PyInt_FromLong(clQueryMaxHeaderSize(scheme));
|
1993-02-04 12:43:28 -04:00
|
|
|
}
|
|
|
|
|
1997-01-17 12:00:02 -04:00
|
|
|
static PyObject *
|
|
|
|
cl_QueryAlgorithms(PyObject *self, PyObject *args)
|
1993-02-04 12:43:28 -04:00
|
|
|
{
|
2010-05-09 11:46:46 -03:00
|
|
|
int algorithmMediaType;
|
|
|
|
int bufferlength;
|
|
|
|
int *PVbuffer;
|
|
|
|
PyObject *list;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
if (!PyArg_ParseTuple(args, "i", &algorithmMediaType))
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
error_handler_called = 0;
|
|
|
|
bufferlength = clQueryAlgorithms(algorithmMediaType, 0, 0);
|
|
|
|
if (error_handler_called)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
PVbuffer = PyMem_NEW(int, bufferlength);
|
|
|
|
if (PVbuffer == NULL)
|
|
|
|
return PyErr_NoMemory();
|
|
|
|
|
|
|
|
bufferlength = clQueryAlgorithms(algorithmMediaType, PVbuffer,
|
|
|
|
bufferlength);
|
|
|
|
if (error_handler_called) {
|
|
|
|
PyMem_DEL(PVbuffer);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
list = PyList_New(bufferlength);
|
|
|
|
if (list == NULL) {
|
|
|
|
PyMem_DEL(PVbuffer);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < bufferlength; i++) {
|
|
|
|
if (i & 1)
|
|
|
|
PyList_SetItem(list, i, PyInt_FromLong(PVbuffer[i]));
|
|
|
|
else if (PVbuffer[i] == 0) {
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
PyList_SetItem(list, i, Py_None);
|
|
|
|
} else
|
|
|
|
PyList_SetItem(list, i,
|
|
|
|
PyString_FromString((char *) PVbuffer[i]));
|
|
|
|
}
|
|
|
|
|
|
|
|
PyMem_DEL(PVbuffer);
|
|
|
|
|
|
|
|
return list;
|
1993-02-04 12:43:28 -04:00
|
|
|
}
|
|
|
|
|
1997-01-17 12:00:02 -04:00
|
|
|
static PyObject *
|
|
|
|
cl_QuerySchemeFromName(PyObject *self, PyObject *args)
|
1993-02-04 12:43:28 -04:00
|
|
|
{
|
2010-05-09 11:46:46 -03:00
|
|
|
int algorithmMediaType;
|
|
|
|
char *name;
|
|
|
|
int scheme;
|
1993-02-04 12:43:28 -04:00
|
|
|
|
2010-05-09 11:46:46 -03:00
|
|
|
if (!PyArg_ParseTuple(args, "is", &algorithmMediaType, &name))
|
|
|
|
return NULL;
|
1993-02-04 12:43:28 -04:00
|
|
|
|
2010-05-09 11:46:46 -03:00
|
|
|
error_handler_called = 0;
|
|
|
|
scheme = clQuerySchemeFromName(algorithmMediaType, name);
|
|
|
|
if (error_handler_called) {
|
|
|
|
PyErr_SetString(ClError, "unknown compression scheme");
|
|
|
|
return NULL;
|
|
|
|
}
|
1993-02-04 12:43:28 -04:00
|
|
|
|
2010-05-09 11:46:46 -03:00
|
|
|
return PyInt_FromLong(scheme);
|
1993-02-04 12:43:28 -04:00
|
|
|
}
|
|
|
|
|
1997-01-17 12:00:02 -04:00
|
|
|
static PyObject *
|
|
|
|
cl_GetAlgorithmName(PyObject *self, PyObject *args)
|
1993-02-04 12:43:28 -04:00
|
|
|
{
|
2010-05-09 11:46:46 -03:00
|
|
|
int scheme;
|
|
|
|
char *name;
|
1993-02-04 12:43:28 -04:00
|
|
|
|
2010-05-09 11:46:46 -03:00
|
|
|
if (!PyArg_ParseTuple(args, "i", &scheme))
|
|
|
|
return NULL;
|
1993-02-04 12:43:28 -04:00
|
|
|
|
2010-05-09 11:46:46 -03:00
|
|
|
name = clGetAlgorithmName(scheme);
|
|
|
|
if (name == 0) {
|
|
|
|
PyErr_SetString(ClError, "unknown compression scheme");
|
|
|
|
return NULL;
|
|
|
|
}
|
1993-02-04 12:43:28 -04:00
|
|
|
|
2010-05-09 11:46:46 -03:00
|
|
|
return PyString_FromString(name);
|
1993-02-04 12:43:28 -04:00
|
|
|
}
|
|
|
|
|
1997-01-17 12:00:02 -04:00
|
|
|
static PyObject *
|
|
|
|
do_set(PyObject *self, PyObject *args, int (*func)(int, int, int))
|
1993-02-17 05:11:14 -04:00
|
|
|
{
|
2010-05-09 11:46:46 -03:00
|
|
|
int scheme, paramID, value;
|
|
|
|
float fvalue;
|
|
|
|
int is_float = 0;
|
|
|
|
|
|
|
|
if (!PyArg_ParseTuple(args, "iii", &scheme, ¶mID, &value)) {
|
|
|
|
PyErr_Clear();
|
|
|
|
if (!PyArg_ParseTuple(args, "iif", &scheme, ¶mID, &fvalue)) {
|
|
|
|
PyErr_Clear();
|
|
|
|
PyErr_SetString(PyExc_TypeError,
|
|
|
|
"bad argument list (format '(iii)' or '(iif)')");
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
value = CL_TypeIsInt(fvalue);
|
|
|
|
is_float = 1;
|
|
|
|
} else {
|
|
|
|
/* check some parameters which we know to be floats */
|
|
|
|
switch (scheme) {
|
|
|
|
case CL_COMPRESSION_RATIO:
|
|
|
|
case CL_SPEED:
|
|
|
|
fvalue = value;
|
|
|
|
value = CL_TypeIsInt(fvalue);
|
|
|
|
is_float = 1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
error_handler_called = 0;
|
|
|
|
value = (*func)(scheme, paramID, value);
|
|
|
|
if (error_handler_called)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
if (is_float)
|
|
|
|
return PyFloat_FromDouble(CL_TypeIsFloat(value));
|
|
|
|
else
|
|
|
|
return PyInt_FromLong(value);
|
1993-02-17 05:11:14 -04:00
|
|
|
}
|
|
|
|
|
1997-01-17 12:00:02 -04:00
|
|
|
static PyObject *
|
|
|
|
cl_SetDefault(PyObject *self, PyObject *args)
|
1993-02-17 05:11:14 -04:00
|
|
|
{
|
2010-05-09 11:46:46 -03:00
|
|
|
return do_set(self, args, clSetDefault);
|
1993-02-17 05:11:14 -04:00
|
|
|
}
|
|
|
|
|
1997-01-17 12:00:02 -04:00
|
|
|
static PyObject *
|
|
|
|
cl_SetMin(PyObject *self, PyObject *args)
|
1993-02-17 05:11:14 -04:00
|
|
|
{
|
2010-05-09 11:46:46 -03:00
|
|
|
return do_set(self, args, clSetMin);
|
1993-02-17 05:11:14 -04:00
|
|
|
}
|
|
|
|
|
1997-01-17 12:00:02 -04:00
|
|
|
static PyObject *
|
|
|
|
cl_SetMax(PyObject *self, PyObject *args)
|
1993-02-17 05:11:14 -04:00
|
|
|
{
|
2010-05-09 11:46:46 -03:00
|
|
|
return do_set(self, args, clSetMax);
|
1993-02-17 05:11:14 -04:00
|
|
|
}
|
|
|
|
|
2010-05-09 11:46:46 -03:00
|
|
|
#define func(name, handler) \
|
1997-01-17 12:00:02 -04:00
|
|
|
static PyObject *cl_##name(PyObject *self, PyObject *args) \
|
|
|
|
{ \
|
2010-05-09 11:46:46 -03:00
|
|
|
int x; \
|
|
|
|
if (!PyArg_ParseTuple(args, "i", &x)) return NULL; \
|
|
|
|
return Py##handler(CL_##name(x)); \
|
1997-01-17 12:00:02 -04:00
|
|
|
}
|
1995-05-17 08:16:52 -03:00
|
|
|
|
2010-05-09 11:46:46 -03:00
|
|
|
#define func2(name, handler) \
|
1997-01-17 12:00:02 -04:00
|
|
|
static PyObject *cl_##name(PyObject *self, PyObject *args) \
|
|
|
|
{ \
|
2010-05-09 11:46:46 -03:00
|
|
|
int a1, a2; \
|
|
|
|
if (!PyArg_ParseTuple(args, "ii", &a1, &a2)) return NULL; \
|
|
|
|
return Py##handler(CL_##name(a1, a2)); \
|
1997-01-17 12:00:02 -04:00
|
|
|
}
|
1995-05-17 08:16:52 -03:00
|
|
|
|
1997-01-17 12:00:02 -04:00
|
|
|
func(BytesPerSample, Int_FromLong)
|
|
|
|
func(BytesPerPixel, Int_FromLong)
|
|
|
|
func(AudioFormatName, String_FromString)
|
|
|
|
func(VideoFormatName, String_FromString)
|
|
|
|
func(AlgorithmNumber, Int_FromLong)
|
|
|
|
func(AlgorithmType, Int_FromLong)
|
|
|
|
func2(Algorithm, Int_FromLong)
|
|
|
|
func(ParamNumber, Int_FromLong)
|
|
|
|
func(ParamType, Int_FromLong)
|
|
|
|
func2(ParamID, Int_FromLong)
|
1995-05-17 08:16:52 -03:00
|
|
|
|
1993-02-16 07:55:17 -04:00
|
|
|
#ifdef CLDEBUG
|
2010-05-09 11:46:46 -03:00
|
|
|
static PyObject *
|
1997-01-17 12:00:02 -04:00
|
|
|
cvt_type(PyObject *self, PyObject *args)
|
1993-02-16 07:55:17 -04:00
|
|
|
{
|
2010-05-09 11:46:46 -03:00
|
|
|
int number;
|
|
|
|
float fnumber;
|
|
|
|
|
|
|
|
if (PyArg_Parse(args, "i", &number))
|
|
|
|
return PyFloat_FromDouble(CL_TypeIsFloat(number));
|
|
|
|
else {
|
|
|
|
PyErr_Clear();
|
|
|
|
if (PyArg_Parse(args, "f", &fnumber))
|
|
|
|
return PyInt_FromLong(CL_TypeIsInt(fnumber));
|
|
|
|
return NULL;
|
|
|
|
}
|
1993-02-16 07:55:17 -04:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
1997-01-17 12:00:02 -04:00
|
|
|
static PyMethodDef cl_methods[] = {
|
2010-05-09 11:46:46 -03:00
|
|
|
{"CompressImage", cl_CompressImage, METH_VARARGS},
|
|
|
|
{"DecompressImage", cl_DecompressImage, METH_VARARGS},
|
|
|
|
{"GetAlgorithmName", cl_GetAlgorithmName, METH_VARARGS},
|
|
|
|
{"OpenCompressor", cl_OpenCompressor, METH_VARARGS},
|
|
|
|
{"OpenDecompressor", cl_OpenDecompressor, METH_VARARGS},
|
|
|
|
{"QueryAlgorithms", cl_QueryAlgorithms, METH_VARARGS},
|
|
|
|
{"QueryMaxHeaderSize", cl_QueryMaxHeaderSize, METH_VARARGS},
|
|
|
|
{"QueryScheme", cl_QueryScheme, METH_VARARGS},
|
|
|
|
{"QuerySchemeFromName", cl_QuerySchemeFromName, METH_VARARGS},
|
|
|
|
{"SetDefault", cl_SetDefault, METH_VARARGS},
|
|
|
|
{"SetMax", cl_SetMax, METH_VARARGS},
|
|
|
|
{"SetMin", cl_SetMin, METH_VARARGS},
|
|
|
|
{"BytesPerSample", cl_BytesPerSample, METH_VARARGS},
|
|
|
|
{"BytesPerPixel", cl_BytesPerPixel, METH_VARARGS},
|
|
|
|
{"AudioFormatName", cl_AudioFormatName, METH_VARARGS},
|
|
|
|
{"VideoFormatName", cl_VideoFormatName, METH_VARARGS},
|
|
|
|
{"AlgorithmNumber", cl_AlgorithmNumber, METH_VARARGS},
|
|
|
|
{"AlgorithmType", cl_AlgorithmType, METH_VARARGS},
|
|
|
|
{"Algorithm", cl_Algorithm, METH_VARARGS},
|
|
|
|
{"ParamNumber", cl_ParamNumber, METH_VARARGS},
|
|
|
|
{"ParamType", cl_ParamType, METH_VARARGS},
|
|
|
|
{"ParamID", cl_ParamID, METH_VARARGS},
|
1993-02-16 07:55:17 -04:00
|
|
|
#ifdef CLDEBUG
|
2010-05-09 11:46:46 -03:00
|
|
|
{"cvt_type", cvt_type, METH_VARARGS},
|
1993-02-16 07:55:17 -04:00
|
|
|
#endif
|
2010-05-09 11:46:46 -03:00
|
|
|
{NULL, NULL} /* Sentinel */
|
1992-09-23 11:53:00 -03:00
|
|
|
};
|
|
|
|
|
1995-05-17 08:16:52 -03:00
|
|
|
#ifdef CL_JPEG_SOFTWARE
|
|
|
|
#define IRIX_5_3_LIBRARY
|
|
|
|
#endif
|
|
|
|
|
1992-09-23 11:53:00 -03:00
|
|
|
void
|
2000-07-21 03:00:07 -03:00
|
|
|
initcl(void)
|
1992-09-23 11:53:00 -03:00
|
|
|
{
|
2010-05-09 11:46:46 -03:00
|
|
|
PyObject *m, *d, *x;
|
|
|
|
|
2008-05-14 18:12:12 -03:00
|
|
|
if (PyErr_WarnPy3k("the cl module has been removed in "
|
|
|
|
"Python 3.0", 2) < 0)
|
2016-09-17 04:54:55 -03:00
|
|
|
return;
|
2010-05-09 11:46:46 -03:00
|
|
|
|
|
|
|
m = Py_InitModule("cl", cl_methods);
|
|
|
|
if (m == NULL)
|
2008-05-14 18:12:12 -03:00
|
|
|
return;
|
2010-05-09 11:46:46 -03:00
|
|
|
d = PyModule_GetDict(m);
|
1997-01-17 12:00:02 -04:00
|
|
|
|
2010-05-09 11:46:46 -03:00
|
|
|
ClError = PyErr_NewException("cl.error", NULL, NULL);
|
|
|
|
(void) PyDict_SetItemString(d, "error", ClError);
|
1997-01-17 12:00:02 -04:00
|
|
|
|
1997-08-12 11:58:54 -03:00
|
|
|
#ifdef CL_ADDED_ALGORITHM_ERROR
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_ADDED_ALGORITHM_ERROR);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "ADDED_ALGORITHM_ERROR", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_ALAW
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_ALAW);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "ALAW", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_ALGORITHM_ID
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_ALGORITHM_ID);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "ALGORITHM_ID", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_ALGORITHM_TABLE_FULL
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_ALGORITHM_TABLE_FULL);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "ALGORITHM_TABLE_FULL", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_ALGORITHM_VERSION
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_ALGORITHM_VERSION);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "ALGORITHM_VERSION", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_ALG_AUDIO
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_ALG_AUDIO);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "ALG_AUDIO", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_ALG_VIDEO
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_ALG_VIDEO);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "ALG_VIDEO", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_AUDIO
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_AUDIO);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "AUDIO", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_AWARE_BITRATE_POLICY
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_AWARE_BITRATE_POLICY);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "AWARE_BITRATE_POLICY", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_AWARE_BITRATE_TARGET
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_AWARE_BITRATE_TARGET);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "AWARE_BITRATE_TARGET", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_AWARE_CHANNEL_POLICY
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_AWARE_CHANNEL_POLICY);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "AWARE_CHANNEL_POLICY", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_AWARE_CONST_QUAL
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_AWARE_CONST_QUAL);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "AWARE_CONST_QUAL", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_AWARE_ERROR
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_AWARE_ERROR);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "AWARE_ERROR", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_AWARE_FIXED_RATE
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_AWARE_FIXED_RATE);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "AWARE_FIXED_RATE", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_AWARE_INDEPENDENT
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_AWARE_INDEPENDENT);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "AWARE_INDEPENDENT", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_AWARE_JOINT_STEREO
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_AWARE_JOINT_STEREO);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "AWARE_JOINT_STEREO", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_AWARE_LAYER
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_AWARE_LAYER);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "AWARE_LAYER", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_AWARE_LOSSLESS
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_AWARE_LOSSLESS);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "AWARE_LOSSLESS", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_AWARE_MPEG_AUDIO
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_AWARE_MPEG_AUDIO);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "AWARE_MPEG_AUDIO", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_AWARE_MPEG_LAYER_I
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_AWARE_MPEG_LAYER_I);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "AWARE_MPEG_LAYER_I", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_AWARE_MPEG_LAYER_II
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_AWARE_MPEG_LAYER_II);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "AWARE_MPEG_LAYER_II", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_AWARE_MULTIRATE
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_AWARE_MULTIRATE);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "AWARE_MULTIRATE", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_AWARE_NOISE_MARGIN
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_AWARE_NOISE_MARGIN);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "AWARE_NOISE_MARGIN", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_AWARE_STEREO
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_AWARE_STEREO);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "AWARE_STEREO", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_BAD_ALGORITHM_NAME
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_BAD_ALGORITHM_NAME);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "BAD_ALGORITHM_NAME", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_BAD_ALGORITHM_TYPE
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_BAD_ALGORITHM_TYPE);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "BAD_ALGORITHM_TYPE", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_BAD_BLOCK_SIZE
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_BAD_BLOCK_SIZE);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "BAD_BLOCK_SIZE", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_BAD_BOARD
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_BAD_BOARD);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "BAD_BOARD", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_BAD_BUFFERING
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_BAD_BUFFERING);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "BAD_BUFFERING", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_BAD_BUFFERLENGTH_NEG
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_BAD_BUFFERLENGTH_NEG);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "BAD_BUFFERLENGTH_NEG", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_BAD_BUFFERLENGTH_ODD
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_BAD_BUFFERLENGTH_ODD);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "BAD_BUFFERLENGTH_ODD", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_BAD_BUFFER_EXISTS
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_BAD_BUFFER_EXISTS);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "BAD_BUFFER_EXISTS", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_BAD_BUFFER_HANDLE
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_BAD_BUFFER_HANDLE);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "BAD_BUFFER_HANDLE", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_BAD_BUFFER_POINTER
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_BAD_BUFFER_POINTER);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "BAD_BUFFER_POINTER", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_BAD_BUFFER_QUERY_SIZE
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_BAD_BUFFER_QUERY_SIZE);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "BAD_BUFFER_QUERY_SIZE", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_BAD_BUFFER_SIZE
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_BAD_BUFFER_SIZE);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "BAD_BUFFER_SIZE", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_BAD_BUFFER_SIZE_POINTER
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_BAD_BUFFER_SIZE_POINTER);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "BAD_BUFFER_SIZE_POINTER", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_BAD_BUFFER_TYPE
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_BAD_BUFFER_TYPE);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "BAD_BUFFER_TYPE", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_BAD_COMPRESSION_SCHEME
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_BAD_COMPRESSION_SCHEME);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "BAD_COMPRESSION_SCHEME", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_BAD_COMPRESSOR_HANDLE
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_BAD_COMPRESSOR_HANDLE);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "BAD_COMPRESSOR_HANDLE", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_BAD_COMPRESSOR_HANDLE_POINTER
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_BAD_COMPRESSOR_HANDLE_POINTER);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "BAD_COMPRESSOR_HANDLE_POINTER", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_BAD_FRAME_SIZE
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_BAD_FRAME_SIZE);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "BAD_FRAME_SIZE", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_BAD_FUNCTIONALITY
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_BAD_FUNCTIONALITY);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "BAD_FUNCTIONALITY", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_BAD_FUNCTION_POINTER
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_BAD_FUNCTION_POINTER);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "BAD_FUNCTION_POINTER", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_BAD_HEADER_SIZE
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_BAD_HEADER_SIZE);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "BAD_HEADER_SIZE", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_BAD_INITIAL_VALUE
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_BAD_INITIAL_VALUE);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "BAD_INITIAL_VALUE", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_BAD_INTERNAL_FORMAT
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_BAD_INTERNAL_FORMAT);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "BAD_INTERNAL_FORMAT", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_BAD_LICENSE
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_BAD_LICENSE);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "BAD_LICENSE", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_BAD_MIN_GT_MAX
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_BAD_MIN_GT_MAX);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "BAD_MIN_GT_MAX", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_BAD_NO_BUFFERSPACE
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_BAD_NO_BUFFERSPACE);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "BAD_NO_BUFFERSPACE", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_BAD_NUMBER_OF_BLOCKS
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_BAD_NUMBER_OF_BLOCKS);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "BAD_NUMBER_OF_BLOCKS", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_BAD_PARAM
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_BAD_PARAM);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "BAD_PARAM", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_BAD_PARAM_ID_POINTER
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_BAD_PARAM_ID_POINTER);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "BAD_PARAM_ID_POINTER", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_BAD_PARAM_TYPE
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_BAD_PARAM_TYPE);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "BAD_PARAM_TYPE", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_BAD_POINTER
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_BAD_POINTER);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "BAD_POINTER", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_BAD_PVBUFFER
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_BAD_PVBUFFER);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "BAD_PVBUFFER", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_BAD_SCHEME_POINTER
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_BAD_SCHEME_POINTER);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "BAD_SCHEME_POINTER", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_BAD_STREAM_HEADER
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_BAD_STREAM_HEADER);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "BAD_STREAM_HEADER", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_BAD_STRING_POINTER
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_BAD_STRING_POINTER);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "BAD_STRING_POINTER", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_BAD_TEXT_STRING_PTR
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_BAD_TEXT_STRING_PTR);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "BAD_TEXT_STRING_PTR", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_BEST_FIT
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_BEST_FIT);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "BEST_FIT", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_BIDIRECTIONAL
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_BIDIRECTIONAL);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "BIDIRECTIONAL", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_BITRATE
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_BITRATE);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "BITRATE", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_BITRATE_POLICY
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_BITRATE_POLICY);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "BITRATE_POLICY", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_BITRATE_TARGET
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_BITRATE_TARGET);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "BITRATE_TARGET", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_BITS_PER_COMPONENT
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_BITS_PER_COMPONENT);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "BITS_PER_COMPONENT", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_BLENDING
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_BLENDING);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "BLENDING", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_BLOCK_SIZE
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_BLOCK_SIZE);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "BLOCK_SIZE", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_BOTTOM_UP
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_BOTTOM_UP);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "BOTTOM_UP", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_BUFFER_NOT_CREATED
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_BUFFER_NOT_CREATED);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "BUFFER_NOT_CREATED", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_BUF_COMPRESSED
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_BUF_COMPRESSED);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "BUF_COMPRESSED", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_BUF_DATA
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_BUF_DATA);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "BUF_DATA", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_BUF_FRAME
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_BUF_FRAME);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "BUF_FRAME", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_CHANNEL_POLICY
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_CHANNEL_POLICY);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "CHANNEL_POLICY", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_CHROMA_THRESHOLD
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_CHROMA_THRESHOLD);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "CHROMA_THRESHOLD", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_CODEC
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_CODEC);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "CODEC", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_COMPONENTS
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_COMPONENTS);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "COMPONENTS", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_COMPRESSED_BUFFER_SIZE
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_COMPRESSED_BUFFER_SIZE);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "COMPRESSED_BUFFER_SIZE", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_COMPRESSION_RATIO
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_COMPRESSION_RATIO);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "COMPRESSION_RATIO", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_COMPRESSOR
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_COMPRESSOR);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "COMPRESSOR", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_CONTINUOUS_BLOCK
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_CONTINUOUS_BLOCK);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "CONTINUOUS_BLOCK", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_CONTINUOUS_NONBLOCK
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_CONTINUOUS_NONBLOCK);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "CONTINUOUS_NONBLOCK", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_COSMO_CODEC_CONTROL
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_COSMO_CODEC_CONTROL);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "COSMO_CODEC_CONTROL", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_COSMO_NUM_PARAMS
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_COSMO_NUM_PARAMS);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "COSMO_NUM_PARAMS", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_COSMO_VALUE_BASE
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_COSMO_VALUE_BASE);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "COSMO_VALUE_BASE", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_COSMO_VIDEO_MANUAL_CONTROL
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_COSMO_VIDEO_MANUAL_CONTROL);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "COSMO_VIDEO_MANUAL_CONTROL", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_COSMO_VIDEO_TRANSFER_MODE
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_COSMO_VIDEO_TRANSFER_MODE);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "COSMO_VIDEO_TRANSFER_MODE", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_DATA
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_DATA);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "DATA", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_DECOMPRESSOR
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_DECOMPRESSOR);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "DECOMPRESSOR", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_DSO_ERROR
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_DSO_ERROR);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "DSO_ERROR", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_EDGE_THRESHOLD
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_EDGE_THRESHOLD);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "EDGE_THRESHOLD", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_ENABLE_IMAGEINFO
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_ENABLE_IMAGEINFO);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "ENABLE_IMAGEINFO", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_END_OF_SEQUENCE
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_END_OF_SEQUENCE);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "END_OF_SEQUENCE", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_ENUM_VALUE
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_ENUM_VALUE);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "ENUM_VALUE", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_EXACT_COMPRESSION_RATIO
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_EXACT_COMPRESSION_RATIO);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "EXACT_COMPRESSION_RATIO", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_EXTERNAL_DEVICE
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong((long) CL_EXTERNAL_DEVICE);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "EXTERNAL_DEVICE", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_FLOATING_ENUM_VALUE
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_FLOATING_ENUM_VALUE);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "FLOATING_ENUM_VALUE", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_FLOATING_RANGE_VALUE
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_FLOATING_RANGE_VALUE);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "FLOATING_RANGE_VALUE", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_FORMAT
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_FORMAT);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "FORMAT", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_FORMAT_ABGR
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_FORMAT_ABGR);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "FORMAT_ABGR", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_FORMAT_BGR
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_FORMAT_BGR);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "FORMAT_BGR", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_FORMAT_BGR233
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_FORMAT_BGR233);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "FORMAT_BGR233", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_FORMAT_GRAYSCALE
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_FORMAT_GRAYSCALE);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "FORMAT_GRAYSCALE", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_FORMAT_MONO
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_FORMAT_MONO);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "FORMAT_MONO", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_FORMAT_RBG323
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_FORMAT_RBG323);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "FORMAT_RBG323", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_FORMAT_STEREO_INTERLEAVED
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_FORMAT_STEREO_INTERLEAVED);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "FORMAT_STEREO_INTERLEAVED", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_FORMAT_XBGR
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_FORMAT_XBGR);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "FORMAT_XBGR", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_FORMAT_YCbCr
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_FORMAT_YCbCr);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "FORMAT_YCbCr", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_FORMAT_YCbCr422
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_FORMAT_YCbCr422);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "FORMAT_YCbCr422", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_FORMAT_YCbCr422DC
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_FORMAT_YCbCr422DC);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "FORMAT_YCbCr422DC", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1995-05-17 08:16:52 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_FRAME
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_FRAME);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "FRAME", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_FRAMES_PER_CHUNK
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_FRAMES_PER_CHUNK);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "FRAMES_PER_CHUNK", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_FRAME_BUFFER_SIZE
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_FRAME_BUFFER_SIZE);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "FRAME_BUFFER_SIZE", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_FRAME_BUFFER_SIZE_ZERO
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_FRAME_BUFFER_SIZE_ZERO);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "FRAME_BUFFER_SIZE_ZERO", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_FRAME_INDEX
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_FRAME_INDEX);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "FRAME_INDEX", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_FRAME_RATE
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_FRAME_RATE);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "FRAME_RATE", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_FRAME_SIZE
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_FRAME_SIZE);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "FRAME_SIZE", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_FRAME_TYPE
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_FRAME_TYPE);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "FRAME_TYPE", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_G711_ALAW
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_G711_ALAW);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "G711_ALAW", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_G711_ALAW_SOFTWARE
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_G711_ALAW_SOFTWARE);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "G711_ALAW_SOFTWARE", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_G711_ULAW
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_G711_ULAW);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "G711_ULAW", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_G711_ULAW_SOFTWARE
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_G711_ULAW_SOFTWARE);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "G711_ULAW_SOFTWARE", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_GRAYSCALE
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_GRAYSCALE);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "GRAYSCALE", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_HDCC
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_HDCC);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "HDCC", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_HDCC_SAMPLES_PER_TILE
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_HDCC_SAMPLES_PER_TILE);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "HDCC_SAMPLES_PER_TILE", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_HDCC_SOFTWARE
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_HDCC_SOFTWARE);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "HDCC_SOFTWARE", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_HDCC_TILE_THRESHOLD
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_HDCC_TILE_THRESHOLD);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "HDCC_TILE_THRESHOLD", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_HEADER_START_CODE
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_HEADER_START_CODE);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "HEADER_START_CODE", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_IMAGEINFO_FIELDMASK
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_IMAGEINFO_FIELDMASK);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "IMAGEINFO_FIELDMASK", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_IMAGE_CROP_BOTTOM
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_IMAGE_CROP_BOTTOM);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "IMAGE_CROP_BOTTOM", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_IMAGE_CROP_LEFT
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_IMAGE_CROP_LEFT);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "IMAGE_CROP_LEFT", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_IMAGE_CROP_RIGHT
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_IMAGE_CROP_RIGHT);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "IMAGE_CROP_RIGHT", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_IMAGE_CROP_TOP
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_IMAGE_CROP_TOP);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "IMAGE_CROP_TOP", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_IMAGE_HEIGHT
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_IMAGE_HEIGHT);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "IMAGE_HEIGHT", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_IMAGE_WIDTH
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_IMAGE_WIDTH);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "IMAGE_WIDTH", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_IMPACT_CODEC_CONTROL
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_IMPACT_CODEC_CONTROL);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "IMPACT_CODEC_CONTROL", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_IMPACT_FRAME_INTERLEAVE
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_IMPACT_FRAME_INTERLEAVE);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "IMPACT_FRAME_INTERLEAVE", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_IMPACT_NUM_PARAMS
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_IMPACT_NUM_PARAMS);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "IMPACT_NUM_PARAMS", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_INTERNAL_FORMAT
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_INTERNAL_FORMAT);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "INTERNAL_FORMAT", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_INTERNAL_IMAGE_HEIGHT
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_INTERNAL_IMAGE_HEIGHT);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "INTERNAL_IMAGE_HEIGHT", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_INTERNAL_IMAGE_WIDTH
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_INTERNAL_IMAGE_WIDTH);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "INTERNAL_IMAGE_WIDTH", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_INTRA
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_INTRA);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "INTRA", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_JPEG
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_JPEG);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "JPEG", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_JPEG_COSMO
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_JPEG_COSMO);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "JPEG_COSMO", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_JPEG_ERROR
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_JPEG_ERROR);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "JPEG_ERROR", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_JPEG_IMPACT
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_JPEG_IMPACT);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "JPEG_IMPACT", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_JPEG_NUM_PARAMS
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_JPEG_NUM_PARAMS);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "JPEG_NUM_PARAMS", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_JPEG_QUALITY_FACTOR
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_JPEG_QUALITY_FACTOR);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "JPEG_QUALITY_FACTOR", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_JPEG_QUANTIZATION_TABLES
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_JPEG_QUANTIZATION_TABLES);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "JPEG_QUANTIZATION_TABLES", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_JPEG_SOFTWARE
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_JPEG_SOFTWARE);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "JPEG_SOFTWARE", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_JPEG_STREAM_HEADERS
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_JPEG_STREAM_HEADERS);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "JPEG_STREAM_HEADERS", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_KEYFRAME
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_KEYFRAME);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "KEYFRAME", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_KEYFRAME_DISTANCE
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_KEYFRAME_DISTANCE);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "KEYFRAME_DISTANCE", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_LAST_FRAME_INDEX
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_LAST_FRAME_INDEX);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "LAST_FRAME_INDEX", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_LAYER
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_LAYER);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "LAYER", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1995-05-17 08:16:52 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_LUMA_THRESHOLD
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_LUMA_THRESHOLD);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "LUMA_THRESHOLD", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_MAX_NUMBER_OF_AUDIO_ALGORITHMS
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_MAX_NUMBER_OF_AUDIO_ALGORITHMS);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "MAX_NUMBER_OF_AUDIO_ALGORITHMS", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_MAX_NUMBER_OF_FORMATS
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_MAX_NUMBER_OF_FORMATS);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "MAX_NUMBER_OF_FORMATS", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_MAX_NUMBER_OF_ORIGINAL_FORMATS
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_MAX_NUMBER_OF_ORIGINAL_FORMATS);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "MAX_NUMBER_OF_ORIGINAL_FORMATS", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_MAX_NUMBER_OF_PARAMS
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_MAX_NUMBER_OF_PARAMS);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "MAX_NUMBER_OF_PARAMS", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_MAX_NUMBER_OF_VIDEO_ALGORITHMS
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_MAX_NUMBER_OF_VIDEO_ALGORITHMS);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "MAX_NUMBER_OF_VIDEO_ALGORITHMS", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_MONO
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_MONO);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "MONO", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_MPEG1_AUDIO_AWARE
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_MPEG1_AUDIO_AWARE);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "MPEG1_AUDIO_AWARE", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_MPEG1_AUDIO_LAYER
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_MPEG1_AUDIO_LAYER);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "MPEG1_AUDIO_LAYER", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_MPEG1_AUDIO_LAYER_I
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_MPEG1_AUDIO_LAYER_I);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "MPEG1_AUDIO_LAYER_I", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_MPEG1_AUDIO_LAYER_II
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_MPEG1_AUDIO_LAYER_II);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "MPEG1_AUDIO_LAYER_II", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_MPEG1_AUDIO_MODE
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_MPEG1_AUDIO_MODE);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "MPEG1_AUDIO_MODE", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_MPEG1_AUDIO_MODE_DUAL
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_MPEG1_AUDIO_MODE_DUAL);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "MPEG1_AUDIO_MODE_DUAL", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_MPEG1_AUDIO_MODE_JOINT
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_MPEG1_AUDIO_MODE_JOINT);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "MPEG1_AUDIO_MODE_JOINT", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_MPEG1_AUDIO_MODE_SINGLE
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_MPEG1_AUDIO_MODE_SINGLE);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "MPEG1_AUDIO_MODE_SINGLE", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_MPEG1_AUDIO_MODE_STEREO
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_MPEG1_AUDIO_MODE_STEREO);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "MPEG1_AUDIO_MODE_STEREO", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_MPEG1_AUDIO_SOFTWARE
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_MPEG1_AUDIO_SOFTWARE);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "MPEG1_AUDIO_SOFTWARE", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_MPEG1_END_OF_STREAM
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_MPEG1_END_OF_STREAM);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "MPEG1_END_OF_STREAM", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_MPEG1_ERROR
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_MPEG1_ERROR);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "MPEG1_ERROR", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_MPEG1_NUM_PARAMS
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_MPEG1_NUM_PARAMS);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "MPEG1_NUM_PARAMS", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_MPEG1_VIDEO_M
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_MPEG1_VIDEO_M);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "MPEG1_VIDEO_M", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_MPEG1_VIDEO_MAX_MOTION_VECTOR_LENGTH_B_X
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_MPEG1_VIDEO_MAX_MOTION_VECTOR_LENGTH_B_X);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "MPEG1_VIDEO_MAX_MOTION_VECTOR_LENGTH_B_X", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_MPEG1_VIDEO_MAX_MOTION_VECTOR_LENGTH_B_Y
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_MPEG1_VIDEO_MAX_MOTION_VECTOR_LENGTH_B_Y);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "MPEG1_VIDEO_MAX_MOTION_VECTOR_LENGTH_B_Y", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_MPEG1_VIDEO_MAX_MOTION_VECTOR_LENGTH_P_X
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_MPEG1_VIDEO_MAX_MOTION_VECTOR_LENGTH_P_X);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "MPEG1_VIDEO_MAX_MOTION_VECTOR_LENGTH_P_X", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_MPEG1_VIDEO_MAX_MOTION_VECTOR_LENGTH_P_Y
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_MPEG1_VIDEO_MAX_MOTION_VECTOR_LENGTH_P_Y);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "MPEG1_VIDEO_MAX_MOTION_VECTOR_LENGTH_P_Y", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_MPEG1_VIDEO_N
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_MPEG1_VIDEO_N);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "MPEG1_VIDEO_N", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_MPEG1_VIDEO_SOFTNESS
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_MPEG1_VIDEO_SOFTNESS);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "MPEG1_VIDEO_SOFTNESS", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_MPEG1_VIDEO_SOFTNESS_MAXIMUM
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_MPEG1_VIDEO_SOFTNESS_MAXIMUM);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "MPEG1_VIDEO_SOFTNESS_MAXIMUM", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_MPEG1_VIDEO_SOFTNESS_MEDIUM
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_MPEG1_VIDEO_SOFTNESS_MEDIUM);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "MPEG1_VIDEO_SOFTNESS_MEDIUM", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_MPEG1_VIDEO_SOFTNESS_NONE
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_MPEG1_VIDEO_SOFTNESS_NONE);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "MPEG1_VIDEO_SOFTNESS_NONE", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_MPEG1_VIDEO_SOFTWARE
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_MPEG1_VIDEO_SOFTWARE);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "MPEG1_VIDEO_SOFTWARE", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_MPEG_VIDEO
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_MPEG_VIDEO);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "MPEG_VIDEO", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_MULTIRATE_AWARE
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_MULTIRATE_AWARE);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "MULTIRATE_AWARE", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_MVC1
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_MVC1);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "MVC1", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_MVC1_SOFTWARE
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_MVC1_SOFTWARE);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "MVC1_SOFTWARE", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_MVC2
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_MVC2);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "MVC2", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_MVC2_BLENDING
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_MVC2_BLENDING);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "MVC2_BLENDING", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_MVC2_BLENDING_OFF
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_MVC2_BLENDING_OFF);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "MVC2_BLENDING_OFF", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_MVC2_BLENDING_ON
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_MVC2_BLENDING_ON);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "MVC2_BLENDING_ON", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_MVC2_CHROMA_THRESHOLD
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_MVC2_CHROMA_THRESHOLD);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "MVC2_CHROMA_THRESHOLD", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_MVC2_EDGE_THRESHOLD
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_MVC2_EDGE_THRESHOLD);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "MVC2_EDGE_THRESHOLD", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_MVC2_ERROR
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_MVC2_ERROR);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "MVC2_ERROR", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_MVC2_LUMA_THRESHOLD
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_MVC2_LUMA_THRESHOLD);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "MVC2_LUMA_THRESHOLD", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_MVC2_SOFTWARE
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_MVC2_SOFTWARE);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "MVC2_SOFTWARE", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_MVC3_QUALITY_LEVEL
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_MVC3_QUALITY_LEVEL);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "MVC3_QUALITY_LEVEL", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_MVC3_SOFTWARE
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_MVC3_SOFTWARE);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "MVC3_SOFTWARE", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_NEXT_NOT_AVAILABLE
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_NEXT_NOT_AVAILABLE);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "NEXT_NOT_AVAILABLE", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_NOISE_MARGIN
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_NOISE_MARGIN);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "NOISE_MARGIN", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_NONE
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_NONE);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "NONE", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_NUMBER_OF_FORMATS
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_NUMBER_OF_FORMATS);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "NUMBER_OF_FORMATS", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_NUMBER_OF_FRAMES
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_NUMBER_OF_FRAMES);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "NUMBER_OF_FRAMES", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_NUMBER_OF_PARAMS
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_NUMBER_OF_PARAMS);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "NUMBER_OF_PARAMS", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_NUMBER_OF_PARAMS_FREEZE
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_NUMBER_OF_PARAMS_FREEZE);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "NUMBER_OF_PARAMS_FREEZE", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_NUMBER_OF_VIDEO_FORMATS
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_NUMBER_OF_VIDEO_FORMATS);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "NUMBER_OF_VIDEO_FORMATS", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_ORIENTATION
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_ORIENTATION);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "ORIENTATION", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_ORIGINAL_FORMAT
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_ORIGINAL_FORMAT);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "ORIGINAL_FORMAT", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_PARAM_OUT_OF_RANGE
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_PARAM_OUT_OF_RANGE);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "PARAM_OUT_OF_RANGE", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_PIXEL_ASPECT
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_PIXEL_ASPECT);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "PIXEL_ASPECT", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_PREDICTED
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_PREDICTED);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "PREDICTED", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_PREROLL
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_PREROLL);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "PREROLL", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_QUALITY_FACTOR
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_QUALITY_FACTOR);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "QUALITY_FACTOR", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_QUALITY_LEVEL
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_QUALITY_LEVEL);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "QUALITY_LEVEL", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_QUALITY_SPATIAL
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_QUALITY_SPATIAL);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "QUALITY_SPATIAL", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_QUALITY_TEMPORAL
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_QUALITY_TEMPORAL);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "QUALITY_TEMPORAL", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_QUANTIZATION_TABLES
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_QUANTIZATION_TABLES);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "QUANTIZATION_TABLES", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_RANGE_VALUE
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_RANGE_VALUE);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "RANGE_VALUE", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_RGB
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_RGB);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "RGB", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_RGB332
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_RGB332);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "RGB332", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_RGB8
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_RGB8);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "RGB8", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_RGBA
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_RGBA);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "RGBA", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_RGBX
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_RGBX);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "RGBX", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_RLE
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_RLE);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "RLE", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_RLE24
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_RLE24);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "RLE24", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_RLE24_SOFTWARE
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_RLE24_SOFTWARE);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "RLE24_SOFTWARE", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_RLE_SOFTWARE
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_RLE_SOFTWARE);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "RLE_SOFTWARE", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_RTR
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_RTR);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "RTR", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_RTR1
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_RTR1);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "RTR1", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_RTR_QUALITY_LEVEL
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_RTR_QUALITY_LEVEL);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "RTR_QUALITY_LEVEL", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_SAMPLES_PER_TILE
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_SAMPLES_PER_TILE);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "SAMPLES_PER_TILE", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_SCHEME_BUSY
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_SCHEME_BUSY);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "SCHEME_BUSY", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_SCHEME_NOT_AVAILABLE
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_SCHEME_NOT_AVAILABLE);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "SCHEME_NOT_AVAILABLE", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_SPEED
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_SPEED);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "SPEED", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_STEREO_INTERLEAVED
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_STEREO_INTERLEAVED);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "STEREO_INTERLEAVED", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_STREAM_HEADERS
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_STREAM_HEADERS);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "STREAM_HEADERS", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_TILE_THRESHOLD
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_TILE_THRESHOLD);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "TILE_THRESHOLD", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_TOP_DOWN
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_TOP_DOWN);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "TOP_DOWN", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_ULAW
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_ULAW);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "ULAW", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_UNCOMPRESSED
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_UNCOMPRESSED);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "UNCOMPRESSED", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_UNCOMPRESSED_AUDIO
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_UNCOMPRESSED_AUDIO);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "UNCOMPRESSED_AUDIO", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_UNCOMPRESSED_VIDEO
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_UNCOMPRESSED_VIDEO);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "UNCOMPRESSED_VIDEO", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_UNKNOWN_SCHEME
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_UNKNOWN_SCHEME);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "UNKNOWN_SCHEME", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_VIDEO
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_VIDEO);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "VIDEO", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_Y
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_Y);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "Y", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_YCbCr
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_YCbCr);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "YCbCr", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_YCbCr422
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_YCbCr422);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "YCbCr422", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_YCbCr422DC
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_YCbCr422DC);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "YCbCr422DC", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_YCbCr422HC
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_YCbCr422HC);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "YCbCr422HC", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_YUV
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_YUV);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "YUV", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_YUV422
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_YUV422);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "YUV422", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_YUV422DC
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_YUV422DC);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "YUV422DC", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef CL_YUV422HC
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(CL_YUV422HC);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "YUV422HC", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef AWCMP_STEREO
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(AWCMP_STEREO);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "AWCMP_STEREO", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef AWCMP_JOINT_STEREO
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(AWCMP_JOINT_STEREO);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "AWCMP_JOINT_STEREO", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef AWCMP_INDEPENDENT
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(AWCMP_INDEPENDENT);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "AWCMP_INDEPENDENT", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef AWCMP_FIXED_RATE
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(AWCMP_FIXED_RATE);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "AWCMP_FIXED_RATE", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef AWCMP_CONST_QUAL
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(AWCMP_CONST_QUAL);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "AWCMP_CONST_QUAL", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef AWCMP_LOSSLESS
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(AWCMP_LOSSLESS);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "AWCMP_LOSSLESS", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef AWCMP_MPEG_LAYER_I
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(AWCMP_MPEG_LAYER_I);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "AWCMP_MPEG_LAYER_I", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
#ifdef AWCMP_MPEG_LAYER_II
|
2010-05-09 11:46:46 -03:00
|
|
|
x = PyInt_FromLong(AWCMP_MPEG_LAYER_II);
|
|
|
|
if (x == NULL || PyDict_SetItemString(d, "AWCMP_MPEG_LAYER_II", x) < 0)
|
|
|
|
return;
|
|
|
|
Py_DECREF(x);
|
1997-08-12 11:58:54 -03:00
|
|
|
#endif
|
|
|
|
|
2010-05-09 11:46:46 -03:00
|
|
|
(void) clSetErrorHandler(cl_ErrorHandler);
|
1992-09-23 11:53:00 -03:00
|
|
|
}
|