Change response sources API

This commit is contained in:
Alexey Khit
2023-09-01 22:27:33 +03:00
parent 22787b979d
commit 0621b82aff
14 changed files with 29 additions and 29 deletions
+1 -1
View File
@@ -79,7 +79,7 @@ func initDevices() {
audios = append(audios, name)
}
streams = append(streams, api.Source{
streams = append(streams, &api.Source{
Name: name, URL: "ffmpeg:device?" + kind + "=" + name,
})
}
+2 -2
View File
@@ -70,7 +70,7 @@ func initDevices() {
m := re.FindAllStringSubmatch(string(b), -1)
for _, i := range m {
size, _, _ := strings.Cut(i[4], " ")
stream := api.Source{
stream := &api.Source{
Name: i[3] + " | " + i[4],
URL: "ffmpeg:device?video=" + name + "&input_format=" + i[2] + "&video_size=" + size,
}
@@ -86,7 +86,7 @@ func initDevices() {
err = exec.Command(Bin, "-f", "alsa", "-i", "default", "-t", "1", "-f", "null", "-").Run()
if err == nil {
stream := api.Source{
stream := &api.Source{
Name: "ALSA default",
URL: "ffmpeg:device?audio=default&channels=1&sample_rate=16000&#audio=opus",
}
+1 -1
View File
@@ -80,7 +80,7 @@ func initDevices() {
name := m[1]
kind := m[2]
stream := api.Source{
stream := &api.Source{
Name: name, URL: "ffmpeg:device?" + kind + "=" + name,
}
+1 -1
View File
@@ -40,7 +40,7 @@ func GetInput(src string) (string, error) {
var Bin string
var videos, audios []string
var streams []api.Source
var streams []*api.Source
var runonce sync.Once
func apiDevices(w http.ResponseWriter, r *http.Request) {