obs-data.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. #pragma once
  15. #include "util/darray.h"
  16. #include "util/threading.h"
  17. #include "graphics/graphics.h"
  18. #include "media-io/media-io.h"
  19. #include "media-io/video-io.h"
  20. #include "media-io/audio-io.h"
  21. #include "obs.h"
  22. #include "obs-module.h"
  23. #include "obs-source.h"
  24. #include "obs-output.h"
  25. /*#include "obs-service.h"*/
  26. #define NUM_TEXTURES 2
  27. struct obs_display {
  28. swapchain_t swap; /* can be NULL if just sound */
  29. obs_source_t source;
  30. /* TODO: sound output target */
  31. };
  32. struct obs_data {
  33. DARRAY(struct obs_module) modules;
  34. DARRAY(struct source_info) input_types;
  35. DARRAY(struct source_info) filter_types;
  36. DARRAY(struct source_info) transition_types;
  37. DARRAY(struct output_info) output_types;
  38. /*DARRAY(struct service_info) service_types;*/
  39. DARRAY(struct obs_display*) displays;
  40. DARRAY(struct obs_source*) sources;
  41. /* graphics */
  42. graphics_t graphics;
  43. stagesurf_t copy_surfaces[NUM_TEXTURES];
  44. bool textures_copied[NUM_TEXTURES];
  45. bool copy_mapped;
  46. int cur_texture;
  47. /* TODO: sound output stuff */
  48. /* media */
  49. media_t media;
  50. video_t video;
  51. audio_t audio;
  52. uint32_t output_width;
  53. uint32_t output_height;
  54. /* threading */
  55. pthread_t video_thread;
  56. pthread_mutex_t source_mutex;
  57. bool thread_initialized;
  58. obs_source_t primary_source;
  59. };
  60. extern struct obs_data *obs;
  61. extern void *obs_video_thread(void *param);