diff options
author | Scott Randolph <randolphs@google.com> | 2018-07-12 13:10:36 -0700 |
---|---|---|
committer | Scott Randolph <randolphs@google.com> | 2018-07-12 13:20:02 -0700 |
commit | 788109fc6cc647c60d77cf4bcaa4dba32dc06e22 (patch) | |
tree | c579b70210a21dcd5b10b9784f7eeabe6f4cf88b | |
parent | f26773ed52ce972b3abf0b46b5ff1c7c3e23e29f (diff) | |
download | Car-788109fc6cc647c60d77cf4bcaa4dba32dc06e22.tar.gz |
EVS patches from AOSP
Apply a couple of minor fixes recieved via AOSP patches to the sample
EVS driver and evs application.
Header guards added
MIPs turned off for video texture
Video buffer released from gl context at end of each frame
Bug: 111402303
Test: Build mojave
Change-Id: Ic96a91601b74030a894f8a3f5182709af0c761d0
-rw-r--r-- | evs/app/RenderDirectView.cpp | 3 | ||||
-rw-r--r-- | evs/app/RenderTopView.cpp | 3 | ||||
-rw-r--r-- | evs/sampleDriver/GlWrapper.cpp | 5 | ||||
-rw-r--r-- | evs/sampleDriver/ServiceNames.h | 4 | ||||
-rw-r--r-- | evs/sampleDriver/VideoCapture.h | 4 |
5 files changed, 19 insertions, 0 deletions
diff --git a/evs/app/RenderDirectView.cpp b/evs/app/RenderDirectView.cpp index 24eb4854ab..f0d26e404e 100644 --- a/evs/app/RenderDirectView.cpp +++ b/evs/app/RenderDirectView.cpp @@ -133,6 +133,9 @@ bool RenderDirectView::drawFrame(const BufferDesc& tgtBuffer) { glDisableVertexAttribArray(1); + // Now that everything is submitted, release our hold on the texture resource + detachRenderTarget(); + // Wait for the rendering to finish glFinish(); diff --git a/evs/app/RenderTopView.cpp b/evs/app/RenderTopView.cpp index bff2b3c0f4..80ccb11666 100644 --- a/evs/app/RenderTopView.cpp +++ b/evs/app/RenderTopView.cpp @@ -212,6 +212,9 @@ bool RenderTopView::drawFrame(const BufferDesc& tgtBuffer) { // Draw the car image renderCarTopView(); + // Now that everythign is submitted, release our hold on the texture resource + detachRenderTarget(); + // Wait for the rendering to finish glFinish(); diff --git a/evs/sampleDriver/GlWrapper.cpp b/evs/sampleDriver/GlWrapper.cpp index 3055ba0ff0..fbd36a24b2 100644 --- a/evs/sampleDriver/GlWrapper.cpp +++ b/evs/sampleDriver/GlWrapper.cpp @@ -308,6 +308,11 @@ bool GlWrapper::initialize() { return false; } + // Turn off mip-mapping for the created texture surface + // (the inbound camera imagery doesn't have MIPs) + glBindTexture(GL_TEXTURE_2D, mTextureMap); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glBindTexture(GL_TEXTURE_2D, 0); return true; } diff --git a/evs/sampleDriver/ServiceNames.h b/evs/sampleDriver/ServiceNames.h index 1178da5a9c..6458b1b757 100644 --- a/evs/sampleDriver/ServiceNames.h +++ b/evs/sampleDriver/ServiceNames.h @@ -13,5 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#ifndef ANDROID_HARDWARE_AUTOMOTIVE_EVS_V1_0_SERVICENAMES_H +#define ANDROID_HARDWARE_AUTOMOTIVE_EVS_V1_0_SERVICENAMES_H const static char kEnumeratorServiceName[] = "EvsEnumeratorHw"; + +#endif // ANDROID_HARDWARE_AUTOMOTIVE_EVS_V1_0_SERVICENAMES_H diff --git a/evs/sampleDriver/VideoCapture.h b/evs/sampleDriver/VideoCapture.h index f2d11752d7..63305b9182 100644 --- a/evs/sampleDriver/VideoCapture.h +++ b/evs/sampleDriver/VideoCapture.h @@ -13,6 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#ifndef ANDROID_HARDWARE_AUTOMOTIVE_EVS_V1_0_VIDEOCAPTURE_H +#define ANDROID_HARDWARE_AUTOMOTIVE_EVS_V1_0_VIDEOCAPTURE_H + #include <atomic> #include <thread> #include <functional> @@ -73,3 +76,4 @@ private: }; }; +#endif // ANDROID_HARDWARE_AUTOMOTIVE_EVS_V1_0_VIDEOCAPTURE_ |