示例#1
0
文件: clientwin.c 项目: z24/skippy-xd
void
clientwin_destroy(ClientWin *cw, bool destroyed) {
	MainWin *mw = cw->mainwin;
	session_t * const ps = mw->ps;

	free_picture(ps, &cw->origin);
	free_picture(ps, &cw->destination);
	free_pixmap(ps, &cw->pixmap);
	free_pixmap(ps, &cw->cpixmap);

	if (cw->src.window && !destroyed) {
		free_damage(ps, &cw->damage);

		// Stop listening to events, this should be safe because we don't
		// monitor window re-map anyway
		XSelectInput(ps->dpy, cw->src.window, 0);

		if (cw->redirected)
			XCompositeUnredirectWindow(ps->dpy, cw->src.window, CompositeRedirectAutomatic);
	}

	if (cw->mini.window) {
		// Somehow it doesn't work without unmapping firstly
		XUnmapWindow(ps->dpy, cw->mini.window);
		XDestroyWindow(ps->dpy, cw->mini.window);
	}

	free(cw);
}
示例#2
0
void VideoLayer::close() {
  if(frame_number!=0) {
	func("free packet");
    av_free_packet(&pkt);
  }

  if(video_codec_ctx)
    if(video_codec_ctx->codec) {
	func("close video codec");
      avcodec_close(video_codec_ctx);
  }
  
  if(audio_codec_ctx) 
    if(audio_codec_ctx->codec) {
	func("close audio codec");
      avcodec_close(audio_codec_ctx);
    if(audio_buf) {
	func("free audio buffer");
	 free(audio_buf);
	}
  }

#ifdef HAVE_LIB_SWSCALE
  sws_freeContext(img_convert_ctx);
#endif
  
  if(avformat_context) {
    av_close_input_file(avformat_context);
  }
//  free_fifo();
  if(rgba_picture) free_picture(rgba_picture);
  if(deinterlace_buffer) free(deinterlace_buffer);
}
示例#3
0
文件: mpegvideo.c 项目: 90robin/MyGit
void MPV_common_end(MpegEncContext *s)
{
	int i;

	av_freep(&s->cbp_table);

	if(s->picture)
	{
		for(i=0; i<MAX_PICTURE_COUNT; i++)
		{
			free_picture(s, &s->picture[i]);
		}
	}

	av_freep(&s->picture);

	avcodec_default_free_buffers(s->avctx);
	s->context_initialized = 0;
	s->last_picture_ptr= NULL;
	s->next_picture_ptr= NULL;
	s->current_picture_ptr= NULL;
}
示例#4
0
void VideoLayer::free_fifo() {
	for ( int s = 0; s < frame_fifo.length; s++) {
		free_picture(frame_fifo.picture[s]);
	}
}