I am trying to compile a python extension that uses
Quicktime Video Output Components
as shown in the Mac Developers Library
SimpleVideoOutXcode.xodeproj
i am building the extension using the setup.py script attached below
I need to run python in 32-bit because Quicktime has not been upgraded to 64-bit
I am running 10.7.2 and the Apple installed python 2.7.1
/usr/bin/python: Mach-O universal binary with 2 architectures
/usr/bin/python (for architecture x86_64): Mach-O 64-bit executable x86_64
/usr/bin/python (for architecture i386): Mach-O executable i386
this is an excerpt of the output i am getting when I try to build the extension
NOTE: this line
KVoutModule.c:44: error: expected specifier-qualifier-list before
‘QTVideoOutputComponent’
seems to indicate that I am not including the Quicktime/QuicktimeComponents.h
header (which I am)
as shown in the excerpt from the KVout.c source.
relavent setup.py line:
include_dirs = ['.', '/System/Library/Frameworks/Quicktime.framework/Headers/']
------------------------------------
-----------------> output from : arch -i386 /usr/bin/python setup.py build
-----------------------------------
running build
running build_ext
building 'KVout' extension
creating build
creating build/temp.macosx-10.7-intel-2.7
llvm-gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common
-fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG
-Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall
-Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe
-DMAJOR_VERSION=1 -DMINOR_VERSION=0 -I.
-I/System/Library/Frameworks/Quicktime.framework/Headers/
-I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c
KVoutModule.c -o build/temp.macosx-10.7-intel-2.7/KVoutModule.o -m32 -framework
Quicktime
KVoutModule.c: In function ‘KVout_Begin’:
KVoutModule.c:197: warning: ‘ComponentFunctionImplemented’ is deprecated
(declared at
/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Components.h:1216)
KVoutModule.c: At top level:
KVoutModule.c:537: warning: initialization from incompatible pointer type
i686-apple-darwin11-llvm-gcc-4.2: -framework: linker input file unused because
linking not done
i686-apple-darwin11-llvm-gcc-4.2: Quicktime: linker input file unused because
linking not done
KVoutModule.c:44: error: expected specifier-qualifier-list before
‘QTVideoOutputComponent’
KVoutModule.c:91: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
before ‘KVoutComponent_GetInstance’
KVoutModule.c:93: error: expected ‘)’ before ‘container’
KVoutModule.c:94: error: expected declaration specifiers or ‘...’ before
‘QTAtom’
KVoutModule.c:94: error: expected declaration specifiers or ‘...’ before
‘QTAtomContainer’
KVoutModule.c: In function ‘KVout_Open’:
KVoutModule.c:142: warning: implicit declaration of function
‘KVoutComponent_GetInstance’
KVoutModule.c:142: warning: assignment makes pointer from integer without a cast
KVoutModule.c:148: warning: implicit declaration of function
‘QTVideoOutputSetClientName’
KVoutModule.c:151: warning: implicit declaration of function
‘QTVideoOutputSetDisplayMode’
KVoutModule.c: In function ‘KVout_Begin’:
KVoutModule.c:188: warning: assignment makes pointer from integer without a cast
KVoutModule.c:191: warning: implicit declaration of function
‘QTVideoOutputBegin’
KVoutModule.c:197: warning: implicit declaration of function
‘ComponentFunctionImplemented’
KVoutModule.c:197: error: ‘kQTVideoOutputSetEchoPortSelect’ undeclared (first
use in this function)
KVoutModule.c:197: error: (Each undeclared identifier is reported only once
KVoutModule.c:197: error: for each function it appears in.)
KVoutModule.c:201: warning: implicit declaration of function
‘QTVideoOutputGetGWorld’
QUESTION:
Is there something more I need to do (or am I doing something wrong) that is
keeping this from compiling
------------------------------------
-----------------> excerpt from my KVout.c
-----------------------------------
#include <Python/Python.h>
#include <Carbon/Carbon.h>
#include <OpenGL/OpenGL.h>
#include <QuickTime/QuickTime.h>
#include <QuickTime/QuickTimeComponents.h>
#include <Python/structmember.h>
static PyObject *ErrorObject; /* loacal exceptions */
#define ErrorExit(msg) \
{ PyErr_SetString (ErrorObject, msg); return NULL; }
extern void initKVout(void);
static int kMaxNumberOfComponents = 10;
typedef struct {
long width, height; // pixels of the display
Fixed hRes, vRes; // pixels per inch
Fixed refreshRate; // refresh rate
OSType pixelType; // type of pixel used by display format:
//
1,2,4,8,16,24,32 :: standard bit depths
//
33,34,36,40 :: gray-scale pixel depths
// of 1,2,4,8
char name[50]; // name of display mode
} DisplayModeAtomRecord, *DisplayModeAtomPtr;
typedef struct {
Handle hName;
OSType subType;
UInt8 numberOfModes;
DisplayModeAtomPtr pDisplayModeList;
} ComponentListRecord, *ComponentListPtr;
typedef struct {
Component component;
QTVideoOutputComponent componentInstance;
ComponentListPtr componentList;
UInt8 totalNumOfComponents;
UInt8 whichComponentIndex;
UInt8 whichModeIndex;
} KVoutComponent, *KVoutComponentPtr;
------------------------------------
-----------------> my setup.py
-----------------------------------
from distutils.core import setup, Extension
module1 = Extension('KVout',
define_macros = [('MAJOR_VERSION', '1'),
('MINOR_VERSION', '0')],
extra_compile_args = ['-m32',
'-framework', 'Quicktime'],
include_dirs = ['.',
'/System/Library/Frameworks/Quicktime.framework/Headers/'],
libraries = [],
library_dirs = [],
sources = ['KVoutModule.c'])
setup (name = 'KVout',
version = '1.0',
description = 'Output Kabuki to Quicktime Video Component',
author = 'Michael Ferraro',
author_email = '[email protected]',
url = 'http://www.python.org/doc/current/ext/building.html',
long_description = '''
This is really just a demo package.
''',
ext_modules = [module1])
_______________________________________________
Pythonmac-SIG maillist - [email protected]
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG