GSStreamServer
@objc
public protocol GSStreamServer
StreamServer peripheral interface. This peripheral allows streaming of live camera video and replay of video files stored in drone memory. Those methods should no be used from swift
-
Tells whether streaming is enabled.
When streaming gets enabled, currently suspended stream will be resumed. When streaming is enabled, streams can be started.
When streaming gets disabled, currently started stream gets suspended, in case it supports suspended state (CameraLive), or stopped otherwise (MediaReplay). When streaming is disabled, no stream can be started.
Declaration
Swift
var enabled: Bool { get set }
-
Provides access to the drone video live stream. There is only one live stream instance for each CameraLive.Source source, which is shared among all open references. Closing the returned reference does NOT automatically stops the referenced camera live stream.
Declaration
Swift
func live(source: CameraLiveSource, observer: @escaping (_ stream: CameraLive?) -> Void) -> GSCameraLiveRef
Parameters
source
live source to stream
observer
notified when the stream state changes
Return Value
a reference to the camera live stream interface
-
Creates a new replay stream for a media resource. Every successful call to this method creates a new replay stream instance for the given media resource, that must be disposed by closing the returned reference once that stream is not needed. Closing the returned reference automatically stops the referenced media replay stream.
Declaration
Swift
func replay(source: MediaReplaySource, observer: @escaping (_ stream: MediaReplay?) -> Void) -> GSMediaReplayRef?
Parameters
resource
media resource to stream
observer
notified when the stream state changes
Return Value
a reference to the camera live stream interface, or ‘nil’ in case the provided resource cannot be streamed