]> git.sesse.net Git - vlc/blob - bindings/python/vlc_internal.c
python bindings, vlc_position.c: check against invalid origin or key values
[vlc] / bindings / python / vlc_internal.c
1 /*****************************************************************************
2  * vlc_internal.c: vlcinternal python binding module
3  *****************************************************************************
4  * Copyright (C) 2006 the VideoLAN team
5  * $Id$
6  *
7  * Authors: Olivier Aubert <oaubert at bat710.univ-lyon1.fr>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22  *****************************************************************************/
23
24 #include "vlc_internal.h"
25
26 /**************************************************************************
27  * VLC Module
28  **************************************************************************/
29
30 #ifndef vlcinternalMODINIT_FUNC /* declarations for DLL import/export */
31 #define vlcinternalMODINIT_FUNC void
32 #endif
33
34 static PyMethodDef vlcinternal_methods[] = {
35     { NULL }  /* Sentinel */
36 };
37
38 vlcinternalMODINIT_FUNC
39 initvlcinternal( void )
40 {
41     PyObject* p_module;
42
43     p_module = Py_InitModule3( "vlcinternal", vlcinternal_methods,
44                                "VLC media player internal module" );
45
46     if( !p_module )
47       return;
48
49     if( PyType_Ready( &vlcObject_Type ) < 0 )
50         return;
51
52     /* Types */
53     Py_INCREF( &vlcObject_Type );
54     PyModule_AddObject( p_module, "Object",
55                         ( PyObject * )&vlcObject_Type );
56 }
57
58
59 /* Make libpostproc happy... */
60 void * fast_memcpy( void * to, const void * from, size_t len )
61 {
62   return memcpy( to, from, len );
63 }
64
65 /*****************************************************************************
66  * VLCObject implementation
67  *****************************************************************************/
68
69 static PyObject
70 *vlcObject_new( PyTypeObject *p_type, PyObject *p_args, PyObject *p_kwds )
71 {
72     vlcObject *self;
73     vlc_object_t *p_object;
74     int i_id;
75
76     self = PyObject_New( vlcObject, &vlcObject_Type );
77
78     if( !PyArg_ParseTuple( p_args, "i", &i_id ) )
79       return NULL;
80
81     /* Maybe we were already initialized */
82     p_object = ( vlc_object_t* )vlc_current_object( i_id );
83
84     if( !p_object )
85     {
86         /* Try to initialize */
87         i_id = VLC_Create();
88         if( i_id < 0 )
89         {
90             PyErr_SetString( PyExc_StandardError, "Unable to create a VLC instance." );
91             return NULL;
92         }
93         p_object = ( vlc_object_t* )vlc_current_object( i_id );
94     }
95
96     if( !p_object )
97     {
98         PyErr_SetString( PyExc_StandardError, "Unable to get object." );
99         return NULL;
100     }
101
102     self->p_object = p_object;
103     self->b_released = 0;
104
105     Py_INCREF(  self ); /* Ah bon ? */
106     return ( PyObject * )self;
107 }
108
109 static PyObject *
110 vlcObject_release(  PyObject *self, PyObject *p_args )
111 {
112     if( VLCSELF->b_released == 0 )
113     {
114         vlc_object_release( VLCSELF->p_object );
115         VLCSELF->b_released = 1;
116     }
117     Py_INCREF(  Py_None );
118     return Py_None;
119 }
120
121 static void
122 vlcObject_dealloc( PyObject *self )
123 {
124     vlcObject_release( self, NULL );
125     PyObject_DEL( self );
126 }
127
128 static PyObject *
129 vlcObject_find_object( PyObject *self, PyObject *args )
130 {
131     vlcObject *p_retval;
132     vlc_object_t *p_obj;
133     char *psz_name;
134     int i_object_type;
135
136     if( !PyArg_ParseTuple( args, "s", &psz_name ) )
137         return NULL;
138
139     /* psz_name is in
140        ( aout, decoder, input, httpd, intf, playlist, root, vlc, vout )
141     */
142     if( !strncmp( psz_name, "aout", 4 ) )
143     {
144         i_object_type = VLC_OBJECT_AOUT;
145     }
146     else if (! strncmp( psz_name, "decoder", 7 ) )
147     {
148         i_object_type = VLC_OBJECT_DECODER;
149     }
150     else if (! strncmp( psz_name, "httpd", 5 ) )
151     {
152             i_object_type = VLC_OBJECT_HTTPD;
153     }
154     else if (! strncmp( psz_name, "intf", 4 ) )
155     {
156         i_object_type = VLC_OBJECT_INTF;
157     }
158     else if (! strncmp( psz_name, "input", 5 ) )
159     {
160         i_object_type = VLC_OBJECT_INPUT;
161     }
162     else if (! strncmp( psz_name, "playlist", 8 ) )
163     {
164         i_object_type = VLC_OBJECT_PLAYLIST;
165     }
166     else if (! strncmp( psz_name, "libvlc", 6 ) )
167     {
168         i_object_type = VLC_OBJECT_LIBVLC;
169     }
170     else if (! strncmp( psz_name, "vout", 4 ) )
171     {
172         i_object_type = VLC_OBJECT_VOUT;
173     }
174     else if (! strncmp( psz_name, "sout", 4 ) )
175     {
176         i_object_type = VLC_OBJECT_SOUT;
177     }
178     else if (! strncmp( psz_name, "global", 6 ) )
179     {
180         i_object_type = VLC_OBJECT_GLOBAL;
181     }
182     else if (! strncmp( psz_name, "packetizer", 10 ) )
183     {
184         i_object_type = VLC_OBJECT_PACKETIZER;
185     }
186     else if (! strncmp( psz_name, "encoder", 7 ) )
187     {
188         i_object_type = VLC_OBJECT_ENCODER;
189     }
190     else if (! strncmp( psz_name, "vlm", 3 ) )
191     {
192         i_object_type = VLC_OBJECT_VLM;
193     }
194     else if (! strncmp( psz_name, "announce", 8 ) )
195     {
196         i_object_type = VLC_OBJECT_ANNOUNCE;
197     }
198     else if (! strncmp( psz_name, "demux", 5 ) )
199     {
200         i_object_type = VLC_OBJECT_DEMUX;
201     }
202     else if (! strncmp( psz_name, "access", 6 ) )
203     {
204         i_object_type = VLC_OBJECT_ACCESS;
205     }
206     else if (! strncmp( psz_name, "stream", 6 ) )
207     {
208         i_object_type = VLC_OBJECT_STREAM;
209     }
210     else if (! strncmp( psz_name, "filter", 6 ) )
211     {
212         i_object_type = VLC_OBJECT_FILTER;
213     }
214     else if (! strncmp( psz_name, "vod", 3 ) )
215     {
216         i_object_type = VLC_OBJECT_VOD;
217     }
218     else if (! strncmp( psz_name, "xml", 3 ) )
219     {
220         i_object_type = VLC_OBJECT_XML;
221     }
222     else if (! strncmp( psz_name, "osdmenu", 7 ) )
223     {
224         i_object_type = VLC_OBJECT_OSDMENU;
225     }
226     else if (! strncmp( psz_name, "stats", 5 ) )
227     {
228         i_object_type = VLC_OBJECT_STATS;
229     }
230     else if (! strncmp( psz_name, "metaengine", 10 ) )
231     {
232         i_object_type = VLC_OBJECT_META_ENGINE;
233     }
234     else
235     {
236         /* FIXME: raise an exception ? */
237         Py_INCREF( Py_None );
238         return Py_None;
239     }
240
241     p_obj = vlc_object_find( VLCSELF->p_object, i_object_type, FIND_ANYWHERE );
242
243     if( !p_obj )
244     {
245         Py_INCREF( Py_None );
246         return Py_None;
247     }
248
249     p_retval = PyObject_New( vlcObject, &vlcObject_Type );
250
251     p_retval->p_object = p_obj;
252
253     return ( PyObject * )p_retval;
254 }
255
256 static PyObject *
257 vlcObject_find_name( PyObject *self, PyObject *args )
258 {
259     vlcObject *p_retval;
260     vlc_object_t *p_obj;
261     char *psz_name;
262     int i_object_type;
263
264     if( !PyArg_ParseTuple( args, "s", &psz_name ) )
265         return NULL;
266
267     p_obj = vlc_object_find_name( VLCSELF->p_object, psz_name, FIND_ANYWHERE );
268
269     if( !p_obj )
270     {
271         Py_INCREF( Py_None );
272         return Py_None;
273     }
274
275     p_retval = PyObject_New( vlcObject, &vlcObject_Type );
276
277     p_retval->p_object = p_obj;
278
279     return ( PyObject * )p_retval;
280 }
281
282 static PyObject *
283 vlcObject_info( PyObject *self, PyObject *args )
284 {
285     PyObject *p_retval;
286     vlc_object_t *p_obj;
287
288     p_obj = VLCSELF->p_object;
289
290     /* Return information about the object as a dict. */
291     p_retval = PyDict_New();
292
293     PyDict_SetItemString( p_retval, "object-id",
294                           Py_BuildValue( "l", p_obj->i_object_id ) );
295     PyDict_SetItemString( p_retval, "object-type",
296                           Py_BuildValue( "s", p_obj->psz_object_type ) );
297     PyDict_SetItemString( p_retval, "object-name",
298                           Py_BuildValue( "s", p_obj->psz_object_name ) );
299     PyDict_SetItemString( p_retval, "thread",
300                           PyBool_FromLong( p_obj->b_thread ) );
301     PyDict_SetItemString( p_retval, "thread-id",
302                           PyLong_FromLongLong( p_obj->thread_id ) );
303     PyDict_SetItemString( p_retval, "refcount",
304                           PyInt_FromLong( p_obj->i_refcount ) );
305
306     return p_retval;
307 }
308
309 static PyObject *
310 vlcObject_find_id( PyObject *self, PyObject *args )
311 {
312     vlcObject *p_retval;
313     vlc_object_t* p_object;
314     int i_id;
315
316     if( !PyArg_ParseTuple( args, "i", &i_id ) )
317         return NULL;
318
319     p_object = ( vlc_object_t* )vlc_current_object( i_id );
320
321     if( !p_object )
322     {
323         Py_INCREF( Py_None );
324         return Py_None;
325     }
326
327     p_retval = PyObject_NEW( vlcObject, &vlcObject_Type );
328
329     p_retval->p_object = p_object;
330
331     return ( PyObject * )p_retval;
332 }
333
334 /* Do a var_Get call on the object. Parameter: the variable name. */
335 static PyObject *
336 vlcObject_var_get( PyObject *self, PyObject *args )
337 {
338     PyObject *p_retval;
339     vlc_value_t value;
340     char *psz_name;
341     int i_type;
342
343     if( !PyArg_ParseTuple( args, "s", &psz_name ) )
344         return NULL;
345
346     if( var_Get( VLCSELF->p_object, psz_name, &value ) != VLC_SUCCESS )
347     {
348         PyErr_SetString( PyExc_StandardError,
349                          "Error: variable does not exist.\n" );
350         return NULL;
351     }
352
353     i_type = var_Type ( VLCSELF->p_object, psz_name );
354
355     switch ( i_type )
356     {
357     case VLC_VAR_VOID      :
358         p_retval = PyString_FromString( "A void variable" );
359         break;
360     case VLC_VAR_BOOL      :
361         p_retval = PyBool_FromLong( value.b_bool );
362         break;
363     case VLC_VAR_INTEGER   :
364         p_retval = PyInt_FromLong( ( long )value.i_int );
365         break;
366     case VLC_VAR_HOTKEY    :
367         p_retval = PyString_FromFormat( "A hotkey variable ( %d )", value.i_int );
368         break;
369     case VLC_VAR_FILE      :
370     case VLC_VAR_STRING    :
371     case VLC_VAR_DIRECTORY :
372     case VLC_VAR_VARIABLE  :
373         p_retval = PyString_FromString( value.psz_string );
374         break;
375     case VLC_VAR_MODULE   :
376         p_retval = ( PyObject* )PyObject_New( vlcObject, &vlcObject_Type );
377         ( ( vlcObject* )p_retval )->p_object = value.p_object;
378         break;
379     case VLC_VAR_FLOAT     :
380         p_retval = PyFloat_FromDouble( ( double )value.f_float );
381         break;
382     case VLC_VAR_TIME      :
383         p_retval = PyLong_FromLongLong( value.i_time );
384         break;
385     case VLC_VAR_ADDRESS   :
386         p_retval = PyString_FromString( "A VLC address ( not handled yet )" );
387         break;
388     case VLC_VAR_LIST      :
389         p_retval = PyString_FromString( "A VLC list ( not handled yet )" );
390         break;
391     case VLC_VAR_MUTEX :
392         p_retval = PyString_FromString( "A mutex" );
393         break;
394     default:
395         p_retval = Py_None;
396     }
397
398     Py_INCREF( p_retval );
399     return p_retval;
400 }
401
402 static PyObject *
403 vlcObject_var_type( PyObject *self, PyObject *args )
404 {
405     char *psz_name;
406     PyObject *p_retval;
407     int i_type;
408
409     if( !PyArg_ParseTuple( args, "s", &psz_name ) )
410         return NULL;
411
412     i_type = var_Type( VLCSELF->p_object, psz_name );
413
414     switch ( i_type )
415     {
416     case VLC_VAR_VOID   :
417         p_retval = PyString_FromString( "Void" );
418         break;
419     case VLC_VAR_BOOL      :
420         p_retval = PyString_FromString( "Boolean" );
421         break;
422     case VLC_VAR_INTEGER   :
423         p_retval = PyString_FromString( "Integer" );
424         break;
425     case VLC_VAR_HOTKEY   :
426         p_retval = PyString_FromString( "Hotkey" );
427         break;
428     case VLC_VAR_FILE      :
429         p_retval = PyString_FromString( "File" );
430         break;
431     case VLC_VAR_STRING    :
432         p_retval = PyString_FromString( "String" );
433         break;
434     case VLC_VAR_DIRECTORY :
435         p_retval = PyString_FromString( "Directory" );
436         break;
437     case VLC_VAR_VARIABLE  :
438         p_retval = PyString_FromString( "Variable" );
439         break;
440     case VLC_VAR_MODULE   :
441         p_retval = PyString_FromString( "Module" );
442         break;
443     case VLC_VAR_FLOAT     :
444         p_retval = PyString_FromString( "Float" );
445         break;
446     case VLC_VAR_TIME      :
447         p_retval = PyString_FromString( "Time" );
448         break;
449     case VLC_VAR_ADDRESS   :
450         p_retval = PyString_FromString( "Address" );
451         break;
452     case VLC_VAR_LIST      :
453         p_retval = PyString_FromString( "List" );
454         break;
455     case VLC_VAR_MUTEX :
456         p_retval = PyString_FromString( "Mutex" );
457         break;
458     default:
459         p_retval = PyString_FromString( "Unknown" );
460     }
461     return p_retval;
462 }
463
464 /* Do a var_Set call on the object. Parameter: the variable name. */
465 static PyObject *
466 vlcObject_var_set( PyObject *self, PyObject *args )
467 {
468     vlc_value_t value;
469     char *psz_name;
470     PyObject *py_value;
471     int i_type;
472     vlc_object_t *p_obj;
473
474     if( !PyArg_ParseTuple( args, "sO", &psz_name, &py_value ) )
475         return NULL;
476
477     p_obj = VLCSELF->p_object;
478     i_type = var_Type( p_obj, psz_name );
479
480     switch ( i_type )
481     {
482     case VLC_VAR_VOID   :
483         break;
484     case VLC_VAR_BOOL      :
485         value.b_bool = PyInt_AsLong( py_value );
486         break;
487     case VLC_VAR_INTEGER   :
488     case VLC_VAR_HOTKEY   :
489         value.i_int = PyInt_AsLong( py_value );
490         break;
491     case VLC_VAR_FILE      :
492     case VLC_VAR_STRING    :
493     case VLC_VAR_DIRECTORY :
494     case VLC_VAR_VARIABLE  :
495         value.psz_string = strdup( PyString_AsString( py_value ) );
496         break;
497     case VLC_VAR_MODULE   :
498         /* FIXME: we should check the PyObject type and get its p_object */
499         value.p_object = ( ( vlcObject* )p_obj )->p_object;
500         break;
501     case VLC_VAR_FLOAT     :
502         value.f_float = PyFloat_AsDouble( py_value );
503         break;
504     case VLC_VAR_TIME      :
505         value.i_time = PyLong_AsLongLong( py_value );
506         break;
507     case VLC_VAR_ADDRESS   :
508         value.p_address = ( char* )PyLong_AsVoidPtr( py_value );
509         break;
510     case VLC_VAR_LIST      :
511         /* FIXME */
512         value.p_list = NULL;
513         break;
514     case VLC_VAR_MUTEX :
515         break;
516     }
517
518     var_Set( p_obj, psz_name, value );
519
520     Py_INCREF( Py_None );
521     return Py_None;
522 }
523
524 static PyObject *
525 vlcObject_var_list( PyObject *self, PyObject *args )
526 {
527     PyObject *p_retval;
528     Py_ssize_t i_size;
529     Py_ssize_t i_index;
530
531     i_size = VLCSELF->p_object->i_vars;
532     p_retval = PyTuple_New( i_size );
533
534     for ( i_index = 0 ; i_index < i_size ; i_index++ )
535     {
536         PyTuple_SetItem( p_retval, i_index,
537                          Py_BuildValue( "s", VLCSELF->p_object->p_vars[i_index].psz_name ) );
538     }
539
540     return p_retval;
541 }
542
543 /* Do a config_Get call on the object. Parameter: the variable name. */
544 static PyObject *
545 vlcObject_config_get( PyObject *self, PyObject *args )
546 {
547     PyObject *p_retval;
548     vlc_value_t value;
549     char *psz_name;
550     module_config_t *p_config;
551
552     if( !PyArg_ParseTuple( args, "s", &psz_name ) )
553         return NULL;
554
555     p_config = config_FindConfig( VLCSELF->p_object, psz_name );
556
557     if( !p_config )
558     {
559         PyErr_SetString( PyExc_StandardError,
560                          "Error: config variable does not exist.\n" );
561         return NULL;
562     }
563
564     switch ( p_config->i_type )
565     {
566     case CONFIG_ITEM_BOOL      :
567         p_retval = PyBool_FromLong( p_config->value.i );
568         break;
569     case CONFIG_ITEM_INTEGER   :
570         p_retval = PyInt_FromLong( ( long )p_config->value.i );
571         break;
572     case CONFIG_ITEM_KEY   :
573         p_retval = PyString_FromFormat( "A hotkey variable ( %d )", p_config->value.i );
574         break;
575     case CONFIG_ITEM_FILE      :
576     case CONFIG_ITEM_STRING    :
577     case CONFIG_ITEM_DIRECTORY :
578     case CONFIG_ITEM_MODULE    :
579         vlc_mutex_lock( p_config->p_lock );
580         if( p_config->value.psz )
581             p_retval = PyString_FromString( p_config->value.psz );
582         else
583             p_retval = PyString_FromString( "" );
584         vlc_mutex_unlock( p_config->p_lock );
585         break;
586         p_retval = ( PyObject* )PyObject_New( vlcObject, &vlcObject_Type );
587         ( ( vlcObject* )p_retval )->p_object = value.p_object;
588         break;
589     case CONFIG_ITEM_FLOAT     :
590         p_retval = PyFloat_FromDouble( ( double )p_config->value.f );
591         break;
592     default:
593         p_retval = Py_None;
594         Py_INCREF( p_retval );
595     }
596
597     return p_retval;
598 }
599
600 /* Do a config_put* call on the object. Parameter: the variable name. */
601 static PyObject *
602 vlcObject_config_set( PyObject *self, PyObject *args )
603 {
604     char *psz_name;
605     PyObject *py_value;
606     vlc_object_t *p_obj;
607     module_config_t *p_config;
608
609
610     if( !PyArg_ParseTuple( args, "sO", &psz_name, &py_value ) )
611         return NULL;
612
613     p_obj = VLCSELF->p_object;
614     p_config = config_FindConfig( p_obj, psz_name );
615     /* sanity checks */
616     if( !p_config )
617     {
618         PyErr_SetString( PyExc_StandardError,
619                          "Error: option does not exist.\n" );
620         return NULL;
621     }
622
623     switch ( p_config->i_type )
624     {
625     case CONFIG_ITEM_BOOL      :
626     case CONFIG_ITEM_INTEGER   :
627     case CONFIG_ITEM_KEY       :
628         config_PutInt( p_obj, psz_name, PyInt_AsLong( py_value ) );
629         break;
630     case CONFIG_ITEM_FILE      :
631     case CONFIG_ITEM_STRING    :
632     case CONFIG_ITEM_DIRECTORY :
633     case CONFIG_ITEM_MODULE   :
634         config_PutPsz( p_obj, psz_name, PyString_AsString( py_value ) );
635         break;
636     case CONFIG_ITEM_FLOAT     :
637         config_PutFloat( p_obj, psz_name, PyFloat_AsDouble( py_value ) );
638         break;
639     }
640     Py_INCREF( Py_None );
641     return Py_None;
642 }
643
644 static PyObject *
645 vlcObject_children( PyObject *self, PyObject *args )
646 {
647     PyObject *p_retval;
648     Py_ssize_t i_size;
649     Py_ssize_t i_index;
650
651     i_size = VLCSELF->p_object->i_children;
652     p_retval = PyTuple_New( i_size );
653
654     for ( i_index = 0 ; i_index < i_size ; i_index++ )
655     {
656         PyTuple_SetItem( p_retval, i_index,
657                          Py_BuildValue( "i",
658                                         VLCSELF->p_object->pp_children[i_index]->i_object_id ) );
659     }
660
661     return p_retval;
662 }
663
664
665 /* Method table */
666 static PyMethodDef vlcObject_methods[] =
667 {
668     { "get", vlcObject_var_get, METH_VARARGS,
669       "get( str ) -> value   Get a variable value."},
670     { "set", vlcObject_var_set, METH_VARARGS,
671       "set( str, value )     Set a variable value" },
672     { "config_get", vlcObject_config_get, METH_VARARGS,
673       "config_get( str ) -> value   Get a configuration option." },
674     { "config_set", vlcObject_config_set, METH_VARARGS,
675       "config_set( str, value )     Set a configuration option" },
676     { "type", vlcObject_var_type, METH_VARARGS,
677       "type( str ) -> str     Get a variable type" },
678     { "list", vlcObject_var_list, METH_NOARGS,
679       "list( )             List the available variables" },
680     { "children", vlcObject_children, METH_NOARGS,
681       "children( )             List the children ids" },
682     { "find_object", vlcObject_find_object, METH_VARARGS,
683       "find_object( str ) -> Object     Find the object of a given type.\n\nAvailable types are : aout, decoder, input, httpd, intf, playlist, root, vlc, vout"},
684     { "find_id", vlcObject_find_id, METH_VARARGS,
685       "find_id( int ) -> Object      Find an object by id" },
686     { "find_name", vlcObject_find_name, METH_VARARGS,
687       "find_name( str ) -> Object      Find an object by name" },
688     { "info", vlcObject_info, METH_NOARGS,
689        "info( ) -> dict    Return information about the object" },
690     { "release", vlcObject_release, METH_NOARGS,
691       "release( ) ->     Release the VLC Object" },
692     { NULL, NULL, 0, NULL },
693 };
694
695 static PyTypeObject vlcObject_Type =
696 {
697     PyObject_HEAD_INIT( NULL )
698     0,                         /*ob_size*/
699     "vlc.Object",       /*tp_name*/
700     sizeof( vlcObject_Type ), /*tp_basicsize*/
701     0,                         /*tp_itemsize*/
702     ( destructor )vlcObject_dealloc,      /*tp_dealloc*/
703     0,                         /*tp_print*/
704     0,                         /*tp_getattr*/
705     0,                         /*tp_setattr*/
706     0,                         /*tp_compare*/
707     0,                         /*tp_repr*/
708     0,                         /*tp_as_number*/
709     0,                         /*tp_as_sequence*/
710     0,                         /*tp_as_mapping*/
711     0,                         /*tp_hash */
712     0,                         /*tp_call*/
713     0,                         /*tp_str*/
714     0,                         /*tp_getattro*/
715     0,                         /*tp_setattro*/
716     0,                         /*tp_as_buffer*/
717     Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
718     "Expose VLC object infrastructure.\n\nConstructor: vlc.Object(object_id)",  /* tp_doc */
719     0,                     /* tp_traverse */
720     0,                     /* tp_clear */
721     0,                     /* tp_richcompare */
722     0,                     /* tp_weaklistoffset */
723     0,                     /* tp_iter */
724     0,                     /* tp_iternext */
725     vlcObject_methods,             /* tp_methods */
726     0,             /* tp_members */
727     0,                         /* tp_getset */
728     0,                         /* tp_base */
729     0,                         /* tp_dict */
730     0,                         /* tp_descr_get */
731     0,                         /* tp_descr_set */
732     0,                         /* tp_dictoffset */
733     0,                         /* tp_init */
734     0,                         /* tp_alloc */
735     vlcObject_new,          /* tp_new */
736 };