-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
globals.go
62 lines (50 loc) · 2.5 KB
/
globals.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package streamer
import "fmt"
const (
// InputElementName is the name of the input element. Filesrc, souphttpsrc...
InputElementName ElementName = "fyne-input"
// DecodeElementName is the name of the decode element. Actually, a decodebin.
DecodeElementName ElementName = "fyne-decode"
// AppSinkElementName is the name of the appsink element. It's the mandatory element
// in the pipeline.
AppSinkElementName ElementName = "fyne-app"
// VideoRateElementName is the name of the videorate element. It's used to limit
// the framerate of the video. Place it just after the videoconvert element in the same
// branch of the appsink element
VideoRateElementName ElementName = "fyne-videorate"
// ImageEncoderElementName is the name of the image encoder element. It's used to
// encode the video frames to jpeg or png. It must be the last element in the pipeline before
// the appsink element.
// Generally, it's a "jpenenc". But it can be a "pngenc" if you want to encode the frames
// with alpha channel.
ImageEncoderElementName ElementName = "fyne-imageencoder"
// VolumeElementName is the name of the volume element.
// It's used to control the volume of the audio.
VolumeElementName ElementName = "fyne-volume"
// VideoBalanceElementName is the name of the videobalance element. It can be used to
// controle the brightness, contrast, hue and saturation of the video.
VideoBalanceElementName ElementName = "fyne-videobalance"
)
// TimeFormat is the format used to display the time in the video widget.
const TimeFormat = "15:04:05"
// ElementMap is a map of the element names used in the pipeline. This is used
// in templates to create the pipeline.
var ElementMap = map[string]ElementName{
"InputElementName": InputElementName,
"DecodeElementName": DecodeElementName,
"VideoRateElementName": VideoRateElementName,
"ImageEncoderElementName": ImageEncoderElementName,
"AppSinkElementName": AppSinkElementName,
"VolumeElementName": VolumeElementName,
"VideoBalanceElementName": VideoBalanceElementName,
}
// ElementName is the name of a GStreamer element. It's a string (alias).
type ElementName = string
var (
ErrNoPipeline = fmt.Errorf("no pipeline")
ErrPositionUnseekable = fmt.Errorf("could not get position")
ErrSeekUnsupported = fmt.Errorf("seeking is not supported")
ErrSeekFailed = fmt.Errorf("seek failed")
ErrFailedToGetFirstFrame = fmt.Errorf("failed to get the first frame")
ErrNoDuration = fmt.Errorf("couldn't get duration")
)