gopro

package
v0.0.0-...-51a4268 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2023 License: Apache-2.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FileTypeMatches = map[Type][]FileTypeMatch{
	V2: {
		{
			Regex:    regexp.MustCompile(`^GOPR\d+\.JPG$`),
			Type:     Photo,
			HeroMode: true,
		},
		{
			Regex:    regexp.MustCompile(`^GP\d+\.JPG$`),
			Type:     Photo,
			HeroMode: true,
		},
		{
			Regex:    regexp.MustCompile(`^GX\d+\.MP4$`),
			Type:     Video,
			HeroMode: true,
		},
		{
			Regex:    regexp.MustCompile(`^GX\d+\.WAV$`),
			Type:     Audio,
			HeroMode: true,
		},
		{
			Regex:    regexp.MustCompile(`^GH\d+\.MP4$`),
			Type:     Video,
			HeroMode: true,
		},
		{
			Regex:    regexp.MustCompile(`^GG\d+\.MP4$`),
			Type:     Video,
			HeroMode: true,
		},
		{
			Regex:    regexp.MustCompile(`^G\d+\.JPG$`),
			Type:     Multishot,
			HeroMode: true,
		},
		{
			Regex:    regexp.MustCompile(`\.GPR$`),
			Type:     RawPhoto,
			HeroMode: true,
		},

		{
			Regex:    regexp.MustCompile(`^GS\d+\.360$`),
			Type:     Video,
			HeroMode: false,
		},
		{
			Regex:    regexp.MustCompile(`^GS_+\d+\.JPG$`),
			Type:     Photo,
			HeroMode: false,
		},
		{
			Regex:    regexp.MustCompile(`^GP_+\d+\.JPG$`),
			Type:     Photo,
			HeroMode: true,
		},
		{
			Regex:    regexp.MustCompile(`^GPA[A-Z]\d+\.JPG$`),
			Type:     Multishot,
			HeroMode: true,
		},
		{
			Regex:    regexp.MustCompile(`^GSA[A-Z]\d+\.JPG$`),
			Type:     Multishot,
			HeroMode: false,
		},
	},
	V1: {
		{
			Regex:    regexp.MustCompile(`^GOPR\d+\.JPG$`),
			Type:     Photo,
			HeroMode: true,
		},
		{
			Regex:    regexp.MustCompile(`^G\d+\.JPG$`),
			Type:     Multishot,
			HeroMode: true,
		},
		{
			Regex:    regexp.MustCompile(`^GOPR\d+\.MP4$`),
			Type:     Video,
			HeroMode: true,
		},
		{
			Regex:    regexp.MustCompile(`^GP\d+\.MP4$`),
			Type:     ChapteredVideo,
			HeroMode: true,
		},
		{
			Regex:    regexp.MustCompile(`\.GPR$`),
			Type:     RawPhoto,
			HeroMode: true,
		},
	},
}
View Source
var FirmwareCatalogRemoteURL = "https://firmware-api.gopro.com/v2/firmware/catalog"
View Source
var MediaFolderRegex = regexp.MustCompile(`\d\d\dGOPRO`)

Functions

func BoxTypeHMMT

func BoxTypeHMMT() mp4.BoxType

func Detect

func Detect() (string, utils.ConnectionType, error)

func ImportConnect

func ImportConnect(params utils.ImportParams) (*utils.Result, error)

func UpdateCamera

func UpdateCamera(sdcard string) error

Types

type Camera

type Camera struct {
	Model                  int      `json:"model"`
	ModelString            string   `json:"model_string"`
	Name                   string   `json:"name"`
	Version                string   `json:"version"`
	URL                    string   `json:"url"`
	ReleaseDate            string   `json:"release_date"`
	Sha1                   string   `json:"sha1"`
	RequiredFreeLocalSpace int      `json:"required_free_local_space"`
	CriticalUpdate         bool     `json:"criticalUpdate"`
	Languages              []string `json:"languages"`
	ReleaseHTML            string   `json:"release_html"`
	LicenseHTML            string   `json:"license_html"`
}

type ConnectDevice

type ConnectDevice struct {
	IP   string
	Info cameraInfo
}

func GetGoProNetworkAddresses

func GetGoProNetworkAddresses(ctx context.Context) ([]ConnectDevice, error)

type Directory

type Directory string
const (
	DCIM Directory = "DCIM"
	MISC Directory = "MISC"
)

type Entrypoint

type Entrypoint struct{}

func (Entrypoint) Import

func (Entrypoint) Import(params utils.ImportParams) (*utils.Result, error)

type FileOfInterest

type FileOfInterest string
const (
	GetStarted FileOfInterest = "Get_started_with_GoPro.url"
	Version    FileOfInterest = "version.txt"
)

type FileType

type FileType string
const (
	Audio              FileType = "audio"
	Video              FileType = "video"
	Photo              FileType = "photo"
	PowerPano          FileType = "powerpano"
	ChapteredVideo     FileType = "chapteredvideo"
	Multishot          FileType = "multishot"
	LowResolutionVideo FileType = "lrv"
	Thumbnail          FileType = "thm"
	RawPhoto           FileType = "gpr"
)

type FileTypeMatch

type FileTypeMatch struct {
	Regex    *regexp.Regexp
	Type     FileType
	HeroMode bool
}

type FirmwareCatalog

type FirmwareCatalog struct {
	Version string   `json:"version"`
	Magic   string   `json:"magic"`
	Group   string   `json:"group"`
	Cameras []Camera `json:"cameras"`
}

type HMMT

type HMMT struct {
	mp4.Box
	Count   int   `mp4:"0,size=32,len=dynamic,int"`
	Entries []int `mp4:"1,size=32,len=dynamic,int"`
}

func (*HMMT) GetFieldLength

func (h *HMMT) GetFieldLength(name string, ctx mp4.Context) uint

func (*HMMT) GetType

func (*HMMT) GetType() mp4.BoxType

type HiLights

type HiLights struct {
	Count      int   `json:"count"`
	Timestamps []int `json:"timestamps"`
}

func GetHiLights

func GetHiLights(path string) (*HiLights, error)

type Info

type Info struct {
	InfoVersion        string `json:"info version"`
	FirmwareVersion    string `json:"firmware version"`
	WifiMac            string `json:"wifi mac"`
	CameraType         string `json:"camera type"`
	CameraSerialNumber string `json:"camera serial number"`
}

type LocationService

type LocationService struct{}

func (LocationService) GetLocation

func (LocationService) GetLocation(path string) (*utils.Location, error)

type MediaList

type MediaList struct {
	ID    string `json:"id"`
	Media []struct {
		D  string `json:"d"`
		Fs []struct {
			N    string        `json:"n"`
			Cre  int64         `json:"cre,string"`
			Mod  string        `json:"mod"`
			Glrv int           `json:"glrv,string,omitempty"`
			Ls   string        `json:"ls,omitempty"`
			S    int64         `json:"s,string"`
			G    string        `json:"g,omitempty"`
			B    int           `json:"b,string,omitempty"`
			L    int           `json:"l,string,omitempty"`
			T    string        `json:"t,omitempty"`
			M    []interface{} `json:"m,omitempty"`
			Raw  string        `json:"raw,omitempty"`
		} `json:"fs"`
	} `json:"media"`
}

func GetMediaList

func GetMediaList(in string) (*MediaList, error)

type Type

type Type string
const (
	V2 Type = "v2"
	V1 Type = "v1"

	UNKNOWN Type = "unknown"
)

Jump to

Keyboard shortcuts

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