2013-09-30 19:37:13 -07:00
|
|
|
/******************************************************************************
|
|
|
|
Copyright (C) 2013 by Hugh Bailey <obs.jim@gmail.com>
|
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
******************************************************************************/
|
|
|
|
|
2013-10-14 04:21:15 -07:00
|
|
|
#pragma once
|
2013-09-30 19:37:13 -07:00
|
|
|
|
|
|
|
#include "util/darray.h"
|
|
|
|
#include "util/threading.h"
|
|
|
|
|
|
|
|
#include "graphics/graphics.h"
|
|
|
|
|
|
|
|
#include "media-io/media-io.h"
|
|
|
|
#include "media-io/video-io.h"
|
|
|
|
#include "media-io/audio-io.h"
|
|
|
|
|
|
|
|
#include "obs.h"
|
|
|
|
#include "obs-module.h"
|
|
|
|
#include "obs-source.h"
|
|
|
|
#include "obs-output.h"
|
|
|
|
/*#include "obs-service.h"*/
|
|
|
|
|
|
|
|
#define NUM_TEXTURES 2
|
|
|
|
|
|
|
|
struct obs_display {
|
2013-10-14 12:37:52 -07:00
|
|
|
swapchain_t swap; /* can be NULL if just sound */
|
|
|
|
obs_source_t source;
|
2013-09-30 19:37:13 -07:00
|
|
|
/* TODO: sound output target */
|
|
|
|
};
|
|
|
|
|
|
|
|
struct obs_data {
|
|
|
|
DARRAY(struct obs_module) modules;
|
|
|
|
|
|
|
|
DARRAY(struct source_info) input_types;
|
|
|
|
DARRAY(struct source_info) filter_types;
|
|
|
|
DARRAY(struct source_info) transition_types;
|
|
|
|
DARRAY(struct output_info) output_types;
|
|
|
|
/*DARRAY(struct service_info) service_types;*/
|
|
|
|
|
|
|
|
DARRAY(struct obs_display*) displays;
|
|
|
|
DARRAY(struct obs_source*) sources;
|
|
|
|
|
|
|
|
/* graphics */
|
|
|
|
graphics_t graphics;
|
|
|
|
stagesurf_t copy_surfaces[NUM_TEXTURES];
|
2013-10-25 10:25:28 -07:00
|
|
|
effect_t default_effect;
|
2013-09-30 19:37:13 -07:00
|
|
|
bool textures_copied[NUM_TEXTURES];
|
|
|
|
bool copy_mapped;
|
|
|
|
int cur_texture;
|
|
|
|
|
|
|
|
/* TODO: sound output stuff */
|
|
|
|
|
|
|
|
/* media */
|
2013-10-18 20:25:13 -07:00
|
|
|
media_t media;
|
|
|
|
video_t video;
|
|
|
|
audio_t audio;
|
2013-09-30 19:37:13 -07:00
|
|
|
|
|
|
|
uint32_t output_width;
|
|
|
|
uint32_t output_height;
|
|
|
|
|
|
|
|
/* threading */
|
|
|
|
pthread_t video_thread;
|
|
|
|
bool thread_initialized;
|
2013-10-18 20:25:13 -07:00
|
|
|
pthread_mutex_t source_list_mutex;
|
|
|
|
pthread_mutex_t display_list_mutex;
|
2013-09-30 19:37:13 -07:00
|
|
|
|
2013-10-14 12:37:52 -07:00
|
|
|
obs_source_t primary_source;
|
2013-09-30 19:37:13 -07:00
|
|
|
};
|
|
|
|
|
2013-10-14 12:37:52 -07:00
|
|
|
extern struct obs_data *obs;
|
|
|
|
|
2013-09-30 19:37:13 -07:00
|
|
|
extern void *obs_video_thread(void *param);
|