From 2b367721a7f6575ef3927e4eceac1a40fdfc1700 Mon Sep 17 00:00:00 2001 From: matt Date: Sat, 10 Oct 2020 23:28:30 +0100 Subject: [PATCH] fix compiler errors --- include/f1x/openauto/autoapp/Service/VideoService.hpp | 1 + src/autoapp/Projection/OMXVideoOutput.cpp | 8 ++++---- src/autoapp/Service/AndroidAutoEntity.cpp | 5 ++++- src/autoapp/Service/VideoService.cpp | 7 +++++++ 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/include/f1x/openauto/autoapp/Service/VideoService.hpp b/include/f1x/openauto/autoapp/Service/VideoService.hpp index 4c67a05..391e1bc 100644 --- a/include/f1x/openauto/autoapp/Service/VideoService.hpp +++ b/include/f1x/openauto/autoapp/Service/VideoService.hpp @@ -48,6 +48,7 @@ public: void onChannelOpenRequest(const aasdk::proto::messages::ChannelOpenRequest& request) override; void onAVChannelSetupRequest(const aasdk::proto::messages::AVChannelSetupRequest& request) override; void onAVChannelStartIndication(const aasdk::proto::messages::AVChannelStartIndication& indication) override; + void onAVChannelStopIndication(const aasdk::proto::messages::AVChannelStopIndication& indication) override; void onAVMediaWithTimestampIndication(aasdk::messenger::Timestamp::ValueType timestamp, const aasdk::common::DataConstBuffer& buffer) override; void onAVMediaIndication(const aasdk::common::DataConstBuffer& buffer) override; void onVideoFocusRequest(const aasdk::proto::messages::VideoFocusRequest& request) override; diff --git a/src/autoapp/Projection/OMXVideoOutput.cpp b/src/autoapp/Projection/OMXVideoOutput.cpp index 12f5960..f8f3808 100644 --- a/src/autoapp/Projection/OMXVideoOutput.cpp +++ b/src/autoapp/Projection/OMXVideoOutput.cpp @@ -204,19 +204,19 @@ void OMXVideoOutput::stop() bool OMXVideoOutput::createComponents() { - if(ilclient_create_component(client_, &components_[VideoComponent::DECODER], "video_decode", static_cast(ILCLIENT_DISABLE_ALL_PORTS | ILCLIENT_ENABLE_INPUT_BUFFERS)) != 0) + if(ilclient_create_component(client_, &components_[VideoComponent::DECODER], const_cast("video_decode"), static_cast(ILCLIENT_DISABLE_ALL_PORTS | ILCLIENT_ENABLE_INPUT_BUFFERS)) != 0) { OPENAUTO_LOG(error) << "[OMXVideoOutput] video decode component creation failed."; return false; } - if(ilclient_create_component(client_, &components_[VideoComponent::RENDERER], "video_render", ILCLIENT_DISABLE_ALL_PORTS) != 0) + if(ilclient_create_component(client_, &components_[VideoComponent::RENDERER], const_cast("video_render"), ILCLIENT_DISABLE_ALL_PORTS) != 0) { OPENAUTO_LOG(error) << "[OMXVideoOutput] video renderer component creation failed."; return false; } - if(ilclient_create_component(client_, &components_[VideoComponent::CLOCK], "clock", ILCLIENT_DISABLE_ALL_PORTS) != 0) + if(ilclient_create_component(client_, &components_[VideoComponent::CLOCK], const_cast("clock"), ILCLIENT_DISABLE_ALL_PORTS) != 0) { OPENAUTO_LOG(error) << "[OMXVideoOutput] clock component creation failed."; return false; @@ -228,7 +228,7 @@ bool OMXVideoOutput::createComponents() return false; } - if(ilclient_create_component(client_, &components_[VideoComponent::SCHEDULER], "video_scheduler", ILCLIENT_DISABLE_ALL_PORTS) != 0) + if(ilclient_create_component(client_, &components_[VideoComponent::SCHEDULER], const_cast("video_scheduler"), ILCLIENT_DISABLE_ALL_PORTS) != 0) { OPENAUTO_LOG(error) << "[OMXVideoOutput] video scheduler component creation failed."; return false; diff --git a/src/autoapp/Service/AndroidAutoEntity.cpp b/src/autoapp/Service/AndroidAutoEntity.cpp index 54b14b6..02986dd 100644 --- a/src/autoapp/Service/AndroidAutoEntity.cpp +++ b/src/autoapp/Service/AndroidAutoEntity.cpp @@ -257,8 +257,9 @@ void AndroidAutoEntity::onNavigationFocusRequest(const aasdk::proto::messages::N controlServiceChannel_->receive(this->shared_from_this()); } -void AndroidAutoEntity::onPingResponse(const aasdk::proto::messages::PingResponse&) +void AndroidAutoEntity::onPingResponse(const aasdk::proto::messages::PingResponse& response) { + OPENAUTO_LOG(info) << "[AndroidAutoEntity] Ping response, timestamp: " << response.timestamp(); pinger_->pong(); controlServiceChannel_->receive(this->shared_from_this()); } @@ -302,6 +303,8 @@ void AndroidAutoEntity::sendPing() promise->then([]() {}, std::bind(&AndroidAutoEntity::onChannelError, this->shared_from_this(), std::placeholders::_1)); aasdk::proto::messages::PingRequest request; + auto timestamp = std::chrono::duration_cast(std::chrono::high_resolution_clock::now().time_since_epoch()); + request.set_timestamp(timestamp.count()); controlServiceChannel_->sendPingRequest(request, std::move(promise)); } diff --git a/src/autoapp/Service/VideoService.cpp b/src/autoapp/Service/VideoService.cpp index 4abdc29..cd4b065 100644 --- a/src/autoapp/Service/VideoService.cpp +++ b/src/autoapp/Service/VideoService.cpp @@ -110,6 +110,13 @@ void VideoService::onAVChannelStartIndication(const aasdk::proto::messages::AVCh channel_->receive(this->shared_from_this()); } +void VideoService::onAVChannelStopIndication(const aasdk::proto::messages::AVChannelStopIndication& indication) +{ + OPENAUTO_LOG(info) << "[VideoService] stop indication"; + + channel_->receive(this->shared_from_this()); +} + void VideoService::onAVMediaWithTimestampIndication(aasdk::messenger::Timestamp::ValueType timestamp, const aasdk::common::DataConstBuffer& buffer) { videoOutput_->write(timestamp, buffer);