-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Co-authored-by: Abe Winter <[email protected]>
- Loading branch information
1 parent
8acdd7f
commit d65bbc4
Showing
6 changed files
with
91 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
//go:build !no_cgo || android | ||
|
||
// Package webstream provides controls for streaming from the web server. | ||
package webstream | ||
|
||
import ( | ||
"context" | ||
|
||
"go.viam.com/rdk/gostream" | ||
"go.viam.com/rdk/logging" | ||
) | ||
|
||
// streamVideoSource starts a stream from a video source with a throttled error handler. | ||
func streamVideoSource( | ||
ctx context.Context, | ||
source gostream.VideoSource, | ||
stream gostream.Stream, | ||
backoffOpts *BackoffTuningOptions, | ||
logger logging.Logger, | ||
) error { | ||
return gostream.StreamVideoSourceWithErrorHandler(ctx, source, stream, backoffOpts.getErrorThrottledHandler(logger, stream.Name()), logger) | ||
} | ||
|
||
// streamAudioSource starts a stream from an audio source with a throttled error handler. | ||
func streamAudioSource( | ||
ctx context.Context, | ||
source gostream.AudioSource, | ||
stream gostream.Stream, | ||
backoffOpts *BackoffTuningOptions, | ||
logger logging.Logger, | ||
) error { | ||
return gostream.StreamAudioSourceWithErrorHandler(ctx, source, stream, backoffOpts.getErrorThrottledHandler(logger, "audio"), logger) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
//go:build no_cgo && !android | ||
|
||
// Package webstream provides controls for streaming from the web server. | ||
package webstream | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/pkg/errors" | ||
"go.viam.com/rdk/gostream" | ||
"go.viam.com/rdk/logging" | ||
) | ||
|
||
// streamVideoSource starts a stream from a video source with a throttled error handler. | ||
func streamVideoSource( | ||
ctx context.Context, | ||
source gostream.VideoSource, | ||
stream gostream.Stream, | ||
backoffOpts *BackoffTuningOptions, | ||
logger logging.Logger, | ||
) error { | ||
return errors.New("not implemented for non-cgo") | ||
} | ||
|
||
// streamAudioSource starts a stream from an audio source with a throttled error handler. | ||
func streamAudioSource( | ||
ctx context.Context, | ||
source gostream.AudioSource, | ||
stream gostream.Stream, | ||
backoffOpts *BackoffTuningOptions, | ||
logger logging.Logger, | ||
) error { | ||
return errors.New("not implemented for non-cgo") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters