Open Broadcaster Software
Free, open source software for live streaming and recording
obs-source.h File Reference

header for modules implementing sources. More...

Go to the source code of this file.

Data Structures

struct  obs_source_audio_mix
 
struct  obs_source_info
 

Macros

#define obs_register_source(info)   obs_register_source_s(info, sizeof(struct obs_source_info))
 
Source output flags

These flags determine what type of data the source outputs and expects.

#define OBS_SOURCE_VIDEO   (1 << 0)
 
#define OBS_SOURCE_AUDIO   (1 << 1)
 
#define OBS_SOURCE_ASYNC   (1 << 2)
 
#define OBS_SOURCE_ASYNC_VIDEO   (OBS_SOURCE_ASYNC | OBS_SOURCE_VIDEO)
 
#define OBS_SOURCE_CUSTOM_DRAW   (1 << 3)
 
#define OBS_SOURCE_INTERACTION   (1 << 5)
 
#define OBS_SOURCE_COMPOSITE   (1 << 6)
 
#define OBS_SOURCE_DO_NOT_DUPLICATE   (1 << 7)
 
#define OBS_SOURCE_DEPRECATED   (1 << 8)
 
#define OBS_SOURCE_DO_NOT_SELF_MONITOR   (1 << 9)
 
#define OBS_SOURCE_CAP_DISABLED   (1 << 10)
 
#define OBS_SOURCE_CAP_OBSOLETE   OBS_SOURCE_CAP_DISABLED
 
#define OBS_SOURCE_MONITOR_BY_DEFAULT   (1 << 11)
 
#define OBS_SOURCE_SUBMIX   (1 << 12)
 
#define OBS_SOURCE_CONTROLLABLE_MEDIA   (1 << 13)
 

Typedefs

typedef void(* obs_source_enum_proc_t) (obs_source_t *parent, obs_source_t *child, void *param)
 

Enumerations

enum  obs_source_type { OBS_SOURCE_TYPE_INPUT, OBS_SOURCE_TYPE_FILTER, OBS_SOURCE_TYPE_TRANSITION, OBS_SOURCE_TYPE_SCENE }
 
enum  obs_balance_type { OBS_BALANCE_TYPE_SINE_LAW, OBS_BALANCE_TYPE_SQUARE_LAW, OBS_BALANCE_TYPE_LINEAR }
 
enum  obs_icon_type {
  OBS_ICON_TYPE_UNKNOWN, OBS_ICON_TYPE_IMAGE, OBS_ICON_TYPE_COLOR, OBS_ICON_TYPE_SLIDESHOW,
  OBS_ICON_TYPE_AUDIO_INPUT, OBS_ICON_TYPE_AUDIO_OUTPUT, OBS_ICON_TYPE_DESKTOP_CAPTURE, OBS_ICON_TYPE_WINDOW_CAPTURE,
  OBS_ICON_TYPE_GAME_CAPTURE, OBS_ICON_TYPE_CAMERA, OBS_ICON_TYPE_TEXT, OBS_ICON_TYPE_MEDIA,
  OBS_ICON_TYPE_BROWSER, OBS_ICON_TYPE_CUSTOM
}
 
enum  obs_media_state {
  OBS_MEDIA_STATE_NONE, OBS_MEDIA_STATE_PLAYING, OBS_MEDIA_STATE_OPENING, OBS_MEDIA_STATE_BUFFERING,
  OBS_MEDIA_STATE_PAUSED, OBS_MEDIA_STATE_STOPPED, OBS_MEDIA_STATE_ENDED, OBS_MEDIA_STATE_ERROR
}
 

Functions

EXPORT void obs_register_source_s (const struct obs_source_info *info, size_t size)
 

Detailed Description

header for modules implementing sources.

Sources are modules that either feed data to libobs or modify it.

Macro Definition Documentation

◆ obs_register_source

#define obs_register_source (   info)    obs_register_source_s(info, sizeof(struct obs_source_info))

Registers a source definition to the current obs context. This should be used in obs_module_load.

Parameters
infoPointer to the source definition structure

◆ OBS_SOURCE_ASYNC

#define OBS_SOURCE_ASYNC   (1 << 2)

Async video flag (use OBS_SOURCE_ASYNC_VIDEO)

◆ OBS_SOURCE_ASYNC_VIDEO

#define OBS_SOURCE_ASYNC_VIDEO   (OBS_SOURCE_ASYNC | OBS_SOURCE_VIDEO)

Source passes raw video data via RAM.

Use the obs_source_output_video function to pass raw video data, which will be automatically uploaded at the specified timestamp.

If this flag is specified, it is not necessary to include the video_render callback. However, if you wish to use that function as well, you must call obs_source_getframe to get the current frame data, and obs_source_releaseframe to release the data when complete.

◆ OBS_SOURCE_AUDIO

#define OBS_SOURCE_AUDIO   (1 << 1)

Source has audio.

Use the obs_source_output_audio function to pass raw audio data, which will be automatically converted and uploaded. If used with SOURCE_ASYNC_VIDEO, audio will automatically be synced up to the video output.

