代码拉取完成,页面将自动刷新
package v4l2_framesize
import (
"fmt"
"unsafe"
)
const (
const_TYPE_DISCRETE = 1 // (V4L2_FRMSIZE_TYPE_DISCRETE)
const_TYPE_CONTINUOUS = 2 // (V4L2_FRMSIZE_TYPE_CONTINUOUS)
const_TYPE_STEPWISE = 3 // (V4L2_FRMSIZE_TYPE_STEPWISE)
)
// Cast tries to turn a v4l2_framesize.Type into a:
// v4l2_framesize.Discrete,
// v4l2_framesize.Continuous, or
// v4l2_framesize.Stepwise.
//
// Example:
//
// switch casted := frameSize.Cast().(type) {
// case v4l2_framesize.Continuous
// //@TODO
// case v4l2_framesize.Discrete:
// //@TODO
// case v4l2_framesize.Stepwise
// //@TODO
// default:
// //@TODO: Error, unknown framesize type.
// }
func (receiver Type) Cast() (interface{}, error) {
switch receiver.typ {
case const_TYPE_DISCRETE:
return *(*Discrete)(unsafe.Pointer(&receiver)), nil
case const_TYPE_CONTINUOUS:
return *(*Continuous)(unsafe.Pointer(&receiver)), nil
case const_TYPE_STEPWISE:
return *(*Stepwise)(unsafe.Pointer(&receiver)), nil
default:
return nil, fmt.Errorf("Unexpected frame size type: %d", receiver.typ)
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。