aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2020-10-13 01:15:50 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2020-10-13 01:15:50 +0000
commit2a642ca97b60c0126ec5844659383fb5c894c7a0 (patch)
treebb7b7716637bc6140d15770e245461a78758623c
parentb0cc85c7b0d5ac114e4c7ba3fcd8929356c5e95c (diff)
parenta3971d1ead6e9e18b23352ffc17ba3334c6e9d6f (diff)
downloadCar-android11-qpr1-s2-release.tar.gz
Merge cherrypicks of [12820899, 12820921, 12820267, 12820924, 12820699, 12820781, 12821235, 12821236, 12820925, 12821237, 12820545, 12821039, 12820926, 12820927, 12820928, 12820929, 12820930, 12820590, 12820471, 12820591, 12820592, 12820593, 12820594, 12821255, 12821256, 12821257, 12820998, 12820932, 12821258, 12820546, 12820933, 12820934, 12820547, 12820548, 12821275, 12821238, 12821239, 12821240, 12821241, 12821199, 12821276, 12821277, 12821278, 12821279, 12821280] into rvc-qpr1-releaseandroid-11.0.0_r23android-11.0.0_r22android-11.0.0_r21android-11.0.0_r20android-11.0.0_r19android-11.0.0_r18android11-qpr1-s2-releaseandroid11-qpr1-s1-release
Change-Id: Ie1f58fe5b8d3799da515be054b60d9fac31104b6
-rw-r--r--evs/manager/1.1/HalCamera.cpp6
-rw-r--r--evs/manager/1.1/VirtualCamera.cpp9
2 files changed, 12 insertions, 3 deletions
diff --git a/evs/manager/1.1/HalCamera.cpp b/evs/manager/1.1/HalCamera.cpp
index 38297bb3e4..f4d2c499fe 100644
--- a/evs/manager/1.1/HalCamera.cpp
+++ b/evs/manager/1.1/HalCamera.cpp
@@ -236,6 +236,12 @@ UniqueFence HalCamera::requestNewFrame(sp<VirtualCamera> client,
std::lock_guard<std::mutex> lock(mFrameMutex);
+ if (mTimelines.find(id) == mTimelines.end()) {
+ // Timeline for this client either does not exist or is deleted.
+ LOG(ERROR) << "Timeline for this client does not exist.";
+ return {};
+ }
+
mTimelines[id]->BumpFenceEventCounter();
UniqueFence fence = mTimelines[id]->CreateFence("FrameFence");
diff --git a/evs/manager/1.1/VirtualCamera.cpp b/evs/manager/1.1/VirtualCamera.cpp
index 6204a78e3a..fda58d1c48 100644
--- a/evs/manager/1.1/VirtualCamera.cpp
+++ b/evs/manager/1.1/VirtualCamera.cpp
@@ -180,10 +180,13 @@ bool VirtualCamera::notify(const EvsEventDesc& event) {
// Warn if we got an unexpected stream termination
LOG(WARNING) << "Stream unexpectedly stopped, current status "
<< mStreamState;
- }
- // Mark the stream as stopped.
- mStreamState = STOPPED;
+ // Clean up the resource and forward an event to the client
+ stopVideoStream();
+
+ // This event is handled properly.
+ return true;
+ }
if (mStream_1_1 == nullptr) {
// Send a null frame instead, for v1.0 client