/*
 * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
 *
 * 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 "camera_recorder_settings.h"

int camera_settings_quality_bitrate_get(int width, int height, recording_quality quality)
{
    int result = 0;
    int size = sizeof(quality_table)/sizeof(quality_components);

    int i;
    for (i = 0; i < size; i++)
    {
        if (quality_table[i].width >= width && quality_table[i].height >= height && quality_table[i].quality == quality)
        {
            result = quality_table[i].bitrate;
            break;
        }
    }

    return result;
}

int camera_settings_item_number_get(settings_supported_data *supported_data, int supported_type)
{
    int i = 0;

    for(; i < supported_data->max_data_type; i++)
    {
        if(supported_type == supported_data->data[i].mode)
        {
            return i;
        }
    }
    return supported_type;
}


