From a257e2d038329d816181e8e494ae8c94e4fa9319 Mon Sep 17 00:00:00 2001 From: tbago Date: Thu, 22 Feb 2024 16:44:43 +0800 Subject: [PATCH] add more camera video stream info * unify the camera and camera server stream info; * support multi camera video stream info; * add camera video stream id in camera proto VideoStreamInfo message; --- protos/camera/camera.proto | 9 ++--- protos/camera_server/camera_server.proto | 44 +++++++++++++++++++----- 2 files changed, 40 insertions(+), 13 deletions(-) diff --git a/protos/camera/camera.proto b/protos/camera/camera.proto index 79ad9a2f..1bd1bca4 100644 --- a/protos/camera/camera.proto +++ b/protos/camera/camera.proto @@ -190,7 +190,7 @@ message ModeResponse { message SubscribeVideoStreamInfoRequest {} message VideoStreamInfoResponse { - VideoStreamInfo video_stream_info = 1; // Video stream info + repeated VideoStreamInfo video_stream_infos = 1; // Video stream infos } message SubscribeCaptureInfoRequest {} @@ -356,9 +356,10 @@ message VideoStreamInfo { VIDEO_STREAM_SPECTRUM_INFRARED = 2; // Infrared } - VideoStreamSettings settings = 1; // Video stream settings - VideoStreamStatus status = 2; // Current status of video streaming - VideoStreamSpectrum spectrum = 3; // Light-spectrum of the video stream + int32 stream_id = 1; // stream unique id + VideoStreamSettings settings = 2; // Video stream settings + VideoStreamStatus status = 3; // Current status of video streaming + VideoStreamSpectrum spectrum = 4; // Light-spectrum of the video stream } // Information about the camera status. diff --git a/protos/camera_server/camera_server.proto b/protos/camera_server/camera_server.proto index a8283dcd..02f7e0f9 100644 --- a/protos/camera_server/camera_server.proto +++ b/protos/camera_server/camera_server.proto @@ -12,8 +12,8 @@ service CameraServerService { // Sets the camera information. This must be called as soon as the camera server is created. rpc SetInformation(SetInformationRequest) returns(SetInformationResponse) { option (mavsdk.options.async_type) = SYNC; } - // Sets video streaming settings. - rpc SetVideoStreaming(SetVideoStreamingRequest) returns(SetVideoStreamingResponse) { option (mavsdk.options.async_type) = SYNC; } + // Sets video stream info. + rpc SetVideoStreamInfo(SetVideoStreamInfoRequest) returns(SetVideoStreamInfoResponse) { option (mavsdk.options.async_type) = SYNC; } // Sets image capture in progress status flags. This should be set to true when the camera is busy taking a photo and false when it is done. rpc SetInProgress(SetInProgressRequest) returns(SetInProgressResponse) { option (mavsdk.options.async_type) = SYNC; } @@ -87,11 +87,11 @@ message SetInformationResponse { CameraServerResult camera_server_result = 1; } -message SetVideoStreamingRequest { - VideoStreaming video_streaming = 1; // information about the video stream +message SetVideoStreamInfoRequest { + repeated VideoStreamInfo video_stream_infos = 1; // Video stream infos } -message SetVideoStreamingResponse { +message SetVideoStreamInfoResponse { CameraServerResult camera_server_result = 1; } @@ -249,10 +249,36 @@ message Information { string definition_file_uri = 11; // Camera definition URI (http or mavlink ftp) } -// Type to represent video streaming settings -message VideoStreaming { - bool has_rtsp_server = 1; // True if the capture was successful - string rtsp_uri = 2; // RTSP URI (e.g. rtsp://192.168.1.42:8554/live) +// Type for video stream settings. +message VideoStreamSettings { + float frame_rate_hz = 1; // Frames per second + uint32 horizontal_resolution_pix = 2; // Horizontal resolution (in pixels) + uint32 vertical_resolution_pix = 3; // Vertical resolution (in pixels) + uint32 bit_rate_b_s = 4; // Bit rate (in bits per second) + uint32 rotation_deg = 5; // Video image rotation (clockwise, 0-359 degrees) + string uri = 6; // Video stream URI + float horizontal_fov_deg = 7; // Horizontal fov in degrees +} + +// Information about the video stream. +message VideoStreamInfo { + // Video stream status type. + enum VideoStreamStatus { + VIDEO_STREAM_STATUS_NOT_RUNNING = 0; // Video stream is not running + VIDEO_STREAM_STATUS_IN_PROGRESS = 1; // Video stream is running + } + + // Video stream light spectrum type + enum VideoStreamSpectrum { + VIDEO_STREAM_SPECTRUM_UNKNOWN = 0; // Unknown + VIDEO_STREAM_SPECTRUM_VISIBLE_LIGHT = 1; // Visible light + VIDEO_STREAM_SPECTRUM_INFRARED = 2; // Infrared + } + + int32 stream_id = 1; // stream unique id + VideoStreamSettings settings = 2; // Video stream settings + VideoStreamStatus status = 3; // Current status of video streaming + VideoStreamSpectrum spectrum = 4; // Light-spectrum of the video stream } // Position type in global coordinates.