media_perception: Fixes a bug with smart framing proto output.
Pushes smart framing protos out over the software_autozoom.mojom
interface after we've checked to see that the handler is bound.
TEST=Verified on a real device that this fixes output over Mojo IPC.
BUG=chromium:1078220
Change-Id: I38a40a5e8f925b78382b0c49800a6d129f0af8f7
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform2/+/2181528
Reviewed-by: Toni Baržić <tbarzic@chromium.org>
Tested-by: Luke Sorenson <lasoren@chromium.org>
Commit-Queue: Luke Sorenson <lasoren@chromium.org>
(cherry picked from commit b4b451b9c874370a7312defc58b5ff0e8fd0d565)
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform2/+/2238390
diff --git a/media_perception/output_manager.cc b/media_perception/output_manager.cc
index 9a4549d..b105b32 100644
--- a/media_perception/output_manager.cc
+++ b/media_perception/output_manager.cc
@@ -334,18 +334,16 @@
void OutputManager::HandleSmartFraming(
const std::vector<uint8_t>& bytes) {
- if (!one_touch_autozoom_handler_ptr_.is_bound()) {
+ if (one_touch_autozoom_handler_ptr_.is_bound() &&
+ one_touch_autozoom_handler_ptr_.get() != nullptr) {
+ one_touch_autozoom_handler_ptr_->OnSmartFraming(bytes);
+ } else if (software_autozoom_handler_ptr_.is_bound() &&
+ software_autozoom_handler_ptr_.get() != nullptr) {
+ software_autozoom_handler_ptr_->OnSmartFraming(bytes);
+ } else {
LOG(WARNING)
- << "Got smart framing proto but handler ptr is not bound.";
- return;
+ << "Got smart framing but handler ptr is not bound.";
}
-
- if (one_touch_autozoom_handler_ptr_.get() == nullptr) {
- LOG(ERROR) << "Handler ptr is null.";
- return;
- }
-
- one_touch_autozoom_handler_ptr_->OnSmartFraming(bytes);
}
} // namespace mri