mjpeg

package
v0.0.0-...-f5abbc1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 20, 2017 License: GPL-3.0 Imports: 8 Imported by: 1

Documentation

Overview

Package mjpeg creates a motion jpeg handler from a camera

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FrameGetter

type FrameGetter interface {
	GetFrame() ([]byte, error)
}

FrameGetter is any structure that can return a JPEG image in bytes. Ideally this would be a camera of some sort.

type Mjpeg

type Mjpeg struct {
	// contains filtered or unexported fields
}

Mjpeg is a http.Handler used to server up Motion JPEG.

func New

func New(cam FrameGetter) *Mjpeg

New creates a new MJPEG instance with the given FrameGetter.

func (*Mjpeg) ServeHTTP

func (m *Mjpeg) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServerHTTP will use the camera in Mjpeg server it over the response. Sets all the appropriate headers to be able to stream a Mjpeg over http.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL