Skip to content

Commit 057f39f

Browse files
committed
Reformat with ament_uncrustify
1 parent a307db7 commit 057f39f

2 files changed

Lines changed: 30 additions & 27 deletions

File tree

include/web_video_server/streamer.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class StreamerInterface
8686
*/
8787
virtual std::string get_client_id() = 0;
8888

89-
virtual rclcpp::CallbackGroup::SharedPtr get_callback_group() const { return nullptr; }
89+
virtual rclcpp::CallbackGroup::SharedPtr get_callback_group() const {return nullptr;}
9090
};
9191

9292
/**
@@ -119,7 +119,7 @@ class StreamerBase : public StreamerInterface
119119
return client_id_;
120120
}
121121

122-
rclcpp::CallbackGroup::SharedPtr get_callback_group() const override { return callback_group_; }
122+
rclcpp::CallbackGroup::SharedPtr get_callback_group() const override {return callback_group_;}
123123

124124
protected:
125125
rclcpp::Node::SharedPtr lock_node() const;

src/web_video_server.cpp

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,9 @@ WebVideoServer::WebVideoServer(const rclcpp::NodeOptions & options)
151151
[this]() {restream_frames(1s / publish_rate_);});
152152
}
153153

154-
resource_management_timer_ = create_wall_timer(100ms,
155-
[this]() {resourse_management_timer_callback();}
154+
resource_management_timer_ = create_wall_timer(
155+
100ms,
156+
[this]() {resourse_management_timer_callback();}
156157
);
157158

158159
server_->run();
@@ -207,7 +208,7 @@ void WebVideoServer::activate_pending_streamers()
207208
pending_streamers_.erase(
208209
std::remove_if(
209210
pending_streamers_.begin(), pending_streamers_.end(),
210-
[](const std::shared_ptr<StreamerInterface> & s) { return s->is_inactive(); }),
211+
[](const std::shared_ptr<StreamerInterface> & s) {return s->is_inactive();}),
211212
pending_streamers_.end());
212213
if (pending_streamers_.empty()) {
213214
return;
@@ -234,29 +235,30 @@ void WebVideoServer::activate_pending_streamers()
234235
// stream's thread is affected; all other streams and the management
235236
// timers keep running.
236237
auto weak_node = weak_from_this();
237-
streamer_threads_.emplace_back([s = streamer, weak_node]() {
238-
s->start();
239-
if (s->is_inactive()) {
240-
return;
241-
}
238+
streamer_threads_.emplace_back(
239+
[s = streamer, weak_node]() {
240+
s->start();
241+
if (s->is_inactive()) {
242+
return;
243+
}
242244

243-
auto node = weak_node.lock();
244-
if (!node) {
245-
return;
246-
}
245+
auto node = weak_node.lock();
246+
if (!node) {
247+
return;
248+
}
247249

248-
auto cb_group = s->get_callback_group();
249-
if (!cb_group) {
250-
return;
251-
}
250+
auto cb_group = s->get_callback_group();
251+
if (!cb_group) {
252+
return;
253+
}
252254

253-
rclcpp::executors::SingleThreadedExecutor executor;
254-
executor.add_callback_group(cb_group, node->get_node_base_interface());
255+
rclcpp::executors::SingleThreadedExecutor executor;
256+
executor.add_callback_group(cb_group, node->get_node_base_interface());
255257

256-
while (!s->is_inactive() && rclcpp::ok()) {
257-
executor.spin_once(std::chrono::milliseconds(100));
258-
}
259-
});
258+
while (!s->is_inactive() && rclcpp::ok()) {
259+
executor.spin_once(std::chrono::milliseconds(100));
260+
}
261+
});
260262
}
261263

262264
void WebVideoServer::cleanup_inactive_streams()
@@ -289,9 +291,10 @@ void WebVideoServer::cleanup_inactive_streams()
289291
// deleteUserEndpoint which waits on the DDS event thread — if that
290292
// thread is stuck (FastDDS internal deadlock), we'd block the entire
291293
// main executor. A throwaway thread can afford to wait.
292-
std::thread([captured = std::move(to_destroy)]() mutable {
293-
captured.clear();
294-
}).detach();
294+
std::thread(
295+
[captured = std::move(to_destroy)]() mutable {
296+
captured.clear();
297+
}).detach();
295298
}
296299
}
297300

0 commit comments

Comments
 (0)