From a0bd7e37dbb142f6d370f54daad9c7d1b69b542c Mon Sep 17 00:00:00 2001 From: Shinichi Watanabe Date: Thu, 4 Feb 2021 23:06:06 +0900 Subject: SDL-0274: add preferred FPS to VideoStreamingCapability (#3437) * SDL-0274: issue-#3243: add preferred FPS to VideoStreamingCapability. * Add preferredFPS to HMI_API (which was needed). * Fix for failure in hmi_capabilities_test. --- src/appMain/hmi_capabilities.json | 3 ++- .../include/application_manager/smart_object_keys.h | 1 + .../test/commands/hmi/ui_get_capabilities_response_test.cc | 1 + src/components/application_manager/src/smart_object_keys.cc | 1 + src/components/application_manager/test/hmi_capabilities_test.cc | 1 + src/components/interfaces/HMI_API.xml | 3 +++ tools/rpc_spec | 2 +- 7 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/appMain/hmi_capabilities.json b/src/appMain/hmi_capabilities.json index 1e1c5aea79..4266f40cf3 100755 --- a/src/appMain/hmi_capabilities.json +++ b/src/appMain/hmi_capabilities.json @@ -323,7 +323,8 @@ "hapticSpatialDataSupported": false, "diagonalScreenSize": 8, "pixelPerInch": 117, - "scale": 1 + "scale": 1, + "preferredFPS": 15 }, "driverDistractionCapability": { "menuLength": 10, diff --git a/src/components/application_manager/include/application_manager/smart_object_keys.h b/src/components/application_manager/include/application_manager/smart_object_keys.h index eeaa9f4140..bb5e08f6e2 100644 --- a/src/components/application_manager/include/application_manager/smart_object_keys.h +++ b/src/components/application_manager/include/application_manager/smart_object_keys.h @@ -488,6 +488,7 @@ extern const char* const haptic_rect_data; extern const char* const rect; extern const char* const x; extern const char* const y; +extern const char* const preferred_fps; } // namespace strings namespace hmi_interface { diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_capabilities_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_capabilities_response_test.cc index cf701caf51..a1661dc247 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_capabilities_response_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_capabilities_response_test.cc @@ -344,6 +344,7 @@ TEST_F(UIGetCapabilitiesResponseTest, SetVideoStreamingCapability_SUCCESS) { video_streaming_capability[strings::pixel_per_inch] = 117.f; video_streaming_capability[strings::scale] = 1.f; + video_streaming_capability[strings::preferred_fps] = 30; ResponseFromHMIPtr command( CreateCommand(command_msg)); diff --git a/src/components/application_manager/src/smart_object_keys.cc b/src/components/application_manager/src/smart_object_keys.cc index 90889e6240..a96c02f88f 100644 --- a/src/components/application_manager/src/smart_object_keys.cc +++ b/src/components/application_manager/src/smart_object_keys.cc @@ -447,6 +447,7 @@ const char* const haptic_rect_data = "hapticRectData"; const char* const rect = "rect"; const char* const x = "x"; const char* const y = "y"; +const char* const preferred_fps = "preferredFPS"; } // namespace strings namespace hmi_interface { diff --git a/src/components/application_manager/test/hmi_capabilities_test.cc b/src/components/application_manager/test/hmi_capabilities_test.cc index 4e2e948335..1377b0bc22 100644 --- a/src/components/application_manager/test/hmi_capabilities_test.cc +++ b/src/components/application_manager/test/hmi_capabilities_test.cc @@ -556,6 +556,7 @@ TEST_F( vs_capability_so.keyExists(strings::haptic_spatial_data_supported)); EXPECT_FALSE( vs_capability_so[strings::haptic_spatial_data_supported].asBool()); + EXPECT_TRUE(vs_capability_so.keyExists(strings::preferred_fps)); EXPECT_TRUE(hmi_capabilities_->video_streaming_supported()); } diff --git a/src/components/interfaces/HMI_API.xml b/src/components/interfaces/HMI_API.xml index 9071649556..3ac14e4d54 100644 --- a/src/components/interfaces/HMI_API.xml +++ b/src/components/interfaces/HMI_API.xml @@ -3659,6 +3659,9 @@ The scaling factor the app should use to change the size of the projecting view. + + The preferred frame rate per second of the head unit. The mobile application / app library may take other factors into account that constrain the frame rate lower than this value, but it should not perform streaming at a higher frame rate than this value. + diff --git a/tools/rpc_spec b/tools/rpc_spec index b9c2d34555..390394de35 160000 --- a/tools/rpc_spec +++ b/tools/rpc_spec @@ -1 +1 @@ -Subproject commit b9c2d345555be36e995152315109844e6d7cce6a +Subproject commit 390394de357d3f097aef33ead9d17ef0f4c3d34c -- cgit v1.2.1