Open Broadcaster Software
Free, open source software for live streaming and recording
obs-scene.h
Go to the documentation of this file.
1 /******************************************************************************
2  Copyright (C) 2013 by Hugh Bailey <obs.jim@gmail.com>
3 
4  This program is free software: you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation, either version 2 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program. If not, see <http://www.gnu.org/licenses/>.
16 ******************************************************************************/
17 
18 #pragma once
19 
20 #include "obs.h"
21 #include "obs-internal.h"
22 #include "graphics/matrix4.h"
23 
24 /* how obs scene! */
25 
26 struct item_action {
27  bool visible;
28  uint64_t timestamp;
29 };
30 
32  volatile long ref;
33  volatile bool removed;
34 
35  bool is_group;
38 
39  int64_t id;
40 
41  struct obs_scene *parent;
42  struct obs_source *source;
43  volatile long active_refs;
44  volatile long defer_update;
45  volatile long defer_group_resize;
47  bool visible;
48  bool selected;
49  bool locked;
50 
52  struct obs_sceneitem_crop crop;
53 
54  struct vec2 pos;
55  struct vec2 scale;
56  float rot;
57  uint32_t align;
58 
59  /* last width/height of the source, this is used to check whether
60  * the transform needs updating */
61  uint32_t last_width;
62  uint32_t last_height;
63 
64  struct vec2 output_scale;
66 
67  struct matrix4 box_transform;
68  struct vec2 box_scale;
69  struct matrix4 draw_transform;
70 
72  uint32_t bounds_align;
73  struct vec2 bounds;
74 
76 
78 
79  pthread_mutex_t actions_mutex;
80  DARRAY(struct item_action) audio_actions;
81 
82  /* would do **prev_next, but not really great for reordering */
85 };
86 
87 struct obs_scene {
88  struct obs_source *source;
89 
90  bool is_group;
92  uint32_t cx;
93  uint32_t cy;
94 
95  int64_t id_counter;
96 
97  pthread_mutex_t video_mutex;
98  pthread_mutex_t audio_mutex;
100 };
obs_source
Definition: obs-internal.h:568
obs_scene_item::draw_transform
struct matrix4 draw_transform
Definition: obs-scene.h:69
obs_scene_item::defer_update
volatile long defer_update
Definition: obs-scene.h:44
obs_scene_item::item_render
gs_texrender_t * item_render
Definition: obs-scene.h:51
obs_scene_item::id
int64_t id
Definition: obs-scene.h:39
obs_scene_item::user_visible
bool user_visible
Definition: obs-scene.h:46
obs_scene
Definition: obs-scene.h:87
obs_scene_item::locked
bool locked
Definition: obs-scene.h:49
obs_scene_item::defer_group_resize
volatile long defer_group_resize
Definition: obs-scene.h:45
obs_scene_item::parent
struct obs_scene * parent
Definition: obs-scene.h:41
obs_scene_item
Definition: obs-scene.h:31
obs-internal.h
obs_scene::audio_mutex
pthread_mutex_t audio_mutex
Definition: obs-scene.h:98
obs_scale_type
obs_scale_type
Definition: obs.h:114
matrix4
Definition: matrix4.h:32
obs_scene_item::update_transform
bool update_transform
Definition: obs-scene.h:36
obs_data_t
struct obs_data obs_data_t
Definition: obs-data.h:42
obs_scene_item::selected
bool selected
Definition: obs-scene.h:48
obs_scene_item::is_group
bool is_group
Definition: obs-scene.h:35
obs_scene_item::removed
volatile bool removed
Definition: obs-scene.h:33
obs_hotkey_pair_id
size_t obs_hotkey_pair_id
Definition: obs-hotkey.h:25
matrix4.h
obs_scene_item::actions_mutex
pthread_mutex_t actions_mutex
Definition: obs-scene.h:79
obs_scene_item::pos
struct vec2 pos
Definition: obs-scene.h:54
obs_bounds_type
obs_bounds_type
Definition: obs.h:128
obs_scene::id_counter
int64_t id_counter
Definition: obs-scene.h:95
item_action::timestamp
uint64_t timestamp
Definition: obs-scene.h:28
obs_scene_item::align
uint32_t align
Definition: obs-scene.h:57
obs_scene_item::visible
bool visible
Definition: obs-scene.h:47
item_action::visible
bool visible
Definition: obs-scene.h:27
obs_scene::video_mutex
pthread_mutex_t video_mutex
Definition: obs-scene.h:97
obs_scene_item::source
struct obs_source * source
Definition: obs-scene.h:42
obs_scene::cx
uint32_t cx
Definition: obs-scene.h:92
obs_scene_item::toggle_visibility
obs_hotkey_pair_id toggle_visibility
Definition: obs-scene.h:75
obs_scene_item::scale_filter
enum obs_scale_type scale_filter
Definition: obs-scene.h:65
obs_scene_item::bounds_type
enum obs_bounds_type bounds_type
Definition: obs-scene.h:71
obs_scene_item::output_scale
struct vec2 output_scale
Definition: obs-scene.h:64
obs_scene::is_group
bool is_group
Definition: obs-scene.h:90
obs_scene::first_item
struct obs_scene_item * first_item
Definition: obs-scene.h:99
vec2
Definition: vec2.h:27
obs_scene::cy
uint32_t cy
Definition: obs-scene.h:93
obs_scene_item::rot
float rot
Definition: obs-scene.h:56
obs_scene_item::last_height
uint32_t last_height
Definition: obs-scene.h:62
obs_scene::source
struct obs_source * source
Definition: obs-scene.h:88
obs_scene_item::active_refs
volatile long active_refs
Definition: obs-scene.h:43
obs.h
obs_scene_item::update_group_resize
bool update_group_resize
Definition: obs-scene.h:37
obs_scene_item::next
struct obs_scene_item * next
Definition: obs-scene.h:84
obs_scene_item::box_scale
struct vec2 box_scale
Definition: obs-scene.h:68
obs_scene_item::ref
volatile long ref
Definition: obs-scene.h:32
obs_scene_item::box_transform
struct matrix4 box_transform
Definition: obs-scene.h:67
obs_scene_item::last_width
uint32_t last_width
Definition: obs-scene.h:61
obs_scene_item::scale
struct vec2 scale
Definition: obs-scene.h:55
obs_scene::custom_size
bool custom_size
Definition: obs-scene.h:91
gs_texrender_t
struct gs_texture_render gs_texrender_t
Definition: graphics.h:275
obs_scene_item::private_settings
obs_data_t * private_settings
Definition: obs-scene.h:77
obs_scene_item::prev
struct obs_scene_item * prev
Definition: obs-scene.h:83
obs_scene_item::DARRAY
DARRAY(struct item_action) audio_actions
bounds
Definition: bounds.h:39
obs_scene_item::crop
struct obs_sceneitem_crop crop
Definition: obs-scene.h:52
obs_sceneitem_crop
Definition: obs.h:1588
item_action
Definition: obs-scene.h:26
obs_scene_item::bounds_align
uint32_t bounds_align
Definition: obs-scene.h:72