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