1 /* 2 * cl_demo_handler.h - CL demo handler 3 * 4 * Copyright (c) 2015 Intel Corporation 5 * 6 * Licensed under the Apache License, Version 2.0 (the "License"); 7 * you may not use this file except in compliance with the License. 8 * You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an "AS IS" BASIS, 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 * See the License for the specific language governing permissions and 16 * limitations under the License. 17 * 18 * Author: Wind Yuan <feng.yuan@intel.com> 19 */ 20 21 #ifndef XCAM_CL_DEMO_HANLDER_H 22 #define XCAM_CL_DEMO_HANLDER_H 23 24 #include <xcam_std.h> 25 #include <ocl/cl_image_handler.h> 26 27 namespace XCam { 28 29 class CLDemoImageHandler 30 : public CLImageHandler 31 { 32 public: 33 explicit CLDemoImageHandler (const SmartPtr<CLContext> &context); set_copy_kernel(SmartPtr<CLImageKernel> & kernel)34 void set_copy_kernel (SmartPtr<CLImageKernel> &kernel) { 35 _copy_kernel = kernel; 36 add_kernel (kernel); 37 } 38 39 protected: 40 virtual XCamReturn prepare_output_buf (SmartPtr<VideoBuffer> &input, SmartPtr<VideoBuffer> &output); 41 virtual XCamReturn prepare_parameters (SmartPtr<VideoBuffer> &input, SmartPtr<VideoBuffer> &output); 42 43 private: 44 SmartPtr<CLImageKernel> _copy_kernel; 45 }; 46 47 SmartPtr<CLImageHandler> 48 create_cl_demo_image_handler (const SmartPtr<CLContext> &context); 49 50 SmartPtr<CLImageHandler> 51 create_cl_binary_demo_image_handler (const SmartPtr<CLContext> &context, const uint8_t *binary, size_t size); 52 53 }; 54 55 #endif //XCAM_CL_DEMO_HANLDER_H 56