1c6c182f354142b47b7a5abfa9f95c82b236f5832David Smith/* 2c6c182f354142b47b7a5abfa9f95c82b236f5832David Smith * Copyright (C) 2014 The Android Open Source Project 3c6c182f354142b47b7a5abfa9f95c82b236f5832David Smith * 4c6c182f354142b47b7a5abfa9f95c82b236f5832David Smith * Licensed under the Apache License, Version 2.0 (the "License"); 5c6c182f354142b47b7a5abfa9f95c82b236f5832David Smith * you may not use this file except in compliance with the License. 6c6c182f354142b47b7a5abfa9f95c82b236f5832David Smith * You may obtain a copy of the License at 7c6c182f354142b47b7a5abfa9f95c82b236f5832David Smith * 8c6c182f354142b47b7a5abfa9f95c82b236f5832David Smith * http://www.apache.org/licenses/LICENSE-2.0 9c6c182f354142b47b7a5abfa9f95c82b236f5832David Smith * 10c6c182f354142b47b7a5abfa9f95c82b236f5832David Smith * Unless required by applicable law or agreed to in writing, software 11c6c182f354142b47b7a5abfa9f95c82b236f5832David Smith * distributed under the License is distributed on an "AS IS" BASIS, 12c6c182f354142b47b7a5abfa9f95c82b236f5832David Smith * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13c6c182f354142b47b7a5abfa9f95c82b236f5832David Smith * See the License for the specific language governing permissions and 14c6c182f354142b47b7a5abfa9f95c82b236f5832David Smith * limitations under the License. 15c6c182f354142b47b7a5abfa9f95c82b236f5832David Smith */ 16c6c182f354142b47b7a5abfa9f95c82b236f5832David Smith 17c6c182f354142b47b7a5abfa9f95c82b236f5832David Smith#ifndef RENDERSCRIPT_WRAPPER_H_ 18c6c182f354142b47b7a5abfa9f95c82b236f5832David Smith#define RENDERSCRIPT_WRAPPER_H_ 19c6c182f354142b47b7a5abfa9f95c82b236f5832David Smith 20c6c182f354142b47b7a5abfa9f95c82b236f5832David Smith#include <RenderScript.h> 21c6c182f354142b47b7a5abfa9f95c82b236f5832David Smith 22c6c182f354142b47b7a5abfa9f95c82b236f5832David Smithnamespace android { 23c6c182f354142b47b7a5abfa9f95c82b236f5832David Smith 24c6c182f354142b47b7a5abfa9f95c82b236f5832David Smithstruct RenderScriptWrapper : public RefBase { 25c6c182f354142b47b7a5abfa9f95c82b236f5832David Smithpublic: 26c6c182f354142b47b7a5abfa9f95c82b236f5832David Smith struct RSFilterCallback : public RefBase { 27c6c182f354142b47b7a5abfa9f95c82b236f5832David Smith public: 28c6c182f354142b47b7a5abfa9f95c82b236f5832David Smith // called by RSFilter to process each input buffer 29c6c182f354142b47b7a5abfa9f95c82b236f5832David Smith virtual status_t processBuffers( 30c6c182f354142b47b7a5abfa9f95c82b236f5832David Smith RSC::Allocation* inBuffer, 31c6c182f354142b47b7a5abfa9f95c82b236f5832David Smith RSC::Allocation* outBuffer) = 0; 32c6c182f354142b47b7a5abfa9f95c82b236f5832David Smith 33c6c182f354142b47b7a5abfa9f95c82b236f5832David Smith virtual status_t handleSetParameters(const sp<AMessage> &msg) = 0; 34c6c182f354142b47b7a5abfa9f95c82b236f5832David Smith }; 35c6c182f354142b47b7a5abfa9f95c82b236f5832David Smith 36c6c182f354142b47b7a5abfa9f95c82b236f5832David Smith sp<RSFilterCallback> mCallback; 37c6c182f354142b47b7a5abfa9f95c82b236f5832David Smith RSC::sp<RSC::RS> mContext; 38c6c182f354142b47b7a5abfa9f95c82b236f5832David Smith}; 39c6c182f354142b47b7a5abfa9f95c82b236f5832David Smith 40c6c182f354142b47b7a5abfa9f95c82b236f5832David Smith} // namespace android 41c6c182f354142b47b7a5abfa9f95c82b236f5832David Smith 42c6c182f354142b47b7a5abfa9f95c82b236f5832David Smith#endif // RENDERSCRIPT_WRAPPER_H_ 43