Skip to content

Commit

Permalink
Remove weird stuff that made it in via merge
Browse files Browse the repository at this point in the history
  • Loading branch information
hexbabe committed Jan 29, 2025
1 parent 47a749f commit 6e599b6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 21 deletions.
20 changes: 0 additions & 20 deletions components/camera/camera.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"fmt"
"image"

"github.com/pion/mediadevices/pkg/prop"
"github.com/pkg/errors"
pb "go.viam.com/api/component/camera/v1"

Expand Down Expand Up @@ -172,25 +171,6 @@ func DecodeImageFromCamera(ctx context.Context, mimeType string, extra map[strin
return img, nil
}

// VideoSourceFromCamera converts a camera resource into a gostream VideoSource.
func VideoSourceFromCamera(ctx context.Context, cam Camera) gostream.VideoSource {
reader := gostream.VideoReaderFunc(func(ctx context.Context) (image.Image, func(), error) {
img, err := DecodeImageFromCamera(ctx, "", nil, cam)
if err != nil {
return nil, func() {}, err
}
return img, func() {}, nil
})
camProps, err := cam.Properties(ctx)
if err != nil {
camProps = Properties{}
}
if camProps.IntrinsicParams == nil {
return gostream.NewVideoSource(reader, prop.Video{Width: 0, Height: 0})
}
return gostream.NewVideoSource(reader, prop.Video{Width: camProps.IntrinsicParams.Width, Height: camProps.IntrinsicParams.Height})
}

// A PointCloudSource is a source that can generate pointclouds.
type PointCloudSource interface {
NextPointCloud(ctx context.Context) (pointcloud.PointCloud, error)
Expand Down
2 changes: 1 addition & 1 deletion components/camera/transformpipeline/transform.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func buildTransform(
}
}

func propsFromVideoSource(ctx context.Context, source camera.VideoSource) (camera.Properties, error) {
func propsFromVideoSource(ctx context.Context, source camera.Camera) (camera.Properties, error) {
var camProps camera.Properties

props, err := source.Properties(ctx)
Expand Down

0 comments on commit 6e599b6

Please sign in to comment.