Esempio n. 1
0
func main() {
	if len(os.Args) < 2 {
		fmt.Fprintf(os.Stderr, "usage: %s IP_address_of_livewedge\n", os.Args[0])
		os.Exit(1)
	}
	vsw, err := libvsw.NewVsw(os.Args[1])
	if err != nil {
		fmt.Fprintf(os.Stderr, "Failed to open LiveWedge: %s\n", err)
		os.Exit(1)
	}
	defer vsw.Close()

	vsw.Cut(1)

	pa := loadParams(PARAMS_FILE)
	if pa.StartLiveBroadcast {
		vsw.ChangeLiveBroadcastState(1)
	} else {
		vsw.ChangeLiveBroadcastState(0)
	}
	if pa.UploadStillPicture {
		vsw.UploadFile(pa.Picture)
	}

	notify := make(chan Params, 1)
	go loop(vsw, pa, notify)

	WebUI(pa, notify)
}
Esempio n. 2
0
func main() {
	if len(os.Args) < 2 {
		fmt.Fprintf(os.Stderr, "usage: %s IP_address_of_livewedge\n", os.Args[0])
		os.Exit(1)
	}
	vsw, err := libvsw.NewVsw(os.Args[1])
	if err != nil {
		fmt.Fprintf(os.Stderr, "Failed to open LiveWedge: %s\n", err)
		os.Exit(1)
	}
	defer vsw.Close()
	sample_chromakey(vsw)
}
Esempio n. 3
0
func main() {
	if len(os.Args) < 2 {
		fmt.Fprintf(os.Stderr, "usage: %s IP_address_of_livewedge\n", os.Args[0])
		os.Exit(1)
	}
	vsw, err := libvsw.NewVsw(os.Args[1])
	if err != nil {
		fmt.Fprintf(os.Stderr, "Failed to open LiveWedge: %s\n", err)
		os.Exit(1)
	}
	defer vsw.Close()
	fmt.Printf("Open http://localhost:8080/ by web browser.\n")
	http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
		if r.FormValue("rec") == "start" {
			vsw.ChangeRecordingState(1)
		} else if r.FormValue("rec") == "stop" {
			vsw.ChangeRecordingState(0)
		}
		fmt.Fprint(w, f0)
	})
	http.ListenAndServe(":8080", nil)
}