Skip to content

Commit

Permalink
Add CompressedVideo schema (#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
defunctzombie authored Aug 4, 2023
1 parent bded79a commit e243fee
Show file tree
Hide file tree
Showing 13 changed files with 340 additions and 0 deletions.
24 changes: 24 additions & 0 deletions internal/__snapshots__/exportTypeScriptSchemas.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,29 @@ export type CompressedImage = {
*/
format: string;
};
",
"CompressedVideo" => "// Generated by https://github.com/foxglove/schemas
import { Time } from "./Time";
/** A single frame of a compressed video bitstream */
export type CompressedVideo = {
/** Timestamp of image */
timestamp: Time;
/** Frame of reference for the image. The origin of the frame is the optical center of the camera. +x points to the right in the image, +y points down, and +z points into the plane of the image. */
frame_id: string;
/** Compressed video frame data. For packet-based video codecs this data must begin and end on packet boundaries (no partial packets), and must contain enough video packets to decode exactly one image (either a keyframe or delta frame). */
data: Uint8Array;
/**
* Video format
*
* Supported values: \`h264\`
*/
format: string;
};
",
"CylinderPrimitive" => "// Generated by https://github.com/foxglove/schemas
Expand Down Expand Up @@ -999,6 +1022,7 @@ export * from "./CameraCalibration";
export * from "./CircleAnnotation";
export * from "./Color";
export * from "./CompressedImage";
export * from "./CompressedVideo";
export * from "./CubePrimitive";
export * from "./CylinderPrimitive";
export * from "./FrameTransform";
Expand Down
31 changes: 31 additions & 0 deletions internal/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,36 @@ const CompressedImage: FoxgloveMessageSchema = {
],
};

const CompressedVideo: FoxgloveMessageSchema = {
type: "message",
name: "CompressedVideo",
description: "A single frame of a compressed video bitstream",
fields: [
{
name: "timestamp",
type: { type: "primitive", name: "time" },
description: "Timestamp of image",
},
{
name: "frame_id",
type: { type: "primitive", name: "string" },
description:
"Frame of reference for the image. The origin of the frame is the optical center of the camera. +x points to the right in the image, +y points down, and +z points into the plane of the image.",
},
{
name: "data",
type: { type: "primitive", name: "bytes" },
description:
"Compressed video frame data. For packet-based video codecs this data must begin and end on packet boundaries (no partial packets), and must contain enough video packets to decode exactly one image (either a keyframe or delta frame).",
},
{
name: "format",
type: { type: "primitive", name: "string" },
description: "Video format\n\nSupported values: `h264`",
},
],
};

const RawImage: FoxgloveMessageSchema = {
type: "message",
name: "RawImage",
Expand Down Expand Up @@ -1425,6 +1455,7 @@ export const foxgloveMessageSchemas = {
CircleAnnotation,
Color,
CompressedImage,
CompressedVideo,
CylinderPrimitive,
CubePrimitive,
FrameTransform,
Expand Down
18 changes: 18 additions & 0 deletions ros_foxglove_msgs/ros1/CompressedVideo.msg

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions ros_foxglove_msgs/ros2/CompressedVideo.msg

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

67 changes: 67 additions & 0 deletions schemas/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions schemas/flatbuffer/CompressedVideo.fbs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 37 additions & 0 deletions schemas/jsonschema/CompressedVideo.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 38 additions & 0 deletions schemas/jsonschema/index.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions schemas/proto/foxglove/CompressedVideo.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions schemas/ros1/CompressedVideo.msg

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions schemas/ros2/CompressedVideo.msg

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions schemas/typescript/CompressedVideo.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e243fee

Please sign in to comment.