◆ OBS_SOURCE_CAP_DISABLED

#define OBS_SOURCE_CAP_DISABLED   (1 << 10)

Source type is currently disabled and should not be shown to the user

◆ OBS_SOURCE_CAP_OBSOLETE

#define OBS_SOURCE_CAP_OBSOLETE   OBS_SOURCE_CAP_DISABLED

Source type is obsolete (has been updated with new defaults/properties/etc)

◆ OBS_SOURCE_COMPOSITE

#define OBS_SOURCE_COMPOSITE   (1 << 6)

Source composites sub-sources

When used specifies that the source composites one or more sub-sources. Sources that render sub-sources must implement the audio_render callback in order to perform custom mixing of sub-sources.

This capability flag is always set for transitions.

◆ OBS_SOURCE_CONTROLLABLE_MEDIA

#define OBS_SOURCE_CONTROLLABLE_MEDIA   (1 << 13)

Source type can be controlled by media controls

◆ OBS_SOURCE_CUSTOM_DRAW

#define OBS_SOURCE_CUSTOM_DRAW   (1 << 3)

Source uses custom drawing, rather than a default effect.

If this flag is specified, the video_render callback will pass a NULL effect, and effect-based filters will not use direct rendering.

◆ OBS_SOURCE_DEPRECATED

#define OBS_SOURCE_DEPRECATED   (1 << 8)

Source is deprecated and should not be used

◆ OBS_SOURCE_DO_NOT_DUPLICATE

#define OBS_SOURCE_DO_NOT_DUPLICATE   (1 << 7)

Source should not be fully duplicated

When this is used, specifies that the source should not be fully duplicated, and should prefer to duplicate via holding references rather than full duplication.

◆ OBS_SOURCE_DO_NOT_SELF_MONITOR

#define OBS_SOURCE_DO_NOT_SELF_MONITOR   (1 << 9)

Source cannot have its audio monitored

Specifies that this source may cause a feedback loop if audio is monitored with a device selected as desktop audio.

This is used primarily with desktop audio capture sources.

◆ OBS_SOURCE_INTERACTION

#define OBS_SOURCE_INTERACTION   (1 << 5)

Source supports interaction.

When this is used, the source will receive interaction events if they provide the necessary callbacks in the source definition structure.

◆ OBS_SOURCE_MONITOR_BY_DEFAULT

#define OBS_SOURCE_MONITOR_BY_DEFAULT   (1 << 11)

Source should enable monitoring by default. Monitoring should be set by the frontend if this flag is set.

◆ OBS_SOURCE_SUBMIX

#define OBS_SOURCE_SUBMIX   (1 << 12)

Used internally for audio submixing

◆ OBS_SOURCE_VIDEO

#define OBS_SOURCE_VIDEO   (1 << 0)

Source has video.

Unless SOURCE_ASYNC_VIDEO is specified, the source must include the video_render callback in the source definition structure.

Typedef Documentation

◆ obs_source_enum_proc_t

typedef void(* obs_source_enum_proc_t) (obs_source_t *parent, obs_source_t *child, void *param)

Enumeration Type Documentation

◆ obs_balance_type

Enumerator
OBS_BALANCE_TYPE_SINE_LAW 
OBS_BALANCE_TYPE_SQUARE_LAW 
OBS_BALANCE_TYPE_LINEAR 

◆ obs_icon_type

Enumerator
OBS_ICON_TYPE_UNKNOWN 
OBS_ICON_TYPE_IMAGE 
OBS_ICON_TYPE_COLOR 
OBS_ICON_TYPE_SLIDESHOW 
OBS_ICON_TYPE_AUDIO_INPUT 
OBS_ICON_TYPE_AUDIO_OUTPUT 
OBS_ICON_TYPE_DESKTOP_CAPTURE 
OBS_ICON_TYPE_WINDOW_CAPTURE 
OBS_ICON_TYPE_GAME_CAPTURE 
OBS_ICON_TYPE_CAMERA 
OBS_ICON_TYPE_TEXT 
OBS_ICON_TYPE_MEDIA 
OBS_ICON_TYPE_BROWSER 
OBS_ICON_TYPE_CUSTOM 

◆ obs_media_state

Enumerator
OBS_MEDIA_STATE_NONE 
OBS_MEDIA_STATE_PLAYING 
OBS_MEDIA_STATE_OPENING 
OBS_MEDIA_STATE_BUFFERING 
OBS_MEDIA_STATE_PAUSED 
OBS_MEDIA_STATE_STOPPED 
OBS_MEDIA_STATE_ENDED 
OBS_MEDIA_STATE_ERROR 

◆ obs_source_type

Enumerator
OBS_SOURCE_TYPE_INPUT 
OBS_SOURCE_TYPE_FILTER 
OBS_SOURCE_TYPE_TRANSITION 
OBS_SOURCE_TYPE_SCENE 

Function Documentation

◆ obs_register_source_s()

EXPORT void obs_register_source_s ( const struct obs_source_info info,
size_t  size 
)