forked from gqf2008/babylon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
74 lines (65 loc) · 1.71 KB
/
main.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
63
64
65
66
67
68
69
70
71
72
73
74
// mss project main.go
package main
import (
"babylon/rtmp"
_ "flag"
log "github.com/cihub/seelog"
_ "net"
_ "net/rtp"
_ "path/filepath"
"runtime"
)
//UINT GetUeValue(BYTE *pBuff, UINT nLen, UINT &nStartBit) {
// //计算0bit的个数
// UINT nZeroNum = 0;
//while (nStartBit < nLen * 8)
//{
// if (pBuff[nStartBit / 8] & (0x80 >> (nStartBit % 8)))
// {
// break;
// }
// nZeroNum++;
// nStartBit++;
//}
// nStartBit ++;
// //计算结果
// DWORD dwRet = 0;
// for (UINT i=0; i<nZeroNum; i++)
// {
// dwRet <<= 1;
// if (pBuff[nStartBit / 8] & (0x80 >> (nStartBit % 8)))
// {
// dwRet += 1;
// }
// nStartBit++;
// }
// return (1 << nZeroNum) - 1 + dwRet;
// }
func main() {
runtime.GOMAXPROCS(runtime.NumCPU())
//filePath, _ := filepath.Abs(os.Args[0])
//file := filepath.Dir(filePath) + "../etc/mss.conf"
//c := flag.String("c", file, "config file path")
//daemon := flag.Bool("d", false, "daemon mode")
////s := flag.String("s", "", "test|reload|nodes|static|table|shutdown")
//flag.Parse()
//if *daemon && os.Getppid() != 1 {
// filePath, _ := filepath.Abs(os.Args[0])
// args := append([]string{filePath}, os.Args[1:]...)
// os.StartProcess(filePath, args, &os.ProcAttr{Files: []*os.File{os.Stdin, os.Stdout, os.Stderr}})
// return
//}
//e := config_init(*c)
//if e != nil {
// panic(e)
//}
//log_init()
l := ":1935" //GetString("rtmp", "listen", ":1935")
err := rtmp.ListenAndServe(l)
if err != nil {
panic(err)
}
log.Info("Babylon Rtmp Server Listen At " + l)
log.Info("Babylon Media Streaming Server Running")
select {}
}