void VolumeFaderEffectXT::createInstance() { xine_audio_port_t *audioPort = fakeAudioPort(); Q_ASSERT(0 == m_plugin); debug() << Q_FUNC_INFO << audioPort << " fadeTime = " << m_parameters.fadeTime; m_plugin = xine_post_init(m_xine, "KVolumeFader", 1, &audioPort, 0); xine_post_in_t *paraInput = xine_post_input(m_plugin, "parameters"); Q_ASSERT(paraInput); Q_ASSERT(paraInput->type == XINE_POST_DATA_PARAMETERS); Q_ASSERT(paraInput->data); m_pluginApi = reinterpret_cast<xine_post_api_t *>(paraInput->data); m_pluginApi->set_parameters(m_plugin, &m_parameters); }
PyObject * Xine_PyObject_post_init(Xine_PyObject *self, PyObject *args, PyObject *kwargs) { char *name; int inputs, i; PyObject *audio_targets, *video_targets, *post_pyobject = NULL; xine_video_port_t **vo; xine_audio_port_t **ao; xine_post_t *post; if (!PyArg_ParseTuple(args, "siOO", &name, &inputs, &audio_targets, &video_targets)) return NULL; ao = (xine_audio_port_t **)malloc((1 + sizeof(xine_audio_port_t *) * PyList_Size(audio_targets))); for (i = 0; i < PyList_Size(audio_targets); i++) ao[i] = ((Xine_Audio_Port_PyObject *)PyList_GetItem(audio_targets, i))->ao; ao[i] = NULL; vo = (xine_video_port_t **)malloc((1 + sizeof(xine_video_port_t *) * PyList_Size(video_targets))); for (i = 0; i < PyList_Size(video_targets); i++) vo[i] = ((Xine_Video_Port_PyObject *)PyList_GetItem(video_targets, i))->vo; vo[i] = NULL; post = xine_post_init(self->xine, name, inputs, ao, vo); if (post) post_pyobject = (PyObject *)pyxine_new_post_pyobject(self, post, name, 1); free(ao); free(vo); if (!post) { PyErr_Format(xine_error, "Failed to initialize post plugin."); return NULL; } return post_pyobject; }