Beispiel #1
0
static void obs_source_destroy(obs_source_t source)
{
	size_t i;

	if (source->filter_parent)
		obs_source_filter_remove(source->filter_parent, source);

	for (i = 0; i < source->filters.num; i++)
		obs_source_release(source->filters.array[i]);

	for (i = 0; i < source->audio_wait_buffer.num; i++)
		audiobuf_free(source->audio_wait_buffer.array+i);
	for (i = 0; i < source->video_frames.num; i++)
		source_frame_destroy(source->video_frames.array[i]);

	gs_entercontext(obs->video.graphics);
	texture_destroy(source->output_texture);
	gs_leavecontext();

	if (source->data)
		source->callbacks.destroy(source->data);

	bfree(source->audio_data.data);
	audio_line_destroy(source->audio_line);
	audio_resampler_destroy(source->resampler);

	da_free(source->video_frames);
	da_free(source->audio_wait_buffer);
	da_free(source->filters);
	pthread_mutex_destroy(&source->filter_mutex);
	pthread_mutex_destroy(&source->audio_mutex);
	pthread_mutex_destroy(&source->video_mutex);
	dstr_free(&source->settings);
	bfree(source);
}
Beispiel #2
0
void obs_source_destroy(struct obs_source *source)
{
	size_t i;

	if (!source)
		return;

	obs_context_data_remove(&source->context);

	obs_source_dosignal(source, "source_destroy", "destroy");

	if (source->context.data)
		source->info.destroy(source->context.data);

	if (source->filter_parent)
		obs_source_filter_remove(source->filter_parent, source);

	for (i = 0; i < source->filters.num; i++)
		obs_source_release(source->filters.array[i]);

	for (i = 0; i < source->video_frames.num; i++)
		source_frame_destroy(source->video_frames.array[i]);

	gs_entercontext(obs->video.graphics);
	texrender_destroy(source->async_convert_texrender);
	texture_destroy(source->async_texture);
	gs_leavecontext();

	for (i = 0; i < MAX_AV_PLANES; i++)
		bfree(source->audio_data.data[i]);

	audio_line_destroy(source->audio_line);
	audio_resampler_destroy(source->resampler);

	texrender_destroy(source->filter_texrender);
	da_free(source->video_frames);
	da_free(source->filters);
	pthread_mutex_destroy(&source->filter_mutex);
	pthread_mutex_destroy(&source->audio_mutex);
	pthread_mutex_destroy(&source->video_mutex);
	obs_context_data_free(&source->context);
	bfree(source);
}
Beispiel #3
0
static void obs_source_destroy(obs_source_t source)
{
	size_t i;

	obs_source_dosignal(source, "source-destroy");

	if (source->filter_parent)
		obs_source_filter_remove(source->filter_parent, source);

	for (i = 0; i < source->filters.num; i++)
		obs_source_release(source->filters.array[i]);

	for (i = 0; i < source->video_frames.num; i++)
		source_frame_destroy(source->video_frames.array[i]);

	gs_entercontext(obs->video.graphics);
	texture_destroy(source->output_texture);
	gs_leavecontext();

	if (source->data)
		source->callbacks.destroy(source->data);

	bfree(source->audio_data.data);
	audio_line_destroy(source->audio_line);
	audio_resampler_destroy(source->resampler);

	proc_handler_destroy(source->procs);
	signal_handler_destroy(source->signals);

	da_free(source->video_frames);
	da_free(source->filters);
	pthread_mutex_destroy(&source->filter_mutex);
	pthread_mutex_destroy(&source->audio_mutex);
	pthread_mutex_destroy(&source->video_mutex);
	obs_data_release(source->settings);
	bfree(source->name);
	bfree(source);
}