static void PyGoom_dealloc(PyGoomObject *self) { if (debug >= 1) { printf("PyGoom_dealloc\n"); fflush(stdout); } Py_XDECREF(self->exportfile); Py_XDECREF(self->songtitle); Py_XDECREF(self->message); if (self->mmap_area) { munmap(self->mmap_area, sizeof(data_t)); } if (self->mmap_fd >= 0) { close(self->mmap_fd); } if (self->surface) { SDL_FreeSurface(self->surface); } if (self->goominfo) { goom_close(self->goominfo); } PyObject_Del(self); }
VideoVisualGoom::~VideoVisualGoom() { #ifdef USING_OPENGL if (m_surface && m_render && (m_render->Type() == kRenderOpenGL1 || m_render->Type() == kRenderOpenGL2 || m_render->Type() == kRenderOpenGL2ES)) { MythRenderOpenGL *glrender = static_cast<MythRenderOpenGL*>(m_render); if (glrender) glrender->DeleteTexture(m_surface); m_surface = 0; } #endif #ifdef USING_VDPAU if (m_surface && m_render && (m_render->Type() == kRenderVDPAU)) { MythRenderVDPAU *render = static_cast<MythRenderVDPAU*>(m_render); if (render) render->DestroyBitmapSurface(m_surface); m_surface = 0; } #endif goom_close(); }
/** * $(fclass) * * */ void data_import_clean() { if (init == 1) { goom_close(goomInfo); counter = 0; init = 0; } }
/***************************************************************************** * Thread: *****************************************************************************/ static void *Thread( void *p_thread_data ) { goom_thread_t *p_thread = (goom_thread_t*)p_thread_data; date_t i_pts; int16_t p_data[2][512]; int i_data = 0, i_count = 0; PluginInfo *p_plugin_info; int canc = vlc_savecancel (); p_plugin_info = goom_init( p_thread->i_width, p_thread->i_height ); for( ;; ) { uint32_t *plane; picture_t *p_pic; /* FIXME the way the update is done is not really good. * Supurious wake up from p_thread->wait will make it generates a frame * without using new samples (probably rare as we should not be waiting * samples). * The frame rate at which the video is generated is not well controlled * nor the time at which each frame is displayed (not smooth) */ /* goom_update is damn slow, so just copy data and release the lock */ vlc_mutex_lock( &p_thread->lock ); if( !p_thread->b_exit && FillBuffer( (int16_t *)p_data, &i_data, &i_pts, &p_thread->date, p_thread ) != VLC_SUCCESS ) vlc_cond_wait( &p_thread->wait, &p_thread->lock ); bool b_exit = p_thread->b_exit; vlc_mutex_unlock( &p_thread->lock ); if( b_exit ) break; /* Speed selection */ if( p_thread->i_speed && (++i_count % (p_thread->i_speed+1)) ) continue; /* Frame dropping if necessary */ if( date_Get( &i_pts ) + GOOM_DELAY <= mdate() ) continue; plane = goom_update( p_plugin_info, p_data, 0, 0.0, NULL, NULL ); p_pic = vout_GetPicture( p_thread->p_vout ); if( unlikely(p_pic == NULL) ) continue; memcpy( p_pic->p[0].p_pixels, plane, p_thread->i_width * p_thread->i_height * 4 ); p_pic->date = date_Get( &i_pts ) + GOOM_DELAY; vout_PutPicture( p_thread->p_vout, p_pic ); } goom_close( p_plugin_info ); vlc_restorecancel (canc); return NULL; }
static void gst_goom2k1_finalize (GObject * object) { GstGoom2k1 *goom = GST_GOOM2K1 (object); goom_close (&(goom->goomdata)); G_OBJECT_CLASS (gst_goom2k1_parent_class)->finalize (object); }
void data_import_clean() { if (init == 1) { goom_close(); counter = 0; init = 0; } Py_XDECREF(pysurf); }
static void gst_goom_finalize (GObject * object) { GstGoom *goom = GST_GOOM (object); goom_close (goom->plugin); goom->plugin = NULL; g_object_unref (goom->adapter); G_OBJECT_CLASS (parent_class)->finalize (object); }
static int lv_goom_cleanup (VisPluginData *plugin) { GoomPrivate *priv = visual_object_get_private (VISUAL_OBJECT (plugin)); if (priv->goominfo != NULL) goom_close (priv->goominfo); visual_buffer_free (priv->pcmbuf1); visual_buffer_free (priv->pcmbuf2); visual_mem_free (priv); return 0; }
//-- Stop --------------------------------------------------------------------- // Called when the visualisation is closed by XBMC //----------------------------------------------------------------------------- extern "C" void Stop() { if ( g_goom ) { goom_close( g_goom ); g_goom = NULL; } if ( g_goom_buffer ) { free( g_goom_buffer ); g_goom_buffer = NULL; } if (g_texid) { glDeleteTextures( 1, &g_texid ); } m_vecSettings.clear(); }
//-- Create ------------------------------------------------------------------- // Called once when the visualisation is created by XBMC. Do any setup here. //----------------------------------------------------------------------------- extern "C" void Create(void* pd3dDevice, int iPosX, int iPosY, int iWidth, int iHeight, const char* szVisualisationName, float fPixelRatio, const char *szSubModuleName) { strcpy(g_visName, szVisualisationName); m_vecSettings.clear(); m_uiVisElements = 0; /** Initialise Goom */ if (g_goom) { goom_close( g_goom ); g_goom = NULL; } g_goom = goom_init(g_tex_width, g_tex_height); if (!g_goom) return; g_goom_buffer = (unsigned char*)malloc(g_tex_width * g_tex_height * 4); goom_set_screenbuffer( g_goom, g_goom_buffer ); memset( g_audio_data, 0, sizeof(g_audio_data) ); g_window_width = iWidth; g_window_height = iHeight; g_window_xpos = iPosX; g_window_ypos = iPosY; #ifdef _WIN32 #ifndef _MINGW g_configFile = string(getenv("XBMC_PROFILE_USERDATA")) + "\\" + CONFIG_FILE; std::string presetsDir = string(getenv("XBMC_HOME")) + "\\" + PRESETS_DIR; #endif #else g_configFile = _P(CONFIG_FILE); std::string presetsDir = _P(PRESETS_DIR); #endif }
/***************************************************************************** * Thread: *****************************************************************************/ static void* Thread( vlc_object_t *p_this ) { goom_thread_t *p_thread = (goom_thread_t*)p_this; int width, height, speed; date_t i_pts; int16_t p_data[2][512]; int i_data = 0, i_count = 0; PluginInfo *p_plugin_info; int canc = vlc_savecancel (); width = var_GetInteger( p_this, "goom-width" ); height = var_GetInteger( p_this, "goom-height" ); speed = var_CreateGetInteger( p_thread, "goom-speed" ); speed = MAX_SPEED - speed; if( speed < 0 ) speed = 0; p_plugin_info = goom_init( width, height ); while( vlc_object_alive (p_thread) ) { uint32_t *plane; picture_t *p_pic; /* goom_update is damn slow, so just copy data and release the lock */ vlc_mutex_lock( &p_thread->lock ); if( FillBuffer( (int16_t *)p_data, &i_data, &i_pts, &p_thread->date, p_thread ) != VLC_SUCCESS ) vlc_cond_wait( &p_thread->wait, &p_thread->lock ); vlc_mutex_unlock( &p_thread->lock ); /* Speed selection */ if( speed && (++i_count % (speed+1)) ) continue; /* Frame dropping if necessary */ if( date_Get( &i_pts ) + GOOM_DELAY <= mdate() ) continue; plane = goom_update( p_plugin_info, p_data, 0, 0.0, p_thread->psz_title, NULL ); free( p_thread->psz_title ); p_thread->psz_title = NULL; while( !( p_pic = vout_GetPicture( p_thread->p_vout ) ) && vlc_object_alive (p_thread) ) { msleep( VOUT_OUTMEM_SLEEP ); } if( p_pic == NULL ) break; memcpy( p_pic->p[0].p_pixels, plane, width * height * 4 ); p_pic->date = date_Get( &i_pts ) + GOOM_DELAY; vout_PutPicture( p_thread->p_vout, p_pic ); } goom_close( p_plugin_info ); vlc_restorecancel (canc); return NULL; }
/***************************************************************************** * Thread: *****************************************************************************/ static void Thread( vlc_object_t *p_this ) { goom_thread_t *p_thread = (goom_thread_t*)p_this; vlc_value_t width, height, speed; audio_date_t i_pts; int16_t p_data[2][512]; int i_data = 0, i_count = 0; PluginInfo *p_plugin_info; var_Get( p_this, "goom-width", &width ); var_Get( p_this, "goom-height", &height ); var_Create( p_thread, "goom-speed", VLC_VAR_INTEGER|VLC_VAR_DOINHERIT ); var_Get( p_thread, "goom-speed", &speed ); speed.i_int = MAX_SPEED - speed.i_int; if( speed.i_int < 0 ) speed.i_int = 0; p_plugin_info = goom_init( width.i_int, height.i_int ); while( !p_thread->b_die ) { uint32_t *plane; picture_t *p_pic; /* goom_update is damn slow, so just copy data and release the lock */ vlc_mutex_lock( &p_thread->lock ); if( FillBuffer( (int16_t *)p_data, &i_data, &i_pts, &p_thread->date, p_thread ) != VLC_SUCCESS ) vlc_cond_wait( &p_thread->wait, &p_thread->lock ); vlc_mutex_unlock( &p_thread->lock ); /* Speed selection */ if( speed.i_int && (++i_count % (speed.i_int+1)) ) continue; /* Frame dropping if necessary */ if( aout_DateGet( &i_pts ) + GOOM_DELAY <= mdate() ) continue; plane = goom_update( p_plugin_info, p_data, 0, 0.0, p_thread->psz_title, NULL ); if( p_thread->psz_title ) { free( p_thread->psz_title ); p_thread->psz_title = NULL; } while( !( p_pic = vout_CreatePicture( p_thread->p_vout, 0, 0, 0 ) ) && !p_thread->b_die ) { msleep( VOUT_OUTMEM_SLEEP ); } if( p_pic == NULL ) break; memcpy( p_pic->p[0].p_pixels, plane, width.i_int * height.i_int * 4 ); vout_DatePicture( p_thread->p_vout, p_pic, aout_DateGet( &i_pts ) + GOOM_DELAY ); vout_DisplayPicture( p_thread->p_vout, p_pic ); } goom_close( p_plugin_info ); }