1b166940edca6e312463461438e2aa66e9852c26aBenoit Goby/* 2b166940edca6e312463461438e2aa66e9852c26aBenoit Goby * Copyright (c) 2011, The Linux Foundation. All rights reserved. 3b166940edca6e312463461438e2aa66e9852c26aBenoit Goby * 4b166940edca6e312463461438e2aa66e9852c26aBenoit Goby * Redistribution and use in source and binary forms, with or without 5b166940edca6e312463461438e2aa66e9852c26aBenoit Goby * modification, are permitted provided that the following conditions are 6b166940edca6e312463461438e2aa66e9852c26aBenoit Goby * met: 7b166940edca6e312463461438e2aa66e9852c26aBenoit Goby * * Redistributions of source code must retain the above copyright 8b166940edca6e312463461438e2aa66e9852c26aBenoit Goby * notice, this list of conditions and the following disclaimer. 9b166940edca6e312463461438e2aa66e9852c26aBenoit Goby * * Redistributions in binary form must reproduce the above 10b166940edca6e312463461438e2aa66e9852c26aBenoit Goby * copyright notice, this list of conditions and the following 11b166940edca6e312463461438e2aa66e9852c26aBenoit Goby * disclaimer in the documentation and/or other materials provided 12b166940edca6e312463461438e2aa66e9852c26aBenoit Goby * with the distribution. 13b166940edca6e312463461438e2aa66e9852c26aBenoit Goby * * Neither the name of The Linux Foundation nor the names of its 14b166940edca6e312463461438e2aa66e9852c26aBenoit Goby * contributors may be used to endorse or promote products derived 15b166940edca6e312463461438e2aa66e9852c26aBenoit Goby * from this software without specific prior written permission. 16b166940edca6e312463461438e2aa66e9852c26aBenoit Goby * 17b166940edca6e312463461438e2aa66e9852c26aBenoit Goby * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 18b166940edca6e312463461438e2aa66e9852c26aBenoit Goby * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 19b166940edca6e312463461438e2aa66e9852c26aBenoit Goby * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 20b166940edca6e312463461438e2aa66e9852c26aBenoit Goby * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 21b166940edca6e312463461438e2aa66e9852c26aBenoit Goby * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22b166940edca6e312463461438e2aa66e9852c26aBenoit Goby * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23b166940edca6e312463461438e2aa66e9852c26aBenoit Goby * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 24b166940edca6e312463461438e2aa66e9852c26aBenoit Goby * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25b166940edca6e312463461438e2aa66e9852c26aBenoit Goby * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 26b166940edca6e312463461438e2aa66e9852c26aBenoit Goby * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 27b166940edca6e312463461438e2aa66e9852c26aBenoit Goby * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28b166940edca6e312463461438e2aa66e9852c26aBenoit Goby */ 29b166940edca6e312463461438e2aa66e9852c26aBenoit Goby 30b166940edca6e312463461438e2aa66e9852c26aBenoit Goby 31b166940edca6e312463461438e2aa66e9852c26aBenoit Goby 32b166940edca6e312463461438e2aa66e9852c26aBenoit Goby#include <copybit.h> 33b166940edca6e312463461438e2aa66e9852c26aBenoit Goby#include "gralloc_priv.h" 34b166940edca6e312463461438e2aa66e9852c26aBenoit Goby#include "gr.h" 35b166940edca6e312463461438e2aa66e9852c26aBenoit Goby 36b166940edca6e312463461438e2aa66e9852c26aBenoit Goby#define COPYBIT_SUCCESS 0 37b166940edca6e312463461438e2aa66e9852c26aBenoit Goby#define COPYBIT_FAILURE -1 38b166940edca6e312463461438e2aa66e9852c26aBenoit Goby 39b166940edca6e312463461438e2aa66e9852c26aBenoit Gobyint convertYV12toYCrCb420SP(const copybit_image_t *src,private_handle_t *yv12_handle); 40b166940edca6e312463461438e2aa66e9852c26aBenoit Goby 41b166940edca6e312463461438e2aa66e9852c26aBenoit Goby/* 42b166940edca6e312463461438e2aa66e9852c26aBenoit Goby * Function to convert the c2d format into an equivalent Android format 43b166940edca6e312463461438e2aa66e9852c26aBenoit Goby * 44b166940edca6e312463461438e2aa66e9852c26aBenoit Goby * @param: source buffer handle 45b166940edca6e312463461438e2aa66e9852c26aBenoit Goby * @param: destination image 46b166940edca6e312463461438e2aa66e9852c26aBenoit Goby * 47b166940edca6e312463461438e2aa66e9852c26aBenoit Goby * @return: return status 48b166940edca6e312463461438e2aa66e9852c26aBenoit Goby */ 49b166940edca6e312463461438e2aa66e9852c26aBenoit Gobyint convert_yuv_c2d_to_yuv_android(private_handle_t *hnd, 50b166940edca6e312463461438e2aa66e9852c26aBenoit Goby struct copybit_image_t const *rhs); 51b166940edca6e312463461438e2aa66e9852c26aBenoit Goby 52b166940edca6e312463461438e2aa66e9852c26aBenoit Goby 53b166940edca6e312463461438e2aa66e9852c26aBenoit Goby/* 54b166940edca6e312463461438e2aa66e9852c26aBenoit Goby * Function to convert the Android format into an equivalent C2D format 55b166940edca6e312463461438e2aa66e9852c26aBenoit Goby * 56b166940edca6e312463461438e2aa66e9852c26aBenoit Goby * @param: source buffer handle 57b166940edca6e312463461438e2aa66e9852c26aBenoit Goby * @param: destination image 58b166940edca6e312463461438e2aa66e9852c26aBenoit Goby * 59b166940edca6e312463461438e2aa66e9852c26aBenoit Goby * @return: return status 60b166940edca6e312463461438e2aa66e9852c26aBenoit Goby */ 61b166940edca6e312463461438e2aa66e9852c26aBenoit Gobyint convert_yuv_android_to_yuv_c2d(private_handle_t *hnd, 62b166940edca6e312463461438e2aa66e9852c26aBenoit Goby struct copybit_image_t const *rhs); 63