├── logs └── .gitignore ├── lib └── src │ ├── go-gypsy │ ├── README │ ├── example │ │ └── yget │ │ │ ├── .gitignore │ │ │ ├── Makefile │ │ │ ├── config.yaml │ │ │ └── main.go │ ├── yaml │ │ └── Makefile │ └── .gitignore │ ├── github.com │ ├── metachord │ │ └── amf.go │ │ │ ├── decoder.go │ │ │ ├── README.md │ │ │ ├── amf3 │ │ │ ├── const.go │ │ │ ├── types.go │ │ │ ├── int29_test.go │ │ │ └── int29.go │ │ │ ├── .gitignore │ │ │ └── amf0 │ │ │ ├── const.go │ │ │ └── types.go │ ├── BurntSushi │ │ └── xgb │ │ │ ├── .gitignore │ │ │ ├── examples │ │ │ ├── atoms │ │ │ │ ├── .gitignore │ │ │ │ ├── Makefile │ │ │ │ └── main.go │ │ │ ├── doc.go │ │ │ ├── xinerama │ │ │ │ └── main.go │ │ │ └── get-active-window │ │ │ │ └── main.go │ │ │ ├── xgbgen │ │ │ ├── COPYING │ │ │ ├── size.go │ │ │ ├── misc.go │ │ │ ├── main.go │ │ │ └── protocol.go │ │ │ ├── AUTHORS │ │ │ ├── sync.go │ │ │ ├── STYLE │ │ │ ├── CONTRIBUTORS │ │ │ ├── README │ │ │ └── LICENSE │ ├── pixiv │ │ └── go-libjpeg │ │ │ ├── .gitignore │ │ │ ├── jpeg │ │ │ ├── jpeg.h │ │ │ ├── panic_c.c │ │ │ ├── panic.go │ │ │ └── jpeg.go │ │ │ ├── test │ │ │ ├── images │ │ │ │ ├── cosmos.jpg │ │ │ │ ├── cosmos.png │ │ │ │ ├── kinkaku.jpg │ │ │ │ ├── kinkaku.png │ │ │ │ ├── checkerboard.png │ │ │ │ ├── checkerboard_420.jpg │ │ │ │ ├── checkerboard_422.jpg │ │ │ │ ├── checkerboard_440.jpg │ │ │ │ ├── checkerboard_444.jpg │ │ │ │ └── testdata │ │ │ │ │ ├── video-001.png │ │ │ │ │ ├── video-001.jpeg │ │ │ │ │ ├── video-001.cmyk.png │ │ │ │ │ ├── video-001.rgb.jpeg │ │ │ │ │ ├── video-001.rgb.png │ │ │ │ │ ├── video-005.gray.png │ │ │ │ │ ├── video-001.221212.jpeg │ │ │ │ │ ├── video-001.221212.png │ │ │ │ │ ├── video-001.cmyk.jpeg │ │ │ │ │ ├── video-005.gray.jpeg │ │ │ │ │ ├── video-001.q50.410.jpeg │ │ │ │ │ ├── video-001.q50.411.jpeg │ │ │ │ │ ├── video-001.q50.420.jpeg │ │ │ │ │ ├── video-001.q50.422.jpeg │ │ │ │ │ ├── video-001.q50.440.jpeg │ │ │ │ │ ├── video-001.q50.444.jpeg │ │ │ │ │ ├── video-005.gray.q50.jpeg │ │ │ │ │ ├── video-001.progressive.jpeg │ │ │ │ │ ├── video-005.gray.q50.2x2.jpeg │ │ │ │ │ ├── video-001.q50.410.progressive.jpeg │ │ │ │ │ ├── video-001.q50.411.progressive.jpeg │ │ │ │ │ ├── video-001.q50.420.progressive.jpeg │ │ │ │ │ ├── video-001.q50.422.progressive.jpeg │ │ │ │ │ ├── video-001.q50.440.progressive.jpeg │ │ │ │ │ ├── video-001.q50.444.progressive.jpeg │ │ │ │ │ ├── video-005.gray.q50.progressive.jpeg │ │ │ │ │ ├── video-001.separate.dc.progression.jpeg │ │ │ │ │ ├── video-005.gray.q50.2x2.progressive.jpeg │ │ │ │ │ └── video-001.separate.dc.progression.progressive.jpeg │ │ │ └── util │ │ │ │ ├── util_test.go │ │ │ │ └── util.go │ │ │ ├── example │ │ │ └── decoder │ │ │ │ ├── main.exe │ │ │ │ └── main.go │ │ │ ├── travis-install-libjpeg-turbo.sh │ │ │ ├── .travis.yml │ │ │ ├── LICENSE │ │ │ └── rgb │ │ │ ├── rgb_test.go │ │ │ └── rgb.go │ ├── sdming │ │ └── gosnow │ │ │ ├── example │ │ │ └── demo.go │ │ │ ├── .gitignore │ │ │ ├── README.md │ │ │ ├── gosnow_test.go │ │ │ └── gosnow.go │ ├── manucorporat │ │ └── try │ │ │ └── try.go │ └── streamrail │ │ └── concurrent-map │ │ ├── LICENSE │ │ └── README.md │ ├── golang.org │ └── x │ │ └── image │ │ ├── codereview.cfg │ │ ├── .gitignore │ │ ├── testdata │ │ ├── tux.png │ │ ├── no_rps.tiff │ │ ├── video-001.bmp │ │ ├── video-001.png │ │ ├── video-001.tiff │ │ ├── bw-deflate.tiff │ │ ├── bw-packbits.tiff │ │ ├── no_compress.tiff │ │ ├── testpattern.png │ │ ├── tux-rotate-ab.png │ │ ├── tux-rotate-bl.png │ │ ├── tux-rotate-cr.png │ │ ├── tux-rotate-nn.png │ │ ├── tux.lossless.webp │ │ ├── yellow_rose.png │ │ ├── gopher-doc.1bpp.png │ │ ├── gopher-doc.2bpp.png │ │ ├── gopher-doc.4bpp.png │ │ ├── gopher-doc.8bpp.png │ │ ├── video-001-gray.tiff │ │ ├── blue-purple-pink.png │ │ ├── bw-uncompressed.tiff │ │ ├── go-turns-two-14x18.png │ │ ├── go-turns-two-up-ab.png │ │ ├── go-turns-two-up-bl.png │ │ ├── go-turns-two-up-cr.png │ │ ├── go-turns-two-up-nn.png │ │ ├── video-001-16bit.tiff │ │ ├── video-001.lossy.webp │ │ ├── yellow_rose-small.bmp │ │ ├── yellow_rose-small.png │ │ ├── yellow_rose.lossy.webp │ │ ├── go-turns-two-down-ab.png │ │ ├── go-turns-two-down-bl.png │ │ ├── go-turns-two-down-cr.png │ │ ├── go-turns-two-down-nn.png │ │ ├── video-001-paletted.tiff │ │ ├── video-001-strip-64.tiff │ │ ├── blue-purple-pink-large.png │ │ ├── blue-purple-pink.lossy.webp │ │ ├── go-turns-two-280x360.jpeg │ │ ├── go-turns-two-rotate-ab.png │ │ ├── go-turns-two-rotate-bl.png │ │ ├── go-turns-two-rotate-cr.png │ │ ├── go-turns-two-rotate-nn.png │ │ ├── video-001-gray-16bit.tiff │ │ ├── video-001-tile-64x64.tiff │ │ ├── video-001-uncompressed.tiff │ │ ├── yellow_rose.lossless.webp │ │ ├── gopher-doc.1bpp.lossless.webp │ │ ├── gopher-doc.2bpp.lossless.webp │ │ ├── gopher-doc.4bpp.lossless.webp │ │ ├── gopher-doc.8bpp.lossless.webp │ │ ├── blue-purple-pink.lossless.webp │ │ ├── video-001.lossy.webp.ycbcr.png │ │ ├── yellow_rose.lossy.webp.ycbcr.png │ │ ├── yellow_rose.lossy-with-alpha.webp │ │ ├── blue-purple-pink-large.lossless.webp │ │ ├── blue-purple-pink.lossy.webp.ycbcr.png │ │ ├── blue-purple-pink.lzwcompressed.tiff │ │ ├── blue-purple-pink-large.no-filter.lossy.webp │ │ ├── blue-purple-pink-large.normal-filter.lossy.webp │ │ ├── blue-purple-pink-large.simple-filter.lossy.webp │ │ ├── yellow_rose.lossy-with-alpha.webp.nycbcra.png │ │ ├── blue-purple-pink-large.no-filter.lossy.webp.ycbcr.png │ │ ├── blue-purple-pink-large.normal-filter.lossy.webp.ycbcr.png │ │ └── blue-purple-pink-large.simple-filter.lossy.webp.ycbcr.png │ │ ├── font │ │ ├── testdata │ │ │ └── fixed │ │ │ │ ├── 7x13.0000 │ │ │ │ ├── 7x13.0100 │ │ │ │ ├── 7x13.0200 │ │ │ │ ├── 7x13.0300 │ │ │ │ ├── 7x13.0400 │ │ │ │ ├── 7x13.0500 │ │ │ │ ├── 7x13.0E00 │ │ │ │ ├── 7x13.1000 │ │ │ │ ├── 7x13.1600 │ │ │ │ ├── 7x13.1E00 │ │ │ │ ├── 7x13.1F00 │ │ │ │ ├── 7x13.2000 │ │ │ │ ├── 7x13.2100 │ │ │ │ ├── 7x13.2200 │ │ │ │ ├── 7x13.2300 │ │ │ │ ├── 7x13.2400 │ │ │ │ ├── 7x13.2500 │ │ │ │ ├── 7x13.2600 │ │ │ │ ├── 7x13.2700 │ │ │ │ ├── 7x13.2800 │ │ │ │ ├── 7x13.2A00 │ │ │ │ ├── 7x13.3000 │ │ │ │ ├── 7x13.FB00 │ │ │ │ ├── 7x13.FE00 │ │ │ │ ├── 7x13.FF00 │ │ │ │ ├── README │ │ │ │ └── unicode.7x13.font │ │ ├── plan9font │ │ │ └── plan9font_test.go │ │ └── inconsolata │ │ │ └── inconsolata.go │ │ ├── README │ │ ├── AUTHORS │ │ ├── CONTRIBUTORS │ │ ├── .gitattributes │ │ ├── colornames │ │ ├── colornames.go │ │ └── colornames_test.go │ │ ├── tiff │ │ ├── buffer_test.go │ │ ├── compress.go │ │ └── buffer.go │ │ ├── CONTRIBUTING.md │ │ ├── math │ │ ├── f32 │ │ │ └── f32.go │ │ └── f64 │ │ │ └── f64.go │ │ ├── PATENTS │ │ ├── webp │ │ └── webp.go │ │ ├── LICENSE │ │ ├── bmp │ │ ├── reader_test.go │ │ └── writer_test.go │ │ └── riff │ │ └── riff_test.go │ ├── flv.go │ ├── README.md │ ├── flv │ │ ├── flv_test.go │ │ ├── bitreader_test.go │ │ └── errors.go │ └── LICENSE │ ├── simplertmp │ ├── .gitignore │ ├── simplertmp │ │ └── main.go │ ├── rtmp │ │ ├── client.go │ │ └── rtmp_writer.go │ ├── util │ │ └── filelogger.go │ └── hls │ │ └── rtmp_ts_writer.go │ ├── seelog │ ├── internals_baseerror.go │ ├── common_closer.go │ ├── LICENSE.txt │ ├── common_flusher.go │ ├── dispatch_splitdispatcher.go │ ├── writers_consolewriter.go │ ├── README.markdown │ ├── writers_formattedwriter_test.go │ ├── dispatch_splitdispatcher_test.go │ ├── dispatch_filterdispatcher_test.go │ ├── cfg_errors.go │ ├── writers_formattedwriter.go │ ├── behavior_synclogger.go │ └── behavior_asynclooplogger.go │ ├── screenshot │ ├── README.md │ ├── example │ │ └── ss.go │ ├── screenshot_darwin.go │ ├── LICENSE │ └── screenshot_freebsd.go │ ├── imaging │ ├── .travis.yml │ ├── LICENSE │ ├── utils.go │ └── utils_test.go │ ├── stoppableListener │ ├── README.md │ ├── example │ │ └── example.go │ ├── LICENSE │ └── listener.go │ ├── w32 │ ├── AUTHORS │ ├── psapi.go │ ├── iunknown.go │ ├── istream.go │ ├── vars.go │ ├── README.md │ ├── comdlg32.go │ ├── idispatch.go │ ├── oleaut32.go │ ├── LICENSE │ ├── ole32.go │ └── opengl32.go │ ├── codec │ ├── util.go │ ├── README.md │ ├── aacdec.go │ └── aacenc.go │ └── stringio │ └── README.md ├── doc └── stream_video_to_phone.png ├── dev.sh ├── .gitignore ├── test ├── color │ └── main.go └── rtmp │ └── main.go ├── cmd └── get_active_window │ └── get_active_window.go ├── handlers ├── jpeg.go └── stop.go ├── config └── config.go ├── configuration.rtmp.yml └── configuration.mjpeg.yml /logs/.gitignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/src/go-gypsy/README: -------------------------------------------------------------------------------- 1 | yaml/doc.go -------------------------------------------------------------------------------- /lib/src/go-gypsy/example/yget/.gitignore: -------------------------------------------------------------------------------- 1 | yget 2 | -------------------------------------------------------------------------------- /lib/src/github.com/metachord/amf.go/decoder.go: -------------------------------------------------------------------------------- 1 | package amf 2 | -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/codereview.cfg: -------------------------------------------------------------------------------- 1 | issuerepo: golang/go 2 | -------------------------------------------------------------------------------- /lib/src/github.com/BurntSushi/xgb/.gitignore: -------------------------------------------------------------------------------- 1 | xgbgen/xgbgen 2 | .*.swp 3 | -------------------------------------------------------------------------------- /lib/src/flv.go/README.md: -------------------------------------------------------------------------------- 1 | # FLV.go # 2 | 3 | FLV reader and writer for Go 4 | -------------------------------------------------------------------------------- /lib/src/github.com/metachord/amf.go/README.md: -------------------------------------------------------------------------------- 1 | amf.go 2 | ====== 3 | 4 | amf.go -------------------------------------------------------------------------------- /lib/src/github.com/pixiv/go-libjpeg/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | 3 | /test/out/* 4 | -------------------------------------------------------------------------------- /lib/src/github.com/BurntSushi/xgb/examples/atoms/.gitignore: -------------------------------------------------------------------------------- 1 | atoms 2 | *.info 3 | *.prof 4 | -------------------------------------------------------------------------------- /doc/stream_video_to_phone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/doc/stream_video_to_phone.png -------------------------------------------------------------------------------- /lib/src/simplertmp/.gitignore: -------------------------------------------------------------------------------- 1 | *.log 2 | *.log.* 3 | test/screenshot 4 | test/*.jpeg 5 | test/*.jpg 6 | lib/pkg 7 | -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/.gitignore: -------------------------------------------------------------------------------- 1 | # Add no patterns to .hgignore except for files generated by the build. 2 | last-change 3 | -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/tux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/tux.png -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/no_rps.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/no_rps.tiff -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/video-001.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/video-001.bmp -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/video-001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/video-001.png -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/video-001.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/video-001.tiff -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/bw-deflate.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/bw-deflate.tiff -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/bw-packbits.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/bw-packbits.tiff -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/no_compress.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/no_compress.tiff -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/testpattern.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/testpattern.png -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/tux-rotate-ab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/tux-rotate-ab.png -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/tux-rotate-bl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/tux-rotate-bl.png -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/tux-rotate-cr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/tux-rotate-cr.png -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/tux-rotate-nn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/tux-rotate-nn.png -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/tux.lossless.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/tux.lossless.webp -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/yellow_rose.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/yellow_rose.png -------------------------------------------------------------------------------- /lib/src/github.com/pixiv/go-libjpeg/jpeg/jpeg.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // the dimension multiple to which data buffers should be aligned. 4 | #define ALIGN_SIZE 16 5 | -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/gopher-doc.1bpp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/gopher-doc.1bpp.png -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/gopher-doc.2bpp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/gopher-doc.2bpp.png -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/gopher-doc.4bpp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/gopher-doc.4bpp.png -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/gopher-doc.8bpp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/gopher-doc.8bpp.png -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/video-001-gray.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/video-001-gray.tiff -------------------------------------------------------------------------------- /lib/src/github.com/pixiv/go-libjpeg/test/images/cosmos.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/github.com/pixiv/go-libjpeg/test/images/cosmos.jpg -------------------------------------------------------------------------------- /lib/src/github.com/pixiv/go-libjpeg/test/images/cosmos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/github.com/pixiv/go-libjpeg/test/images/cosmos.png -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/font/testdata/fixed/7x13.0000: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/font/testdata/fixed/7x13.0000 -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/font/testdata/fixed/7x13.0100: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/font/testdata/fixed/7x13.0100 -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/font/testdata/fixed/7x13.0200: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/font/testdata/fixed/7x13.0200 -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/font/testdata/fixed/7x13.0300: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/font/testdata/fixed/7x13.0300 -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/font/testdata/fixed/7x13.0400: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/font/testdata/fixed/7x13.0400 -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/font/testdata/fixed/7x13.0500: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/font/testdata/fixed/7x13.0500 -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/font/testdata/fixed/7x13.0E00: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/font/testdata/fixed/7x13.0E00 -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/font/testdata/fixed/7x13.1000: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/font/testdata/fixed/7x13.1000 -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/font/testdata/fixed/7x13.1600: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/font/testdata/fixed/7x13.1600 -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/font/testdata/fixed/7x13.1E00: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/font/testdata/fixed/7x13.1E00 -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/font/testdata/fixed/7x13.1F00: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/font/testdata/fixed/7x13.1F00 -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/font/testdata/fixed/7x13.2000: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/font/testdata/fixed/7x13.2000 -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/font/testdata/fixed/7x13.2100: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/font/testdata/fixed/7x13.2100 -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/font/testdata/fixed/7x13.2200: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/font/testdata/fixed/7x13.2200 -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/font/testdata/fixed/7x13.2300: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/font/testdata/fixed/7x13.2300 -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/font/testdata/fixed/7x13.2400: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/font/testdata/fixed/7x13.2400 -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/font/testdata/fixed/7x13.2500: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/font/testdata/fixed/7x13.2500 -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/font/testdata/fixed/7x13.2600: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/font/testdata/fixed/7x13.2600 -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/font/testdata/fixed/7x13.2700: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/font/testdata/fixed/7x13.2700 -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/font/testdata/fixed/7x13.2800: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/font/testdata/fixed/7x13.2800 -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/font/testdata/fixed/7x13.2A00: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/font/testdata/fixed/7x13.2A00 -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/font/testdata/fixed/7x13.3000: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/font/testdata/fixed/7x13.3000 -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/font/testdata/fixed/7x13.FB00: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/font/testdata/fixed/7x13.FB00 -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/font/testdata/fixed/7x13.FE00: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/font/testdata/fixed/7x13.FE00 -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/font/testdata/fixed/7x13.FF00: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/font/testdata/fixed/7x13.FF00 -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/blue-purple-pink.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/blue-purple-pink.png -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/bw-uncompressed.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/bw-uncompressed.tiff -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/go-turns-two-14x18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/go-turns-two-14x18.png -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/go-turns-two-up-ab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/go-turns-two-up-ab.png -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/go-turns-two-up-bl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/go-turns-two-up-bl.png -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/go-turns-two-up-cr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/go-turns-two-up-cr.png -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/go-turns-two-up-nn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/go-turns-two-up-nn.png -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/video-001-16bit.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/video-001-16bit.tiff -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/video-001.lossy.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/video-001.lossy.webp -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/yellow_rose-small.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/yellow_rose-small.bmp -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/yellow_rose-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/yellow_rose-small.png -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/yellow_rose.lossy.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/yellow_rose.lossy.webp -------------------------------------------------------------------------------- /lib/src/github.com/pixiv/go-libjpeg/example/decoder/main.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/github.com/pixiv/go-libjpeg/example/decoder/main.exe -------------------------------------------------------------------------------- /lib/src/github.com/pixiv/go-libjpeg/test/images/kinkaku.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/github.com/pixiv/go-libjpeg/test/images/kinkaku.jpg -------------------------------------------------------------------------------- /lib/src/github.com/pixiv/go-libjpeg/test/images/kinkaku.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/github.com/pixiv/go-libjpeg/test/images/kinkaku.png -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/go-turns-two-down-ab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/go-turns-two-down-ab.png -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/go-turns-two-down-bl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/go-turns-two-down-bl.png -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/go-turns-two-down-cr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/go-turns-two-down-cr.png -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/go-turns-two-down-nn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/go-turns-two-down-nn.png -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/video-001-paletted.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/video-001-paletted.tiff -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/video-001-strip-64.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/video-001-strip-64.tiff -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/README: -------------------------------------------------------------------------------- 1 | This repository holds supplementary Go image libraries. 2 | 3 | To submit changes to this repository, see http://golang.org/doc/contribute.html. 4 | -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/blue-purple-pink-large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/blue-purple-pink-large.png -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/blue-purple-pink.lossy.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/blue-purple-pink.lossy.webp -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/go-turns-two-280x360.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/go-turns-two-280x360.jpeg -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/go-turns-two-rotate-ab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/go-turns-two-rotate-ab.png -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/go-turns-two-rotate-bl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/go-turns-two-rotate-bl.png -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/go-turns-two-rotate-cr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/go-turns-two-rotate-cr.png -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/go-turns-two-rotate-nn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/go-turns-two-rotate-nn.png -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/video-001-gray-16bit.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/video-001-gray-16bit.tiff -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/video-001-tile-64x64.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/video-001-tile-64x64.tiff -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/video-001-uncompressed.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/video-001-uncompressed.tiff -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/yellow_rose.lossless.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/yellow_rose.lossless.webp -------------------------------------------------------------------------------- /lib/src/github.com/pixiv/go-libjpeg/test/images/checkerboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/github.com/pixiv/go-libjpeg/test/images/checkerboard.png -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/gopher-doc.1bpp.lossless.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/gopher-doc.1bpp.lossless.webp -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/gopher-doc.2bpp.lossless.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/gopher-doc.2bpp.lossless.webp -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/gopher-doc.4bpp.lossless.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/gopher-doc.4bpp.lossless.webp -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/gopher-doc.8bpp.lossless.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/gopher-doc.8bpp.lossless.webp -------------------------------------------------------------------------------- /dev.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export PROJECTTOP=$(pwd) 4 | export PROJECTROOT=${PROJECTTOP/\/src\/ScreenStreamer/} 5 | export GOBIN=$PROJECTTOP/bin 6 | export GOPATH="$PROJECTROOT:$PROJECTTOP/lib" -------------------------------------------------------------------------------- /lib/src/github.com/pixiv/go-libjpeg/test/images/checkerboard_420.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/github.com/pixiv/go-libjpeg/test/images/checkerboard_420.jpg -------------------------------------------------------------------------------- /lib/src/github.com/pixiv/go-libjpeg/test/images/checkerboard_422.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/github.com/pixiv/go-libjpeg/test/images/checkerboard_422.jpg -------------------------------------------------------------------------------- /lib/src/github.com/pixiv/go-libjpeg/test/images/checkerboard_440.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/github.com/pixiv/go-libjpeg/test/images/checkerboard_440.jpg -------------------------------------------------------------------------------- /lib/src/github.com/pixiv/go-libjpeg/test/images/checkerboard_444.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/github.com/pixiv/go-libjpeg/test/images/checkerboard_444.jpg -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/blue-purple-pink.lossless.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/blue-purple-pink.lossless.webp -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/video-001.lossy.webp.ycbcr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/video-001.lossy.webp.ycbcr.png -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/yellow_rose.lossy.webp.ycbcr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/yellow_rose.lossy.webp.ycbcr.png -------------------------------------------------------------------------------- /lib/src/github.com/pixiv/go-libjpeg/test/images/testdata/video-001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/github.com/pixiv/go-libjpeg/test/images/testdata/video-001.png -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/yellow_rose.lossy-with-alpha.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/yellow_rose.lossy-with-alpha.webp -------------------------------------------------------------------------------- /lib/src/github.com/pixiv/go-libjpeg/test/images/testdata/video-001.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/github.com/pixiv/go-libjpeg/test/images/testdata/video-001.jpeg -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/blue-purple-pink-large.lossless.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/blue-purple-pink-large.lossless.webp -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/blue-purple-pink.lossy.webp.ycbcr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/blue-purple-pink.lossy.webp.ycbcr.png -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/blue-purple-pink.lzwcompressed.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/blue-purple-pink.lzwcompressed.tiff -------------------------------------------------------------------------------- /lib/src/github.com/pixiv/go-libjpeg/test/images/testdata/video-001.cmyk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/github.com/pixiv/go-libjpeg/test/images/testdata/video-001.cmyk.png -------------------------------------------------------------------------------- /lib/src/github.com/pixiv/go-libjpeg/test/images/testdata/video-001.rgb.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/github.com/pixiv/go-libjpeg/test/images/testdata/video-001.rgb.jpeg -------------------------------------------------------------------------------- /lib/src/github.com/pixiv/go-libjpeg/test/images/testdata/video-001.rgb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/github.com/pixiv/go-libjpeg/test/images/testdata/video-001.rgb.png -------------------------------------------------------------------------------- /lib/src/github.com/pixiv/go-libjpeg/test/images/testdata/video-005.gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/github.com/pixiv/go-libjpeg/test/images/testdata/video-005.gray.png -------------------------------------------------------------------------------- /lib/src/github.com/pixiv/go-libjpeg/test/images/testdata/video-001.221212.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/github.com/pixiv/go-libjpeg/test/images/testdata/video-001.221212.jpeg -------------------------------------------------------------------------------- /lib/src/github.com/pixiv/go-libjpeg/test/images/testdata/video-001.221212.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/github.com/pixiv/go-libjpeg/test/images/testdata/video-001.221212.png -------------------------------------------------------------------------------- /lib/src/github.com/pixiv/go-libjpeg/test/images/testdata/video-001.cmyk.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/github.com/pixiv/go-libjpeg/test/images/testdata/video-001.cmyk.jpeg -------------------------------------------------------------------------------- /lib/src/github.com/pixiv/go-libjpeg/test/images/testdata/video-005.gray.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/github.com/pixiv/go-libjpeg/test/images/testdata/video-005.gray.jpeg -------------------------------------------------------------------------------- /lib/src/github.com/pixiv/go-libjpeg/test/images/testdata/video-001.q50.410.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/github.com/pixiv/go-libjpeg/test/images/testdata/video-001.q50.410.jpeg -------------------------------------------------------------------------------- /lib/src/github.com/pixiv/go-libjpeg/test/images/testdata/video-001.q50.411.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/github.com/pixiv/go-libjpeg/test/images/testdata/video-001.q50.411.jpeg -------------------------------------------------------------------------------- /lib/src/github.com/pixiv/go-libjpeg/test/images/testdata/video-001.q50.420.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/github.com/pixiv/go-libjpeg/test/images/testdata/video-001.q50.420.jpeg -------------------------------------------------------------------------------- /lib/src/github.com/pixiv/go-libjpeg/test/images/testdata/video-001.q50.422.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/github.com/pixiv/go-libjpeg/test/images/testdata/video-001.q50.422.jpeg -------------------------------------------------------------------------------- /lib/src/github.com/pixiv/go-libjpeg/test/images/testdata/video-001.q50.440.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/github.com/pixiv/go-libjpeg/test/images/testdata/video-001.q50.440.jpeg -------------------------------------------------------------------------------- /lib/src/github.com/pixiv/go-libjpeg/test/images/testdata/video-001.q50.444.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/github.com/pixiv/go-libjpeg/test/images/testdata/video-001.q50.444.jpeg -------------------------------------------------------------------------------- /lib/src/github.com/pixiv/go-libjpeg/test/images/testdata/video-005.gray.q50.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/github.com/pixiv/go-libjpeg/test/images/testdata/video-005.gray.q50.jpeg -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/blue-purple-pink-large.no-filter.lossy.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/blue-purple-pink-large.no-filter.lossy.webp -------------------------------------------------------------------------------- /lib/src/github.com/pixiv/go-libjpeg/test/images/testdata/video-001.progressive.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/github.com/pixiv/go-libjpeg/test/images/testdata/video-001.progressive.jpeg -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/blue-purple-pink-large.normal-filter.lossy.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/blue-purple-pink-large.normal-filter.lossy.webp -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/blue-purple-pink-large.simple-filter.lossy.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/blue-purple-pink-large.simple-filter.lossy.webp -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/yellow_rose.lossy-with-alpha.webp.nycbcra.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/yellow_rose.lossy-with-alpha.webp.nycbcra.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.log 2 | *.log.* 3 | stream 4 | rtmp 5 | mjpeg 6 | get_active_window 7 | test/*.jpeg 8 | test/*.jpg 9 | *.h264 10 | *.flv 11 | *.mp4 12 | *.txt 13 | *.mp3 14 | *.jpeg 15 | *.jpg 16 | lib/pkg 17 | !cmd/* 18 | -------------------------------------------------------------------------------- /lib/src/github.com/pixiv/go-libjpeg/test/images/testdata/video-005.gray.q50.2x2.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/github.com/pixiv/go-libjpeg/test/images/testdata/video-005.gray.q50.2x2.jpeg -------------------------------------------------------------------------------- /lib/src/go-gypsy/yaml/Makefile: -------------------------------------------------------------------------------- 1 | include $(GOROOT)/src/Make.inc 2 | 3 | TARG=github.com/kylelemons/go-gypsy/yaml 4 | GOFILES=\ 5 | types.go\ 6 | parser.go\ 7 | config.go\ 8 | 9 | include $(GOROOT)/src/Make.pkg 10 | -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/blue-purple-pink-large.no-filter.lossy.webp.ycbcr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/blue-purple-pink-large.no-filter.lossy.webp.ycbcr.png -------------------------------------------------------------------------------- /lib/src/github.com/pixiv/go-libjpeg/test/images/testdata/video-001.q50.410.progressive.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/github.com/pixiv/go-libjpeg/test/images/testdata/video-001.q50.410.progressive.jpeg -------------------------------------------------------------------------------- /lib/src/github.com/pixiv/go-libjpeg/test/images/testdata/video-001.q50.411.progressive.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/github.com/pixiv/go-libjpeg/test/images/testdata/video-001.q50.411.progressive.jpeg -------------------------------------------------------------------------------- /lib/src/github.com/pixiv/go-libjpeg/test/images/testdata/video-001.q50.420.progressive.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/github.com/pixiv/go-libjpeg/test/images/testdata/video-001.q50.420.progressive.jpeg -------------------------------------------------------------------------------- /lib/src/github.com/pixiv/go-libjpeg/test/images/testdata/video-001.q50.422.progressive.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/github.com/pixiv/go-libjpeg/test/images/testdata/video-001.q50.422.progressive.jpeg -------------------------------------------------------------------------------- /lib/src/github.com/pixiv/go-libjpeg/test/images/testdata/video-001.q50.440.progressive.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/github.com/pixiv/go-libjpeg/test/images/testdata/video-001.q50.440.progressive.jpeg -------------------------------------------------------------------------------- /lib/src/github.com/pixiv/go-libjpeg/test/images/testdata/video-001.q50.444.progressive.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/github.com/pixiv/go-libjpeg/test/images/testdata/video-001.q50.444.progressive.jpeg -------------------------------------------------------------------------------- /lib/src/github.com/pixiv/go-libjpeg/test/images/testdata/video-005.gray.q50.progressive.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/github.com/pixiv/go-libjpeg/test/images/testdata/video-005.gray.q50.progressive.jpeg -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/blue-purple-pink-large.normal-filter.lossy.webp.ycbcr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/blue-purple-pink-large.normal-filter.lossy.webp.ycbcr.png -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/testdata/blue-purple-pink-large.simple-filter.lossy.webp.ycbcr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/golang.org/x/image/testdata/blue-purple-pink-large.simple-filter.lossy.webp.ycbcr.png -------------------------------------------------------------------------------- /lib/src/seelog/internals_baseerror.go: -------------------------------------------------------------------------------- 1 | package seelog 2 | 3 | // Base struct for custom errors. 4 | type baseError struct { 5 | message string 6 | } 7 | 8 | func (be baseError) Error() string { 9 | return be.message 10 | } 11 | -------------------------------------------------------------------------------- /lib/src/github.com/pixiv/go-libjpeg/test/images/testdata/video-001.separate.dc.progression.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/github.com/pixiv/go-libjpeg/test/images/testdata/video-001.separate.dc.progression.jpeg -------------------------------------------------------------------------------- /lib/src/github.com/pixiv/go-libjpeg/test/images/testdata/video-005.gray.q50.2x2.progressive.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/github.com/pixiv/go-libjpeg/test/images/testdata/video-005.gray.q50.2x2.progressive.jpeg -------------------------------------------------------------------------------- /lib/src/go-gypsy/.gitignore: -------------------------------------------------------------------------------- 1 | *.out 2 | .DS_Store 3 | *.[568ao] 4 | ._* 5 | .nfs.* 6 | [568a].out 7 | *~ 8 | *.orig 9 | *.rej 10 | *.exe 11 | .*.swp 12 | core 13 | *.cgo*.go 14 | *.cgo*.c 15 | _cgo_* 16 | _obj 17 | _test 18 | _testmain.go 19 | -------------------------------------------------------------------------------- /lib/src/github.com/pixiv/go-libjpeg/test/images/testdata/video-001.separate.dc.progression.progressive.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fiefdx/ScreenStreamer/HEAD/lib/src/github.com/pixiv/go-libjpeg/test/images/testdata/video-001.separate.dc.progression.progressive.jpeg -------------------------------------------------------------------------------- /lib/src/github.com/pixiv/go-libjpeg/jpeg/panic_c.c: -------------------------------------------------------------------------------- 1 | #include "_cgo_export.h" 2 | 3 | void error_panic(j_common_ptr cinfo) { 4 | struct { const char *p; } a; 5 | char buffer[JMSG_LENGTH_MAX]; 6 | (*cinfo->err->format_message) (cinfo, buffer); 7 | goPanic(buffer); 8 | } 9 | -------------------------------------------------------------------------------- /lib/src/go-gypsy/example/yget/Makefile: -------------------------------------------------------------------------------- 1 | include $(GOROOT)/src/Make.inc 2 | 3 | TARG=yget 4 | DEP= 5 | GOFILES=\ 6 | main.go\ 7 | 8 | pkgdir=$(GOROOT)/pkg/$(GOOS)_$(GOARCH) 9 | PREREQ+=$(foreach PKG,$(DEP),$(pkgdir)/$(PKG).a) 10 | 11 | include $(GOROOT)/src/Make.cmd 12 | -------------------------------------------------------------------------------- /lib/src/github.com/metachord/amf.go/amf3/const.go: -------------------------------------------------------------------------------- 1 | package amf3 2 | 3 | const ( 4 | UndefinedMarker = iota 5 | NullMarker 6 | FalseMarker 7 | TrueMarker 8 | IntegerMarker 9 | DoubleMarker 10 | StringMarker 11 | XmlDocMarker 12 | DateMarker 13 | ArrayMarker 14 | ObjectMarker 15 | XmlMarker 16 | ByteArrayMarker 17 | ) 18 | -------------------------------------------------------------------------------- /test/color/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "image/color" 6 | ) 7 | 8 | func main() { 9 | co := color.RGBA{188, 188, 188, 255} 10 | y, cb, cr := color.RGBToYCbCr(co.R, co.G, co.B) 11 | 12 | r, g, b := color.YCbCrToRGB(y, cb, cr) 13 | 14 | fmt.Printf("r, g, b : %v, %v, %v\n", r, g, b) 15 | } 16 | -------------------------------------------------------------------------------- /lib/src/go-gypsy/example/yget/config.yaml: -------------------------------------------------------------------------------- 1 | mapping: 2 | key1: value1 3 | key2: value2 4 | list: 5 | - item1 6 | - item2 7 | config: 8 | server: 9 | - www.google.com 10 | - www.cnn.com 11 | - www.example.com 12 | admin: 13 | - username: god 14 | password: z3u5 15 | - username: lowly 16 | password: f!r3m3 17 | -------------------------------------------------------------------------------- /lib/src/github.com/pixiv/go-libjpeg/jpeg/panic.go: -------------------------------------------------------------------------------- 1 | package jpeg 2 | 3 | /* 4 | #include 5 | #include 6 | #include "jpeglib.h" 7 | 8 | // export from golang 9 | void goPanic(char*); 10 | 11 | void error_panic(j_common_ptr dinfo); 12 | 13 | */ 14 | import "C" 15 | 16 | //export goPanic 17 | func goPanic(msg *C.char) { 18 | panic(C.GoString(msg)) 19 | } 20 | -------------------------------------------------------------------------------- /lib/src/github.com/pixiv/go-libjpeg/travis-install-libjpeg-turbo.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -eux 2 | 3 | if [ "$1" != "" ]; then 4 | cd /tmp 5 | wget http://downloads.sourceforge.net/project/libjpeg-turbo/$1/libjpeg-turbo-official_$1_amd64.deb 6 | dpkg -x libjpeg-turbo-official_$1_amd64.deb /tmp/libjpeg-turbo-official 7 | mv /tmp/libjpeg-turbo-official/opt/libjpeg-turbo /tmp/libjpeg-turbo 8 | fi 9 | -------------------------------------------------------------------------------- /lib/src/github.com/sdming/gosnow/example/demo.go: -------------------------------------------------------------------------------- 1 | /* 2 | github.com/twitter/snowflake in golang 3 | */ 4 | 5 | package main 6 | 7 | import ( 8 | "github.com/sdming/gosnow" 9 | "fmt" 10 | ) 11 | 12 | func main() { 13 | 14 | v := gosnow.Default() 15 | //v := gosnow.NewSnowFlake(100) 16 | for i := 0; i < 10; i++ { 17 | id := v.Next() 18 | fmt.Println(id) 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /lib/src/screenshot/README.md: -------------------------------------------------------------------------------- 1 | Simple cross-platform pure Go screen shot library. (tested only on linux&windows, mac is currently not working) 2 | 3 | 4 | ## Install: 5 | go get github.com/vova616/screenshot 6 | 7 | ## Dependencies: 8 | Windows: https://github.com/AllenDang/w32 9 |
10 | Other: https://github.com/BurntSushi/xgb 11 | 12 | ## Examples: 13 | look at example/ folder. 14 | -------------------------------------------------------------------------------- /cmd/get_active_window/get_active_window.go: -------------------------------------------------------------------------------- 1 | // Created on 2017-03-04 2 | // summary: ScreenStreamer 3 | // author: YangHaitao 4 | 5 | package main 6 | 7 | import ( 8 | "fmt" 9 | "os" 10 | 11 | "screenshot" 12 | ) 13 | 14 | func main() { 15 | screenshot.InitConn() 16 | id := screenshot.GetActiveWindow() 17 | fmt.Printf("%v", id) 18 | screenshot.CloseConn() 19 | os.Exit(0) 20 | } 21 | -------------------------------------------------------------------------------- /lib/src/github.com/sdming/gosnow/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | -------------------------------------------------------------------------------- /lib/src/github.com/metachord/amf.go/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/.gitattributes: -------------------------------------------------------------------------------- 1 | # Treat all files in this repo as binary, with no git magic updating 2 | # line endings. Windows users contributing to Go will need to use a 3 | # modern version of git and editors capable of LF line endings. 4 | # 5 | # We'll prevent accidental CRLF line endings from entering the repo 6 | # via the git-review gofmt checks. 7 | # 8 | # See golang.org/issue/9281 9 | 10 | * -text 11 | -------------------------------------------------------------------------------- /lib/src/imaging/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | sudo: false 4 | 5 | go: 6 | - 1.2 7 | - 1.3 8 | - 1.4 9 | - 1.5 10 | - 1.6 11 | - tip 12 | 13 | before_install: 14 | - go get golang.org/x/tools/cmd/cover 15 | - go get github.com/mattn/goveralls 16 | 17 | script: 18 | - go test -v -covermode=count -coverprofile=coverage.out 19 | - $HOME/gopath/bin/goveralls -service=travis-ci -coverprofile=coverage.out 20 | -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/colornames/colornames.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:generate go run gen.go 6 | 7 | // Package colornames provides named colors as defined in the SVG 1.1 spec. 8 | // 9 | // See http://www.w3.org/TR/SVG/types.html#ColorKeywords 10 | package colornames 11 | -------------------------------------------------------------------------------- /lib/src/screenshot/example/ss.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "github.com/vova616/screenshot" 5 | "image/png" 6 | "os" 7 | ) 8 | 9 | func main() { 10 | img, err := screenshot.CaptureScreen() 11 | if err != nil { 12 | panic(err) 13 | } 14 | f, err := os.Create("./ss.png") 15 | if err != nil { 16 | panic(err) 17 | } 18 | err = png.Encode(f, img) 19 | if err != nil { 20 | panic(err) 21 | } 22 | f.Close() 23 | } 24 | -------------------------------------------------------------------------------- /lib/src/github.com/metachord/amf.go/amf0/const.go: -------------------------------------------------------------------------------- 1 | package amf0 2 | 3 | const ( 4 | NumberMarker = iota 5 | BooleanMarker 6 | StringMarker 7 | ObjectMarker 8 | MovieclipMarker 9 | NullMarker 10 | UndefinedMarker 11 | ReferenceMarker 12 | EcmaArrayMarker 13 | ObjectEndMarker 14 | StrictArrayMarker 15 | DateMarker 16 | LongStringMarker 17 | UnsupportedMarker 18 | RecordsetMarker 19 | XmlDocumentMarker 20 | TypedObjectMarker 21 | ) 22 | -------------------------------------------------------------------------------- /lib/src/screenshot/screenshot_darwin.go: -------------------------------------------------------------------------------- 1 | package screenshot 2 | 3 | import ( 4 | "image" 5 | ) 6 | 7 | func ScreenRect() (image.Rectangle, error) { 8 | panic("ScreenRect is not supported on this platform.") 9 | } 10 | 11 | func CaptureScreen() (*image.RGBA, error) { 12 | panic("CaptureScreen is not supported on this platform.") 13 | } 14 | 15 | func CaptureRect(rect image.Rectangle) (*image.RGBA, error) { 16 | panic("CaptureRect is not supported on this platform.") 17 | } 18 | -------------------------------------------------------------------------------- /lib/src/github.com/BurntSushi/xgb/examples/atoms/Makefile: -------------------------------------------------------------------------------- 1 | atoms: 2 | go build 3 | 4 | test: atoms 5 | ./atoms --requests 500000 --cpu 1 \ 6 | --cpuprof cpu1.prof --memprof mem1.prof > atoms1.info 2>&1 7 | ./atoms --requests 500000 --cpu 2 \ 8 | --cpuprof cpu2.prof --memprof mem2.prof > atoms2.info 2>&1 9 | ./atoms --requests 500000 --cpu 3 \ 10 | --cpuprof cpu3.prof --memprof mem3.prof > atoms3.info 2>&1 11 | ./atoms --requests 500000 --cpu 6 \ 12 | --cpuprof cpu6.prof --memprof mem6.prof > atoms6.info 2>&1 13 | -------------------------------------------------------------------------------- /lib/src/github.com/pixiv/go-libjpeg/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.6 5 | - 1.7 6 | - tip 7 | 8 | env: 9 | - TURBO_VER="" 10 | - TURBO_VER="1.5.1" CGO_LDFLAGS="-L/tmp/libjpeg-turbo/lib64" CGO_CPPFLAGS="-I/tmp/libjpeg-turbo/include" LD_LIBRARY_PATH="/tmp/libjpeg-turbo/lib64" 11 | 12 | before_install: 13 | - ./travis-install-libjpeg-turbo.sh "$TURBO_VER" 14 | - cd $HOME/gopath/src/github.com/pixiv/go-libjpeg 15 | 16 | script: 17 | - go test -a -test.v ./... 18 | - cd jpeg && go test -a -bench . -benchtime 10s 19 | -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/font/testdata/fixed/README: -------------------------------------------------------------------------------- 1 | These font files were copied from the Plan 9 Port's font/fixed directory. The 2 | README in that directory states that: "These fonts are converted from the BDFs 3 | in the XFree86 distribution. They were all marked as public domain." 4 | 5 | The Plan 9 Port is at https://github.com/9fans/plan9port and the copy was made 6 | from commit a78b1841 (2015-08-18). 7 | 8 | The unicode.7x13.font file also refers to a ../shinonome directory, but this 9 | testdata does not include those subfont files. 10 | -------------------------------------------------------------------------------- /lib/src/github.com/BurntSushi/xgb/xgbgen/COPYING: -------------------------------------------------------------------------------- 1 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 2 | Version 2, December 2004 3 | 4 | Copyright (C) 2004 Sam Hocevar 5 | 6 | Everyone is permitted to copy and distribute verbatim or modified 7 | copies of this license document, and changing it is allowed as long 8 | as the name is changed. 9 | 10 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 11 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 12 | 13 | 0. You just DO WHAT THE FUCK YOU WANT TO. 14 | -------------------------------------------------------------------------------- /lib/src/github.com/pixiv/go-libjpeg/test/util/util_test.go: -------------------------------------------------------------------------------- 1 | package util_test 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/pixiv/go-libjpeg/test/util" 7 | ) 8 | 9 | func TestOpenFile(t *testing.T) { 10 | for _, file := range util.SubsampledImages { 11 | util.OpenFile(file) 12 | } 13 | } 14 | 15 | func TestReadFile(t *testing.T) { 16 | for _, file := range util.SubsampledImages { 17 | util.ReadFile(file) 18 | } 19 | } 20 | 21 | func TestCreateFile(t *testing.T) { 22 | f := util.CreateFile("util_test") 23 | f.Write([]byte{'o', 'k'}) 24 | f.Close() 25 | } 26 | -------------------------------------------------------------------------------- /handlers/jpeg.go: -------------------------------------------------------------------------------- 1 | // Created on 2015-07-21 2 | // summary: get handler 3 | // author: YangHaitao 4 | 5 | package handlers 6 | 7 | import ( 8 | "fmt" 9 | "net/http" 10 | ) 11 | 12 | func JpegHandler(w http.ResponseWriter, r *http.Request) { 13 | Log.Debug(fmt.Sprintf("Start request %s", r.URL)) 14 | 15 | Log.Debug(fmt.Sprintf("Wait source")) 16 | snapshot := <- Images 17 | Log.Debug(fmt.Sprintf("Write snapshot")) 18 | 19 | w.Header().Add("Content-Type", "image/jpeg") 20 | w.Write(snapshot.GetValueBytes()) 21 | Log.Debug(fmt.Sprintf("Success request")) 22 | } 23 | -------------------------------------------------------------------------------- /lib/src/stoppableListener/README.md: -------------------------------------------------------------------------------- 1 | stoppableListener 2 | ================= 3 | 4 | An example of a stoppable TCP listener in Go. This library wraps an existing TCP connection object. A goroutine calling `Accept()` 5 | is interrupted with `StoppedError` whenever the listener is stopped by a call to `Stop()`. Usage is demonstrated below, and in `example/example.go`. 6 | 7 | 8 | ``` 9 | originalListener, err := net.Listen("tcp", ":8080") 10 | if err != nil { 11 | panic(err) 12 | } 13 | 14 | sl, err := stoppableListener.New(originalListener) 15 | if err != nil { 16 | panic(err) 17 | } 18 | ``` 19 | -------------------------------------------------------------------------------- /lib/src/w32/AUTHORS: -------------------------------------------------------------------------------- 1 | # This is the official list of 'w32' authors for copyright purposes. 2 | 3 | # Names should be added to this file as 4 | # Name or Organization 5 | # The email address is not required for organizations. 6 | 7 | # Please keep the list sorted. 8 | 9 | # Contributors 10 | # ============ 11 | 12 | Allen Dang 13 | Benny Siegert 14 | Bruno Bigras 15 | Daniel Joos 16 | Gerald Rosenberg 17 | Liam Bowen 18 | Michael Henke 19 | Paul Maddox -------------------------------------------------------------------------------- /lib/src/github.com/sdming/gosnow/README.md: -------------------------------------------------------------------------------- 1 | gosnow 2 | ====== 3 | 4 | gosnow is a snowflake implementation in golang. 5 | 6 | This is a fork of the upstream that replaces the the usage of panic() by returning errors instead. 7 | 8 | ~~~golang 9 | package main 10 | 11 | import ( 12 | "github.com/sdming/gosnow" 13 | "fmt" 14 | ) 15 | 16 | func main() { 17 | 18 | v, err := gosnow.Default() 19 | 20 | // Alternatively you can set the worker id if you are running multiple snowflakes 21 | // v, err := gosnow.NewSnowFlake(100) 22 | 23 | for i := 0; i < 10; i++ { 24 | id, err := v.Next() 25 | fmt.Println(id) 26 | } 27 | } 28 | 29 | ~~~ -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/font/plan9font/plan9font_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package plan9font 6 | 7 | import ( 8 | "io/ioutil" 9 | "path/filepath" 10 | "testing" 11 | ) 12 | 13 | func BenchmarkParseSubfont(b *testing.B) { 14 | subfontData, err := ioutil.ReadFile(filepath.FromSlash("../testdata/fixed/7x13.0000")) 15 | if err != nil { 16 | b.Fatal(err) 17 | } 18 | b.ResetTimer() 19 | for i := 0; i < b.N; i++ { 20 | if _, err := ParseSubfont(subfontData, 0); err != nil { 21 | b.Fatal(err) 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/src/w32/psapi.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010-2012 The W32 Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package w32 6 | 7 | import ( 8 | "syscall" 9 | "unsafe" 10 | ) 11 | 12 | var ( 13 | modpsapi = syscall.NewLazyDLL("psapi.dll") 14 | 15 | procEnumProcesses = modpsapi.NewProc("EnumProcesses") 16 | ) 17 | 18 | func EnumProcesses(processIds []uint32, cb uint32, bytesReturned *uint32) bool { 19 | ret, _, _ := procEnumProcesses.Call( 20 | uintptr(unsafe.Pointer(&processIds[0])), 21 | uintptr(cb), 22 | uintptr(unsafe.Pointer(bytesReturned))) 23 | 24 | return ret != 0 25 | } 26 | -------------------------------------------------------------------------------- /lib/src/github.com/metachord/amf.go/amf0/types.go: -------------------------------------------------------------------------------- 1 | package amf0 2 | 3 | import () 4 | 5 | type NullType struct { 6 | } 7 | 8 | type UndefinedType struct { 9 | } 10 | 11 | type UnsupportedType struct { 12 | } 13 | 14 | type NumberType float64 15 | type BooleanType bool 16 | type StringType string 17 | type LongStringType string 18 | type XmlDocumentType LongStringType 19 | type _Object map[StringType]interface{} 20 | type ObjectType _Object 21 | type EcmaArrayType _Object 22 | type StrictArrayType []interface{} 23 | 24 | type DateType struct { 25 | TimeZone int16 26 | Date float64 27 | } 28 | 29 | type TypedObjectType struct { 30 | ClassName StringType 31 | Object _Object 32 | } 33 | -------------------------------------------------------------------------------- /lib/src/w32/iunknown.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010-2012 The W32 Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package w32 6 | 7 | type pIUnknownVtbl struct { 8 | pQueryInterface uintptr 9 | pAddRef uintptr 10 | pRelease uintptr 11 | } 12 | 13 | type IUnknown struct { 14 | lpVtbl *pIUnknownVtbl 15 | } 16 | 17 | func (this *IUnknown) QueryInterface(id *GUID) *IDispatch { 18 | return ComQueryInterface(this, id) 19 | } 20 | 21 | func (this *IUnknown) AddRef() int32 { 22 | return ComAddRef(this) 23 | } 24 | 25 | func (this *IUnknown) Release() int32 { 26 | return ComRelease(this) 27 | } 28 | -------------------------------------------------------------------------------- /lib/src/github.com/BurntSushi/xgb/AUTHORS: -------------------------------------------------------------------------------- 1 | Andrew Gallant is the maintainer of this fork. What follows is the original 2 | list of authors for the x-go-binding. 3 | 4 | # This is the official list of XGB authors for copyright purposes. 5 | # This file is distinct from the CONTRIBUTORS files. 6 | # See the latter for an explanation. 7 | 8 | # Names should be added to this file as 9 | # Name or Organization 10 | # The email address is not required for organizations. 11 | 12 | # Please keep the list sorted. 13 | 14 | Anthony Martin 15 | Firmansyah Adiputra 16 | Google Inc. 17 | Scott Lawrence 18 | Tor Andersson 19 | -------------------------------------------------------------------------------- /test/rtmp/main.go: -------------------------------------------------------------------------------- 1 | // mss project main.go 2 | package main 3 | 4 | import ( 5 | "simplertmp/rtmp" 6 | "flag" 7 | "log" 8 | "net/http" 9 | _ "net/http/pprof" 10 | "runtime" 11 | ) 12 | 13 | var pprof bool 14 | var listen string 15 | 16 | func init() { 17 | runtime.GOMAXPROCS(runtime.NumCPU() * 4) 18 | flag.StringVar(&listen, "l", ":1935", "-l=:1935") 19 | flag.BoolVar(&pprof, "pprof", false, "-pprof=true") 20 | } 21 | func main() { 22 | flag.Parse() 23 | err := rtmp.ListenAndServe(listen) 24 | if err != nil { 25 | panic(err) 26 | } 27 | log.Println("Babylon Live Server Listen At " + listen) 28 | if pprof { 29 | go func() { 30 | log.Println(http.ListenAndServe(":6060", nil)) 31 | }() 32 | } 33 | select {} 34 | } -------------------------------------------------------------------------------- /lib/src/flv.go/flv/flv_test.go: -------------------------------------------------------------------------------- 1 | package flv 2 | 3 | import ( 4 | "bytes" 5 | "testing" 6 | ) 7 | 8 | func TestWriteFrame(t *testing.T) { 9 | got := new(bytes.Buffer) 10 | cFrame := CFrame{ 11 | Stream: 55, 12 | Dts: 123123, 13 | Type: TAG_TYPE_META, 14 | Body: []byte{0x12, 0x34, 0x56, 0x78, 0x90}, 15 | } 16 | err := cFrame.WriteFrame(got) 17 | if err != nil { 18 | t.Errorf("test for %s error: %s", "CFrame", err) 19 | } else { 20 | expect := []byte{ 21 | 0x12, 0x00, 0x00, 0x05, 0x01, 0xe0, 0xf3, 0x00, 22 | 0x00, 0x00, 0x37, 0x12, 0x34, 0x56, 0x78, 0x90, 23 | 0x00, 0x00, 0x00, 0x10, 24 | } 25 | if !bytes.Equal(expect, got.Bytes()) { 26 | t.Errorf("expect %x got %x", expect, got) 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /handlers/stop.go: -------------------------------------------------------------------------------- 1 | // Created on 2015-08-03 2 | // summary: stop handler 3 | // author: YangHaitao 4 | 5 | package handlers 6 | 7 | import ( 8 | "fmt" 9 | "encoding/json" 10 | "net/http" 11 | ) 12 | 13 | func StopHandler(w http.ResponseWriter, r *http.Request) { 14 | headers := make(map[string]string) 15 | Log.Info(fmt.Sprintf("Stop server")) 16 | 17 | headers[Headers["status"]] = Response["success"] 18 | headers[Headers["message"]] = Response["server_will_stop"] 19 | 20 | w.Header().Set(Headers["status"], headers[Headers["status"]]) 21 | w.Header().Set(Headers["message"], headers[Headers["message"]]) 22 | w.WriteHeader(http.StatusOK) 23 | 24 | Done <- true 25 | 26 | result, _ := json.Marshal(headers) 27 | w.Write(result) 28 | } -------------------------------------------------------------------------------- /lib/src/simplertmp/simplertmp/main.go: -------------------------------------------------------------------------------- 1 | // mss project main.go 2 | package main 3 | 4 | import ( 5 | "simplertmp/rtmp" 6 | "flag" 7 | "log" 8 | "net/http" 9 | _ "net/http/pprof" 10 | "runtime" 11 | ) 12 | 13 | var pprof bool 14 | var listen string 15 | 16 | func init() { 17 | runtime.GOMAXPROCS(runtime.NumCPU() * 4) 18 | flag.StringVar(&listen, "l", ":1935", "-l=:1935") 19 | flag.BoolVar(&pprof, "pprof", false, "-pprof=true") 20 | } 21 | func main() { 22 | flag.Parse() 23 | err := rtmp.ListenAndServe(listen) 24 | if err != nil { 25 | panic(err) 26 | } 27 | log.Println("Server Listen At " + listen) 28 | if pprof { 29 | go func() { 30 | log.Println(http.ListenAndServe(":6060", nil)) 31 | }() 32 | } 33 | select {} 34 | } 35 | -------------------------------------------------------------------------------- /lib/src/github.com/metachord/amf.go/amf3/types.go: -------------------------------------------------------------------------------- 1 | package amf3 2 | 3 | type UndefinedType struct { 4 | } 5 | 6 | type NullType struct { 7 | } 8 | 9 | type FalseType struct { 10 | } 11 | 12 | type TrueType struct { 13 | } 14 | 15 | type IntegerType uint32 16 | type DoubleType float64 17 | type StringType string 18 | type XMLDocumentType string 19 | type DateType float64 20 | type ArrayType struct { 21 | Associative map[StringType]interface{} 22 | Dense []interface{} 23 | } 24 | 25 | type Trait struct { 26 | ClassName StringType 27 | IsDynamic bool 28 | Attrs []StringType 29 | } 30 | 31 | type ObjectType struct { 32 | Trait *Trait 33 | Static []interface{} 34 | Dynamic map[StringType]interface{} 35 | } 36 | 37 | type XMLType string 38 | type ByteArrayType []byte 39 | -------------------------------------------------------------------------------- /config/config.go: -------------------------------------------------------------------------------- 1 | // Created on 2015-07-20 2 | // summary: config 3 | // author: YangHaitao 4 | 5 | package config 6 | 7 | import ( 8 | "os" 9 | "fmt" 10 | "go-gypsy/yaml" 11 | ) 12 | 13 | var Config *yaml.File 14 | 15 | func GetConfig(config_path string) *yaml.File { 16 | if Config != nil { 17 | return Config 18 | } 19 | 20 | if _, err := os.Stat(config_path); os.IsNotExist(err) { 21 | fmt.Printf("Init Config (%s) error: config_path does not exist!\n", config_path) 22 | return Config 23 | } 24 | 25 | tmp_config, err := yaml.ReadFile(config_path) 26 | if err != nil { 27 | fmt.Printf("Init Config (%s) error: %s\n", config_path, err) 28 | return Config 29 | } 30 | Config = tmp_config 31 | return Config 32 | } 33 | -------------------------------------------------------------------------------- /lib/src/w32/istream.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010-2012 The W32 Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package w32 6 | 7 | import ( 8 | "unsafe" 9 | ) 10 | 11 | type pIStreamVtbl struct { 12 | pQueryInterface uintptr 13 | pAddRef uintptr 14 | pRelease uintptr 15 | } 16 | 17 | type IStream struct { 18 | lpVtbl *pIStreamVtbl 19 | } 20 | 21 | func (this *IStream) QueryInterface(id *GUID) *IDispatch { 22 | return ComQueryInterface((*IUnknown)(unsafe.Pointer(this)), id) 23 | } 24 | 25 | func (this *IStream) AddRef() int32 { 26 | return ComAddRef((*IUnknown)(unsafe.Pointer(this))) 27 | } 28 | 29 | func (this *IStream) Release() int32 { 30 | return ComRelease((*IUnknown)(unsafe.Pointer(this))) 31 | } 32 | -------------------------------------------------------------------------------- /lib/src/github.com/pixiv/go-libjpeg/example/decoder/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "flag" 5 | "image" 6 | "log" 7 | "os" 8 | 9 | "github.com/pixiv/go-libjpeg/jpeg" 10 | ) 11 | 12 | func main() { 13 | flag.Parse() 14 | file := flag.Arg(0) 15 | 16 | io, err := os.Open(file) 17 | if err != nil { 18 | log.Fatalln("Can't open file: ", file) 19 | } 20 | 21 | img, err := jpeg.Decode(io, &jpeg.DecoderOptions{}) 22 | if img == nil { 23 | log.Fatalln("Got nil") 24 | } 25 | if err != nil { 26 | log.Fatalln("Got Error: %v", err) 27 | } 28 | 29 | // 30 | // write your code here ... 31 | // 32 | 33 | switch img.(type) { 34 | case *image.YCbCr: 35 | log.Println("decoded YCbCr") 36 | case *image.Gray: 37 | log.Println("decoded Gray") 38 | default: 39 | log.Println("unknown format") 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /lib/src/w32/vars.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010-2012 The W32 Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package w32 6 | 7 | var ( 8 | IID_NULL = &GUID{0x00000000, 0x0000, 0x0000, [8]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}} 9 | IID_IUnknown = &GUID{0x00000000, 0x0000, 0x0000, [8]byte{0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46}} 10 | IID_IDispatch = &GUID{0x00020400, 0x0000, 0x0000, [8]byte{0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46}} 11 | IID_IConnectionPointContainer = &GUID{0xB196B284, 0xBAB4, 0x101A, [8]byte{0xB6, 0x9C, 0x00, 0xAA, 0x00, 0x34, 0x1D, 0x07}} 12 | IID_IConnectionPoint = &GUID{0xB196B286, 0xBAB4, 0x101A, [8]byte{0xB6, 0x9C, 0x00, 0xAA, 0x00, 0x34, 0x1D, 0x07}} 13 | ) 14 | -------------------------------------------------------------------------------- /lib/src/flv.go/flv/bitreader_test.go: -------------------------------------------------------------------------------- 1 | package flv; 2 | 3 | import ( 4 | "testing" 5 | // "bytes" 6 | ) 7 | 8 | func TestBitReader(t *testing.T) { 9 | data1 := []byte {0xF, 0xFF, (1<<7)|(011), (1<<7)|(011)}; 10 | r := NewBitReader(data1) 11 | 12 | p1 := r.U(4) 13 | if p1 != 0 { 14 | t.Errorf("U: 0 != %d", p1) 15 | } 16 | 17 | p2 := r.U(12) 18 | if p2 != 0xFFF { 19 | t.Errorf("U: 0xFFF != %d", p1) 20 | } 21 | 22 | ue1 := r.Ue() 23 | if ue1 != 0 { 24 | t.Errorf("Ue: 0 != %d", ue1) 25 | } 26 | 27 | ue2 := r.Ue() 28 | if ue2 != 8 { 29 | t.Errorf("Ue: 8 != %d", ue2) 30 | } 31 | 32 | se1 := r.Se() 33 | if se1 != 0 { 34 | t.Errorf("Se: 0 != %d", se1) 35 | } 36 | 37 | se2 := r.Se() 38 | if se2 != -4 { 39 | t.Errorf("Se: -4 != %d", se2) 40 | } 41 | } -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/tiff/buffer_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package tiff 6 | 7 | import ( 8 | "io" 9 | "strings" 10 | "testing" 11 | ) 12 | 13 | var readAtTests = []struct { 14 | n int 15 | off int64 16 | s string 17 | err error 18 | }{ 19 | {2, 0, "ab", nil}, 20 | {6, 0, "abcdef", nil}, 21 | {3, 3, "def", nil}, 22 | {3, 5, "f", io.EOF}, 23 | {3, 6, "", io.EOF}, 24 | } 25 | 26 | func TestReadAt(t *testing.T) { 27 | r := newReaderAt(strings.NewReader("abcdef")) 28 | b := make([]byte, 10) 29 | for _, test := range readAtTests { 30 | n, err := r.ReadAt(b[:test.n], test.off) 31 | s := string(b[:n]) 32 | if s != test.s || err != test.err { 33 | t.Errorf("buffer.ReadAt(<%v bytes>, %v): got %v, %q; want %v, %q", test.n, test.off, err, s, test.err, test.s) 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /lib/src/github.com/BurntSushi/xgb/sync.go: -------------------------------------------------------------------------------- 1 | package xgb 2 | 3 | // Sync sends a round trip request and waits for the response. 4 | // This forces all pending cookies to be dealt with. 5 | // You actually shouldn't need to use this like you might with Xlib. Namely, 6 | // buffers are automatically flushed using Go's channels and round trip requests 7 | // are forced where appropriate automatically. 8 | func (c *Conn) Sync() { 9 | cookie := c.NewCookie(true, true) 10 | c.NewRequest(c.getInputFocusRequest(), cookie) 11 | cookie.Reply() // wait for the buffer to clear 12 | } 13 | 14 | // getInputFocusRequest writes the raw bytes to a buffer. 15 | // It is duplicated from xproto/xproto.go. 16 | func (c *Conn) getInputFocusRequest() []byte { 17 | size := 4 18 | b := 0 19 | buf := make([]byte, size) 20 | 21 | buf[b] = 43 // request opcode 22 | b += 1 23 | 24 | b += 1 // padding 25 | Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units 26 | b += 2 27 | 28 | return buf 29 | } 30 | -------------------------------------------------------------------------------- /lib/src/w32/README.md: -------------------------------------------------------------------------------- 1 | About w32 2 | ========== 3 | 4 | w32 is a wrapper of windows apis for the Go Programming Language. 5 | 6 | It wraps win32 apis to "Go style" to make them easier to use. 7 | 8 | Setup 9 | ===== 10 | 11 | 1. Make sure you have a working Go installation and build environment, 12 | see this go-nuts post for details: 13 | http://groups.google.com/group/golang-nuts/msg/5c87630a84f4fd0c 14 | 15 | Updated versions of the Windows Go build are available here: 16 | http://code.google.com/p/gomingw/downloads/list 17 | 18 | 2. Create a "gopath" directory if you do not have one yet and set the 19 | GOPATH variable accordingly. For example: 20 | mkdir -p go-externals/src 21 | export GOPATH=${PWD}/go-externals 22 | 23 | 3. go get github.com/AllenDang/w32 24 | 25 | 4. go install github.com/AllenDang/w32... 26 | 27 | Contribute 28 | ========== 29 | 30 | Contributions in form of design, code, documentation, bug reporting or other 31 | ways you see fit are very welcome. 32 | 33 | Thank You! 34 | -------------------------------------------------------------------------------- /lib/src/w32/comdlg32.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010-2012 The W32 Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package w32 6 | 7 | import ( 8 | "syscall" 9 | "unsafe" 10 | ) 11 | 12 | var ( 13 | modcomdlg32 = syscall.NewLazyDLL("comdlg32.dll") 14 | 15 | procGetSaveFileName = modcomdlg32.NewProc("GetSaveFileNameW") 16 | procGetOpenFileName = modcomdlg32.NewProc("GetOpenFileNameW") 17 | procCommDlgExtendedError = modcomdlg32.NewProc("CommDlgExtendedError") 18 | ) 19 | 20 | func GetOpenFileName(ofn *OPENFILENAME) bool { 21 | ret, _, _ := procGetOpenFileName.Call( 22 | uintptr(unsafe.Pointer(ofn))) 23 | 24 | return ret != 0 25 | } 26 | 27 | func GetSaveFileName(ofn *OPENFILENAME) bool { 28 | ret, _, _ := procGetSaveFileName.Call( 29 | uintptr(unsafe.Pointer(ofn))) 30 | 31 | return ret != 0 32 | } 33 | 34 | func CommDlgExtendedError() uint { 35 | ret, _, _ := procCommDlgExtendedError.Call() 36 | 37 | return uint(ret) 38 | } 39 | -------------------------------------------------------------------------------- /lib/src/codec/util.go: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | 4 | Golang h264,aac decoder/encoder libav wrapper 5 | 6 | d, err = codec.NewAACEncoder() 7 | data, err = d.Encode(samples) 8 | 9 | d, err = codec.NewAACDecoder(aaccfg) 10 | samples, err = d.Decode(data) 11 | 12 | var img *image.YCbCr 13 | d, err = codec.NewH264Encoder(640, 480) 14 | img, err = d.Encode(img) 15 | 16 | d, err = codec.NewH264Decoder(pps) 17 | img, err = d.Decode(nal) 18 | */ 19 | package codec 20 | 21 | /* 22 | #cgo darwin LDFLAGS: -lavformat -lavutil -lavcodec 23 | 24 | #include 25 | #include 26 | 27 | static void libav_init() { 28 | av_register_all(); 29 | av_log_set_level(AV_LOG_DEBUG); 30 | } 31 | */ 32 | import "C" 33 | 34 | import ( 35 | "unsafe" 36 | "reflect" 37 | ) 38 | 39 | func init() { 40 | C.libav_init() 41 | } 42 | 43 | func fromCPtr(buf unsafe.Pointer, size int) (ret []uint8) { 44 | hdr := (*reflect.SliceHeader)((unsafe.Pointer(&ret))) 45 | hdr.Cap = size 46 | hdr.Len = size 47 | hdr.Data = uintptr(buf) 48 | return 49 | } 50 | 51 | 52 | -------------------------------------------------------------------------------- /lib/src/github.com/BurntSushi/xgb/examples/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package examples contains a few different use cases of XGB, like creating 3 | a window, reading properties, and querying for information about multiple 4 | heads using the Xinerama or RandR extensions. 5 | 6 | If you're looking to get started quickly, I recommend checking out the 7 | create-window example first. It is the most documented and probably covers 8 | some of the more common bare bones cases of creating windows and responding 9 | to events. 10 | 11 | If you're looking to query information about your window manager, 12 | get-active-window is a start. However, to do anything extensive requires 13 | a lot of boiler plate. To that end, I'd recommend use of my higher level 14 | library, xgbutil: https://github.com/BurntSushi/xgbutil 15 | 16 | There are also examples of using the Xinerama and RandR extensions, if you're 17 | interested in querying information about your active heads. In RandR's case, 18 | you can also reconfigure your heads, but the example doesn't cover that. 19 | 20 | */ 21 | package documentation 22 | -------------------------------------------------------------------------------- /lib/src/github.com/manucorporat/try/try.go: -------------------------------------------------------------------------------- 1 | package try 2 | 3 | const rethrow_panic = "_____rethrow" 4 | 5 | type ( 6 | E interface{} 7 | exception struct { 8 | finally func() 9 | Error E 10 | } 11 | ) 12 | 13 | func Throw() { 14 | panic(rethrow_panic) 15 | } 16 | 17 | func This(f func()) (e exception) { 18 | e = exception{nil, nil} 19 | // catch error in 20 | defer func() { 21 | e.Error = recover() 22 | }() 23 | f() 24 | return 25 | } 26 | 27 | func (e exception) Catch(f func(err E)) { 28 | if e.Error != nil { 29 | defer func() { 30 | // call finally 31 | if e.finally != nil { 32 | e.finally() 33 | } 34 | 35 | // rethrow exceptions 36 | if err := recover(); err != nil { 37 | if err == rethrow_panic { 38 | err = e.Error 39 | } 40 | panic(err) 41 | } 42 | }() 43 | f(e.Error) 44 | } else if e.finally != nil { 45 | e.finally() 46 | } 47 | } 48 | 49 | func (e exception) Finally(f func()) (e2 exception) { 50 | if e.finally != nil { 51 | panic("finally was only set") 52 | } 53 | e2 = e 54 | e2.finally = f 55 | return 56 | } 57 | -------------------------------------------------------------------------------- /lib/src/stoppableListener/example/example.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "github.com/hydrogen18/stoppableListener" 6 | "net" 7 | "net/http" 8 | "os" 9 | "os/signal" 10 | "sync" 11 | "syscall" 12 | ) 13 | 14 | func helloHttp(rw http.ResponseWriter, req *http.Request) { 15 | rw.WriteHeader(http.StatusOK) 16 | fmt.Fprintf(rw, "Hello HTTP!\n") 17 | } 18 | 19 | func main() { 20 | originalListener, err := net.Listen("tcp", ":8080") 21 | if err != nil { 22 | panic(err) 23 | } 24 | 25 | sl, err := stoppableListener.New(originalListener) 26 | if err != nil { 27 | panic(err) 28 | } 29 | 30 | http.HandleFunc("/", helloHttp) 31 | server := http.Server{} 32 | 33 | stop := make(chan os.Signal) 34 | signal.Notify(stop, syscall.SIGINT) 35 | var wg sync.WaitGroup 36 | go func() { 37 | wg.Add(1) 38 | defer wg.Done() 39 | server.Serve(sl) 40 | }() 41 | 42 | fmt.Printf("Serving HTTP\n") 43 | select { 44 | case signal := <-stop: 45 | fmt.Printf("Got signal:%v\n", signal) 46 | } 47 | fmt.Printf("Stopping listener\n") 48 | sl.Stop() 49 | fmt.Printf("Waiting on server\n") 50 | wg.Wait() 51 | 52 | } 53 | -------------------------------------------------------------------------------- /lib/src/github.com/BurntSushi/xgb/xgbgen/size.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | // Size corresponds to an expression that represents the number of bytes 4 | // in some *thing*. Generally, sizes are used to allocate buffers and to 5 | // inform X how big requests are. 6 | // Size is basically a thin layer over an Expression that yields easy methods 7 | // for adding and multiplying sizes. 8 | type Size struct { 9 | Expression 10 | exact bool 11 | } 12 | 13 | // newFixedSize creates a new Size with some fixed and known value. 14 | func newFixedSize(fixed uint, exact bool) Size { 15 | return Size{&Value{v: int(fixed)}, exact} 16 | } 17 | 18 | // newExpressionSize creates a new Size with some expression. 19 | func newExpressionSize(variable Expression, exact bool) Size { 20 | return Size{variable, exact} 21 | } 22 | 23 | // Add adds s1 and s2 and returns a new Size. 24 | func (s1 Size) Add(s2 Size) Size { 25 | return Size{newBinaryOp("+", s1, s2), s1.exact && s2.exact} 26 | } 27 | 28 | // Multiply mupltiplies s1 and s2 and returns a new Size. 29 | func (s1 Size) Multiply(s2 Size) Size { 30 | return Size{newBinaryOp("*", s1, s2), s1.exact && s2.exact} 31 | } 32 | -------------------------------------------------------------------------------- /lib/src/screenshot/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2012 vova616 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /lib/src/flv.go/LICENSE: -------------------------------------------------------------------------------- 1 | This is the MIT license. 2 | 3 | Copyright (c) 2012 Metachord Ltd. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this 6 | software and associated documentation files (the "Software"), to deal in the Software 7 | without restriction, including without limitation the rights to use, copy, modify, 8 | merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 9 | permit persons to whom the Software is furnished to do so, subject to the following 10 | conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies 13 | or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 16 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 17 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 18 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 19 | CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE 20 | OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /lib/src/imaging/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2012-2014 Grigory Dryapak 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Go 2 | 3 | Go is an open source project. 4 | 5 | It is the work of hundreds of contributors. We appreciate your help! 6 | 7 | 8 | ## Filing issues 9 | 10 | When [filing an issue](https://golang.org/issue/new), make sure to answer these five questions: 11 | 12 | 1. What version of Go are you using (`go version`)? 13 | 2. What operating system and processor architecture are you using? 14 | 3. What did you do? 15 | 4. What did you expect to see? 16 | 5. What did you see instead? 17 | 18 | General questions should go to the [golang-nuts mailing list](https://groups.google.com/group/golang-nuts) instead of the issue tracker. 19 | The gophers there will answer or ask you to file an issue if you've tripped over a bug. 20 | 21 | ## Contributing code 22 | 23 | Please read the [Contribution Guidelines](https://golang.org/doc/contribute.html) 24 | before sending patches. 25 | 26 | **We do not accept GitHub pull requests** 27 | (we use [Gerrit](https://code.google.com/p/gerrit/) instead for code review). 28 | 29 | Unless otherwise noted, the Go source files are distributed under 30 | the BSD-style license found in the LICENSE file. 31 | 32 | -------------------------------------------------------------------------------- /lib/src/simplertmp/rtmp/client.go: -------------------------------------------------------------------------------- 1 | package rtmp 2 | 3 | import ( 4 | "bytes" 5 | "strings" 6 | "time" 7 | ) 8 | 9 | var clientHandler ClientHandler = new(DefaultClientHandler) 10 | 11 | func HandleClientRTMP(h ClientHandler) { 12 | clientHandler = h 13 | } 14 | 15 | func Connect(url string) (s *RtmpNetStream, err error) { 16 | //rtmp://host:port/xxx/xxxx 17 | ss := strings.Split(url, "/") 18 | addr := ss[0] + "//" + ss[2] + "/" + ss[3] 19 | 20 | file := strings.Join(ss[4:], "/") 21 | 22 | conn := newNetConnection() 23 | 24 | err = conn.Connect(addr) 25 | if err != nil { 26 | return 27 | } 28 | s = newNetStream(conn, nil, clientHandler) 29 | s.play(file, "live") 30 | return 31 | } 32 | func newNetConnection() (c *RtmpNetConnection) { 33 | c = new(RtmpNetConnection) 34 | c.readChunkSize = RTMP_DEFAULT_CHUNK_SIZE 35 | c.writeChunkSize = RTMP_DEFAULT_CHUNK_SIZE 36 | c.createTime = time.Now() 37 | c.bandwidth = 512 << 10 38 | c.rchunks = make(map[uint32]*RtmpChunk) 39 | c.wchunks = make(map[uint32]*RtmpChunk) 40 | c.buffer = bytes.NewBuffer(nil) 41 | c.w_buffer = bytes.NewBuffer(nil) 42 | c.nextStreamId = gen_next_stream_id 43 | c.objectEncoding = 0 44 | return 45 | } 46 | -------------------------------------------------------------------------------- /lib/src/github.com/streamrail/concurrent-map/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 streamrail 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /lib/src/github.com/pixiv/go-libjpeg/jpeg/jpeg.go: -------------------------------------------------------------------------------- 1 | // Package jpeg decodes JPEG image to image.YCbCr using libjpeg (or libjpeg-turbo). 2 | package jpeg 3 | 4 | // 5 | // Original codes are bollowed from go-thumber. 6 | // Copyright (c) 2014 pixiv Inc. All rights reserved. 7 | // 8 | // See: https://github.com/pixiv/go-thumber 9 | // 10 | 11 | /* 12 | #cgo LDFLAGS: -ljpeg 13 | #include 14 | #include 15 | #include 16 | 17 | static J_COLOR_SPACE getJCS_EXT_RGBA(void) { 18 | #ifdef JCS_ALPHA_EXTENSIONS 19 | return JCS_EXT_RGBA; 20 | #endif 21 | return JCS_UNKNOWN; 22 | } 23 | 24 | */ 25 | import "C" 26 | 27 | // Y/Cb/Cr Planes 28 | const ( 29 | Y = 0 30 | Cb = 1 31 | Cr = 2 32 | ) 33 | 34 | // DCTMethod is the DCT/IDCT method type. 35 | type DCTMethod C.J_DCT_METHOD 36 | 37 | const ( 38 | // DCTISlow is slow but accurate integer algorithm 39 | DCTISlow DCTMethod = C.JDCT_ISLOW 40 | // DCTIFast is faster, less accurate integer method 41 | DCTIFast DCTMethod = C.JDCT_IFAST 42 | // DCTFloat is floating-point: accurate, fast on fast HW 43 | DCTFloat DCTMethod = C.JDCT_FLOAT 44 | ) 45 | 46 | func getJCS_EXT_RGBA() C.J_COLOR_SPACE { 47 | return C.getJCS_EXT_RGBA() 48 | } 49 | -------------------------------------------------------------------------------- /lib/src/github.com/BurntSushi/xgb/examples/xinerama/main.go: -------------------------------------------------------------------------------- 1 | // Example xinerama shows how to query the geometry of all active heads. 2 | package main 3 | 4 | import ( 5 | "fmt" 6 | "log" 7 | 8 | "github.com/BurntSushi/xgb" 9 | "github.com/BurntSushi/xgb/xinerama" 10 | ) 11 | 12 | func main() { 13 | X, err := xgb.NewConn() 14 | if err != nil { 15 | log.Fatal(err) 16 | } 17 | 18 | // Initialize the Xinerama extension. 19 | // The appropriate 'Init' function must be run for *every* 20 | // extension before any of its requests can be used. 21 | err = xinerama.Init(X) 22 | if err != nil { 23 | log.Fatal(err) 24 | } 25 | 26 | // Issue a request to get the screen information. 27 | reply, err := xinerama.QueryScreens(X).Reply() 28 | if err != nil { 29 | log.Fatal(err) 30 | } 31 | 32 | // reply.Number is the number of active heads, while reply.ScreenInfo 33 | // is a slice of XineramaScreenInfo containing the rectangle geometry 34 | // of each head. 35 | fmt.Printf("Number of heads: %d\n", reply.Number) 36 | for i, screen := range reply.ScreenInfo { 37 | fmt.Printf("%d :: X: %d, Y: %d, Width: %d, Height: %d\n", 38 | i, screen.XOrg, screen.YOrg, screen.Width, screen.Height) 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /lib/src/w32/idispatch.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010-2012 The W32 Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package w32 6 | 7 | import ( 8 | "unsafe" 9 | ) 10 | 11 | type pIDispatchVtbl struct { 12 | pQueryInterface uintptr 13 | pAddRef uintptr 14 | pRelease uintptr 15 | pGetTypeInfoCount uintptr 16 | pGetTypeInfo uintptr 17 | pGetIDsOfNames uintptr 18 | pInvoke uintptr 19 | } 20 | 21 | type IDispatch struct { 22 | lpVtbl *pIDispatchVtbl 23 | } 24 | 25 | func (this *IDispatch) QueryInterface(id *GUID) *IDispatch { 26 | return ComQueryInterface((*IUnknown)(unsafe.Pointer(this)), id) 27 | } 28 | 29 | func (this *IDispatch) AddRef() int32 { 30 | return ComAddRef((*IUnknown)(unsafe.Pointer(this))) 31 | } 32 | 33 | func (this *IDispatch) Release() int32 { 34 | return ComRelease((*IUnknown)(unsafe.Pointer(this))) 35 | } 36 | 37 | func (this *IDispatch) GetIDsOfName(names []string) []int32 { 38 | return ComGetIDsOfName(this, names) 39 | } 40 | 41 | func (this *IDispatch) Invoke(dispid int32, dispatch int16, params ...interface{}) *VARIANT { 42 | return ComInvoke(this, dispid, dispatch, params...) 43 | } 44 | -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/math/f32/f32.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package f32 implements float32 vector and matrix types. 6 | package f32 // import "golang.org/x/image/math/f32" 7 | 8 | // Vec2 is a 2-element vector. 9 | type Vec2 [2]float32 10 | 11 | // Vec3 is a 3-element vector. 12 | type Vec3 [3]float32 13 | 14 | // Vec4 is a 4-element vector. 15 | type Vec4 [4]float32 16 | 17 | // Mat3 is a 3x3 matrix in row major order. 18 | // 19 | // m[3*r + c] is the element in the r'th row and c'th column. 20 | type Mat3 [9]float32 21 | 22 | // Mat4 is a 4x4 matrix in row major order. 23 | // 24 | // m[4*r + c] is the element in the r'th row and c'th column. 25 | type Mat4 [16]float32 26 | 27 | // Aff3 is a 3x3 affine transformation matrix in row major order, where the 28 | // bottom row is implicitly [0 0 1]. 29 | // 30 | // m[3*r + c] is the element in the r'th row and c'th column. 31 | type Aff3 [6]float32 32 | 33 | // Aff4 is a 4x4 affine transformation matrix in row major order, where the 34 | // bottom row is implicitly [0 0 0 1]. 35 | // 36 | // m[4*r + c] is the element in the r'th row and c'th column. 37 | type Aff4 [12]float32 38 | -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/math/f64/f64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package f64 implements float64 vector and matrix types. 6 | package f64 // import "golang.org/x/image/math/f64" 7 | 8 | // Vec2 is a 2-element vector. 9 | type Vec2 [2]float64 10 | 11 | // Vec3 is a 3-element vector. 12 | type Vec3 [3]float64 13 | 14 | // Vec4 is a 4-element vector. 15 | type Vec4 [4]float64 16 | 17 | // Mat3 is a 3x3 matrix in row major order. 18 | // 19 | // m[3*r + c] is the element in the r'th row and c'th column. 20 | type Mat3 [9]float64 21 | 22 | // Mat4 is a 4x4 matrix in row major order. 23 | // 24 | // m[4*r + c] is the element in the r'th row and c'th column. 25 | type Mat4 [16]float64 26 | 27 | // Aff3 is a 3x3 affine transformation matrix in row major order, where the 28 | // bottom row is implicitly [0 0 1]. 29 | // 30 | // m[3*r + c] is the element in the r'th row and c'th column. 31 | type Aff3 [6]float64 32 | 33 | // Aff4 is a 4x4 affine transformation matrix in row major order, where the 34 | // bottom row is implicitly [0 0 0 1]. 35 | // 36 | // m[4*r + c] is the element in the r'th row and c'th column. 37 | type Aff4 [12]float64 38 | -------------------------------------------------------------------------------- /lib/src/flv.go/flv/errors.go: -------------------------------------------------------------------------------- 1 | package flv 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | type Error interface { 8 | Error() string 9 | IsRecoverable() bool 10 | } 11 | 12 | type ReadError struct { 13 | incomplete *CFrame 14 | position int64 15 | } 16 | 17 | func (e *ReadError) Error() string { 18 | if e.incomplete == nil { 19 | return fmt.Sprintf("Invalid tag type @%d", e.position) 20 | } else { 21 | return fmt.Sprintf("Incomplete frame[dts=%d,stream=%d]@%d", e.incomplete.Dts, e.incomplete.Stream, e.position) 22 | } 23 | } 24 | 25 | func (e *ReadError) IsRecoverable() bool { 26 | return true 27 | } 28 | 29 | func IncompleteFrameError(incomplete *CFrame) Error { 30 | return &ReadError{incomplete, incomplete.Position+11} 31 | } 32 | 33 | func InvalidTagStart(position int64) Error { 34 | return &ReadError{nil, position} 35 | } 36 | 37 | type UnrecoverableError struct { 38 | message string 39 | position int64 40 | } 41 | 42 | func (e *UnrecoverableError) Error() string { 43 | return fmt.Sprintf("unrecoverable@%d: %s", e.position, e.message) 44 | } 45 | 46 | func (*UnrecoverableError) IsRecoverable () bool { 47 | return false 48 | } 49 | 50 | func Unrecoverable(message string, position int64) Error { 51 | return &UnrecoverableError{message, position} 52 | } -------------------------------------------------------------------------------- /lib/src/stoppableListener/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014, Eric Urban 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 5 | 6 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 7 | 8 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | 10 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /lib/src/simplertmp/rtmp/rtmp_writer.go: -------------------------------------------------------------------------------- 1 | package rtmp 2 | 3 | import ( 4 | "bytes" 5 | "io" 6 | ) 7 | 8 | func NewRtmpWriter(chunkSize int, streamid uint32) *rtmpWriter { 9 | return &rtmpWriter{ 10 | avconfig: []byte{}, 11 | chunkSize: chunkSize, 12 | streamid: streamid, 13 | wchunk: make(map[uint32]*RtmpChunk, 0), 14 | } 15 | } 16 | 17 | type rtmpWriter struct { 18 | avconfig []byte 19 | chunkSize int 20 | streamid uint32 21 | wchunk map[uint32]*RtmpChunk 22 | buffer *bytes.Buffer 23 | } 24 | 25 | func (w *rtmpWriter) SetMetadata(frame *MediaFrame) error { 26 | return nil 27 | } 28 | func (w *rtmpWriter) SetVideoConfig(frame *MediaFrame) error { 29 | return nil 30 | } 31 | func (w *rtmpWriter) SetAudioConfig(frame *MediaFrame) error { 32 | return nil 33 | } 34 | 35 | func (w *rtmpWriter) Write(frame *MediaFrame) error { 36 | return nil 37 | } 38 | 39 | func (w *rtmpWriter) WriteTo(o io.Writer) (n int64, err error) { 40 | return 41 | } 42 | 43 | func (w *rtmpWriter) Bytes() []byte { 44 | return w.buffer.Bytes() 45 | } 46 | 47 | func (w *rtmpWriter) ResetWChunk() { 48 | w.wchunk = make(map[uint32]*RtmpChunk, 0) 49 | } 50 | 51 | func (w *rtmpWriter) ResetBuffer() { 52 | w.buffer.Reset() 53 | } 54 | 55 | func (w *rtmpWriter) Reset() { 56 | w.wchunk = make(map[uint32]*RtmpChunk, 0) 57 | w.buffer.Reset() 58 | } 59 | -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/font/inconsolata/inconsolata.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:generate genbasicfont -size=16 -pkg=inconsolata -hinting=full -var=regular8x16 -fontfile=http://www.levien.com/type/myfonts/inconsolata/InconsolataGo-Regular.ttf 6 | //go:generate genbasicfont -size=16 -pkg=inconsolata -hinting=full -var=bold8x16 -fontfile=http://www.levien.com/type/myfonts/inconsolata/InconsolataGo-Bold.ttf 7 | 8 | // The genbasicfont program is github.com/golang/freetype/example/genbasicfont 9 | 10 | // Package inconsolata provides pre-rendered bitmap versions of the Inconsolata 11 | // font family. 12 | // 13 | // Inconsolata is copyright Raph Levien and Cyreal. This package is licensed 14 | // under Go's BSD-style license (https://golang.org/LICENSE) with their 15 | // permission. 16 | // 17 | // Inconsolata's home page is at 18 | // http://www.levien.com/type/myfonts/inconsolata.html 19 | package inconsolata // import "golang.org/x/image/font/inconsolata" 20 | 21 | import ( 22 | "golang.org/x/image/font/basicfont" 23 | ) 24 | 25 | // Regular8x16 is a regular weight, 8x16 font face. 26 | var Regular8x16 *basicfont.Face = ®ular8x16 27 | 28 | // Bold8x16 is a bold weight, 8x16 font face. 29 | var Bold8x16 *basicfont.Face = &bold8x16 30 | -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /lib/src/screenshot/screenshot_freebsd.go: -------------------------------------------------------------------------------- 1 | package screenshot 2 | 3 | import ( 4 | "image" 5 | 6 | "github.com/BurntSushi/xgb" 7 | "github.com/BurntSushi/xgb/xproto" 8 | ) 9 | 10 | func ScreenRect() (image.Rectangle, error) { 11 | c, err := xgb.NewConn() 12 | if err != nil { 13 | return image.Rectangle{}, err 14 | } 15 | defer c.Close() 16 | 17 | screen := xproto.Setup(c).DefaultScreen(c) 18 | x := screen.WidthInPixels 19 | y := screen.HeightInPixels 20 | 21 | return image.Rect(0, 0, int(x), int(y)), nil 22 | } 23 | 24 | func CaptureScreen() (*image.RGBA, error) { 25 | r, e := ScreenRect() 26 | if e != nil { 27 | return nil, e 28 | } 29 | return CaptureRect(r) 30 | } 31 | 32 | func CaptureRect(rect image.Rectangle) (*image.RGBA, error) { 33 | c, err := xgb.NewConn() 34 | if err != nil { 35 | return nil, err 36 | } 37 | defer c.Close() 38 | 39 | screen := xproto.Setup(c).DefaultScreen(c) 40 | x, y := rect.Dx(), rect.Dy() 41 | xImg, err := xproto.GetImage(c, xproto.ImageFormatZPixmap, xproto.Drawable(screen.Root), int16(rect.Min.X), int16(rect.Min.Y), uint16(x), uint16(y), 0xffffffff).Reply() 42 | if err != nil { 43 | return nil, err 44 | } 45 | 46 | data := xImg.Data 47 | for i := 0; i < len(data); i += 4 { 48 | data[i], data[i+2], data[i+3] = data[i+2], data[i], 255 49 | } 50 | 51 | img := &image.RGBA{data, 4 * x, image.Rect(0, 0, x, y)} 52 | return img, nil 53 | } 54 | -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/tiff/compress.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package tiff 6 | 7 | import ( 8 | "bufio" 9 | "io" 10 | ) 11 | 12 | type byteReader interface { 13 | io.Reader 14 | io.ByteReader 15 | } 16 | 17 | // unpackBits decodes the PackBits-compressed data in src and returns the 18 | // uncompressed data. 19 | // 20 | // The PackBits compression format is described in section 9 (p. 42) 21 | // of the TIFF spec. 22 | func unpackBits(r io.Reader) ([]byte, error) { 23 | buf := make([]byte, 128) 24 | dst := make([]byte, 0, 1024) 25 | br, ok := r.(byteReader) 26 | if !ok { 27 | br = bufio.NewReader(r) 28 | } 29 | 30 | for { 31 | b, err := br.ReadByte() 32 | if err != nil { 33 | if err == io.EOF { 34 | return dst, nil 35 | } 36 | return nil, err 37 | } 38 | code := int(int8(b)) 39 | switch { 40 | case code >= 0: 41 | n, err := io.ReadFull(br, buf[:code+1]) 42 | if err != nil { 43 | return nil, err 44 | } 45 | dst = append(dst, buf[:n]...) 46 | case code == -128: 47 | // No-op. 48 | default: 49 | if b, err = br.ReadByte(); err != nil { 50 | return nil, err 51 | } 52 | for j := 0; j < 1-code; j++ { 53 | buf[j] = b 54 | } 55 | dst = append(dst, buf[:1-code]...) 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /lib/src/codec/README.md: -------------------------------------------------------------------------------- 1 | 2 | codec 3 | ==== 4 | 5 | Golang aac/h264 encoder and decoder 6 | 7 | H264 encoding example 8 | 9 | w := 400 10 | h := 400 11 | var nal [][]byte 12 | 13 | c, _ := codec.NewH264Encoder(w, h, image.YCbCrSubsampleRatio420) 14 | nal = append(nal, c.Header) 15 | 16 | for i := 0; i < 60; i++ { 17 | img := image.NewYCbCr(image.Rect(0,0,w,h), image.YCbCrSubsampleRatio420) 18 | p, _ := c.Encode(img) 19 | if len(p.Data) > 0 { 20 | nal = append(nal, p.Data) 21 | } 22 | } 23 | for { 24 | // flush encoder 25 | p, err := c.Encode(nil) 26 | if err != nil { 27 | break 28 | } 29 | nal = append(nal, p.Data) 30 | } 31 | 32 | H264 decoding example 33 | 34 | dec, err := codec.NewH264Decoder(nal[0]) 35 | for i, n := range nal[1:] { 36 | img, err := dec.Decode(n) 37 | if err == nil { 38 | fp, _ := os.Create(fmt.Sprintf("/tmp/dec-%d.jpg", i)) 39 | jpeg.Encode(fp, img, nil) 40 | fp.Close() 41 | } 42 | } 43 | 44 | AAC encoding example 45 | 46 | var pkts [][]byte 47 | 48 | c, _ := codec.NewAACEncoder() 49 | pkts = append(pkts, c.Header) 50 | 51 | for i := 0; i < 60; i++ { 52 | var sample [8192]byte 53 | p, _ := c.Encode(sample) 54 | if len(p) > 0 { 55 | pkts = append(pkts, p) 56 | } 57 | } 58 | 59 | AAC decoding example 60 | 61 | dec, _ := codec.NewAACDecoder(pkts[0]) 62 | for _, p := range pkts[1:] { 63 | sample, err := dec.Decode(p) 64 | } 65 | 66 | -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/colornames/colornames_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package colornames 6 | 7 | import ( 8 | "image/color" 9 | "testing" 10 | ) 11 | 12 | func TestColornames(t *testing.T) { 13 | if len(Map) != len(Names) { 14 | t.Fatalf("Map and Names have different length: %d vs %d", len(Map), len(Names)) 15 | } 16 | 17 | for name, want := range testCases { 18 | got, ok := Map[name] 19 | if !ok { 20 | t.Errorf("Did not find %s", name) 21 | continue 22 | } 23 | if got != want { 24 | t.Errorf("%s:\ngot %v\nwant %v", name, got, want) 25 | } 26 | } 27 | } 28 | 29 | var testCases = map[string]color.RGBA{ 30 | "aliceblue": color.RGBA{240, 248, 255, 255}, 31 | "crimson": color.RGBA{220, 20, 60, 255}, 32 | "darkorange": color.RGBA{255, 140, 0, 255}, 33 | "deepskyblue": color.RGBA{0, 191, 255, 255}, 34 | "greenyellow": color.RGBA{173, 255, 47, 255}, 35 | "lightgrey": color.RGBA{211, 211, 211, 255}, 36 | "lightpink": color.RGBA{255, 182, 193, 255}, 37 | "mediumseagreen": color.RGBA{60, 179, 113, 255}, 38 | "olivedrab": color.RGBA{107, 142, 35, 255}, 39 | "purple": color.RGBA{128, 0, 128, 255}, 40 | "slategrey": color.RGBA{112, 128, 144, 255}, 41 | "yellowgreen": color.RGBA{154, 205, 50, 255}, 42 | } 43 | -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/webp/webp.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package webp implements a decoder for WEBP images. 6 | // 7 | // WEBP is defined at: 8 | // https://developers.google.com/speed/webp/docs/riff_container 9 | // 10 | // It requires Go 1.6 or later. 11 | package webp // import "golang.org/x/image/webp" 12 | 13 | // This blank Go file, other than the package clause, exists so that this 14 | // package can be built for Go 1.5 and earlier. (The other files in this 15 | // package are all marked "+build go1.6" for the NYCbCrA types introduced in Go 16 | // 1.6). There is no functionality in a blank package, but some image 17 | // manipulation programs might still underscore import this package for the 18 | // side effect of registering the WEBP format with the standard library's 19 | // image.RegisterFormat and image.Decode functions. For example, that program 20 | // might contain: 21 | // 22 | // // Underscore imports to register some formats for image.Decode. 23 | // import _ "image/gif" 24 | // import _ "image/jpeg" 25 | // import _ "image/png" 26 | // import _ "golang.org/x/image/webp" 27 | // 28 | // Such a program will still compile for Go 1.5 (due to this placeholder Go 29 | // file). It will simply not be able to recognize and decode WEBP (but still 30 | // handle GIF, JPEG and PNG). 31 | -------------------------------------------------------------------------------- /lib/src/github.com/BurntSushi/xgb/xgbgen/misc.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "regexp" 5 | "strings" 6 | ) 7 | 8 | // AllCaps is a regex to test if a string identifier is made of 9 | // all upper case letters. 10 | var allCaps = regexp.MustCompile("^[A-Z0-9]+$") 11 | 12 | // popCount counts number of bits 'set' in mask. 13 | func popCount(mask uint) uint { 14 | m := uint32(mask) 15 | n := uint(0) 16 | for i := uint32(0); i < 32; i++ { 17 | if m&(1< -1 { 22 | basename = basename[lastSlash+1:] 23 | } 24 | log.Printf("Usage: %s [flags] xml-file", basename) 25 | flag.PrintDefaults() 26 | os.Exit(1) 27 | } 28 | 29 | func init() { 30 | log.SetFlags(0) 31 | } 32 | 33 | func main() { 34 | flag.Usage = usage 35 | flag.Parse() 36 | 37 | if flag.NArg() != 1 { 38 | log.Printf("A single XML protocol file can be processed at once.") 39 | flag.Usage() 40 | } 41 | 42 | // Read the single XML file into []byte 43 | xmlBytes, err := ioutil.ReadFile(flag.Arg(0)) 44 | if err != nil { 45 | log.Fatal(err) 46 | } 47 | 48 | // Initialize the buffer, parse it, and filter it through gofmt. 49 | c := newContext() 50 | c.Morph(xmlBytes) 51 | 52 | if !*gofmt { 53 | c.out.WriteTo(os.Stdout) 54 | } else { 55 | cmdGofmt := exec.Command("gofmt") 56 | cmdGofmt.Stdin = c.out 57 | cmdGofmt.Stdout = os.Stdout 58 | cmdGofmt.Stderr = os.Stderr 59 | err = cmdGofmt.Run() 60 | if err != nil { 61 | log.Fatal(err) 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /lib/src/github.com/BurntSushi/xgb/STYLE: -------------------------------------------------------------------------------- 1 | I like to keep all my code to 80 columns or less. I have plenty of screen real 2 | estate, but enjoy 80 columns so that I can have multiple code windows open side 3 | to side and not be plagued by the ugly auto-wrapping of a text editor. 4 | 5 | If you don't oblige me, I will fix any patch you submit to abide 80 columns. 6 | 7 | Note that this style restriction does not preclude gofmt, but introduces a few 8 | peculiarities. The first is that gofmt will occasionally add spacing (typically 9 | to comments) that ends up going over 80 columns. Either shorten the comment or 10 | put it on its own line. 11 | 12 | The second and more common hiccup is when a function definition extends beyond 13 | 80 columns. If one adds line breaks to keep it below 80 columns, gofmt will 14 | indent all subsequent lines in a function definition to the same indentation 15 | level of the function body. This results in a less-than-ideal separation 16 | between function definition and function body. To remedy this, simply add a 17 | line break like so: 18 | 19 | func RestackWindowExtra(xu *xgbutil.XUtil, win xproto.Window, stackMode int, 20 | sibling xproto.Window, source int) error { 21 | 22 | return ClientEvent(xu, win, "_NET_RESTACK_WINDOW", source, int(sibling), 23 | stackMode) 24 | } 25 | 26 | Something similar should also be applied to long 'if' or 'for' conditionals, 27 | although it would probably be preferrable to break up the conditional to 28 | smaller chunks with a few helper variables. 29 | 30 | -------------------------------------------------------------------------------- /lib/src/github.com/pixiv/go-libjpeg/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 pixiv Inc. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of pixiv Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /lib/src/seelog/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012, Cloud Instruments Co., Ltd. 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of the Cloud Instruments Co., Ltd. nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 19 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /lib/src/github.com/BurntSushi/xgb/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | Andrew Gallant is the maintainer of this fork. What follows is the original 2 | list of contributors for the x-go-binding. 3 | 4 | # This is the official list of people who can contribute 5 | # (and typically have contributed) code to the XGB repository. 6 | # The AUTHORS file lists the copyright holders; this file 7 | # lists people. For example, Google employees are listed here 8 | # but not in AUTHORS, because Google holds the copyright. 9 | # 10 | # The submission process automatically checks to make sure 11 | # that people submitting code are listed in this file (by email address). 12 | # 13 | # Names should be added to this file only after verifying that 14 | # the individual or the individual's organization has agreed to 15 | # the appropriate Contributor License Agreement, found here: 16 | # 17 | # http://code.google.com/legal/individual-cla-v1.0.html 18 | # http://code.google.com/legal/corporate-cla-v1.0.html 19 | # 20 | # The agreement for individuals can be filled out on the web. 21 | # 22 | # When adding J Random Contributor's name to this file, 23 | # either J's name or J's organization's name should be 24 | # added to the AUTHORS file, depending on whether the 25 | # individual or corporate CLA was used. 26 | 27 | # Names should be added to this file like so: 28 | # Name 29 | 30 | # Please keep the list sorted. 31 | 32 | Anthony Martin 33 | Firmansyah Adiputra 34 | Ian Lance Taylor 35 | Nigel Tao 36 | Robert Griesemer 37 | Russ Cox 38 | Scott Lawrence 39 | Tor Andersson 40 | -------------------------------------------------------------------------------- /lib/src/github.com/sdming/gosnow/gosnow_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | github.com/twitter/snowflake in golang 3 | */ 4 | 5 | package gosnow 6 | 7 | import ( 8 | "testing" 9 | "github.com/stretchrcom/testify/assert" 10 | ) 11 | 12 | func TestDefaultWorkId(t *testing.T) { 13 | id := DefaultWorkId() 14 | id2 := DefaultWorkId() 15 | t.Logf("id %v, next id %v", id, id2) 16 | 17 | if id != id2 { 18 | t.Errorf("different workd id, %v and %v", id, id2) 19 | } 20 | } 21 | 22 | func TestNext(t *testing.T) { 23 | sf, err := Default() 24 | assert.Nil(t, err) 25 | 26 | id, err := sf.Next() 27 | assert.Nil(t, err) 28 | 29 | id2, err := sf.Next() 30 | assert.Nil(t, err) 31 | 32 | t.Logf("id %v, next id %v", id, id2) 33 | 34 | if id > id2 { 35 | t.Errorf("id %v is smaller then previous one %v", id2, id) 36 | } 37 | } 38 | 39 | func TestDuplicate(t *testing.T) { 40 | 41 | total := 1000 * 1000 42 | data := make(map[uint64]int) 43 | 44 | sf, err := Default() 45 | assert.Nil(t, err) 46 | 47 | var id, pre uint64 48 | for i := 0; i < total; i++ { 49 | 50 | id, err = sf.Next() 51 | assert.Nil(t, err) 52 | 53 | if id < pre { 54 | t.Errorf("id %v is samller than previous one %v", id, pre) 55 | } 56 | pre = id 57 | 58 | count := data[id] 59 | if count > 0 { 60 | t.Errorf("duplicate id %v %d", id, count) 61 | } 62 | data[id] = count + 1 63 | } 64 | 65 | length := len(data) 66 | t.Logf("map length %v", length) 67 | if length != total { 68 | t.Errorf("legth does not match want %v actual %d", total, length) 69 | } 70 | 71 | } 72 | -------------------------------------------------------------------------------- /lib/src/seelog/common_flusher.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 - Cloud Instruments Co., Ltd. 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this 9 | // list of conditions and the following disclaimer. 10 | // 2. Redistributions in binary form must reproduce the above copyright notice, 11 | // this list of conditions and the following disclaimer in the documentation 12 | // and/or other materials provided with the distribution. 13 | // 14 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 18 | // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 | // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | 25 | package seelog 26 | 27 | // flusherInterface represents all objects that have to do cleanup 28 | // at certain moments of time (e.g. before app shutdown to avoid data loss) 29 | type flusherInterface interface { 30 | Flush() 31 | } 32 | -------------------------------------------------------------------------------- /lib/src/imaging/utils.go: -------------------------------------------------------------------------------- 1 | package imaging 2 | 3 | import ( 4 | "math" 5 | "runtime" 6 | "sync" 7 | "sync/atomic" 8 | ) 9 | 10 | var parallelizationEnabled = true 11 | 12 | // if GOMAXPROCS = 1: no goroutines used 13 | // if GOMAXPROCS > 1: spawn N=GOMAXPROCS workers in separate goroutines 14 | func parallel(dataSize int, fn func(partStart, partEnd int)) { 15 | numGoroutines := 1 16 | partSize := dataSize 17 | 18 | if parallelizationEnabled { 19 | numProcs := runtime.GOMAXPROCS(0) 20 | if numProcs > 1 { 21 | numGoroutines = numProcs 22 | partSize = dataSize / (numGoroutines * 10) 23 | if partSize < 1 { 24 | partSize = 1 25 | } 26 | } 27 | } 28 | 29 | if numGoroutines == 1 { 30 | fn(0, dataSize) 31 | } else { 32 | var wg sync.WaitGroup 33 | wg.Add(numGoroutines) 34 | idx := uint64(0) 35 | 36 | for p := 0; p < numGoroutines; p++ { 37 | go func() { 38 | defer wg.Done() 39 | for { 40 | partStart := int(atomic.AddUint64(&idx, uint64(partSize))) - partSize 41 | if partStart >= dataSize { 42 | break 43 | } 44 | partEnd := partStart + partSize 45 | if partEnd > dataSize { 46 | partEnd = dataSize 47 | } 48 | fn(partStart, partEnd) 49 | } 50 | }() 51 | } 52 | 53 | wg.Wait() 54 | } 55 | } 56 | 57 | func absint(i int) int { 58 | if i < 0 { 59 | return -i 60 | } 61 | return i 62 | } 63 | 64 | // clamp & round float64 to uint8 (0..255) 65 | func clamp(v float64) uint8 { 66 | return uint8(math.Min(math.Max(v, 0.0), 255.0) + 0.5) 67 | } 68 | 69 | // clamp int32 to uint8 (0..255) 70 | func clampint32(v int32) uint8 { 71 | if v < 0 { 72 | return 0 73 | } else if v > 255 { 74 | return 255 75 | } 76 | return uint8(v) 77 | } 78 | -------------------------------------------------------------------------------- /lib/src/imaging/utils_test.go: -------------------------------------------------------------------------------- 1 | package imaging 2 | 3 | import ( 4 | "runtime" 5 | "testing" 6 | ) 7 | 8 | func testParallelN(enabled bool, n, procs int) bool { 9 | data := make([]bool, n) 10 | before := runtime.GOMAXPROCS(0) 11 | runtime.GOMAXPROCS(procs) 12 | parallel(n, func(start, end int) { 13 | for i := start; i < end; i++ { 14 | data[i] = true 15 | } 16 | }) 17 | for i := 0; i < n; i++ { 18 | if data[i] != true { 19 | return false 20 | } 21 | } 22 | runtime.GOMAXPROCS(before) 23 | return true 24 | } 25 | 26 | func TestParallel(t *testing.T) { 27 | for _, e := range []bool{true, false} { 28 | for _, n := range []int{1, 10, 100, 1000} { 29 | for _, p := range []int{1, 2, 4, 8, 16, 100} { 30 | if testParallelN(e, n, p) != true { 31 | t.Errorf("test [parallel %v %d %d] failed", e, n, p) 32 | } 33 | } 34 | } 35 | } 36 | } 37 | 38 | func TestClamp(t *testing.T) { 39 | td := []struct { 40 | f float64 41 | u uint8 42 | }{ 43 | {0, 0}, 44 | {255, 255}, 45 | {128, 128}, 46 | {0.49, 0}, 47 | {0.50, 1}, 48 | {254.9, 255}, 49 | {254.0, 254}, 50 | {256, 255}, 51 | {2500, 255}, 52 | {-10, 0}, 53 | {127.6, 128}, 54 | } 55 | 56 | for _, d := range td { 57 | if clamp(d.f) != d.u { 58 | t.Errorf("test [clamp %v %v] failed: %v", d.f, d.u, clamp(d.f)) 59 | } 60 | } 61 | } 62 | 63 | func TestClampint32(t *testing.T) { 64 | td := []struct { 65 | i int32 66 | u uint8 67 | }{ 68 | {0, 0}, 69 | {255, 255}, 70 | {128, 128}, 71 | {256, 255}, 72 | {2500, 255}, 73 | {-10, 0}, 74 | } 75 | 76 | for _, d := range td { 77 | if clampint32(d.i) != d.u { 78 | t.Errorf("test [clampint32 %v %v] failed: %v", d.i, d.u, clampint32(d.i)) 79 | } 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /lib/src/w32/ole32.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010-2012 The W32 Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package w32 6 | 7 | import ( 8 | "syscall" 9 | "unsafe" 10 | ) 11 | 12 | var ( 13 | modole32 = syscall.NewLazyDLL("ole32.dll") 14 | 15 | procCoInitializeEx = modole32.NewProc("CoInitializeEx") 16 | procCoInitialize = modole32.NewProc("CoInitialize") 17 | procCoUninitialize = modole32.NewProc("CoUninitialize") 18 | procCreateStreamOnHGlobal = modole32.NewProc("CreateStreamOnHGlobal") 19 | ) 20 | 21 | func CoInitializeEx(coInit uintptr) HRESULT { 22 | ret, _, _ := procCoInitializeEx.Call( 23 | 0, 24 | coInit) 25 | 26 | switch uint32(ret) { 27 | case E_INVALIDARG: 28 | panic("CoInitializeEx failed with E_INVALIDARG") 29 | case E_OUTOFMEMORY: 30 | panic("CoInitializeEx failed with E_OUTOFMEMORY") 31 | case E_UNEXPECTED: 32 | panic("CoInitializeEx failed with E_UNEXPECTED") 33 | } 34 | 35 | return HRESULT(ret) 36 | } 37 | 38 | func CoInitialize() { 39 | procCoInitialize.Call(0) 40 | } 41 | 42 | func CoUninitialize() { 43 | procCoUninitialize.Call() 44 | } 45 | 46 | func CreateStreamOnHGlobal(hGlobal HGLOBAL, fDeleteOnRelease bool) *IStream { 47 | stream := new(IStream) 48 | ret, _, _ := procCreateStreamOnHGlobal.Call( 49 | uintptr(hGlobal), 50 | uintptr(BoolToBOOL(fDeleteOnRelease)), 51 | uintptr(unsafe.Pointer(&stream))) 52 | 53 | switch uint32(ret) { 54 | case E_INVALIDARG: 55 | panic("CreateStreamOnHGlobal failed with E_INVALIDARG") 56 | case E_OUTOFMEMORY: 57 | panic("CreateStreamOnHGlobal failed with E_OUTOFMEMORY") 58 | case E_UNEXPECTED: 59 | panic("CreateStreamOnHGlobal failed with E_UNEXPECTED") 60 | } 61 | 62 | return stream 63 | } 64 | -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/tiff/buffer.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package tiff 6 | 7 | import "io" 8 | 9 | // buffer buffers an io.Reader to satisfy io.ReaderAt. 10 | type buffer struct { 11 | r io.Reader 12 | buf []byte 13 | } 14 | 15 | // fill reads data from b.r until the buffer contains at least end bytes. 16 | func (b *buffer) fill(end int) error { 17 | m := len(b.buf) 18 | if end > m { 19 | if end > cap(b.buf) { 20 | newcap := 1024 21 | for newcap < end { 22 | newcap *= 2 23 | } 24 | newbuf := make([]byte, end, newcap) 25 | copy(newbuf, b.buf) 26 | b.buf = newbuf 27 | } else { 28 | b.buf = b.buf[:end] 29 | } 30 | if n, err := io.ReadFull(b.r, b.buf[m:end]); err != nil { 31 | end = m + n 32 | b.buf = b.buf[:end] 33 | return err 34 | } 35 | } 36 | return nil 37 | } 38 | 39 | func (b *buffer) ReadAt(p []byte, off int64) (int, error) { 40 | o := int(off) 41 | end := o + len(p) 42 | if int64(end) != off+int64(len(p)) { 43 | return 0, io.ErrUnexpectedEOF 44 | } 45 | 46 | err := b.fill(end) 47 | return copy(p, b.buf[o:end]), err 48 | } 49 | 50 | // Slice returns a slice of the underlying buffer. The slice contains 51 | // n bytes starting at offset off. 52 | func (b *buffer) Slice(off, n int) ([]byte, error) { 53 | end := off + n 54 | if err := b.fill(end); err != nil { 55 | return nil, err 56 | } 57 | return b.buf[off:end], nil 58 | } 59 | 60 | // newReaderAt converts an io.Reader into an io.ReaderAt. 61 | func newReaderAt(r io.Reader) io.ReaderAt { 62 | if ra, ok := r.(io.ReaderAt); ok { 63 | return ra 64 | } 65 | return &buffer{ 66 | r: r, 67 | buf: make([]byte, 0, 1024), 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /lib/src/github.com/pixiv/go-libjpeg/rgb/rgb_test.go: -------------------------------------------------------------------------------- 1 | package rgb_test 2 | 3 | import ( 4 | "image" 5 | "image/color" 6 | "testing" 7 | 8 | "github.com/pixiv/go-libjpeg/rgb" 9 | ) 10 | 11 | func TestImageInterface(t *testing.T) { 12 | rect := image.Rect(0, 0, 100, 100) 13 | img := rgb.NewImage(rect) 14 | 15 | if got := img.ColorModel(); got != rgb.ColorModel { 16 | t.Errorf("ColorModel() should return rgb.ColorModel, got: %v", got) 17 | } 18 | 19 | if got := img.Bounds(); got != rect { 20 | t.Errorf("Bounds() should return %v, got: %v", rect, got) 21 | } 22 | 23 | black := color.RGBA{0x00, 0x00, 0x00, 0xFF} 24 | if got := img.At(0, 0); got != black { 25 | t.Errorf("At(0, 0) should return %v, got: %v", black, got) 26 | } 27 | 28 | blank := color.RGBA{} 29 | if got := img.At(-1, -1); got != blank { 30 | t.Errorf("At(0, 0) should return %v, got: %v", blank, got) 31 | } 32 | } 33 | 34 | func TestConvertFromRGBA(t *testing.T) { 35 | rgba := color.RGBA{0x11, 0x22, 0x33, 0xFF} 36 | expect := rgb.RGB{0x11, 0x22, 0x33} 37 | if got := rgb.ColorModel.Convert(rgba); got != expect { 38 | t.Errorf("got: %v, expect: %v", got, expect) 39 | } 40 | } 41 | 42 | func TestConvertFromRGB(t *testing.T) { 43 | c := rgb.RGB{0x11, 0x22, 0x33} 44 | if got := rgb.ColorModel.Convert(c); got != c { 45 | t.Errorf("got: %v, expect: %v", got, c) 46 | } 47 | } 48 | 49 | func TestColorRGBA(t *testing.T) { 50 | c := rgb.RGB{0x11, 0x22, 0x33} 51 | r, g, b, a := uint32(0x1111), uint32(0x2222), uint32(0x3333), uint32(0xFFFF) 52 | 53 | gotR, gotG, gotB, gotA := c.RGBA() 54 | if gotR != r { 55 | t.Errorf("got R: %v, expect R: %v", gotR, r) 56 | } 57 | if gotG != g { 58 | t.Errorf("got G: %v, expect G: %v", gotG, g) 59 | } 60 | if gotB != b { 61 | t.Errorf("got B: %v, expect B: %v", gotB, b) 62 | } 63 | if gotA != a { 64 | t.Errorf("got A: %v, expect A: %v", gotA, a) 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /lib/src/stringio/README.md: -------------------------------------------------------------------------------- 1 | stringio 2 | -------- 3 | 4 | A stringio library for Go (like the python StringIO). Forked from https://code.google.com/p/go-stringio/ and updated for Go 1.0.3. 5 | 6 | ### Introduction 7 | 8 | StringIO is a low level library to mimic file I/O operations against buffers (memory). Not like File, it does not touch the filesystem at all. Best suit for testing infrastructure. Most language's standard library provides something similar to facilitate the buffer orientated IO operations, and this is an implementation for Go language. 9 | 10 | ### How to use 11 | 12 | Its quite straightforward. 13 | 14 | package main 15 | 16 | import "stringio" 17 | 18 | func main() { 19 | sio := stringio.New() 20 | sio.WriteString("this is a test") 21 | sio.Seek(0, 0) 22 | out := sio.GetValueString() 23 | println(out) // prints "this is a test" 24 | } 25 | 26 | 27 | StringIO struct implements the following interfaces: 28 | 29 | io.ReadWriter, io.Closer, io.Seeker, io.ReadAt, io.WriteAt. 30 | 31 | Most File I/O operations are supported, though there are a few exceptions. In most case, the are either invalid or unnecessary given there is no filesystem semantics in StringIO at all. They are: 32 | 33 | ``Fd()`` - A StringIO has no file descriptor. It doesn't need one, calling StringIO's Fd() function will return (-1, errors.New("invalid")) 34 | 35 | ``Stat()`` - StringIO has no semantics of file stats. It makes no less to implement a fake stats() call at least for now. 36 | 37 | Dir and permission related calls, such as Chown, Chmod, Mkdir, etc... They are simply not unnecessary. 38 | 39 | Linking/Renaming - Since StringIO has no filesystem representation, it makes no sense to implement linking and renaming at all, so no. 40 | 41 | For more info, check out the test code. Most use cases for IO operations are tested and can be treated as examples. -------------------------------------------------------------------------------- /lib/src/w32/opengl32.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010-2012 The W32 Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package w32 6 | 7 | import ( 8 | "syscall" 9 | "unsafe" 10 | ) 11 | 12 | var ( 13 | modopengl32 = syscall.NewLazyDLL("opengl32.dll") 14 | 15 | procwglCreateContext = modopengl32.NewProc("wglCreateContext") 16 | procwglCreateLayerContext = modopengl32.NewProc("wglCreateLayerContext") 17 | procwglDeleteContext = modopengl32.NewProc("wglDeleteContext") 18 | procwglGetProcAddress = modopengl32.NewProc("wglGetProcAddress") 19 | procwglMakeCurrent = modopengl32.NewProc("wglMakeCurrent") 20 | procwglShareLists = modopengl32.NewProc("wglShareLists") 21 | ) 22 | 23 | func WglCreateContext(hdc HDC) HGLRC { 24 | ret, _, _ := procwglCreateContext.Call( 25 | uintptr(hdc), 26 | ) 27 | 28 | return HGLRC(ret) 29 | } 30 | 31 | func WglCreateLayerContext(hdc HDC, iLayerPlane int) HGLRC { 32 | ret, _, _ := procwglCreateLayerContext.Call( 33 | uintptr(hdc), 34 | uintptr(iLayerPlane), 35 | ) 36 | 37 | return HGLRC(ret) 38 | } 39 | 40 | func WglDeleteContext(hglrc HGLRC) bool { 41 | ret, _, _ := procwglDeleteContext.Call( 42 | uintptr(hglrc), 43 | ) 44 | 45 | return ret == TRUE 46 | } 47 | 48 | func WglGetProcAddress(szProc string) uintptr { 49 | ret, _, _ := procwglGetProcAddress.Call( 50 | uintptr(unsafe.Pointer(syscall.StringBytePtr(szProc))), 51 | ) 52 | 53 | return ret 54 | } 55 | 56 | func WglMakeCurrent(hdc HDC, hglrc HGLRC) bool { 57 | ret, _, _ := procwglMakeCurrent.Call( 58 | uintptr(hdc), 59 | uintptr(hglrc), 60 | ) 61 | 62 | return ret == TRUE 63 | } 64 | 65 | func WglShareLists(hglrc1, hglrc2 HGLRC) bool { 66 | ret, _, _ := procwglShareLists.Call( 67 | uintptr(hglrc1), 68 | uintptr(hglrc2), 69 | ) 70 | 71 | return ret == TRUE 72 | } 73 | -------------------------------------------------------------------------------- /configuration.mjpeg.yml: -------------------------------------------------------------------------------- 1 | # ScreenStreamer by YangHaitao 2 | 3 | # log level 4 | # a value of (DEBUG, INFO, WARN, ERROR) 5 | log_level: INFO 6 | log_path: logs 7 | 8 | # host and port that you will use other device to request this service 9 | server_host: 0.0.0.0 10 | server_port: 8080 11 | 12 | # how many threads you want to run goroutines 13 | threads: 5 14 | 15 | # target fps 16 | fps: 30 17 | # target jpeg quality 18 | quality: 96 19 | # broadcast,true for broadcast, false for point to point 20 | broadcast: false 21 | # screenshot image 22 | # left offset, 0 is default 23 | # top offset, 0 is default 24 | # width, 0 is default, means auto 25 | # height, 0 is default, means auto 26 | left: 0 27 | top: 0 28 | width: 0 29 | height: 0 30 | # resize function is not work now, so ignore this two options 31 | resize_width: 0 32 | resize_height: 0 33 | 34 | # don't change this options, if you don't know how it works 35 | tasks_queue_size: 1 36 | buffer_queue_size: 0 37 | images_queue_size: 0 38 | convert_buffer_size: 1 39 | convert_images_size: 1 40 | 41 | # to_sbs, convert 2d image to side-by-side images 42 | to_sbs: false 43 | # cursor, capture cursor or not 44 | cursor: false 45 | 46 | # how many screen shoters to work, less than 10 47 | shot: 1 48 | # alpha is an option to make the fps stable 49 | # every frame sleep +/- (alpha / 100) * (1 / fps) senonds 50 | alpha: 15 51 | # how many image converter to work, less than 10 52 | convert: 3 53 | # the application work mode 54 | # single, just a worker with shoter & converter functions 55 | # single-single, a shoter and a converter 56 | # single-multi, a shoter and multi converters 57 | # multi-multi, multi shoter and multi converters 58 | # sync-single-multi, a shoter and multi converters, shoter and converters works synchronizely 59 | # sync-multi-multi, multi shoters and multi converters, shoters and converters works synchronizely 60 | mode: sync-single-multi 61 | 62 | # fps 22 quality 95 - 100 1600 * 900 threads 5 convert 4 63 | -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/bmp/reader_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package bmp 6 | 7 | import ( 8 | "fmt" 9 | "image" 10 | "os" 11 | "testing" 12 | 13 | _ "image/png" 14 | ) 15 | 16 | const testdataDir = "../testdata/" 17 | 18 | func compare(t *testing.T, img0, img1 image.Image) error { 19 | b := img1.Bounds() 20 | if !b.Eq(img0.Bounds()) { 21 | return fmt.Errorf("wrong image size: want %s, got %s", img0.Bounds(), b) 22 | } 23 | for y := b.Min.Y; y < b.Max.Y; y++ { 24 | for x := b.Min.X; x < b.Max.X; x++ { 25 | c0 := img0.At(x, y) 26 | c1 := img1.At(x, y) 27 | r0, g0, b0, a0 := c0.RGBA() 28 | r1, g1, b1, a1 := c1.RGBA() 29 | if r0 != r1 || g0 != g1 || b0 != b1 || a0 != a1 { 30 | return fmt.Errorf("pixel at (%d, %d) has wrong color: want %v, got %v", x, y, c0, c1) 31 | } 32 | } 33 | } 34 | return nil 35 | } 36 | 37 | // TestDecode tests that decoding a PNG image and a BMP image result in the 38 | // same pixel data. 39 | func TestDecode(t *testing.T) { 40 | testCases := []string{ 41 | "video-001", 42 | "yellow_rose-small", 43 | } 44 | 45 | for _, tc := range testCases { 46 | f0, err := os.Open(testdataDir + tc + ".png") 47 | if err != nil { 48 | t.Errorf("%s: Open PNG: %v", tc, err) 49 | continue 50 | } 51 | defer f0.Close() 52 | img0, _, err := image.Decode(f0) 53 | if err != nil { 54 | t.Errorf("%s: Decode PNG: %v", tc, err) 55 | continue 56 | } 57 | 58 | f1, err := os.Open(testdataDir + tc + ".bmp") 59 | if err != nil { 60 | t.Errorf("%s: Open BMP: %v", tc, err) 61 | continue 62 | } 63 | defer f1.Close() 64 | img1, _, err := image.Decode(f1) 65 | if err != nil { 66 | t.Errorf("%s: Decode BMP: %v", tc, err) 67 | continue 68 | } 69 | 70 | if err := compare(t, img0, img1); err != nil { 71 | t.Errorf("%s: %v", tc, err) 72 | continue 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /lib/src/codec/aacdec.go: -------------------------------------------------------------------------------- 1 | package codec 2 | 3 | /* 4 | #cgo LDFLAGS: -lavcodec -lavformat -lavutil 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | typedef struct { 11 | AVCodec *c; 12 | AVCodecContext *ctx; 13 | AVFrame *f; 14 | int got; 15 | } aacdec_t ; 16 | 17 | static int aacdec_new(aacdec_t *m, uint8_t *buf, int len) { 18 | m->c = avcodec_find_decoder(AV_CODEC_ID_AAC); 19 | m->ctx = avcodec_alloc_context3(m->c); 20 | m->f = av_frame_alloc(); 21 | m->ctx->extradata = buf; 22 | m->ctx->extradata_size = len; 23 | m->ctx->debug = 0x3; 24 | av_log(m->ctx, AV_LOG_DEBUG, "m %p\n", m); 25 | return avcodec_open2(m->ctx, m->c, 0); 26 | } 27 | 28 | static int aacdec_decode(aacdec_t *m, uint8_t *data, int len) { 29 | AVPacket pkt; 30 | av_init_packet(&pkt); 31 | pkt.data = data; 32 | pkt.size = len; 33 | av_log(m->ctx, AV_LOG_DEBUG, "decode %p\n", m); 34 | return avcodec_decode_audio4(m->ctx, m->f, &m->got, &pkt); 35 | } 36 | */ 37 | import "C" 38 | 39 | import ( 40 | "unsafe" 41 | "errors" 42 | ) 43 | 44 | type AACDecoder struct { 45 | m C.aacdec_t 46 | } 47 | 48 | func NewAACDecoder(header []byte) (m *AACDecoder, err error) { 49 | m = &AACDecoder{} 50 | r := C.aacdec_new(&m.m, 51 | (*C.uint8_t)(unsafe.Pointer(&header[0])), 52 | (C.int)(len(header)), 53 | ) 54 | if int(r) < 0 { 55 | err = errors.New("open codec failed") 56 | } 57 | return 58 | } 59 | 60 | func (m *AACDecoder) Decode(data []byte) (sample []byte, err error) { 61 | r := C.aacdec_decode( 62 | &m.m, 63 | (*C.uint8_t)(unsafe.Pointer(&data[0])), 64 | (C.int)(len(data)), 65 | ) 66 | if int(r) < 0 { 67 | err = errors.New("decode failed") 68 | return 69 | } 70 | if int(m.m.got) == 0 { 71 | err = errors.New("no data") 72 | return 73 | } 74 | size := int(m.m.f.linesize[0])*2 75 | sample = make([]byte, size*2) 76 | for i := 0; i < 2; i++ { 77 | C.memcpy( 78 | unsafe.Pointer(&sample[i*size]), 79 | unsafe.Pointer(m.m.f.data[i]), 80 | (C.size_t)(size), 81 | ) 82 | } 83 | return 84 | } 85 | 86 | -------------------------------------------------------------------------------- /lib/src/simplertmp/util/filelogger.go: -------------------------------------------------------------------------------- 1 | package util 2 | 3 | import ( 4 | "fmt" 5 | "log" 6 | "os" 7 | "path/filepath" 8 | ) 9 | 10 | type FileLogger struct { 11 | prefix string 12 | logger *log.Logger 13 | level int 14 | } 15 | 16 | func (l *FileLogger) Debugf(format string, v ...interface{}) { 17 | if l.level > 0 { 18 | return 19 | } 20 | l.logger.Printf("DEBUG "+format, v...) 21 | } 22 | 23 | func (l *FileLogger) Debug(v ...interface{}) { 24 | if l.level > 0 { 25 | return 26 | } 27 | l.logger.Println("DEBUG", fmt.Sprintln(v...)) 28 | } 29 | 30 | func (l *FileLogger) Infof(format string, v ...interface{}) { 31 | if l.level > 1 { 32 | return 33 | } 34 | l.logger.Printf("INFO "+format, v...) 35 | } 36 | 37 | func (l *FileLogger) Info(v ...interface{}) { 38 | if l.level > 1 { 39 | return 40 | } 41 | l.logger.Println("INFO", fmt.Sprintln(v...)) 42 | } 43 | 44 | func (l *FileLogger) Warnf(format string, v ...interface{}) { 45 | if l.level > 2 { 46 | return 47 | } 48 | 49 | l.logger.Printf("WARN "+format, v...) 50 | } 51 | 52 | func (l *FileLogger) Warn(v ...interface{}) { 53 | if l.level > 2 { 54 | return 55 | } 56 | l.logger.Println("WARN", fmt.Sprintln(v...)) 57 | } 58 | 59 | func (l *FileLogger) Errorf(format string, v ...interface{}) { 60 | if l.level > 3 { 61 | return 62 | } 63 | l.logger.Printf("ERROR "+format, v...) 64 | } 65 | 66 | func (l *FileLogger) Error(v ...interface{}) { 67 | if l.level > 3 { 68 | return 69 | } 70 | l.logger.Println("ERROR", fmt.Sprintln(v...)) 71 | } 72 | 73 | func NewFileLogger(prefix, logfile string, level int) (*FileLogger, error) { 74 | if err := os.MkdirAll(filepath.Dir(logfile), os.ModePerm); err != nil { 75 | return nil, err 76 | } 77 | var logger *log.Logger 78 | if "" == logfile || "stdout" == logfile { 79 | logger = log.New(os.Stdout, "", log.Ldate|log.Ltime) 80 | } else { 81 | fi, err := os.OpenFile(logfile, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666) 82 | if err != nil { 83 | return nil, err 84 | } 85 | logger = log.New(fi, "", log.Ldate|log.Ltime) 86 | } 87 | 88 | return &FileLogger{prefix, logger, level}, nil 89 | } 90 | -------------------------------------------------------------------------------- /lib/src/seelog/dispatch_splitdispatcher.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 - Cloud Instruments Co., Ltd. 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this 9 | // list of conditions and the following disclaimer. 10 | // 2. Redistributions in binary form must reproduce the above copyright notice, 11 | // this list of conditions and the following disclaimer in the documentation 12 | // and/or other materials provided with the distribution. 13 | // 14 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 18 | // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 | // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | 25 | package seelog 26 | 27 | import ( 28 | "fmt" 29 | ) 30 | 31 | // A splitDispatcher just writes the given message to underlying receivers. (Splits the message stream.) 32 | type splitDispatcher struct { 33 | *dispatcher 34 | } 35 | 36 | func newSplitDispatcher(formatter *formatter, receivers []interface{}) (*splitDispatcher, error) { 37 | disp, err := createDispatcher(formatter, receivers) 38 | if err != nil { 39 | return nil, err 40 | } 41 | 42 | return &splitDispatcher{disp}, nil 43 | } 44 | 45 | func (splitter *splitDispatcher) String() string { 46 | return fmt.Sprintf("splitDispatcher ->\n%s", splitter.dispatcher.String()) 47 | } 48 | -------------------------------------------------------------------------------- /lib/src/seelog/writers_consolewriter.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 - Cloud Instruments Co., Ltd. 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this 9 | // list of conditions and the following disclaimer. 10 | // 2. Redistributions in binary form must reproduce the above copyright notice, 11 | // this list of conditions and the following disclaimer in the documentation 12 | // and/or other materials provided with the distribution. 13 | // 14 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 18 | // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 | // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | 25 | package seelog 26 | 27 | import "fmt" 28 | 29 | // consoleWriter is used to write to console 30 | type consoleWriter struct { 31 | } 32 | 33 | // Creates a new console writer. Returns error, if the console writer couldn't be created. 34 | func newConsoleWriter() (writer *consoleWriter, err error) { 35 | newWriter := new(consoleWriter) 36 | 37 | return newWriter, nil 38 | } 39 | 40 | // Create folder and file on WriteLog/Write first call 41 | func (console *consoleWriter) Write(bytes []byte) (int, error) { 42 | return fmt.Print(string(bytes)) 43 | } 44 | 45 | func (console *consoleWriter) String() string { 46 | return "Console writer" 47 | } 48 | -------------------------------------------------------------------------------- /lib/src/github.com/BurntSushi/xgb/examples/get-active-window/main.go: -------------------------------------------------------------------------------- 1 | // Example get-active-window reads the _NET_ACTIVE_WINDOW property of the root 2 | // window and uses the result (a window id) to get the name of the window. 3 | package main 4 | 5 | import ( 6 | "fmt" 7 | "log" 8 | 9 | "github.com/BurntSushi/xgb" 10 | "github.com/BurntSushi/xgb/xproto" 11 | ) 12 | 13 | func main() { 14 | X, err := xgb.NewConn() 15 | if err != nil { 16 | log.Fatal(err) 17 | } 18 | 19 | // Get the window id of the root window. 20 | setup := xproto.Setup(X) 21 | root := setup.DefaultScreen(X).Root 22 | 23 | // Get the atom id (i.e., intern an atom) of "_NET_ACTIVE_WINDOW". 24 | aname := "_NET_ACTIVE_WINDOW" 25 | activeAtom, err := xproto.InternAtom(X, true, uint16(len(aname)), 26 | aname).Reply() 27 | if err != nil { 28 | log.Fatal(err) 29 | } 30 | 31 | // Get the atom id (i.e., intern an atom) of "_NET_WM_NAME". 32 | aname = "_NET_WM_NAME" 33 | nameAtom, err := xproto.InternAtom(X, true, uint16(len(aname)), 34 | aname).Reply() 35 | if err != nil { 36 | log.Fatal(err) 37 | } 38 | 39 | // Get the actual value of _NET_ACTIVE_WINDOW. 40 | // Note that 'reply.Value' is just a slice of bytes, so we use an 41 | // XGB helper function, 'Get32', to pull an unsigned 32-bit integer out 42 | // of the byte slice. We then convert it to an X resource id so it can 43 | // be used to get the name of the window in the next GetProperty request. 44 | reply, err := xproto.GetProperty(X, false, root, activeAtom.Atom, 45 | xproto.GetPropertyTypeAny, 0, (1<<32)-1).Reply() 46 | if err != nil { 47 | log.Fatal(err) 48 | } 49 | windowId := xproto.Window(xgb.Get32(reply.Value)) 50 | fmt.Printf("Active window id: %X\n", windowId) 51 | 52 | // Now get the value of _NET_WM_NAME for the active window. 53 | // Note that this time, we simply convert the resulting byte slice, 54 | // reply.Value, to a string. 55 | reply, err = xproto.GetProperty(X, false, windowId, nameAtom.Atom, 56 | xproto.GetPropertyTypeAny, 0, (1<<32)-1).Reply() 57 | if err != nil { 58 | log.Fatal(err) 59 | } 60 | fmt.Printf("Active window name: %s\n", string(reply.Value)) 61 | } 62 | -------------------------------------------------------------------------------- /lib/src/github.com/streamrail/concurrent-map/README.md: -------------------------------------------------------------------------------- 1 | # concurrent map [![Circle CI](https://circleci.com/gh/orcaman/concurrent-map.png?style=badge)](https://circleci.com/gh/orcaman/concurrent-map) 2 | 3 | As explained [here](http://golang.org/doc/faq#atomic_maps) and [here](http://blog.golang.org/go-maps-in-action), the `map` type in Go doesn't support concurrent reads and writes. `concurrent-map` provides a high-performance solution to this by sharding the map with minimal time spent waiting for locks. 4 | 5 | ## usage 6 | 7 | Import the package: 8 | 9 | ```go 10 | import ( 11 | "github.com/orcaman/concurrent-map" 12 | ) 13 | 14 | ``` 15 | 16 | ```bash 17 | go get "github.com/orcaman/concurrent-map" 18 | ``` 19 | 20 | The package is now imported under the "cmap" namespace. 21 | 22 | ## example 23 | 24 | ```go 25 | 26 | // Create a new map. 27 | map := cmap.New() 28 | 29 | // Sets item within map, sets "bar" under key "foo" 30 | map.Set("foo", "bar") 31 | 32 | // Retrieve item from map. 33 | if tmp, ok := map.Get("foo"); ok { 34 | bar := tmp.(string) 35 | } 36 | 37 | // Removes item under key "foo" 38 | map.Remove("foo") 39 | 40 | ``` 41 | 42 | For more examples have a look at concurrent_map_test.go. 43 | 44 | Running tests: 45 | 46 | ```bash 47 | go test "github.com/orcaman/concurrent-map" 48 | ``` 49 | 50 | ## guidelines for contributing 51 | 52 | Contributions are highly welcome. In order for a contribution to be merged, please follow these guidelines: 53 | - Open an issue and describe what you are after (fixing a bug, adding an enhancement, etc.). 54 | - According to the core team's feedback on the above mentioned issue, submit a pull request, describing the changes and linking to the issue. 55 | - New code must have test coverage. 56 | - If the code is about performance issues, you must include benchmarks in the process (either in the issue or in the PR). 57 | - In general, we would like to keep `concurrent-map` as simple as possible and as similar to the native `map`. Please keep this in mind when opening issues. 58 | 59 | ## license 60 | MIT (see [LICENSE](https://github.com/orcaman/concurrent-map/blob/master/LICENSE) file) 61 | -------------------------------------------------------------------------------- /lib/src/github.com/BurntSushi/xgb/README: -------------------------------------------------------------------------------- 1 | XGB is the X Go Binding, which is a low-level API to communicate with the 2 | core X protocol and many of the X extensions. It is closely modeled after 3 | XCB and xpyb. 4 | 5 | It is thread safe and gets immediate improvement from parallelism when 6 | GOMAXPROCS > 1. (See the benchmarks in xproto/xproto_test.go for evidence.) 7 | 8 | Please see doc.go for more info. 9 | 10 | Note that unless you know you need XGB, you can probably make your life 11 | easier by using a slightly higher level library: xgbutil. 12 | 13 | Quick Usage 14 | =========== 15 | go get github.com/BurntSushi/xgb 16 | go run go/path/src/github.com/BurntSushi/xgb/examples/create-window/main.go 17 | 18 | BurntSushi's Fork 19 | ================= 20 | I've forked the XGB repository from Google Code due to inactivty upstream. 21 | 22 | Godoc documentation can be found here: 23 | http://godoc.burntsushi.net/pkg/github.com/BurntSushi/xgb/ 24 | 25 | Much of the code has been rewritten in an effort to support thread safety 26 | and multiple extensions. Namely, go_client.py has been thrown away in favor 27 | of an xgbgen package. 28 | 29 | The biggest parts that *haven't* been rewritten by me are the connection and 30 | authentication handshakes. They're inherently messy, and there's really no 31 | reason to re-work them. The rest of XGB has been completely rewritten. 32 | 33 | I like to release my code under the WTFPL, but since I'm starting with someone 34 | else's work, I'm leaving the original license/contributor/author information 35 | in tact. 36 | 37 | I suppose I can legitimately release xgbgen under the WTFPL. To be fair, it is 38 | at least as complex as XGB itself. *sigh* 39 | 40 | What follows is the original README: 41 | 42 | XGB README 43 | ========== 44 | XGB is the X protocol Go language Binding. 45 | 46 | It is the Go equivalent of XCB, the X protocol C-language Binding 47 | (http://xcb.freedesktop.org/). 48 | 49 | Unless otherwise noted, the XGB source files are distributed 50 | under the BSD-style license found in the LICENSE file. 51 | 52 | Contributions should follow the same procedure as for the Go project: 53 | http://golang.org/doc/contribute.html 54 | 55 | -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/bmp/writer_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package bmp 6 | 7 | import ( 8 | "bytes" 9 | "fmt" 10 | "image" 11 | "io/ioutil" 12 | "os" 13 | "testing" 14 | "time" 15 | ) 16 | 17 | func openImage(filename string) (image.Image, error) { 18 | f, err := os.Open(testdataDir + filename) 19 | if err != nil { 20 | return nil, err 21 | } 22 | defer f.Close() 23 | return Decode(f) 24 | } 25 | 26 | func TestEncode(t *testing.T) { 27 | img0, err := openImage("video-001.bmp") 28 | if err != nil { 29 | t.Fatal(err) 30 | } 31 | 32 | buf := new(bytes.Buffer) 33 | err = Encode(buf, img0) 34 | if err != nil { 35 | t.Fatal(err) 36 | } 37 | 38 | img1, err := Decode(buf) 39 | if err != nil { 40 | t.Fatal(err) 41 | } 42 | 43 | compare(t, img0, img1) 44 | } 45 | 46 | // TestZeroWidthVeryLargeHeight tests that encoding and decoding a degenerate 47 | // image with zero width but over one billion pixels in height is faster than 48 | // naively calling an io.Reader or io.Writer method once per row. 49 | func TestZeroWidthVeryLargeHeight(t *testing.T) { 50 | c := make(chan error, 1) 51 | go func() { 52 | b := image.Rect(0, 0, 0, 0x3fffffff) 53 | var buf bytes.Buffer 54 | if err := Encode(&buf, image.NewRGBA(b)); err != nil { 55 | c <- err 56 | return 57 | } 58 | m, err := Decode(&buf) 59 | if err != nil { 60 | c <- err 61 | return 62 | } 63 | if got := m.Bounds(); got != b { 64 | c <- fmt.Errorf("bounds: got %v, want %v", got, b) 65 | return 66 | } 67 | c <- nil 68 | }() 69 | select { 70 | case err := <-c: 71 | if err != nil { 72 | t.Fatal(err) 73 | } 74 | case <-time.After(3 * time.Second): 75 | t.Fatalf("timed out") 76 | } 77 | } 78 | 79 | // BenchmarkEncode benchmarks the encoding of an image. 80 | func BenchmarkEncode(b *testing.B) { 81 | img, err := openImage("video-001.bmp") 82 | if err != nil { 83 | b.Fatal(err) 84 | } 85 | s := img.Bounds().Size() 86 | b.SetBytes(int64(s.X * s.Y * 4)) 87 | b.ResetTimer() 88 | for i := 0; i < b.N; i++ { 89 | Encode(ioutil.Discard, img) 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /lib/src/seelog/README.markdown: -------------------------------------------------------------------------------- 1 | Seelog 2 | ======= 3 | 4 | Seelog is a powerful and easy-to-learn logging framework that provides functionality for flexible dispatching, filtering, and formatting log messages. 5 | It is natively written in the [Go](http://golang.org/) programming language. 6 | 7 | [![Build Status](https://drone.io/github.com/cihub/seelog/status.png)](https://drone.io/github.com/cihub/seelog/latest) 8 | 9 | Features 10 | ------------------ 11 | 12 | * Xml configuring to be able to change logger parameters without recompilation 13 | * Changing configurations on the fly without app restart 14 | * Possibility to set different log configurations for different project files and functions 15 | * Adjustable message formatting 16 | * Simultaneous log output to multiple streams 17 | * Choosing logger priority strategy to minimize performance hit 18 | * Different output writers 19 | * Console writer 20 | * File writer 21 | * Buffered writer (Chunk writer) 22 | * Rolling log writer (Logging with rotation) 23 | * SMTP writer 24 | * Others... (See [Wiki](https://github.com/cihub/seelog/wiki)) 25 | * Log message wrappers (JSON, XML, etc.) 26 | * Global variables and functions for easy usage in standalone apps 27 | * Functions for flexible usage in libraries 28 | 29 | Quick-start 30 | ----------- 31 | 32 | ```go 33 | package main 34 | 35 | import log "github.com/cihub/seelog" 36 | 37 | func main() { 38 | defer log.Flush() 39 | log.Info("Hello from Seelog!") 40 | } 41 | ``` 42 | 43 | Installation 44 | ------------ 45 | 46 | If you don't have the Go development environment installed, visit the 47 | [Getting Started](http://golang.org/doc/install.html) document and follow the instructions. Once you're ready, execute the following command: 48 | 49 | ``` 50 | go get -u github.com/cihub/seelog 51 | ``` 52 | 53 | Documentation 54 | --------------- 55 | 56 | Seelog has github wiki pages, which contain detailed how-tos references: https://github.com/cihub/seelog/wiki 57 | 58 | Examples 59 | --------------- 60 | 61 | Seelog examples can be found here: [seelog-examples](https://github.com/cihub/seelog-examples) 62 | 63 | Issues 64 | --------------- 65 | 66 | Feel free to push issues that could make Seelog better: https://github.com/cihub/seelog/issues 67 | 68 | -------------------------------------------------------------------------------- /lib/src/github.com/pixiv/go-libjpeg/rgb/rgb.go: -------------------------------------------------------------------------------- 1 | // Package rgb provides RGB image which implements image.Image interface. 2 | package rgb 3 | 4 | import ( 5 | "image" 6 | "image/color" 7 | ) 8 | 9 | // Image represent image data which has RGB colors. 10 | // Image is compatible with image.RGBA, but does not have alpha channel to reduce using memory. 11 | type Image struct { 12 | // Pix holds the image's stream, in R, G, B order. 13 | Pix []uint8 14 | // Stride is the Pix stride (in bytes) between vertically adjacent pixels. 15 | Stride int 16 | // Rect is the image's bounds. 17 | Rect image.Rectangle 18 | } 19 | 20 | // NewImage allocates and returns RGB image 21 | func NewImage(r image.Rectangle) *Image { 22 | w, h := r.Dx(), r.Dy() 23 | return &Image{Pix: make([]uint8, 3*w*h), Stride: 3 * w, Rect: r} 24 | } 25 | 26 | // ColorModel returns RGB color model. 27 | func (p *Image) ColorModel() color.Model { 28 | return ColorModel 29 | } 30 | 31 | // Bounds implements image.Image.At 32 | func (p *Image) Bounds() image.Rectangle { 33 | return p.Rect 34 | } 35 | 36 | // At implements image.Image.At 37 | func (p *Image) At(x, y int) color.Color { 38 | return p.RGBAAt(x, y) 39 | } 40 | 41 | // RGBAAt returns the color of the pixel at (x, y) as RGBA. 42 | func (p *Image) RGBAAt(x, y int) color.RGBA { 43 | if !(image.Point{x, y}.In(p.Rect)) { 44 | return color.RGBA{} 45 | } 46 | i := (y-p.Rect.Min.Y)*p.Stride + (x-p.Rect.Min.X)*3 47 | return color.RGBA{p.Pix[i+0], p.Pix[i+1], p.Pix[i+2], 0xFF} 48 | } 49 | 50 | // ColorModel is RGB color model instance 51 | var ColorModel = color.ModelFunc(rgbModel) 52 | 53 | func rgbModel(c color.Color) color.Color { 54 | if _, ok := c.(RGB); ok { 55 | return c 56 | } 57 | r, g, b, _ := c.RGBA() 58 | return RGB{uint8(r >> 8), uint8(g >> 8), uint8(b >> 8)} 59 | } 60 | 61 | // RGB color 62 | type RGB struct { 63 | R, G, B uint8 64 | } 65 | 66 | // RGBA implements Color.RGBA 67 | func (c RGB) RGBA() (r, g, b, a uint32) { 68 | r = uint32(c.R) 69 | r |= r << 8 70 | g = uint32(c.G) 71 | g |= g << 8 72 | b = uint32(c.B) 73 | b |= b << 8 74 | a = uint32(0xFFFF) 75 | return 76 | } 77 | 78 | // Make sure Image implements image.Image. 79 | // See https://golang.org/doc/effective_go.html#blank_implements. 80 | var _ image.Image = new(Image) 81 | -------------------------------------------------------------------------------- /lib/src/github.com/BurntSushi/xgb/xgbgen/protocol.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "log" 5 | "strings" 6 | ) 7 | 8 | // Protocol is a type that encapsulates all information about one 9 | // particular XML file. It also contains links to other protocol types 10 | // if this protocol imports other other extensions. The import relationship 11 | // is recursive. 12 | type Protocol struct { 13 | Parent *Protocol 14 | Name string 15 | ExtXName string 16 | ExtName string 17 | MajorVersion string 18 | MinorVersion string 19 | 20 | Imports []*Protocol 21 | Types []Type 22 | Requests []*Request 23 | } 24 | 25 | type Protocols []*Protocol 26 | 27 | func (ps Protocols) Len() int { return len(ps) } 28 | func (ps Protocols) Swap(i, j int) { ps[i], ps[j] = ps[j], ps[i] } 29 | func (ps Protocols) Less(i, j int) bool { return ps[i].ExtName < ps[j].ExtName } 30 | 31 | // Initialize traverses all structures, looks for 'Translation' type, 32 | // and looks up the real type in the namespace. It also sets the source 33 | // name for all relevant fields/structures. 34 | // This is necessary because we don't traverse the XML in order initially. 35 | func (p *Protocol) Initialize() { 36 | for _, typ := range p.Types { 37 | typ.Initialize(p) 38 | } 39 | for _, req := range p.Requests { 40 | req.Initialize(p) 41 | } 42 | } 43 | 44 | // PkgName returns the name of this package. 45 | // i.e., 'xproto' for the core X protocol, 'randr' for the RandR extension, etc. 46 | func (p *Protocol) PkgName() string { 47 | return strings.Replace(p.Name, "_", "", -1) 48 | } 49 | 50 | // ProtocolGet searches the current context for the protocol with the given 51 | // name. (i.e., the current protocol and its imports.) 52 | // It is an error if one is not found. 53 | func (p *Protocol) ProtocolFind(name string) *Protocol { 54 | if p.Name == name { 55 | return p // that was easy 56 | } 57 | for _, imp := range p.Imports { 58 | if imp.Name == name { 59 | return imp 60 | } 61 | } 62 | log.Panicf("Could not find protocol with name '%s'.", name) 63 | panic("unreachable") 64 | } 65 | 66 | // isExt returns true if this protocol is an extension. 67 | // i.e., it's name isn't "xproto". 68 | func (p *Protocol) isExt() bool { 69 | return strings.ToLower(p.Name) != "xproto" 70 | } 71 | -------------------------------------------------------------------------------- /lib/src/go-gypsy/example/yget/main.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Google, Inc. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package main 16 | 17 | import ( 18 | "flag" 19 | "fmt" 20 | "log" 21 | "os" 22 | "go-gypsy/yaml" 23 | ) 24 | 25 | // import "github.com/kylelemons/go-gypsy/yaml" 26 | 27 | var ( 28 | file = flag.String("file", "config.yaml", "(Simple) YAML file to read") 29 | ) 30 | 31 | func main() { 32 | cmd := os.Args[0] 33 | flag.Usage = func() { 34 | fmt.Println(`Usage:`, cmd, `[] [ ...] 35 | 36 | All s given on the commandline are looked up in 37 | the config file "config.yaml" (or whatever is specified for -file). 38 | 39 | Examples: 40 | $`, cmd, `mapping.key1 # = value1 41 | Get the key1 element of the "mapping" mapping 42 | 43 | $`, cmd, `config.server[1] 44 | Get the second (1th) element of the "server" list inside the "config" mapping 45 | 46 | $`, cmd, `mapping mapping.key1 config config.server config.admin[1].password 47 | Retrieve a bunch of options. With the example yaml file, some of these 48 | options are errors, which will print the (text of the) actual Go error from 49 | node.Get 50 | 51 | Options:`) 52 | flag.PrintDefaults() 53 | } 54 | 55 | flag.Parse() 56 | 57 | config, err := yaml.ReadFile(*file) 58 | if err != nil { 59 | log.Fatalf("readfile(%q): %s", *file, err) 60 | } 61 | 62 | params := flag.Args() 63 | 64 | width := 0 65 | for _, param := range params { 66 | if w := len(param); w > width { 67 | width = w 68 | } 69 | } 70 | 71 | for _, param := range params { 72 | val, err := config.Get(param) 73 | if err != nil { 74 | fmt.Printf("%-*s = %s\n", width, param, err) 75 | continue 76 | } 77 | fmt.Printf("%-*s = %q\n", width, param, val) 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/riff/riff_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package riff 6 | 7 | import ( 8 | "bytes" 9 | "testing" 10 | ) 11 | 12 | func encodeU32(u uint32) []byte { 13 | return []byte{ 14 | byte(u >> 0), 15 | byte(u >> 8), 16 | byte(u >> 16), 17 | byte(u >> 24), 18 | } 19 | } 20 | 21 | func TestShortChunks(t *testing.T) { 22 | // s is a RIFF(ABCD) with allegedly 256 bytes of data (excluding the 23 | // leading 8-byte "RIFF\x00\x01\x00\x00"). The first chunk of that ABCD 24 | // list is an abcd chunk of length m followed by n zeroes. 25 | for _, m := range []uint32{0, 8, 15, 200, 300} { 26 | for _, n := range []int{0, 1, 2, 7} { 27 | s := []byte("RIFF\x00\x01\x00\x00ABCDabcd") 28 | s = append(s, encodeU32(m)...) 29 | s = append(s, make([]byte, n)...) 30 | _, r, err := NewReader(bytes.NewReader(s)) 31 | if err != nil { 32 | t.Errorf("m=%d, n=%d: NewReader: %v", m, n, err) 33 | continue 34 | } 35 | 36 | _, _, _, err0 := r.Next() 37 | // The total "ABCD" list length is 256 bytes, of which the first 12 38 | // bytes are "ABCDabcd" plus the 4-byte encoding of m. If the 39 | // "abcd" subchunk length (m) plus those 12 bytes is greater than 40 | // the total list length, we have an invalid RIFF, and we expect an 41 | // errListSubchunkTooLong error. 42 | if m+12 > 256 { 43 | if err0 != errListSubchunkTooLong { 44 | t.Errorf("m=%d, n=%d: Next #0: got %v, want %v", m, n, err0, errListSubchunkTooLong) 45 | } 46 | continue 47 | } 48 | // Otherwise, we expect a nil error. 49 | if err0 != nil { 50 | t.Errorf("m=%d, n=%d: Next #0: %v", m, n, err0) 51 | continue 52 | } 53 | 54 | _, _, _, err1 := r.Next() 55 | // If m > 0, then m > n, so that "abcd" subchunk doesn't have m 56 | // bytes of data. If m == 0, then that "abcd" subchunk is OK in 57 | // that it has 0 extra bytes of data, but the next subchunk (8 byte 58 | // header plus body) is missing, as we only have n < 8 more bytes. 59 | want := errShortChunkData 60 | if m == 0 { 61 | want = errShortChunkHeader 62 | } 63 | if err1 != want { 64 | t.Errorf("m=%d, n=%d: Next #1: got %v, want %v", m, n, err1, want) 65 | continue 66 | } 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /lib/src/seelog/writers_formattedwriter_test.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 - Cloud Instruments Co., Ltd. 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this 9 | // list of conditions and the following disclaimer. 10 | // 2. Redistributions in binary form must reproduce the above copyright notice, 11 | // this list of conditions and the following disclaimer in the documentation 12 | // and/or other materials provided with the distribution. 13 | // 14 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 18 | // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 | // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | 25 | package seelog 26 | 27 | import ( 28 | "testing" 29 | ) 30 | 31 | func TestformattedWriter(t *testing.T) { 32 | formatStr := "%Level %LEVEL %Msg" 33 | message := "message" 34 | var logLevel LogLevel = TraceLvl 35 | 36 | bytesVerifier, err := newBytesVerifier(t) 37 | if err != nil { 38 | t.Error(err) 39 | return 40 | } 41 | 42 | formatter, err := newFormatter(formatStr) 43 | if err != nil { 44 | t.Error(err) 45 | return 46 | } 47 | 48 | writer, err := newFormattedWriter(bytesVerifier, formatter) 49 | if err != nil { 50 | t.Error(err) 51 | return 52 | } 53 | 54 | context, err := currentContext() 55 | if err != nil { 56 | t.Error(err) 57 | return 58 | } 59 | 60 | logMessage := formatter.Format(message, logLevel, context) 61 | 62 | bytesVerifier.ExpectBytes([]byte(logMessage)) 63 | writer.Write(message, logLevel, context) 64 | bytesVerifier.MustNotExpect() 65 | } 66 | -------------------------------------------------------------------------------- /lib/src/github.com/metachord/amf.go/amf3/int29_test.go: -------------------------------------------------------------------------------- 1 | package amf3 2 | 3 | import ( 4 | "bytes" 5 | "testing" 6 | ) 7 | 8 | type uint32BytesPair struct { 9 | i uint32 10 | b []byte 11 | } 12 | 13 | var testUint32BytesPair = []uint32BytesPair{ 14 | {0x00000012, []byte{0x12}}, 15 | {0x00001234, []byte{0xa4, 0x34}}, 16 | {0x00123456, []byte{0xc8, 0xe8, 0x56}}, 17 | {0x12345678, []byte{0xc8, 0xe8, 0xd6, 0x78}}, 18 | } 19 | 20 | func TestEncodeUInt29(t *testing.T) { 21 | for _, pair := range testUint32BytesPair { 22 | b, err := encodeUInt29(pair.i) 23 | if err != nil { 24 | t.Errorf("test for %x: %s", pair.i, err) 25 | } else { 26 | if !bytes.Equal(b, pair.b) { 27 | t.Errorf("test for %x: expect %x got %x", pair.i, pair.b, b) 28 | } 29 | } 30 | } 31 | _, err := encodeUInt29(0xffffffff) 32 | if err == nil { 33 | t.Errorf("test for 0xffffffff: should report out of range") 34 | } 35 | } 36 | 37 | func TestDecodeUint29(t *testing.T) { 38 | for _, pair := range testUint32BytesPair { 39 | r := bytes.NewReader(pair.b) 40 | u29, err := DecodeUInt29(r) 41 | if err != nil { 42 | t.Errorf("test for %x: err", pair.b) 43 | } else { 44 | if u29 != pair.i { 45 | t.Errorf("test for %x: expect %x got %x", pair.b, pair.i, u29) 46 | } 47 | } 48 | } 49 | } 50 | 51 | type intPair struct { 52 | u uint32 53 | s int32 54 | } 55 | 56 | var testIntPair = []intPair{ 57 | {0x01111111, 0x01111111}, 58 | {0x0FFFFFFF, 0x0FFFFFFF}, 59 | {0x1FFFFFFF, -0x00000001}, 60 | } 61 | 62 | func TestS2UInt29(t *testing.T) { 63 | for _, pair := range testIntPair { 64 | u, err := S2UInt29(pair.s) 65 | if err != nil { 66 | t.Errorf("test for %v error", pair.s) 67 | } else { 68 | if u != pair.u { 69 | t.Errorf("test for %v: expect %v got %v", pair.s, pair.u, u) 70 | } 71 | } 72 | } 73 | _, err := S2UInt29(0x10000000) 74 | if err == nil { 75 | t.Errorf("test for 0x10000000: should report out of range") 76 | } 77 | } 78 | 79 | func TestU2SInt29(t *testing.T) { 80 | for _, pair := range testIntPair { 81 | s, err := U2SInt29(pair.u) 82 | if err != nil { 83 | t.Errorf("test for %v error", pair.u) 84 | } else { 85 | if s != pair.s { 86 | t.Errorf("test for %v: expect %v got %v", pair.u, pair.s, s) 87 | } 88 | } 89 | } 90 | _, err := U2SInt29(0xFFFFFFFF) 91 | if err == nil { 92 | t.Errorf("test for 0xFFFFFFFF: should report out of range") 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /lib/src/github.com/BurntSushi/xgb/examples/atoms/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "flag" 5 | "fmt" 6 | "log" 7 | "os" 8 | "runtime" 9 | "runtime/pprof" 10 | "time" 11 | 12 | "github.com/BurntSushi/xgb" 13 | "github.com/BurntSushi/xgb/xproto" 14 | ) 15 | 16 | var ( 17 | flagRequests int 18 | flagGOMAXPROCS int 19 | flagCpuProfName string 20 | flagMemProfName string 21 | ) 22 | 23 | func init() { 24 | flag.IntVar(&flagRequests, "requests", 100000, "Number of atoms to intern.") 25 | flag.IntVar(&flagGOMAXPROCS, "cpu", 1, "Value of GOMAXPROCS.") 26 | flag.StringVar(&flagCpuProfName, "cpuprof", "cpu.prof", 27 | "Name of CPU profile file.") 28 | flag.StringVar(&flagMemProfName, "memprof", "mem.prof", 29 | "Name of memory profile file.") 30 | 31 | flag.Parse() 32 | 33 | runtime.GOMAXPROCS(flagGOMAXPROCS) 34 | } 35 | 36 | func seqNames(n int) []string { 37 | names := make([]string, n) 38 | for i := range names { 39 | names[i] = fmt.Sprintf("NAME%d", i) 40 | } 41 | return names 42 | } 43 | 44 | func main() { 45 | X, err := xgb.NewConn() 46 | if err != nil { 47 | log.Fatal(err) 48 | } 49 | 50 | names := seqNames(flagRequests) 51 | 52 | fcpu, err := os.Create(flagCpuProfName) 53 | if err != nil { 54 | log.Fatal(err) 55 | } 56 | defer fcpu.Close() 57 | pprof.StartCPUProfile(fcpu) 58 | defer pprof.StopCPUProfile() 59 | 60 | start := time.Now() 61 | cookies := make([]xproto.InternAtomCookie, flagRequests) 62 | for i := 0; i < flagRequests; i++ { 63 | cookies[i] = xproto.InternAtom(X, 64 | false, uint16(len(names[i])), names[i]) 65 | } 66 | for _, cookie := range cookies { 67 | cookie.Reply() 68 | } 69 | fmt.Printf("Exec time: %s\n\n", time.Since(start)) 70 | 71 | fmem, err := os.Create(flagMemProfName) 72 | if err != nil { 73 | log.Fatal(err) 74 | } 75 | defer fmem.Close() 76 | pprof.WriteHeapProfile(fmem) 77 | 78 | memStats := &runtime.MemStats{} 79 | runtime.ReadMemStats(memStats) 80 | 81 | // This isn't right. I'm not sure what's wrong. 82 | lastGcTime := time.Unix(int64(memStats.LastGC/1000000000), 83 | int64(memStats.LastGC-memStats.LastGC/1000000000)) 84 | 85 | fmt.Printf("Alloc: %d\n", memStats.Alloc) 86 | fmt.Printf("TotalAlloc: %d\n", memStats.TotalAlloc) 87 | fmt.Printf("LastGC: %s\n", lastGcTime) 88 | fmt.Printf("PauseTotalNs: %d\n", memStats.PauseTotalNs) 89 | fmt.Printf("PauseNs: %d\n", memStats.PauseNs) 90 | fmt.Printf("NumGC: %d\n", memStats.NumGC) 91 | } 92 | -------------------------------------------------------------------------------- /lib/src/golang.org/x/image/font/testdata/fixed/unicode.7x13.font: -------------------------------------------------------------------------------- 1 | 13 11 2 | 0x0000 0x001F 7x13.2400 3 | 0x0000 0x00FF 7x13.0000 4 | 0x0100 0x01FF 7x13.0100 5 | 0x0200 0x02FF 7x13.0200 6 | 0x0300 0x03FF 7x13.0300 7 | 0x0400 0x04FF 7x13.0400 8 | 0x0500 0x05FF 7x13.0500 9 | 0x0E00 0x0EFF 7x13.0E00 10 | 0x1000 0x10FF 7x13.1000 11 | 0x1600 0x16FF 7x13.1600 12 | 0x1E00 0x1EFF 7x13.1E00 13 | 0x1F00 0x1FFF 7x13.1F00 14 | 0x2000 0x20FF 7x13.2000 15 | 0x2100 0x21FF 7x13.2100 16 | 0x2200 0x22FF 7x13.2200 17 | 0x2300 0x23FF 7x13.2300 18 | 0x2400 0x24FF 7x13.2400 19 | 0x2500 0x25FF 7x13.2500 20 | 0x2600 0x26FF 7x13.2600 21 | 0x2700 0x27FF 7x13.2700 22 | 0x2800 0x28FF 7x13.2800 23 | 0x2A00 0x2AFF 7x13.2A00 24 | 0x3000 0x30fe ../shinonome/k12.3000 25 | 0x4e00 0x4ffe ../shinonome/k12.4e00 26 | 0x5005 0x51fe ../shinonome/k12.5005 27 | 0x5200 0x53fa ../shinonome/k12.5200 28 | 0x5401 0x55fe ../shinonome/k12.5401 29 | 0x5606 0x57fc ../shinonome/k12.5606 30 | 0x5800 0x59ff ../shinonome/k12.5800 31 | 0x5a01 0x5bff ../shinonome/k12.5a01 32 | 0x5c01 0x5dfe ../shinonome/k12.5c01 33 | 0x5e02 0x5fff ../shinonome/k12.5e02 34 | 0x600e 0x61ff ../shinonome/k12.600e 35 | 0x6200 0x63fa ../shinonome/k12.6200 36 | 0x6406 0x65fb ../shinonome/k12.6406 37 | 0x6602 0x67ff ../shinonome/k12.6602 38 | 0x6802 0x69ff ../shinonome/k12.6802 39 | 0x6a02 0x6bf3 ../shinonome/k12.6a02 40 | 0x6c08 0x6dfb ../shinonome/k12.6c08 41 | 0x6e05 0x6ffe ../shinonome/k12.6e05 42 | 0x7001 0x71ff ../shinonome/k12.7001 43 | 0x7206 0x73fe ../shinonome/k12.7206 44 | 0x7403 0x75ff ../shinonome/k12.7403 45 | 0x7601 0x77fc ../shinonome/k12.7601 46 | 0x7802 0x79fb ../shinonome/k12.7802 47 | 0x7a00 0x7bf7 ../shinonome/k12.7a00 48 | 0x7c00 0x7dfb ../shinonome/k12.7c00 49 | 0x7e01 0x7ffc ../shinonome/k12.7e01 50 | 0x8000 0x81fe ../shinonome/k12.8000 51 | 0x8201 0x83fd ../shinonome/k12.8201 52 | 0x8403 0x85fe ../shinonome/k12.8403 53 | 0x8602 0x87fe ../shinonome/k12.8602 54 | 0x8805 0x89f8 ../shinonome/k12.8805 55 | 0x8a00 0x8b9a ../shinonome/k12.8a00 56 | 0x8c37 0x8dff ../shinonome/k12.8c37 57 | 0x8e08 0x8ffd ../shinonome/k12.8e08 58 | 0x9000 0x91ff ../shinonome/k12.9000 59 | 0x920d 0x93e8 ../shinonome/k12.920d 60 | 0x9403 0x95e5 ../shinonome/k12.9403 61 | 0x961c 0x97ff ../shinonome/k12.961c 62 | 0x9801 0x99ff ../shinonome/k12.9801 63 | 0x9a01 0x9bf5 ../shinonome/k12.9a01 64 | 0x9c04 0x9dfd ../shinonome/k12.9c04 65 | 0x9e1a 0x9fa0 ../shinonome/k12.9e1a 66 | 0xFB00 0xFBFF 7x13.FB00 67 | 0xFE00 0xFEFF 7x13.FE00 68 | 0xFF00 0xFFFF 7x13.FF00 69 | -------------------------------------------------------------------------------- /lib/src/seelog/dispatch_splitdispatcher_test.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 - Cloud Instruments Co., Ltd. 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this 9 | // list of conditions and the following disclaimer. 10 | // 2. Redistributions in binary form must reproduce the above copyright notice, 11 | // this list of conditions and the following disclaimer in the documentation 12 | // and/or other materials provided with the distribution. 13 | // 14 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 18 | // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 | // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | 25 | package seelog 26 | 27 | import ( 28 | "fmt" 29 | "testing" 30 | ) 31 | 32 | var onlyMessageFormatForTest *formatter 33 | 34 | func init() { 35 | var err error 36 | onlyMessageFormatForTest, err = newFormatter("%Msg") 37 | if err != nil { 38 | fmt.Println("Can not create only message format: " + err.Error()) 39 | } 40 | } 41 | 42 | func TestsplitDispatcher(t *testing.T) { 43 | writer1, _ := newBytesVerifier(t) 44 | writer2, _ := newBytesVerifier(t) 45 | spliter, err := newSplitDispatcher(onlyMessageFormatForTest, []interface{}{writer1, writer2}) 46 | if err != nil { 47 | t.Error(err) 48 | return 49 | } 50 | 51 | context, err := currentContext() 52 | if err != nil { 53 | t.Error(err) 54 | return 55 | } 56 | 57 | bytes := []byte("Hello") 58 | 59 | writer1.ExpectBytes(bytes) 60 | writer2.ExpectBytes(bytes) 61 | spliter.Dispatch(string(bytes), TraceLvl, context, func(err error) {}) 62 | writer1.MustNotExpect() 63 | writer2.MustNotExpect() 64 | } 65 | -------------------------------------------------------------------------------- /lib/src/simplertmp/hls/rtmp_ts_writer.go: -------------------------------------------------------------------------------- 1 | package hls 2 | 3 | import ( 4 | "simplertmp/rtmp" 5 | "bytes" 6 | "errors" 7 | "io" 8 | ) 9 | 10 | var ( 11 | PMT_PID uint16 = 222 12 | PCR_PID uint16 = 222 13 | VIDEO_PID uint16 = 222 14 | AUDIO_PID uint16 = 222 15 | ) 16 | 17 | func NewTsWriter(sps, pps, adts []byte) *tsWriter { 18 | return &tsWriter{ 19 | sps: sps, 20 | pps: pps, 21 | adts: adts, 22 | pmt_pid: PMT_PID, 23 | pcr_pid: PCR_PID, 24 | video_pid: VIDEO_PID, 25 | audio_pid: AUDIO_PID, 26 | buffer: bytes.NewBuffer(nil), 27 | }.makePatPmt() 28 | } 29 | 30 | var ErrFrameType = errors.New("unsupported frame type") 31 | 32 | type tsWriter struct { 33 | sps []byte 34 | pps []byte 35 | adts []byte 36 | pat []byte 37 | pmt []byte 38 | pmt_pid uint16 39 | pcr_pid uint16 40 | video_pid uint16 41 | audio_pid uint16 42 | buffer *bytes.Buffer 43 | duration uint64 44 | } 45 | 46 | func (w *tsWriter) makePatPmt() *tsWriter { 47 | return w 48 | } 49 | 50 | func (w *tsWriter) SetSPS(sps []byte) { 51 | w.sps = sps 52 | } 53 | 54 | func (w *tsWriter) SetPPS(pps []byte) { 55 | w.pps = pps 56 | } 57 | 58 | func (w *tsWriter) SetADTS(adts []byte) { 59 | w.adts = adts 60 | } 61 | 62 | func (w *tsWriter) Write(frame *rtmp.MediaFrame) error { 63 | if w.buffer.Len() == 0 { 64 | w.buffer.Write(w.pat) 65 | w.buffer.Write(w.pmt) 66 | } 67 | if frame.Type == rtmp.RTMP_MSG_VIDEO { 68 | w.buffer.Write(unpack_ts(w.video_pid, unpack_avc_pes(w.sps, w.pps, frame))) 69 | return nil 70 | } 71 | if frame.Type == rtmp.RTMP_MSG_AUDIO { 72 | w.buffer.Write(unpack_ts(w.video_pid, unpack_aac_pes(w.adts, frame))) 73 | return nil 74 | } 75 | return ErrFrameType 76 | } 77 | 78 | func (w *tsWriter) WriteTo(o io.Writer) (n int64, err error) { 79 | return w.buffer.WriteTo(o) 80 | } 81 | 82 | func (w *tsWriter) Bytes() []byte { 83 | return w.buffer.Bytes() 84 | } 85 | 86 | func (w *tsWriter) Reset() { 87 | w.buffer.Reset() 88 | } 89 | 90 | func (w *tsWriter) Duration() uint64 { 91 | return w.duration 92 | } 93 | 94 | func unpack_avc_pes(sps, pps []byte, frame *rtmp.MediaFrame) []byte { 95 | return nil 96 | } 97 | 98 | func unpack_aac_pes(adts []byte, frame *rtmp.MediaFrame) []byte { 99 | return nil 100 | } 101 | 102 | func unpack_ts(pid uint16, pes []byte) []byte { 103 | return nil 104 | } 105 | -------------------------------------------------------------------------------- /lib/src/github.com/pixiv/go-libjpeg/test/util/util.go: -------------------------------------------------------------------------------- 1 | // Package util contains utility code for demosntration of go-libjpeg. 2 | package util 3 | 4 | import ( 5 | "bufio" 6 | "fmt" 7 | "image" 8 | "image/png" 9 | "io" 10 | "io/ioutil" 11 | "os" 12 | "path/filepath" 13 | "strings" 14 | ) 15 | 16 | // SubsampledImages contains example images which have subsampling colors. 17 | var SubsampledImages = []string{ 18 | "checkerboard_444.jpg", 19 | "checkerboard_440.jpg", 20 | "checkerboard_422.jpg", 21 | "checkerboard_420.jpg", 22 | } 23 | 24 | // GetExFilePath returns the path of specified example file. 25 | func GetExFilePath(name string) string { 26 | for _, gopath := range strings.Split(os.Getenv("GOPATH"), ":") { 27 | path := filepath.Join(gopath, "src/github.com/pixiv/go-libjpeg/test/images", name) 28 | if _, err := os.Stat(path); err == nil { 29 | return path 30 | } 31 | } 32 | panic(fmt.Errorf("%v does not exist in any directory which contains in $GOPATH", name)) 33 | } 34 | 35 | // GetOutFilePath returns the path of specified out file. 36 | func GetOutFilePath(name string) string { 37 | for _, gopath := range strings.Split(os.Getenv("GOPATH"), ":") { 38 | path := filepath.Join(gopath, "src/github.com/pixiv/go-libjpeg/test/out") 39 | if _, err := os.Stat(path); err == nil { 40 | return filepath.Join(path, name) 41 | } 42 | } 43 | panic(fmt.Errorf("out directory does not exist in any directory which contains in $GOPATH")) 44 | } 45 | 46 | // OpenFile opens specified example file 47 | func OpenFile(name string) (io io.Reader) { 48 | io, err := os.Open(GetExFilePath(name)) 49 | if err != nil { 50 | panic(err) 51 | } 52 | return 53 | } 54 | 55 | // ReadFile reads and returns data bytes of specified example file. 56 | func ReadFile(name string) (data []byte) { 57 | data, err := ioutil.ReadFile(GetExFilePath(name)) 58 | if err != nil { 59 | panic(err) 60 | } 61 | return 62 | } 63 | 64 | // CreateFile opens specified example file 65 | func CreateFile(name string) (f *os.File) { 66 | f, err := os.Create(GetOutFilePath(name)) 67 | if err != nil { 68 | panic(err) 69 | } 70 | return 71 | } 72 | 73 | // WritePNG encodes and writes image into PNG file. 74 | func WritePNG(img image.Image, name string) { 75 | f, err := os.Create(GetOutFilePath(name)) 76 | if err != nil { 77 | panic(err) 78 | } 79 | b := bufio.NewWriter(f) 80 | defer func() { 81 | b.Flush() 82 | f.Close() 83 | }() 84 | 85 | if err := png.Encode(b, img); err != nil { 86 | panic(err) 87 | } 88 | return 89 | } 90 | -------------------------------------------------------------------------------- /lib/src/github.com/sdming/gosnow/gosnow.go: -------------------------------------------------------------------------------- 1 | /* 2 | github.com/twitter/snowflake in golang 3 | */ 4 | 5 | package gosnow 6 | 7 | import ( 8 | "hash/crc32" 9 | "math/rand" 10 | "net" 11 | "sync" 12 | "time" 13 | "fmt" 14 | ) 15 | 16 | const ( 17 | nano = 1000 * 1000 18 | ) 19 | 20 | const ( 21 | WorkerIdBits = 10 // worker id 22 | MaxWorkerId = -1 ^ (-1 << 10) // worker id mask 23 | SequenceBits = 12 // sequence 24 | MaxSequence = -1 ^ (-1 << 12) //sequence mask 25 | ) 26 | 27 | var ( 28 | Since int64 = time.Date(2012, 1, 0, 0, 0, 0, 0, time.UTC).UnixNano() / nano 29 | ) 30 | 31 | type SnowFlake struct { 32 | lastTimestamp uint64 33 | workerId uint32 34 | sequence uint32 35 | lock sync.Mutex 36 | } 37 | 38 | func (sf *SnowFlake) uint64() uint64 { 39 | return (sf.lastTimestamp << (WorkerIdBits + SequenceBits)) | 40 | (uint64(sf.workerId) << SequenceBits) | 41 | (uint64(sf.sequence)) 42 | } 43 | 44 | func (sf *SnowFlake) Next() (uint64, error) { 45 | sf.lock.Lock() 46 | defer sf.lock.Unlock() 47 | 48 | ts := timestamp() 49 | if ts == sf.lastTimestamp { 50 | sf.sequence = (sf.sequence + 1) & MaxSequence 51 | if sf.sequence == 0 { 52 | ts = tilNextMillis(ts) 53 | } 54 | } else { 55 | sf.sequence = 0 56 | } 57 | 58 | if ts < sf.lastTimestamp { 59 | return 0, fmt.Errorf("Invalid timestamp: %v - precedes %v", ts, sf) 60 | } 61 | sf.lastTimestamp = ts 62 | return sf.uint64(), nil 63 | } 64 | 65 | func Default() (*SnowFlake, error) { 66 | return NewSnowFlake(DefaultWorkId()) 67 | } 68 | 69 | func NewSnowFlake(workerId uint32) (*SnowFlake, error) { 70 | if workerId < 0 || workerId > MaxWorkerId { 71 | return nil, fmt.Errorf("Worker id %v is invalid", workerId) 72 | } 73 | return &SnowFlake{workerId: workerId}, nil 74 | } 75 | 76 | func timestamp() uint64 { 77 | return uint64(time.Now().UnixNano()/nano - Since) 78 | } 79 | 80 | func tilNextMillis(ts uint64) uint64 { 81 | i := timestamp() 82 | for i < ts { 83 | i = timestamp() 84 | } 85 | return i 86 | } 87 | 88 | func DefaultWorkId() uint32 { 89 | var id uint32 90 | ift, err := net.Interfaces() 91 | if err != nil { 92 | rand.Seed(time.Now().UnixNano()) 93 | id = rand.Uint32() % MaxWorkerId 94 | } else { 95 | h := crc32.NewIEEE() 96 | for _, value := range ift { 97 | h.Write(value.HardwareAddr) 98 | } 99 | id = h.Sum32() % MaxWorkerId 100 | } 101 | return id & MaxWorkerId 102 | } 103 | -------------------------------------------------------------------------------- /lib/src/seelog/dispatch_filterdispatcher_test.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 - Cloud Instruments Co., Ltd. 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this 9 | // list of conditions and the following disclaimer. 10 | // 2. Redistributions in binary form must reproduce the above copyright notice, 11 | // this list of conditions and the following disclaimer in the documentation 12 | // and/or other materials provided with the distribution. 13 | // 14 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 18 | // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 | // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | 25 | package seelog 26 | 27 | import ( 28 | "testing" 29 | ) 30 | 31 | func TestfilterDispatcher_Pass(t *testing.T) { 32 | writer, _ := newBytesVerifier(t) 33 | filter, err := newFilterDispatcher(onlyMessageFormatForTest, []interface{}{writer}, TraceLvl) 34 | if err != nil { 35 | t.Error(err) 36 | return 37 | } 38 | 39 | context, err := currentContext() 40 | if err != nil { 41 | t.Error(err) 42 | return 43 | } 44 | 45 | bytes := []byte("Hello") 46 | writer.ExpectBytes(bytes) 47 | filter.Dispatch(string(bytes), TraceLvl, context, func(err error) {}) 48 | writer.MustNotExpect() 49 | } 50 | 51 | func TestfilterDispatcher_Deny(t *testing.T) { 52 | writer, _ := newBytesVerifier(t) 53 | filter, err := newFilterDispatcher(defaultformatter, []interface{}{writer}) 54 | if err != nil { 55 | t.Error(err) 56 | return 57 | } 58 | 59 | context, err := currentContext() 60 | if err != nil { 61 | t.Error(err) 62 | return 63 | } 64 | 65 | bytes := []byte("Hello") 66 | filter.Dispatch(string(bytes), TraceLvl, context, func(err error) {}) 67 | } 68 | -------------------------------------------------------------------------------- /lib/src/codec/aacenc.go: -------------------------------------------------------------------------------- 1 | package codec 2 | 3 | /* 4 | #cgo LDFLAGS: -lavcodec -lavformat -lavutil 5 | #include 6 | #include 7 | #include 8 | 9 | typedef struct { 10 | AVCodec *c; 11 | AVCodecContext *ctx; 12 | AVFrame *f; 13 | int got; 14 | uint8_t buf[1024*10]; int size; 15 | int samplerate; int bitrate; 16 | int channels; 17 | } aacenc_t ; 18 | 19 | static int aacenc_new(aacenc_t *m) { 20 | m->c = avcodec_find_encoder(AV_CODEC_ID_AAC); 21 | m->ctx = avcodec_alloc_context3(m->c); 22 | m->ctx->sample_fmt = AV_SAMPLE_FMT_FLTP; 23 | m->ctx->sample_rate = m->samplerate; 24 | m->ctx->bit_rate = m->bitrate; 25 | m->ctx->channels = m->channels; 26 | m->ctx->strict_std_compliance = FF_COMPLIANCE_EXPERIMENTAL; 27 | m->f = av_frame_alloc(); 28 | int r = avcodec_open2(m->ctx, m->c, 0); 29 | av_log(m->ctx, AV_LOG_DEBUG, "extra %d\n", m->ctx->extradata_size); 30 | return r; 31 | } 32 | 33 | static void aacenc_encode(aacenc_t *m) { 34 | AVPacket pkt; 35 | av_init_packet(&pkt); 36 | pkt.data = m->buf; 37 | pkt.size = sizeof(m->buf); 38 | m->f->nb_samples = 1024; 39 | m->f->extended_data = m->f->data; 40 | m->f->linesize[0] = 4096; 41 | avcodec_encode_audio2(m->ctx, &pkt, m->f, &m->got); 42 | av_log(m->ctx, AV_LOG_DEBUG, "got %d size %d\n", m->got, pkt.size); 43 | m->size = pkt.size; 44 | } 45 | */ 46 | import "C" 47 | 48 | import ( 49 | "unsafe" 50 | "errors" 51 | ) 52 | 53 | type AACEncoder struct { 54 | m C.aacenc_t 55 | Header []byte 56 | } 57 | 58 | // only supported fltp,stereo,44100khz. If you need other config, it's easy to modify code 59 | func NewAACEncoder() (m *AACEncoder, err error) { 60 | m = &AACEncoder{} 61 | m.m.samplerate = 44100 62 | m.m.bitrate = 50000 63 | m.m.channels = 2 64 | r := C.aacenc_new(&m.m) 65 | if int(r) != 0 { 66 | err = errors.New("open codec failed") 67 | return 68 | } 69 | m.Header = make([]byte, (int)(m.m.ctx.extradata_size)) 70 | C.memcpy( 71 | unsafe.Pointer(&m.Header[0]), 72 | unsafe.Pointer(&m.m.ctx.extradata), 73 | (C.size_t)(len(m.Header)), 74 | ) 75 | return 76 | } 77 | 78 | func (m *AACEncoder) Encode(sample [8192]byte) (ret []byte, err error) { 79 | m.m.f.data[0] = (*C.uint8_t)(unsafe.Pointer(&sample[0])) 80 | m.m.f.data[1] = (*C.uint8_t)(unsafe.Pointer(&sample[4096])) 81 | C.aacenc_encode(&m.m) 82 | if int(m.m.got) == 0 { 83 | err = errors.New("no data") 84 | return 85 | } 86 | ret = make([]byte, (int)(m.m.size)) 87 | C.memcpy( 88 | unsafe.Pointer(&ret[0]), 89 | unsafe.Pointer(&m.m.buf[0]), 90 | (C.size_t)(m.m.size), 91 | ) 92 | return 93 | } 94 | 95 | -------------------------------------------------------------------------------- /lib/src/seelog/cfg_errors.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 - Cloud Instruments Co., Ltd. 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this 9 | // list of conditions and the following disclaimer. 10 | // 2. Redistributions in binary form must reproduce the above copyright notice, 11 | // this list of conditions and the following disclaimer in the documentation 12 | // and/or other materials provided with the distribution. 13 | // 14 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 18 | // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 | // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | 25 | package seelog 26 | 27 | import ( 28 | "errors" 29 | ) 30 | 31 | var ( 32 | nodeMustHaveChildrenError = errors.New("Node must have children") 33 | nodeCannotHaveChildrenError = errors.New("Node cannot have children") 34 | ) 35 | 36 | type unexpectedChildElementError struct { 37 | baseError 38 | } 39 | 40 | func newUnexpectedChildElementError(msg string) *unexpectedChildElementError { 41 | custmsg := "Unexpected child element: " + msg 42 | return &unexpectedChildElementError{baseError{message: custmsg}} 43 | } 44 | 45 | type missingArgumentError struct { 46 | baseError 47 | } 48 | 49 | func newMissingArgumentError(nodeName, attrName string) *missingArgumentError { 50 | custmsg := "Output '" + nodeName + "' has no '" + attrName + "' attribute" 51 | return &missingArgumentError{baseError{message: custmsg}} 52 | } 53 | 54 | type unexpectedAttributeError struct { 55 | baseError 56 | } 57 | 58 | func newUnexpectedAttributeError(nodeName, attr string) *unexpectedAttributeError { 59 | custmsg := nodeName + " has unexpected attribute: " + attr 60 | return &unexpectedAttributeError{baseError{message: custmsg}} 61 | } 62 | -------------------------------------------------------------------------------- /lib/src/seelog/writers_formattedwriter.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 - Cloud Instruments Co., Ltd. 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this 9 | // list of conditions and the following disclaimer. 10 | // 2. Redistributions in binary form must reproduce the above copyright notice, 11 | // this list of conditions and the following disclaimer in the documentation 12 | // and/or other materials provided with the distribution. 13 | // 14 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 18 | // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 | // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | 25 | package seelog 26 | 27 | import ( 28 | "errors" 29 | "fmt" 30 | "io" 31 | ) 32 | 33 | type formattedWriter struct { 34 | writer io.Writer 35 | formatter *formatter 36 | } 37 | 38 | func newFormattedWriter(writer io.Writer, formatter *formatter) (*formattedWriter, error) { 39 | if formatter == nil { 40 | return nil, errors.New("formatter can not be nil") 41 | } 42 | 43 | return &formattedWriter{writer, formatter}, nil 44 | } 45 | 46 | func (formattedWriter *formattedWriter) Write(message string, level LogLevel, context LogContextInterface) error { 47 | str := formattedWriter.formatter.Format(message, level, context) 48 | _, err := formattedWriter.writer.Write([]byte(str)) 49 | return err 50 | } 51 | 52 | func (formattedWriter *formattedWriter) String() string { 53 | return fmt.Sprintf("writer: %s, format: %s", formattedWriter.writer, formattedWriter.formatter) 54 | } 55 | 56 | func (formattedWriter *formattedWriter) Writer() io.Writer { 57 | return formattedWriter.writer 58 | } 59 | 60 | func (formattedWriter *formattedWriter) Format() *formatter { 61 | return formattedWriter.formatter 62 | } 63 | -------------------------------------------------------------------------------- /lib/src/github.com/metachord/amf.go/amf3/int29.go: -------------------------------------------------------------------------------- 1 | package amf3 2 | 3 | import ( 4 | "errors" 5 | "io" 6 | ) 7 | 8 | func encodeUInt29(n uint32) ([]byte, error) { 9 | var b []byte 10 | if n <= 0x0000007F { 11 | b = make([]byte, 1) 12 | b[0] = byte(n) 13 | } else if n <= 0x00003FFF { 14 | b = make([]byte, 2) 15 | b[0] = byte(n>>7 | 0x80) 16 | b[1] = byte(n & 0x7F) 17 | } else if n <= 0x001FFFFF { 18 | b = make([]byte, 3) 19 | b[0] = byte(n>>14 | 0x80) 20 | b[1] = byte(n>>7&0x7F | 0x80) 21 | b[2] = byte(n & 0x7F) 22 | } else if n <= 0x1FFFFFFF { 23 | b = make([]byte, 4) 24 | b[0] = byte(n>>22 | 0x80) 25 | b[1] = byte(n>>15&0x7F | 0x80) 26 | b[2] = byte(n>>8&0x7F | 0x80) 27 | b[3] = byte(n) 28 | } else { 29 | return nil, errors.New("out of range") 30 | } 31 | return b, nil 32 | } 33 | 34 | func EncodeUInt29(w io.Writer, n uint32) error { 35 | b, err := encodeUInt29(n) 36 | if err != nil { 37 | return err 38 | } 39 | _, err = w.Write(b) 40 | return err 41 | } 42 | 43 | func EncodeInt29(w io.Writer, n int32) error { 44 | un, err := S2UInt29(n) 45 | if err != nil { 46 | return err 47 | } 48 | un = un&0xFFFFFFF | (un & 0x80000000 >> 3) 49 | return EncodeUInt29(w, un) 50 | } 51 | 52 | func DecodeUInt29(r io.Reader) (uint32, error) { 53 | var n uint32 = 0 54 | i := 0 55 | b := make([]byte, 1) 56 | for { 57 | _, err := r.Read(b) 58 | if err != nil { 59 | return 0, err 60 | } 61 | if i != 3 { 62 | n |= uint32(b[0] & 0x7F) 63 | if b[0]&0x80 != 0 { 64 | if i != 2 { 65 | n <<= 7 66 | } else { 67 | n <<= 8 68 | } 69 | } else { 70 | break 71 | } 72 | } else { 73 | n |= uint32(b[0]) 74 | break 75 | } 76 | i++ 77 | } 78 | return n, nil 79 | } 80 | 81 | func DecodeInt29(r io.Reader) (int32, error) { 82 | un, err := DecodeUInt29(r) 83 | if err != nil { 84 | return 0, err 85 | } 86 | sn, err := U2SInt29(un) 87 | if err != nil { 88 | return 0, err 89 | } 90 | return sn, nil 91 | } 92 | 93 | // signed int -> uint29 94 | func S2UInt29(i int32) (uint32, error) { 95 | if i > 0xFFFFFFF || i < -0x10000000 { 96 | return 0, errors.New("out of range") 97 | } 98 | ui := uint32(i) 99 | ui = ui&0xFFFFFFF | (ui & 0x80000000 >> 3) 100 | return ui, nil 101 | } 102 | 103 | // uint29 -> signed int 104 | func U2SInt29(i uint32) (int32, error) { 105 | if i > 0x1FFFFFFF { 106 | return 0, errors.New("out of range") 107 | } 108 | if i&0x10000000 != 0 { 109 | return int32(i | 0xFF000000), nil 110 | } 111 | return int32(i), nil 112 | } 113 | -------------------------------------------------------------------------------- /lib/src/seelog/behavior_synclogger.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 - Cloud Instruments Co., Ltd. 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this 9 | // list of conditions and the following disclaimer. 10 | // 2. Redistributions in binary form must reproduce the above copyright notice, 11 | // this list of conditions and the following disclaimer in the documentation 12 | // and/or other materials provided with the distribution. 13 | // 14 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 18 | // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 | // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | 25 | package seelog 26 | 27 | import ( 28 | "fmt" 29 | ) 30 | 31 | // syncLogger performs logging in the same goroutine where 'Trace/Debug/...' 32 | // func was called 33 | type syncLogger struct { 34 | commonLogger 35 | } 36 | 37 | // newSyncLogger creates a new synchronous logger 38 | func newSyncLogger(config *logConfig) *syncLogger { 39 | syncLogger := new(syncLogger) 40 | 41 | syncLogger.commonLogger = *newCommonLogger(config, syncLogger) 42 | 43 | return syncLogger 44 | } 45 | 46 | func (cLogger *syncLogger) innerLog( 47 | level LogLevel, 48 | context LogContextInterface, 49 | message fmt.Stringer) { 50 | 51 | cLogger.processLogMsg(level, message, context) 52 | } 53 | 54 | func (syncLogger *syncLogger) Close() { 55 | syncLogger.m.Lock() 56 | defer syncLogger.m.Unlock() 57 | 58 | if !syncLogger.closed { 59 | if err := syncLogger.config.RootDispatcher.Close(); err != nil { 60 | reportInternalError(err) 61 | } 62 | } 63 | } 64 | 65 | func (syncLogger *syncLogger) Flush() { 66 | syncLogger.m.Lock() 67 | defer syncLogger.m.Unlock() 68 | 69 | if !syncLogger.closed { 70 | syncLogger.config.RootDispatcher.Flush() 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /lib/src/github.com/BurntSushi/xgb/LICENSE: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009 The XGB Authors. All rights reserved. 2 | // 3 | // Redistribution and use in source and binary forms, with or without 4 | // modification, are permitted provided that the following conditions are 5 | // met: 6 | // 7 | // * Redistributions of source code must retain the above copyright 8 | // notice, this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above 10 | // copyright notice, this list of conditions and the following disclaimer 11 | // in the documentation and/or other materials provided with the 12 | // distribution. 13 | // * Neither the name of Google Inc. nor the names of its 14 | // contributors may be used to endorse or promote products derived from 15 | // this software without specific prior written permission. 16 | // 17 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | // 29 | // Subject to the terms and conditions of this License, Google hereby 30 | // grants to You a perpetual, worldwide, non-exclusive, no-charge, 31 | // royalty-free, irrevocable (except as stated in this section) patent 32 | // license to make, have made, use, offer to sell, sell, import, and 33 | // otherwise transfer this implementation of XGB, where such license 34 | // applies only to those patent claims licensable by Google that are 35 | // necessarily infringed by use of this implementation of XGB. If You 36 | // institute patent litigation against any entity (including a 37 | // cross-claim or counterclaim in a lawsuit) alleging that this 38 | // implementation of XGB or a Contribution incorporated within this 39 | // implementation of XGB constitutes direct or contributory patent 40 | // infringement, then any patent licenses granted to You under this 41 | // License for this implementation of XGB shall terminate as of the date 42 | // such litigation is filed. 43 | -------------------------------------------------------------------------------- /lib/src/seelog/behavior_asynclooplogger.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 - Cloud Instruments Co., Ltd. 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this 9 | // list of conditions and the following disclaimer. 10 | // 2. Redistributions in binary form must reproduce the above copyright notice, 11 | // this list of conditions and the following disclaimer in the documentation 12 | // and/or other materials provided with the distribution. 13 | // 14 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 18 | // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 | // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | 25 | package seelog 26 | 27 | // asyncLoopLogger represents asynchronous logger which processes the log queue in 28 | // a 'for' loop 29 | type asyncLoopLogger struct { 30 | asyncLogger 31 | } 32 | 33 | // newAsyncLoopLogger creates a new asynchronous loop logger 34 | func newAsyncLoopLogger(config *logConfig) *asyncLoopLogger { 35 | 36 | asnLoopLogger := new(asyncLoopLogger) 37 | 38 | asnLoopLogger.asyncLogger = *newAsyncLogger(config) 39 | 40 | go asnLoopLogger.processQueue() 41 | 42 | return asnLoopLogger 43 | } 44 | 45 | func (asnLoopLogger *asyncLoopLogger) processItem() (closed bool) { 46 | asnLoopLogger.queueHasElements.L.Lock() 47 | defer asnLoopLogger.queueHasElements.L.Unlock() 48 | 49 | for asnLoopLogger.msgQueue.Len() == 0 && !asnLoopLogger.closed { 50 | asnLoopLogger.queueHasElements.Wait() 51 | } 52 | 53 | if asnLoopLogger.closed { 54 | return true 55 | } 56 | 57 | asnLoopLogger.processQueueElement() 58 | return false 59 | } 60 | 61 | func (asnLoopLogger *asyncLoopLogger) processQueue() { 62 | for !asnLoopLogger.closed { 63 | closed := asnLoopLogger.processItem() 64 | 65 | if closed { 66 | break 67 | } 68 | } 69 | } 70 | --------------------------------------------------------------------------------