Documentation ¶
Index ¶
- Variables
- type Camera
- func (c *Camera) AwaitTakePicture() (urls []string, err error)
- func (c *Camera) GetApplicationInfo() (server string, version string, err error)
- func (c *Camera) GetAvailableAPIList() (available []string, err error)
- func (c *Camera) GetAvailableContinuousShootingMode() (current continuousShootingMode, available []continuousShootingMode, err error)
- func (c *Camera) GetAvailablePostviewImageSize() (current string, available []string, err error)
- func (c *Camera) GetAvailableShootMode() (current string, available []string, err error)
- func (c *Camera) GetContinuousShootingMode() (mode continuousShootingMode, err error)
- func (c *Camera) GetMethodTypes(ep endpoint, version string) (types [][]string, err error)
- func (c *Camera) GetPostviewImageSize() (size string, err error)
- func (c *Camera) GetShootMode() (mode string, err error)
- func (c *Camera) GetSupportedContinuousShootingMode() (modes []continuousShootingMode, err error)
- func (c *Camera) GetSupportedLiveviewSize() (sizes []string, err error)
- func (c *Camera) GetSupportedPostviewImageSize() (sizes []string, err error)
- func (c *Camera) GetSupportedShootMode() (modes []string, err error)
- func (c *Camera) GetVersions(ep endpoint) (versions []string, err error)
- func (c *Camera) Initilize() error
- func (c *Camera) SetContinuousShootingMode(mode continuousShootingMode) (err error)
- func (c *Camera) SetContinuousShootingSpeed(speed continuousShootingSpeed) (err error)
- func (c *Camera) SetPostviewImageSize(size PostViewSize) (err error)
- func (c *Camera) SetShootMode(mode ShootMode) (err error)
- func (c *Camera) SetStillQuality(quality stillQuality) (err error)
- func (c *Camera) StartContinuousShooting() (err error)
- func (c *Camera) StartLiveview() (lv *Liveview, err error)
- func (c *Camera) StartLiveviewWithSize(size LiveviewSize) (lv *Liveview, err error)
- func (c *Camera) StopContinuousShooting() (err error)
- func (c *Camera) StopLiveview() (err error)
- func (c *Camera) TakePicture() (urls []string, err error)
- func (c *Camera) UpdateState(polling bool) (err error)
- type Liveview
- type LiveviewCommonHeader
- type LiveviewImagePayload
- type LiveviewInfoPayload
- type LiveviewPayload
- type LiveviewSize
- type PostViewSize
- type ShootMode
Constants ¶
This section is empty.
Variables ¶
var ContinuousShootingModes = struct {
Single continuousShootingMode
Continuous continuousShootingMode
SpdPriority continuousShootingMode
Burst continuousShootingMode
MotionShot continuousShootingMode
}{"Single", "Continuous", "Spd Priority Cont.", "Burst", "MotionShot"}
var ContinuousShootingSpeeds = struct {
Hi continuousShootingSpeed
Low continuousShootingSpeed
TenFPSx1 continuousShootingSpeed
EightFPSx1 continuousShootingSpeed
FiveFPSx2 continuousShootingSpeed
TwoFPSx5 continuousShootingSpeed
}{"Hi", "Low", "10fps 1sec", "8fps 1sec", "5fps 2sec", "2fps 5sec"}
var LiveviewSizes = struct { L LiveviewSize M LiveviewSize }{"L", "M"}
LiveviewSizes is defined as above.
var PostViewSizes = struct { Original PostViewSize // The origianl image size TwoM PostViewSize // A device spcific size, smaller than the original. Often 2 megapixels. }{"Original", "2M"}
PostViewSizes defined the possible size options for postview images returned by the camera.
var ShootModes = struct { Still ShootMode // Still image shoot mode Movie ShootMode // Movie shoot mode Audio ShootMode // Audio shoot mode IntervalStill ShootMode // Interval still shoot mode LoopRec ShootMode // Loop recording shoot mode }{"still", "movie", "audio", "intervalstill", "looprec"}
ShootModes defines, at the time of writing, all possible shoot modes supported by the camera API.
var StillQualities = struct {
RAWJPG stillQuality
Fine stillQuality
Standard stillQuality
}{"RAW+JPEG", "Fine", "Standard"}
StillQualities defines the possible qualities that can be passed to the camera.
Functions ¶
This section is empty.
Types ¶
type Camera ¶
type Camera struct { ActionListURL string // API Versions 1.0 // 0 AvailableAPIList []string `json:"names"` // 1 Status string `json:"cameraStatus"` // 2 Zoom struct { Position int `json:"zoomPosition"` NumberBox int `json:"zoomNumberBox"` CurrentBox int `json:"zoomIndexCurrentBox"` PositionCurrentBox int `json:"zoomPositionCurrentBox"` } // 3 LiveviewStatus bool `json:"liveviewStatus,string"` // 4 LiveviewOrientation string `json:"liveviewOrientation"` // 5 TakePictureURLs []struct { URL []string `json:"takePictureUrl"` } // 10 Storage []struct { ID string `json:"storageID"` RecordTarget bool `json:"recordTarget"` NumberOfRecordableImages int `json:"numberOfRecordableImages"` RecordableTime int `json:"recordableTime"` // minutes Description string `json:"storageDescription"` } // 11 BeepMode struct { Current string `json:"currentBeepMode"` Candidates []string `json:"beepModeCandidates"` } // 12 Function struct { Current string `json:"currentCameraFunction"` Candidates []string `json:"cameraFunctionCandidates"` } // 13 MovieQuality struct { Current string `json:"currentMovieQuality"` Candidates []string `json:"movieQualityCandidates"` } // 14 StillSize struct { CheckAvailability bool `json:"checkAvailability"` CurrentAspect string `json:"currentAspect"` CurrentSize string `json:"currentSize"` } // 15 FunctionResult string `json:"cameraFunctionResult"` // 16 SteadyMode struct { Current string `json:"currentSteadyMode"` Candidates []string `json:"steadyModeCandidates"` } // 17 ViewAngle struct { Current string `json:"currentViewAngle"` Candidates []string `json:"viewAngleCandidates"` } // 18 ExposureMode struct { Current string `json:"currentExposureMode"` Candidates []string `json:"exposureModeCandidates"` } // 19 PostviewImageSize struct { Current string `json:"currentPostviewImageSize"` Candidates []string `json:"postviewImageSizeCandidates"` } // 20 SelfTimer struct { Current int `json:"currentSelfTimer"` Candidates []int `json:"selfTimerCandidates"` } // 21 ShootMode struct { Current string `json:"currentShootMode"` Candidates []string `json:"shootModeCandidates"` } // 25 ExposureCompensation struct { Current int `json:"currentExposureCompensation"` Max int `json:"maxExposureCompensation"` Min int `json:"minExposureCompensation"` StepIndex int `json:"stepIndexOfExposureCompensation"` } // 26 FlashMode struct { Current string `json:"currentFlashMode"` Candidates []string `json:"flashModeCandidates"` } // 27 FNumber struct { Current string `json:"currentFNumber"` Candidates []string `json:"fNumberCandidates"` } // 28 FocusMode struct { Current string `json:"currentFocusMode"` Candidates []string `json:"focusModeCandidates"` } // 29 ISO struct { Current string `json:"currentIsoSpeedRate"` Candidates []string `json:"isoSpeedRateCandidates"` } // 31 IsShifted bool `json:"isShifted,string"` // 32 ShutterSpeed struct { Current string `json:"currentShutterSpeed"` Candidates []string `json:"shutterSpeedCandidates"` } // 33 WhiteBalance struct { CheckAvailability bool `json:"checkAvailability"` Current string `json:"currentWhiteBalanceMode"` ColorTemperature int `json:"currentColorTemperature"` } // 34 TouchAFPosition struct { Set bool `json:"currentSet"` CurrentCoordinates []float64 `json:"currentTouchCoordinates"` } // 35 FocusState string `json:"focusStatus"` // 36 ZoomMode struct { Current string `json:"zoom"` Candidates []string `json:"candidate"` } // 37 StillQuality struct { Current string `json:"stillQuality"` Candidates []string `json:"candidate"` } // 38 ContinuousShootingMode struct { Current string `json:"contShootingMode"` Candidates []string `json:"candidate"` } // 39 ContinuousShootingSpeed struct { Current string `json:"contShootingSpeed"` Candidates []string `json:"candidate"` } // 40 ContinuousShootingURL []struct { PostviewURL string `json:"postviewUrl"` ThumbnailURL string `json:"thumbnailUrl"` } // 41 FlipSetting struct { Current string `json:"flip"` Candidates []string `json:"candidate"` } // 42 SceneSelection struct { Current string `json:"scene"` Candidates []string `json:"candidate"` } // 43 InvtervalTime struct { Current string `json:"intervalTimeSec"` Candidates []string `json:"candidate"` } // 44 Color struct { Current string `json:"colorSetting"` Candidates []string `json:"candidate"` } // 45 MovieFileFormat struct { Current string `json:"movieFileFormat"` Candidates []string `json:"candidate"` } // 52 IRRemoteSetting struct { Current string `json:"infraredRemoteControl"` Candidates []string `json:"candidate"` } // 53 TVColorSystem struct { Current string `json:"tvColorSystem"` Candidates []string `json:"candidate"` } // 54 TrackingFocusStauts string `json:"trackingFocusStatus"` // 55 TrackingFocusSetting struct { Current string `json:"trackingFocus"` Candidates []string `json:"candidate"` } // 56 BatteryInfo []struct { ID string `json:"batteryID"` Status string `json:"status"` AdditionalStatus string `json:"additionalStatus"` LevelNumber int `json:"levelNumer"` LevelDenom int `json:"levelDenom"` Description string `json:"description"` } // 57 RecordingTime int `json:"recordingTime"` // 58 NumberOfshots int `json:"numberOfShots"` // 59 AutoPowerOffTime struct { Current int `json:"autoPowerOff"` Candidates []int `json:"candidate"` } // 60 LoopRecordingTime struct { Current string `json:"loopRecTime"` Candidates []string `json:"candidate"` } // 61 AudioRecording struct { Current string `json:"audioRecording"` Candidates []string `json:"candidate"` } // 62 WindNoiseReduction struct { Current string `json:"windNoiseReduction"` Candidates []string `json:"candidate"` } // contains filtered or unexported fields }
func DiscoverDevice ¶
func (*Camera) AwaitTakePicture ¶
AwaitTakePicture waits while the camera is taking the picture and returns the picture URL
func (*Camera) GetApplicationInfo ¶
GetApplicationInfo obtains the name and version of the application server on the camera.
func (*Camera) GetAvailableAPIList ¶
GetAvailableAPIList obtains a list of available API features from the camera
func (*Camera) GetAvailableContinuousShootingMode ¶
func (*Camera) GetAvailablePostviewImageSize ¶
GetAvailablePostviewImageSize obtains the current and available Post View Image sizes from the camera
func (*Camera) GetAvailableShootMode ¶
GetAvailableShootMode obtains the current and available shoot mode for the camera
func (*Camera) GetContinuousShootingMode ¶
func (*Camera) GetMethodTypes ¶
GetMethodTypes obtains the types for each of the given API functions for a given endpoint. An ampty string for version will return types for all versions
func (*Camera) GetPostviewImageSize ¶
GetPostviewImageSize obtains the current Post View Image size from the camera:
The possible options are: "2M" - a smaller preview, usually 2Megpixels in size, sometimes not - camera dependant "Original" - the size of the image taken
func (*Camera) GetShootMode ¶
GetShootMode returns the current shoot mode of the camera.
func (*Camera) GetSupportedContinuousShootingMode ¶
func (*Camera) GetSupportedLiveviewSize ¶
GetSupportedLiveviewSize obtains the supported Live View sizes from the camera
func (*Camera) GetSupportedPostviewImageSize ¶
GetSupportedPostviewImageSize obtains the supported Post View Image sizes from the camera
func (*Camera) GetSupportedShootMode ¶
GetSupportedShootMode obtains the supported shooting modes for the camera
func (*Camera) GetVersions ¶
GetVersions obtains the supported versions of the API server at the given endpoint
func (*Camera) Initilize ¶
Initlize the camera for recording and start threads ongoing event polling
func (*Camera) SetContinuousShootingMode ¶
func (*Camera) SetContinuousShootingSpeed ¶
SetContinuousShootingSpeed sets the shotting speed of the camera
func (*Camera) SetPostviewImageSize ¶
func (c *Camera) SetPostviewImageSize(size PostViewSize) (err error)
SetPostviewImageSize sets the Post View image size for the camera:
The possible options are: "2M" - a smaller preview, usually 2Megpixels in size, sometimes not - camera dependant "Original" - the size of the image taken
func (*Camera) SetShootMode ¶
SetShootMode sets the camera to the specified shoot mood. All possible shoot modes are defined in the ShootMode sturct.
func (*Camera) SetStillQuality ¶
SetStillQuality sets the quality for still photos taken by the camera. The possible quality settings are defined in the StillQuality struct.
func (*Camera) StartContinuousShooting ¶
StartContinuousShooting informs the camera to begin continuous shooting
func (*Camera) StartLiveview ¶
func (*Camera) StartLiveviewWithSize ¶
func (c *Camera) StartLiveviewWithSize(size LiveviewSize) (lv *Liveview, err error)
func (*Camera) StopContinuousShooting ¶
StopContinuousShooting informs the camera to stop continuous shooting
func (*Camera) StopLiveview ¶
func (*Camera) TakePicture ¶
TakePicture asks the camera to take a still picture It may return an error if the camera is not in a ready state, or error 40403 of the camera is taking a long exposue. In this case, the client should call AwaitTakePicutre and await the full exposure.
func (*Camera) UpdateState ¶
type Liveview ¶
Liveview defines a live view stream for decoding
func (*Liveview) Decode ¶
func (lv *Liveview) Decode(out chan *LiveviewPayload)
type LiveviewCommonHeader ¶
type LiveviewImagePayload ¶
type LiveviewInfoPayload ¶
type LiveviewPayload ¶
type LiveviewPayload struct { LiveviewCommonHeader PayloadSize uint32 PaddingSize uint8 *LiveviewInfoPayload *LiveviewImagePayload }
type LiveviewSize ¶
type LiveviewSize string
LiveviewSize represents pre-defined resolution or quality for the live view stream. Instances of LiveviewSize are defined in the LiveviewSizes struct variable.
type PostViewSize ¶
type PostViewSize string
PostViewSize defines a supported Post View Image size, as defined by the Sony SRC 2.40 API reference. Instances of PostViewSize can be found in the PostViewSizes variable.