typedefs

package
v0.8.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 13, 2022 License: Apache-2.0 Imports: 0 Imported by: 8

Documentation

Overview

Package typedefs defines both generated structs as specified under the [Typedefs section](https://github.com/Palakis/obs-websocket/blob/4.x-current/docs/generated/protocol.md#typedefs) of the protocol, and also manually defined "common" structs used across several events and requests.

For example, `Crop` is used across:

request - GetSceneItemProperties
request - SetSceneItemProperties
typedef - SceneItemTransform

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bounds added in v0.6.0

type Bounds struct {
	// Alignment of the bounding box.
	Alignment int `json:"alignment,omitempty"`

	// Type of bounding box. Can be "OBS_BOUNDS_STRETCH",
	// "OBS_BOUNDS_SCALE_INNER", "OBS_BOUNDS_SCALE_OUTER",
	// "OBS_BOUNDS_SCALE_TO_WIDTH", "OBS_BOUNDS_SCALE_TO_HEIGHT",
	// "OBS_BOUNDS_MAX_ONLY" or "OBS_BOUNDS_NONE".
	Type string `json:"type,omitempty"`

	// Width of the bounding box.
	X float64 `json:"x,omitempty"`

	// Height of the bounding box.
	Y float64 `json:"y,omitempty"`
}

Bounds defines a bounding box.

type Crop added in v0.6.0

type Crop struct {
	// The number of pixels cropped off the bottom of the object before
	// scaling.
	Bottom int `json:"bottom,omitempty"`

	// The number of pixels cropped off the left of the object before
	// scaling.
	Left int `json:"left,omitempty"`

	// The number of pixels cropped off the right of the object before
	// scaling.
	Right int `json:"right,omitempty"`

	// The number of pixels cropped off the top of the object before
	// scaling.
	Top int `json:"top,omitempty"`
}

Crop defines a crop specification.

type Filter added in v0.6.0

type Filter struct {
	// Filter status (enabled or not)
	Enabled bool `json:"enabled,omitempty"`

	// Filter name
	Name string `json:"name,omitempty"`

	// Filter settings
	Settings map[string]interface{} `json:"settings,omitempty"`

	// Filter type
	Type string `json:"type,omitempty"`
}

Filter specifies a filter.

type Flags added in v0.6.0

type Flags struct {
	// Output uses audio
	Audio bool `json:"audio,omitempty"`

	// Output is encoded
	Encoded bool `json:"encoded,omitempty"`

	// Output uses several audio tracks
	MultiTrack bool `json:"multiTrack,omitempty"`

	// Raw flags value
	RawValue int `json:"rawValue,omitempty"`

	// Output uses a service
	Service bool `json:"service,omitempty"`

	// Output uses video
	Video bool `json:"video,omitempty"`
}

type Font added in v0.6.0

type Font struct {
	// Font face.
	Face string `json:"face,omitempty"`

	// Font text styling flag. `Bold=1, Italic=2, Bold Italic=3,
	// Underline=5, Strikeout=8`
	Flags int `json:"flags,omitempty"`

	// Font text size.
	Size int `json:"size,omitempty"`

	// Font Style (unknown function).
	Style string `json:"style,omitempty"`
}

Font specifies the font for Text-specific requests.

type Item added in v0.6.0

type Item struct {
	Id int `json:"id,omitempty"`

	Name string `json:"name,omitempty"`
}

Item represents an item among several requests in the scene items category.

type OBSStats

type OBSStats struct {
	// Average frame render time (in milliseconds)
	AverageFrameTime float64 `json:"average-frame-time,omitempty"`

	// Current CPU usage (percentage)
	CpuUsage float64 `json:"cpu-usage,omitempty"`

	// Current framerate.
	Fps float64 `json:"fps,omitempty"`

	// Free recording disk space (in megabytes)
	FreeDiskSpace float64 `json:"free-disk-space,omitempty"`

	// Current RAM usage (in megabytes)
	MemoryUsage float64 `json:"memory-usage,omitempty"`

	// Number of frames skipped due to encoding lag
	OutputSkippedFrames int `json:"output-skipped-frames,omitempty"`

	// Number of frames outputted
	OutputTotalFrames int `json:"output-total-frames,omitempty"`

	// Number of frames missed due to rendering lag
	RenderMissedFrames int `json:"render-missed-frames,omitempty"`

	// Number of frames rendered
	RenderTotalFrames int `json:"render-total-frames,omitempty"`
}

OBSStats represents the complex type for OBSStats.

type Output added in v0.3.0

type Output struct {
	// Output status (active or not)
	Active bool `json:"active,omitempty"`

	// Output congestion
	Congestion float64 `json:"congestion,omitempty"`

	// Number of frames dropped
	DroppedFrames int `json:"droppedFrames,omitempty"`

	Flags *Flags `json:"flags,omitempty"`

	// Video output height
	Height int `json:"height,omitempty"`

	// Output name
	Name string `json:"name,omitempty"`

	// Output reconnection status (reconnecting or not)
	Reconnecting bool `json:"reconnecting,omitempty"`

	// Output settings
	Settings map[string]interface{} `json:"settings,omitempty"`

	// Total bytes sent
	TotalBytes int `json:"totalBytes,omitempty"`

	// Number of frames sent
	TotalFrames int `json:"totalFrames,omitempty"`

	// Output type/kind
	Type string `json:"type,omitempty"`

	// Video output width
	Width int `json:"width,omitempty"`
}

Output represents the complex type for Output.

type Position added in v0.6.0

type Position struct {
	// The point on the object that the item is manipulated from. The sum of
	// 1=Left or 2=Right, and 4=Top or 8=Bottom, or omit to center on that
	// axis.
	Alignment int `json:"alignment,omitempty"`

	// The x position of the obejct from the left.
	X float64 `json:"x,omitempty"`

	// The y position of the object from the top.
	Y float64 `json:"y,omitempty"`
}

Position defines a position specification.

type Scale added in v0.6.0

type Scale struct {
	// The scale filter of the source. Can be "OBS_SCALE_DISABLE",
	// "OBS_SCALE_POINT", "OBS_SCALE_BICUBIC", "OBS_SCALE_BILINEAR",
	// "OBS_SCALE_LANCZOS" or "OBS_SCALE_AREA".
	Filter string `json:"filter,omitempty"`

	// The x-scale factor of the object.
	X float64 `json:"x,omitempty"`

	// The y-scale factor of the object.
	Y float64 `json:"y,omitempty"`
}

Scale defines a scale specification.

type Scene

type Scene struct {
	// Name of the currently active scene.
	Name string `json:"name,omitempty"`

	// Ordered list of the current scene's source items.
	Sources []SceneItem `json:"sources,omitempty"`
}

Scene represents the complex type for Scene.

type SceneItem

type SceneItem struct {
	// The point on the source that the item is manipulated from. The sum of 1=Left or 2=Right, and 4=Top or 8=Bottom,
	// or omit to center on that axis.
	Alignment float64 `json:"alignment,omitempty"`

	Cx float64 `json:"cx,omitempty"`

	Cy float64 `json:"cy,omitempty"`

	// List of children (if this item is a group)
	GroupChildren []SceneItem `json:"groupChildren,omitempty"`

	// Scene item ID
	Id int `json:"id,omitempty"`

	// Whether or not this Scene Item is locked and can't be moved around
	Locked bool `json:"locked,omitempty"`

	// Whether or not this Scene Item is muted.
	Muted bool `json:"muted,omitempty"`

	// The name of this Scene Item.
	Name string `json:"name,omitempty"`

	// Name of the item's parent (if this item belongs to a group)
	ParentGroupName string `json:"parentGroupName,omitempty"`

	// Whether or not this Scene Item is set to "visible".
	Render bool `json:"render,omitempty"`

	SourceCx float64 `json:"source_cx,omitempty"`

	SourceCy float64 `json:"source_cy,omitempty"`

	// Source type. Value is one of the following: "input", "filter", "transition", "scene" or "unknown"
	Type string `json:"type,omitempty"`

	Volume float64 `json:"volume,omitempty"`

	X float64 `json:"x,omitempty"`

	Y float64 `json:"y,omitempty"`
}

SceneItem represents the complex type for SceneItem.

type SceneItemTransform

type SceneItemTransform struct {
	// The bounding box of the object (source, scene item, etc).
	Bounds *Bounds `json:"bounds,omitempty"`

	// The crop specification for the object (source, scene item, etc).
	Crop *Crop `json:"crop,omitempty"`

	// List of children (if this item is a group)
	GroupChildren []SceneItemTransform `json:"groupChildren,omitempty"`

	// Scene item height (base source height multiplied by the vertical scaling factor)
	Height float64 `json:"height,omitempty"`

	// If the scene item is locked in position.
	Locked bool `json:"locked,omitempty"`

	// Name of the item's parent (if this item belongs to a group)
	ParentGroupName string `json:"parentGroupName,omitempty"`

	// The position of the object (source, scene item, etc).
	Position *Position `json:"position,omitempty"`

	// The clockwise rotation of the scene item in degrees around the point of alignment.
	Rotation float64 `json:"rotation,omitempty"`

	// The scaling specification for the object (source, scene item, etc).
	Scale *Scale `json:"scale,omitempty"`

	// Base source (without scaling) of the source
	SourceHeight int `json:"sourceHeight,omitempty"`

	// Base width (without scaling) of the source
	SourceWidth int `json:"sourceWidth,omitempty"`

	// If the scene item is visible.
	Visible bool `json:"visible,omitempty"`

	// Scene item width (base source width multiplied by the horizontal scaling factor)
	Width float64 `json:"width,omitempty"`
}

SceneItemTransform represents the complex type for SceneItemTransform.

type ScenesCollection added in v0.5.0

type ScenesCollection struct {
	// Name of the scene collection
	ScName string `json:"sc-name,omitempty"`
}

ScenesCollection represents the complex type for ScenesCollection.

type StreamSettings added in v0.6.0

type StreamSettings struct {
	// The publish key of the stream.
	Key string `json:"key,omitempty"`

	// The password to use when accessing the streaming server. Only
	// relevant if `use_auth` is `true`.
	Password string `json:"password,omitempty"`

	// The publish URL.
	Server string `json:"server,omitempty"`

	// Indicates whether authentication should be used when connecting to
	// the streaming server.
	UseAuth *bool `json:"use_auth,omitempty"`

	// The username to use when accessing the streaming server. Only
	// relevant if `use_auth` is `true`.
	Username string `json:"username,omitempty"`
}

StreamSettings specifies the stream settings.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL