16dad9ad21ff547fab7f192956e4a3732fd78488bDavid Smith/* 26dad9ad21ff547fab7f192956e4a3732fd78488bDavid Smith * Copyright (C) 2014 The Android Open Source Project 36dad9ad21ff547fab7f192956e4a3732fd78488bDavid Smith * 46dad9ad21ff547fab7f192956e4a3732fd78488bDavid Smith * Licensed under the Apache License, Version 2.0 (the "License"); 56dad9ad21ff547fab7f192956e4a3732fd78488bDavid Smith * you may not use this file except in compliance with the License. 66dad9ad21ff547fab7f192956e4a3732fd78488bDavid Smith * You may obtain a copy of the License at 76dad9ad21ff547fab7f192956e4a3732fd78488bDavid Smith * 86dad9ad21ff547fab7f192956e4a3732fd78488bDavid Smith * http://www.apache.org/licenses/LICENSE-2.0 96dad9ad21ff547fab7f192956e4a3732fd78488bDavid Smith * 106dad9ad21ff547fab7f192956e4a3732fd78488bDavid Smith * Unless required by applicable law or agreed to in writing, software 116dad9ad21ff547fab7f192956e4a3732fd78488bDavid Smith * distributed under the License is distributed on an "AS IS" BASIS, 126dad9ad21ff547fab7f192956e4a3732fd78488bDavid Smith * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 136dad9ad21ff547fab7f192956e4a3732fd78488bDavid Smith * See the License for the specific language governing permissions and 146dad9ad21ff547fab7f192956e4a3732fd78488bDavid Smith * limitations under the License. 156dad9ad21ff547fab7f192956e4a3732fd78488bDavid Smith */ 166dad9ad21ff547fab7f192956e4a3732fd78488bDavid Smith 176dad9ad21ff547fab7f192956e4a3732fd78488bDavid Smith#include <media/stagefright/foundation/ADebug.h> 186dad9ad21ff547fab7f192956e4a3732fd78488bDavid Smith#include <media/stagefright/foundation/AMessage.h> 196dad9ad21ff547fab7f192956e4a3732fd78488bDavid Smith 206dad9ad21ff547fab7f192956e4a3732fd78488bDavid Smith#include "SimpleFilter.h" 216dad9ad21ff547fab7f192956e4a3732fd78488bDavid Smith 226dad9ad21ff547fab7f192956e4a3732fd78488bDavid Smithnamespace android { 236dad9ad21ff547fab7f192956e4a3732fd78488bDavid Smith 246dad9ad21ff547fab7f192956e4a3732fd78488bDavid Smithstatus_t SimpleFilter::configure(const sp<AMessage> &msg) { 256dad9ad21ff547fab7f192956e4a3732fd78488bDavid Smith CHECK(msg->findInt32("width", &mWidth)); 266dad9ad21ff547fab7f192956e4a3732fd78488bDavid Smith CHECK(msg->findInt32("height", &mHeight)); 276dad9ad21ff547fab7f192956e4a3732fd78488bDavid Smith if (!msg->findInt32("stride", &mStride)) { 286dad9ad21ff547fab7f192956e4a3732fd78488bDavid Smith mStride = mWidth; 296dad9ad21ff547fab7f192956e4a3732fd78488bDavid Smith } 306dad9ad21ff547fab7f192956e4a3732fd78488bDavid Smith if (!msg->findInt32("slice-height", &mSliceHeight)) { 316dad9ad21ff547fab7f192956e4a3732fd78488bDavid Smith mSliceHeight = mHeight; 326dad9ad21ff547fab7f192956e4a3732fd78488bDavid Smith } 336dad9ad21ff547fab7f192956e4a3732fd78488bDavid Smith CHECK(msg->findInt32("color-format", &mColorFormatIn)); 346dad9ad21ff547fab7f192956e4a3732fd78488bDavid Smith mColorFormatOut = mColorFormatIn; 356dad9ad21ff547fab7f192956e4a3732fd78488bDavid Smith 366dad9ad21ff547fab7f192956e4a3732fd78488bDavid Smith return OK; 376dad9ad21ff547fab7f192956e4a3732fd78488bDavid Smith} 386dad9ad21ff547fab7f192956e4a3732fd78488bDavid Smith 396dad9ad21ff547fab7f192956e4a3732fd78488bDavid Smith} // namespace android 40