diff --git a/settings.gradle b/settings.gradle
index 4fe2ea4f0..1bac1cdee 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -62,4 +62,3 @@ include(":teapots:image-decoder")
include(":teapots:more-teapots")
include(":teapots:textured-teapot")
include(":unit-test:app")
-include(":webp:view")
diff --git a/webp/README.md b/webp/README.md
deleted file mode 100644
index e4e1d1b81..000000000
--- a/webp/README.md
+++ /dev/null
@@ -1,61 +0,0 @@
-# WEBP Samples
-
-Webp is an Android sample including a small app to demo usage of webp in
-[Native Activity](http://developer.android.com/reference/android/app/NativeActivity.html)\
-view:
-
-- rotate decoding 3 webp images and load them into on-screen buffer. Decoding is
- in its own thread
-
-This sample uses the new
-[Android Studio CMake plugin](https://developer.android.com/ndk/guides/cmake.html).
-
-## Pre-requisites
-
-- Android Studio 3.0.0+ and android-ndk-r16
-
-## Getting Started
-
-1. Download Android Studio from
- [formal release](http://developer.android.com/sdk/index.html) or
- [canary](http://tools.android.com/download/studio/canary)
-1. Launch Android Studio
-1. Select "Import project (Eclipse ADT, Gradle,etc)"
-1. Browse into downloaded sample directory, select webp/build.gradle
-1. Click *Tools/Android/Sync Project with Gradle Files*.
-1. Click *Run/Run 'app'*.
-
-## Screenshots
-
-![screenshot](screenshot.png)
-
-## Support
-
-If you've found an error in these samples, please
-[file an issue](https://github.com/googlesamples/android-ndk/issues/new).
-
-Patches are encouraged, and may be submitted by
-[forking this project](https://github.com/googlesamples/android-ndk/fork) and
-submitting a pull request through GitHub. Please see
-[CONTRIBUTING.md](../CONTRIBUTING.md) for more details.
-
-- [Stack Overflow](http://stackoverflow.com/questions/tagged/android-ndk)
-- [Android Tools Feedbacks](http://tools.android.com/feedback)
-
-## License
-
-Copyright 2015 Google, Inc.
-
-Licensed to the Apache Software Foundation (ASF) under one or more contributor
-license agreements. See the NOTICE file distributed with this work for
-additional information regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the "License"); you may not use
-this file except in compliance with the License. You may obtain a copy of the
-License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software distributed
-under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-CONDITIONS OF ANY KIND, either express or implied. See the License for the
-specific language governing permissions and limitations under the License.
diff --git a/webp/screenshot.png b/webp/screenshot.png
deleted file mode 100644
index 01d4d257e..000000000
Binary files a/webp/screenshot.png and /dev/null differ
diff --git a/webp/view/build.gradle b/webp/view/build.gradle
deleted file mode 100644
index de1602e2f..000000000
--- a/webp/view/build.gradle
+++ /dev/null
@@ -1,22 +0,0 @@
-plugins {
- id "ndksamples.android.application"
-}
-
-android {
- namespace 'com.example.webp_view'
-
- defaultConfig {
- applicationId 'com.example.webp_view'
- externalNativeBuild {
- cmake {
- arguments '-DANDROID_STL=c++_static'
- }
- }
- }
-
- externalNativeBuild {
- cmake {
- path 'src/main/cpp/CMakeLists.txt'
- }
- }
-}
diff --git a/webp/view/src/main/AndroidManifest.xml b/webp/view/src/main/AndroidManifest.xml
deleted file mode 100644
index 87ab77e71..000000000
--- a/webp/view/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/webp/view/src/main/assets/clips/frame1.webp b/webp/view/src/main/assets/clips/frame1.webp
deleted file mode 100644
index 3e4bca1d8..000000000
Binary files a/webp/view/src/main/assets/clips/frame1.webp and /dev/null differ
diff --git a/webp/view/src/main/assets/clips/frame2.webp b/webp/view/src/main/assets/clips/frame2.webp
deleted file mode 100644
index 0da983e2c..000000000
Binary files a/webp/view/src/main/assets/clips/frame2.webp and /dev/null differ
diff --git a/webp/view/src/main/assets/clips/frame3.webp b/webp/view/src/main/assets/clips/frame3.webp
deleted file mode 100644
index c833c5d4a..000000000
Binary files a/webp/view/src/main/assets/clips/frame3.webp and /dev/null differ
diff --git a/webp/view/src/main/cpp/CMakeLists.txt b/webp/view/src/main/cpp/CMakeLists.txt
deleted file mode 100644
index 0cd39c6e7..000000000
--- a/webp/view/src/main/cpp/CMakeLists.txt
+++ /dev/null
@@ -1,62 +0,0 @@
-#
-# Copyright (C) The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-cmake_minimum_required(VERSION 3.22.1)
-
-set(CMAKE_VERBOSE_MAKEFILE on)
-
-get_filename_component(WEBP_SAMPLE_PROJ_DIR
- ${CMAKE_CURRENT_BINARY_DIR} ABSOLUTE)
-set(WEBP_SRC_DIR ${WEBP_SAMPLE_PROJ_DIR}/libwebp)
-# clone the dependency repo.
-# git submodule could also be used if this sample does not need
-# Android Studio's "Import Android code sample" option
-if ((NOT EXISTS ${WEBP_SRC_DIR}) OR
- (NOT EXISTS ${WEBP_SRC_DIR}/CMakeLists.txt))
- execute_process(COMMAND git clone -b 1.0.0
- https://chromium.googlesource.com/webm/libwebp
- libwebp
- WORKING_DIRECTORY ${WEBP_SAMPLE_PROJ_DIR}/)
-endif()
-
-SET(WEBP_ENABLE_SWAP_16BIT_CSP ON CACHE BOOL
- "Enable byte swap for 16 bit colorspaces." FORCE)
-add_subdirectory(${WEBP_SRC_DIR} ${WEBP_SRC_DIR}/build/)
-
-# build native_app_glue as a static lib
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-add_library(native_app_glue STATIC
- ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-# now build app's shared lib
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99")
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall")
-
-# Export ANativeActivity_onCreate(),
-# Refer to: https://github.com/android-ndk/ndk/issues/381.
-set(CMAKE_SHARED_LINKER_FLAGS
- "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-add_library(webp_view SHARED
- webp_decode.cpp
- webp_view.cpp)
-target_include_directories(webp_view PRIVATE
- ${WEBP_SRC_DIR}/examples
- ${WEBP_SRC_DIR}/src)
-
-# add lib dependencies
-target_link_libraries(webp_view android log m native_app_glue webp)
diff --git a/webp/view/src/main/cpp/webp_decode.cpp b/webp/view/src/main/cpp/webp_decode.cpp
deleted file mode 100644
index 2f497270d..000000000
--- a/webp/view/src/main/cpp/webp_decode.cpp
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
- * Copyright (C) The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#include "webp_decode.h"
-
-#include
-#include
-
-#include
-
-WebpDecoder::WebpDecoder(const char** files, uint32_t count,
- DecodeSurfaceDescriptor* frameBuf,
- AAssetManager* assetMgr)
- : assetMgr_(assetMgr),
- buf_(nullptr),
- stopPending_(false),
- state_(state_idle),
- worker_(nullptr) {
- for (auto i = 0; i < count; i++) {
- files_.push(files[i]);
- }
- if (count && assetMgr && frameBuf) {
- bufInfo_ = *frameBuf;
- switch (bufInfo_.format_) {
- case SurfaceFormat::SURFACE_FORMAT_RGB_565:
- bytePerPix_ = 2;
- break;
- case SurfaceFormat::SURFACE_FORMAT_RGBA_8888:
- case SurfaceFormat::SURFACE_FORMAT_RGBX_8888:
- bytePerPix_ = 4;
- break;
- default:
- assert(0);
- return;
- }
- // allocate a private decode buffer
- uint32_t size = bufInfo_.height_ * bufInfo_.stride_ * bytePerPix_;
- buf_ = new uint8_t[size];
- assert(buf_);
- }
-}
-
-/*
- * GetDecodedFrame(): return decoded frame if available,
- * return nullptr otherwise
- */
-uint8_t* WebpDecoder::GetDecodedFrame(void) {
- return (state_ == state_ready ? buf_ : nullptr);
-}
-
-/*
- * DecodeFrame():
- * thread function to decode a picture
- * directly pass through to internal decoding function
- */
-void* DecodeFrame(void* decoder) {
- reinterpret_cast(decoder)->DecodeFrameInternal();
- return nullptr;
-}
-
-/*
- * DecodeFrameInternal():
- * Main decoding function from app side, and executing inside its own thread
- */
-void WebpDecoder::DecodeFrameInternal() {
- const char* webpFile = files_.front();
- files_.pop();
- files_.push(webpFile);
-
- AAsset* frameFile =
- AAssetManager_open(assetMgr_, webpFile, AASSET_MODE_BUFFER);
- assert(frameFile != NULL);
- int32_t len = AAsset_getLength(frameFile);
- uint8_t* buf = new uint8_t[len];
- assert(buf);
- len = AAsset_read(frameFile, buf, len);
- assert(len > 0);
- AAsset_close(frameFile);
-
- WebPDecoderConfig config;
- if (!WebPInitDecoderConfig(&config)) {
- assert(0);
- }
-
- VP8StatusCode status = WebPGetFeatures(buf, len, &config.input);
- assert(status == VP8_STATUS_OK);
-
- // let's decode it into a buffer ...
- config.options.bypass_filtering = 1;
- config.options.no_fancy_upsampling = 1;
- config.options.flip = 0;
- config.options.use_scaling = 1;
- config.options.scaled_width = bufInfo_.width_;
- config.options.scaled_height = bufInfo_.height_;
-
- // this does not seems to have difference on Nexus 5
- config.options.use_threads = 1;
- switch (bufInfo_.format_) {
- case SurfaceFormat::SURFACE_FORMAT_RGB_565:
- config.output.colorspace = MODE_RGB_565;
- break;
- case SurfaceFormat::SURFACE_FORMAT_RGBA_8888:
- case SurfaceFormat::SURFACE_FORMAT_RGBX_8888:
- config.output.colorspace = MODE_RGBA;
- break;
- default:
- assert(0);
- delete[] buf;
- return;
- }
- config.output.width = bufInfo_.width_;
- config.output.height = bufInfo_.height_;
- config.output.is_external_memory = 1;
- config.output.private_memory = reinterpret_cast(buf_);
- config.output.u.RGBA.stride = bufInfo_.stride_ * bytePerPix_;
- config.output.u.RGBA.rgba = config.output.private_memory;
- config.output.u.RGBA.size =
- config.output.height * config.output.u.RGBA.stride;
-
- status = WebPDecode(buf, len, &config);
- WebPFreeDecBuffer(&config.output);
- delete[] buf;
-
- // only change state when it is decoded OK. Our small decoder engine will be
- // in decoding state when error happens
- assert(status == VP8_STATUS_OK);
- if (status == VP8_STATUS_OK) {
- state_ = state_ready;
- }
-
- delete worker_;
- worker_ = nullptr;
-
- // if we were asked to release while we are busy decoding (at this point,
- // this is dangling pointer), we perform the release here to complete the
- // request.
- if (stopPending_) {
- stopPending_ = false;
- delete this;
- }
-}
-
-/*
- * DecodeFrame(void):
- * Start to decode a picture into internal frame memory
- * The internal memory layout and size are the same as andriod native
- * window to save copying when possible.
- *
- * The decoded frames are scaled up/down by webp decoder to fix the display
- * window size.
- */
-bool WebpDecoder::DecodeFrame(void) {
- if (state_ == state_decoding) return false;
- pthread_t worker_;
- pthread_attr_t attrib;
- pthread_attr_init(&attrib);
- pthread_attr_setdetachstate(&attrib, PTHREAD_CREATE_DETACHED);
- int status = pthread_create(&worker_, &attrib, ::DecodeFrame, this);
- pthread_attr_destroy(&attrib);
-
- if (status == 0) {
- state_ = state_decoding;
- return true;
- }
-
- // create thread failed...
- assert(false);
- return false;
-}
-
-/*
- * DestroyDecoder(void):
- * Self-delete if decoder is idle
- * Otherwise set up a flag to let decoding thread perform self-delete when
- * it finishes. Upon returning from the function, the class pointer is
- * invalid and should not be used
- */
-bool WebpDecoder::DestroyDecoder(void) {
- if (state_ == state_decoding) {
- stopPending_ = true;
- return false;
- }
-
- delete this;
- return true;
-}
-
-/*
- * private destructor prevent object directly call delete
- */
-WebpDecoder::~WebpDecoder() {
- if (buf_) delete[] buf_;
- buf_ = nullptr;
-}
diff --git a/webp/view/src/main/cpp/webp_decode.h b/webp/view/src/main/cpp/webp_decode.h
deleted file mode 100644
index ce116e99d..000000000
--- a/webp/view/src/main/cpp/webp_decode.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (C) The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#ifndef __WEBP_DECODE_H__
-#define __WEBP_DECODE_H__
-#include
-
-#include
-
-enum DecodeState { state_idle, state_decoding, state_ready };
-enum class SurfaceFormat : unsigned int {
- SURFACE_FORMAT_RGBA_8888,
- SURFACE_FORMAT_RGBX_8888,
- SURFACE_FORMAT_RGB_565,
- SURFACE_FORMAT_YUV_420 // Not implemented yet
-};
-struct DecodeSurfaceDescriptor {
- // surface size in pixels
- int32_t width_, height_, stride_;
- SurfaceFormat format_;
-};
-
-/*
- * Webp decoder wrapper:
- * Select a picture to decode in its own thread. The thread is deleted
- * once a picture is decoded into its internal memory. The next picture
- * will be decoded when:
- * - the decoded frame is retrieved
- * - Another DecodeFrame() is called [this is trigger]
- * when display format changes, call DestroyDecoder() to release this decoder
- * and allocate a new deocder object.
- */
-class WebpDecoder {
- public:
- explicit WebpDecoder(const char** files, uint32_t count,
- DecodeSurfaceDescriptor* surfDesc,
- AAssetManager* assetMgr);
- // Start decode a picture
- bool DecodeFrame(void);
-
- // Poll to see if a picture is decoded and ready to be used/displayed
- uint8_t* GetDecodedFrame(void);
-
- // WebpDecoder internal decoding function, no called from user
- void DecodeFrameInternal(void);
-
- // Release this decoder after usage
- bool DestroyDecoder(void);
-
- private:
- DecodeSurfaceDescriptor bufInfo_;
- AAssetManager* assetMgr_;
- std::queue files_;
- uint8_t* buf_;
- bool stopPending_;
- DecodeState state_;
-
- uint32_t bytePerPix_;
- pthread_t* worker_;
- /*
- * private destructor prevent object directly call delete
- */
- ~WebpDecoder();
-};
-#endif // __WEBP_DECODE_H__
\ No newline at end of file
diff --git a/webp/view/src/main/cpp/webp_view.cpp b/webp/view/src/main/cpp/webp_view.cpp
deleted file mode 100644
index 2d99eb196..000000000
--- a/webp/view/src/main/cpp/webp_view.cpp
+++ /dev/null
@@ -1,278 +0,0 @@
-/*
- * Copyright (C) The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include
-#include
-#include
-
-#include
-#include
-
-#include "webp_decode.h"
-
-#define LOG_TAG "libwebp-view"
-#define LOGI(...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)
-#define LOGW(...) __android_log_print(ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__)
-#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)
-
-/*
- * webp files that are inside assets folder:
- * they will be decoded and displayed as slide-show
- * decoding will happen in its own thread
- */
-const char* frames[] = {
- "clips/frame1.webp",
- "clips/frame2.webp",
- "clips/frame3.webp",
-};
-const int kFRAME_COUNT = sizeof(frames) / sizeof(frames[0]);
-const int kFRAME_DISPLAY_TIME = 2;
-
-/*
- * main object handles Android window frame update, and use webp to decode
- * pictures
- */
-class Engine {
- public:
- explicit Engine(android_app* app)
- : app_(app), decoder_(nullptr), animating_(false) {
- memset(&frameStartTime_, 0, sizeof(frameStartTime_));
- }
-
- ~Engine() {}
-
- struct android_app* AndroidApp(void) const { return app_; }
- void StartAnimation(bool start) { animating_ = start; }
- bool IsAnimating(void) const { return animating_; }
- void TerminateDisplay(void) { StartAnimation(false); }
-
- // PrepareDrawing(): Initialize the Engine with current native window geometry
- // and blank current screen to avoid garbbage displaying on device
- bool PrepareDrawing(void);
-
- // Update webp file into display window when it is decoded
- // and current frame has been displayed with requested time
- bool UpdateDisplay(void);
-
- private:
- void UpdateFrameBuffer(ANativeWindow_Buffer* buf, uint8_t* src);
- struct android_app* app_;
- WebpDecoder* decoder_;
- bool animating_;
- struct timespec frameStartTime_;
-};
-
-static int32_t ProcessAndroidInput(struct android_app* app,
- AInputEvent* event) {
- Engine* engine = reinterpret_cast(app->userData);
- if (AInputEvent_getType(event) == AINPUT_EVENT_TYPE_MOTION) {
- engine->StartAnimation(true);
- return 1;
- } else if (AInputEvent_getType(event) == AINPUT_EVENT_TYPE_KEY) {
- LOGI("Key event: action=%d keyCode=%d metaState=0x%x",
- AKeyEvent_getAction(event), AKeyEvent_getKeyCode(event),
- AKeyEvent_getMetaState(event));
- }
-
- return 0;
-}
-
-static void ProcessAndroidCmd(struct android_app* app, int32_t cmd) {
- static int32_t format = WINDOW_FORMAT_RGB_565;
- Engine* engine = reinterpret_cast(app->userData);
- switch (cmd) {
- case APP_CMD_INIT_WINDOW:
- if (engine->AndroidApp()->window != NULL) {
- // save current format to format variable, and set
- // display format to 565 to save time coping. normally
- // 565 might be buggy ( if 565 works, 32 bit mostly like
- // would work )
- format = ANativeWindow_getFormat(app->window);
- ANativeWindow_setBuffersGeometry(
- app->window, ANativeWindow_getWidth(app->window),
- ANativeWindow_getHeight(app->window), WINDOW_FORMAT_RGB_565);
- engine->PrepareDrawing();
- engine->UpdateDisplay();
- engine->StartAnimation(true);
- }
- break;
- case APP_CMD_TERM_WINDOW:
- engine->StartAnimation(false);
- engine->TerminateDisplay();
- ANativeWindow_setBuffersGeometry(
- app->window, ANativeWindow_getWidth(app->window),
- ANativeWindow_getHeight(app->window), format);
- break;
- case APP_CMD_LOST_FOCUS:
- engine->StartAnimation(false);
- engine->UpdateDisplay();
- break;
- }
-}
-
-// Android application glue entry function for us
-extern "C" void android_main(struct android_app* state) {
- Engine engine(state);
-
- state->userData = reinterpret_cast(&engine);
- state->onAppCmd = ProcessAndroidCmd;
- state->onInputEvent = ProcessAndroidInput;
-
- // loop waiting for stuff to do.
- while (!state->destroyRequested) {
- // If not animating, we will block forever waiting for events.
- // If animating, we loop until all events are read, then continue
- // to draw the next frame of animation.
- android_poll_source* source = nullptr;
- auto result = ALooper_pollOnce(engine.IsAnimating() ? 0 : -1, nullptr,
- nullptr, (void**)&source);
- if (result == ALOOPER_POLL_ERROR) {
- LOGE("ALooper_pollOnce returned an error");
- abort();
- }
-
- // Process this event.
- if (source != NULL) {
- source->process(state, source);
- }
-
- if (engine.IsAnimating()) {
- engine.UpdateDisplay();
- }
- }
-
- LOGI("Engine thread destroy requested!");
- engine.TerminateDisplay();
-}
-
-// Engine class implementations
-bool Engine::PrepareDrawing(void) {
- // create decoder
- if (decoder_) {
- decoder_->DestroyDecoder();
- }
- ANativeWindow_Buffer buf;
- if (ANativeWindow_lock(app_->window, &buf, NULL) < 0) {
- LOGW("Unable to lock window buffer to create decoder");
- return false;
- }
- UpdateFrameBuffer(&buf, nullptr);
- ANativeWindow_unlockAndPost(app_->window);
- DecodeSurfaceDescriptor descriptor;
- switch (buf.format) {
- case WINDOW_FORMAT_RGB_565:
- descriptor.format_ = SurfaceFormat::SURFACE_FORMAT_RGB_565;
- break;
- case WINDOW_FORMAT_RGBX_8888:
- descriptor.format_ = SurfaceFormat::SURFACE_FORMAT_RGBX_8888;
- break;
- case WINDOW_FORMAT_RGBA_8888:
- descriptor.format_ = SurfaceFormat::SURFACE_FORMAT_RGBA_8888;
- break;
- default:
- return false;
- }
- descriptor.width_ = buf.width;
- descriptor.height_ = buf.height;
- descriptor.stride_ = buf.stride;
-
- decoder_ = new WebpDecoder(frames, kFRAME_COUNT, &descriptor,
- app_->activity->assetManager);
- assert(decoder_);
- if (!decoder_) {
- return false;
- }
- decoder_->DecodeFrame();
-
- return true;
-}
-
-/*
- * Only copy decoded webp picture when:
- * - current frame has been on for kFrame_DISPLAY_TIME seconds
- * - a new picture is decoded
- * After copying, start decoding the next frame
- */
-bool Engine::UpdateDisplay(void) {
- if (!app_->window || !decoder_) {
- assert(0);
- return false;
- }
- struct timespec curTime;
- clock_gettime(CLOCK_MONOTONIC, &curTime);
- if (curTime.tv_sec <
- (frameStartTime_.tv_sec + (__kernel_time_t)kFRAME_DISPLAY_TIME)) {
- // current frame is displayed less than required duration
- return false;
- }
- uint8_t* frame = decoder_->GetDecodedFrame();
- if (!frame) return false;
-
- ANativeWindow_Buffer buffer;
- if (ANativeWindow_lock(app_->window, &buffer, nullptr) < 0) {
- LOGW("Unable to lock window buffer");
- return false;
- }
- UpdateFrameBuffer(&buffer, frame);
- ANativeWindow_unlockAndPost(app_->window);
- clock_gettime(CLOCK_MONOTONIC, &frameStartTime_);
-
- // start decoding next frame
- decoder_->DecodeFrame();
- return true;
-}
-
-/*
- * UpdateFrameBuffer():
- * Internal function to perform bits copying onto current frame buffer
- * src:
- * - if nullptr, blank it
- * - otherwise, copy to given buf
- * assumption:
- * src and bug MUST be in the same geometry format & layout
- */
-void Engine::UpdateFrameBuffer(ANativeWindow_Buffer* buf, uint8_t* src) {
- // src is either null: to blank the screen
- // or holding exact pixels with the same fmt [stride is the SAME]
- uint8_t* dst = reinterpret_cast(buf->bits);
- uint32_t bpp;
- switch (buf->format) {
- case WINDOW_FORMAT_RGB_565:
- bpp = 2;
- break;
- case WINDOW_FORMAT_RGBA_8888:
- case WINDOW_FORMAT_RGBX_8888:
- bpp = 4;
- break;
- default:
- assert(0);
- return;
- }
- uint32_t stride, width;
- stride = buf->stride * bpp;
- width = buf->width * bpp;
- if (src) {
- for (auto height = 0; height < buf->height; ++height) {
- memcpy(dst, src, width);
- dst += stride, src += stride;
- }
- } else {
- for (auto height = 0; height < buf->height; ++height) {
- memset(dst, 0, width);
- dst += stride;
- }
- }
-}
diff --git a/webp/view/src/main/res/mipmap-hdpi/ic_launcher.png b/webp/view/src/main/res/mipmap-hdpi/ic_launcher.png
deleted file mode 100644
index cde69bccc..000000000
Binary files a/webp/view/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ
diff --git a/webp/view/src/main/res/mipmap-mdpi/ic_launcher.png b/webp/view/src/main/res/mipmap-mdpi/ic_launcher.png
deleted file mode 100644
index c133a0cbd..000000000
Binary files a/webp/view/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ
diff --git a/webp/view/src/main/res/mipmap-xhdpi/ic_launcher.png b/webp/view/src/main/res/mipmap-xhdpi/ic_launcher.png
deleted file mode 100644
index bfa42f0e7..000000000
Binary files a/webp/view/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ
diff --git a/webp/view/src/main/res/mipmap-xxhdpi/ic_launcher.png b/webp/view/src/main/res/mipmap-xxhdpi/ic_launcher.png
deleted file mode 100644
index 324e72cdd..000000000
Binary files a/webp/view/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ
diff --git a/webp/view/src/main/res/values/strings.xml b/webp/view/src/main/res/values/strings.xml
deleted file mode 100644
index d3acaccdc..000000000
--- a/webp/view/src/main/res/values/strings.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
- Webp Slideshow
-