obs-data.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /******************************************************************************
  2. Copyright (C) 2013 by Hugh Bailey <[email protected]>
  3. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation, either version 3 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. ******************************************************************************/
  14. #ifndef OBS_DATA_H
  15. #define OBS_DATA_H
  16. #include "util/darray.h"
  17. #include "util/threading.h"
  18. #include "graphics/graphics.h"
  19. #include "media-io/media-io.h"
  20. #include "media-io/video-io.h"
  21. #include "media-io/audio-io.h"
  22. #include "obs.h"
  23. #include "obs-module.h"
  24. #include "obs-source.h"
  25. #include "obs-output.h"
  26. /*#include "obs-service.h"*/
  27. #define NUM_TEXTURES 2
  28. struct obs_display {
  29. swapchain_t swap; /* can be NULL if just sound */
  30. source_t source;
  31. /* TODO: sound output target */
  32. };
  33. struct obs_data {
  34. DARRAY(struct obs_module) modules;
  35. DARRAY(struct source_info) input_types;
  36. DARRAY(struct source_info) filter_types;
  37. DARRAY(struct source_info) transition_types;
  38. DARRAY(struct output_info) output_types;
  39. /*DARRAY(struct service_info) service_types;*/
  40. DARRAY(struct obs_display*) displays;
  41. DARRAY(struct obs_source*) sources;
  42. /* graphics */
  43. graphics_t graphics;
  44. stagesurf_t copy_surfaces[NUM_TEXTURES];
  45. bool textures_copied[NUM_TEXTURES];
  46. bool copy_mapped;
  47. int cur_texture;
  48. /* TODO: sound output stuff */
  49. /* media */
  50. media_t media;
  51. video_t video;
  52. audio_t audio;
  53. uint32_t output_width;
  54. uint32_t output_height;
  55. /* threading */
  56. pthread_t video_thread;
  57. pthread_mutex_t source_mutex;
  58. bool thread_initialized;
  59. source_t primary_source;
  60. };
  61. extern void *obs_video_thread(void *param);
  62. #endif