camerauis/cameraxui/cxengine/src/cxesettingsmappersymbian.cpp
author hgs
Fri, 23 Jul 2010 11:35:41 +0300
changeset 45 24fd82631616
parent 28 3075d9b614e6
permissions -rw-r--r--
201029
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
19
d9aefe59d544 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     1
/*
45
hgs
parents: 28
diff changeset
     2
* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
19
d9aefe59d544 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     3
* All rights reserved.
d9aefe59d544 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
d9aefe59d544 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
d9aefe59d544 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
d9aefe59d544 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
d9aefe59d544 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     8
*
d9aefe59d544 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     9
* Initial Contributors:
d9aefe59d544 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
d9aefe59d544 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    11
*
d9aefe59d544 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    12
* Contributors:
d9aefe59d544 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    13
*
d9aefe59d544 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    14
* Description:
d9aefe59d544 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    15
*
d9aefe59d544 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    16
*/
d9aefe59d544 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    17
45
hgs
parents: 28
diff changeset
    18
#include <QRegExp>
19
d9aefe59d544 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    19
#include <ecamadvsettingsuids.hrh>
d9aefe59d544 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    20
d9aefe59d544 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    21
#include "cxeautofocuscontrol.h"
d9aefe59d544 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    22
#include "cxesettingsmappersymbian.h"
d9aefe59d544 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    23
#include "cxutils.h"
d9aefe59d544 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    24
#include "cxenamespace.h"
d9aefe59d544 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    25
d9aefe59d544 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    26
using namespace Cxe;
d9aefe59d544 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    27
45
hgs
parents: 28
diff changeset
    28
hgs
parents: 28
diff changeset
    29
hgs
parents: 28
diff changeset
    30
/*!
hgs
parents: 28
diff changeset
    31
    Map Cxe::Whitebalance value to its corresponding CCamera value.
19
d9aefe59d544 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    32
*/
45
hgs
parents: 28
diff changeset
    33
CCamera::TWhiteBalance CxeSettingsMapperSymbian::Map2CameraWb(
hgs
parents: 28
diff changeset
    34
        Cxe::Whitebalance whiteBalance )
hgs
parents: 28
diff changeset
    35
{
hgs
parents: 28
diff changeset
    36
    CCamera::TWhiteBalance wb(CCamera::EWBAuto);
19
d9aefe59d544 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    37
45
hgs
parents: 28
diff changeset
    38
    switch (whiteBalance) {
hgs
parents: 28
diff changeset
    39
        case WhitebalanceSunny:
hgs
parents: 28
diff changeset
    40
            wb = CCamera::EWBDaylight;
hgs
parents: 28
diff changeset
    41
            break;
hgs
parents: 28
diff changeset
    42
        case WhitebalanceCloudy:
hgs
parents: 28
diff changeset
    43
            wb = CCamera::EWBCloudy;
hgs
parents: 28
diff changeset
    44
            break;
hgs
parents: 28
diff changeset
    45
        case WhitebalanceIncandescent:
hgs
parents: 28
diff changeset
    46
            wb = CCamera::EWBTungsten;
hgs
parents: 28
diff changeset
    47
            break;
hgs
parents: 28
diff changeset
    48
        case WhitebalanceFluorescent:
hgs
parents: 28
diff changeset
    49
            wb = CCamera::EWBFluorescent;
hgs
parents: 28
diff changeset
    50
            break;
hgs
parents: 28
diff changeset
    51
        case WhitebalanceAutomatic:
hgs
parents: 28
diff changeset
    52
        default:
hgs
parents: 28
diff changeset
    53
            wb = CCamera::EWBAuto;
hgs
parents: 28
diff changeset
    54
            break;
hgs
parents: 28
diff changeset
    55
    }
hgs
parents: 28
diff changeset
    56
    return wb;
hgs
parents: 28
diff changeset
    57
}
hgs
parents: 28
diff changeset
    58
hgs
parents: 28
diff changeset
    59
hgs
parents: 28
diff changeset
    60
/*!
hgs
parents: 28
diff changeset
    61
    Map Cxe::FlashMode to its corresponding CCamera value.
hgs
parents: 28
diff changeset
    62
*/
hgs
parents: 28
diff changeset
    63
CCamera::TFlash CxeSettingsMapperSymbian::Map2CameraFlash(
hgs
parents: 28
diff changeset
    64
        Cxe::FlashMode flashMode)
hgs
parents: 28
diff changeset
    65
{
hgs
parents: 28
diff changeset
    66
    CCamera::TFlash flash(CCamera::EFlashAuto);
hgs
parents: 28
diff changeset
    67
hgs
parents: 28
diff changeset
    68
    switch (flashMode) {
hgs
parents: 28
diff changeset
    69
        case FlashAntiRedEye:
hgs
parents: 28
diff changeset
    70
            flash = CCamera::EFlashRedEyeReduce;
hgs
parents: 28
diff changeset
    71
            break;
hgs
parents: 28
diff changeset
    72
        case FlashOn:
hgs
parents: 28
diff changeset
    73
            flash = CCamera::EFlashForced;
hgs
parents: 28
diff changeset
    74
            break;
hgs
parents: 28
diff changeset
    75
        case FlashOff:
hgs
parents: 28
diff changeset
    76
            flash = CCamera::EFlashNone;
hgs
parents: 28
diff changeset
    77
            break;
hgs
parents: 28
diff changeset
    78
        case FlashAuto:
hgs
parents: 28
diff changeset
    79
        default:
hgs
parents: 28
diff changeset
    80
            flash = CCamera::EFlashAuto;
hgs
parents: 28
diff changeset
    81
            break;
hgs
parents: 28
diff changeset
    82
    }
hgs
parents: 28
diff changeset
    83
    return flash;
hgs
parents: 28
diff changeset
    84
}
hgs
parents: 28
diff changeset
    85
hgs
parents: 28
diff changeset
    86
hgs
parents: 28
diff changeset
    87
/*!
hgs
parents: 28
diff changeset
    88
    Map Cxe::ExposureMode to its corresponding CCamera value.
hgs
parents: 28
diff changeset
    89
*/
hgs
parents: 28
diff changeset
    90
CCamera::TExposure CxeSettingsMapperSymbian::Map2CameraExposureMode(
hgs
parents: 28
diff changeset
    91
        Cxe::ExposureMode exposureMode)
19
d9aefe59d544 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    92
{
45
hgs
parents: 28
diff changeset
    93
    CCamera::TExposure expo(CCamera::EExposureAuto);
hgs
parents: 28
diff changeset
    94
hgs
parents: 28
diff changeset
    95
    switch (exposureMode) {
hgs
parents: 28
diff changeset
    96
        case ExposureNight:
hgs
parents: 28
diff changeset
    97
            expo = CCamera::EExposureNight;
hgs
parents: 28
diff changeset
    98
            break;
hgs
parents: 28
diff changeset
    99
        case ExposureBacklight:
hgs
parents: 28
diff changeset
   100
            expo = CCamera::EExposureBacklight;
hgs
parents: 28
diff changeset
   101
            break;
hgs
parents: 28
diff changeset
   102
        case ExposureSport:
hgs
parents: 28
diff changeset
   103
            expo = CCamera::EExposureSport;
hgs
parents: 28
diff changeset
   104
            break;
hgs
parents: 28
diff changeset
   105
        case ExposureAuto:
hgs
parents: 28
diff changeset
   106
        default:
hgs
parents: 28
diff changeset
   107
            expo = CCamera::EExposureAuto;
hgs
parents: 28
diff changeset
   108
            break;
hgs
parents: 28
diff changeset
   109
    }
hgs
parents: 28
diff changeset
   110
hgs
parents: 28
diff changeset
   111
    return expo;
hgs
parents: 28
diff changeset
   112
}
hgs
parents: 28
diff changeset
   113
hgs
parents: 28
diff changeset
   114
hgs
parents: 28
diff changeset
   115
/*!
hgs
parents: 28
diff changeset
   116
    Map Cxe::ExposureMode to its corresponding CCamera value.
hgs
parents: 28
diff changeset
   117
*/
hgs
parents: 28
diff changeset
   118
CCamera::CCameraImageProcessing::TEffect
hgs
parents: 28
diff changeset
   119
        CxeSettingsMapperSymbian::Map2CameraEffect(Cxe::Colortone colorTone)
hgs
parents: 28
diff changeset
   120
{
hgs
parents: 28
diff changeset
   121
    CCamera::CCameraImageProcessing::TEffect effect(
hgs
parents: 28
diff changeset
   122
            CCamera::CCameraImageProcessing::EEffectNone);
hgs
parents: 28
diff changeset
   123
hgs
parents: 28
diff changeset
   124
    switch(colorTone) {
hgs
parents: 28
diff changeset
   125
        case ColortoneBlackAndWhite:
hgs
parents: 28
diff changeset
   126
            effect = CCamera::CCameraImageProcessing::EEffectMonochrome;
hgs
parents: 28
diff changeset
   127
            break;
hgs
parents: 28
diff changeset
   128
        case ColortoneSepia:
hgs
parents: 28
diff changeset
   129
            effect = CCamera::CCameraImageProcessing::EEffectSepia;
hgs
parents: 28
diff changeset
   130
            break;
hgs
parents: 28
diff changeset
   131
        case ColortoneNegative:
hgs
parents: 28
diff changeset
   132
            effect = CCamera::CCameraImageProcessing::EEffectNegative;
hgs
parents: 28
diff changeset
   133
            break;
hgs
parents: 28
diff changeset
   134
        case ColortoneVivid:
hgs
parents: 28
diff changeset
   135
            effect = CCamera::CCameraImageProcessing::EEffectVivid;
hgs
parents: 28
diff changeset
   136
            break;
hgs
parents: 28
diff changeset
   137
        case ColortoneNormal:
hgs
parents: 28
diff changeset
   138
        default:
hgs
parents: 28
diff changeset
   139
            effect = CCamera::CCameraImageProcessing::EEffectNone;
hgs
parents: 28
diff changeset
   140
            break;
hgs
parents: 28
diff changeset
   141
    }
hgs
parents: 28
diff changeset
   142
    return effect;
hgs
parents: 28
diff changeset
   143
}
hgs
parents: 28
diff changeset
   144
hgs
parents: 28
diff changeset
   145
/*!
hgs
parents: 28
diff changeset
   146
    Map CxeAutoFocusControl::Mode to its corresponding CCamera value.
hgs
parents: 28
diff changeset
   147
*/
hgs
parents: 28
diff changeset
   148
CCamera::CCameraAdvancedSettings::TFocusRange
hgs
parents: 28
diff changeset
   149
CxeSettingsMapperSymbian::Map2CameraAutofocus(CxeAutoFocusControl::Mode afMode)
hgs
parents: 28
diff changeset
   150
{
hgs
parents: 28
diff changeset
   151
    CCamera::CCameraAdvancedSettings::TFocusRange value;
hgs
parents: 28
diff changeset
   152
hgs
parents: 28
diff changeset
   153
    switch (afMode) {
hgs
parents: 28
diff changeset
   154
        case CxeAutoFocusControl::Macro:
hgs
parents: 28
diff changeset
   155
            value = CCamera::CCameraAdvancedSettings::EFocusRangeMacro;
hgs
parents: 28
diff changeset
   156
            break;
hgs
parents: 28
diff changeset
   157
        case CxeAutoFocusControl::Portrait:
hgs
parents: 28
diff changeset
   158
            value = CCamera::CCameraAdvancedSettings::EFocusRangeAuto;
hgs
parents: 28
diff changeset
   159
            break;
hgs
parents: 28
diff changeset
   160
        case CxeAutoFocusControl::Infinity:
hgs
parents: 28
diff changeset
   161
            value = CCamera::CCameraAdvancedSettings::EFocusRangeInfinite;
hgs
parents: 28
diff changeset
   162
            break;
hgs
parents: 28
diff changeset
   163
        case CxeAutoFocusControl::Hyperfocal:
hgs
parents: 28
diff changeset
   164
            value = CCamera::CCameraAdvancedSettings::EFocusRangeHyperfocal;
hgs
parents: 28
diff changeset
   165
            break;
hgs
parents: 28
diff changeset
   166
        case CxeAutoFocusControl::Auto:     // Fall through
hgs
parents: 28
diff changeset
   167
        default:
hgs
parents: 28
diff changeset
   168
            value = CCamera::CCameraAdvancedSettings::EFocusRangeAuto;
hgs
parents: 28
diff changeset
   169
            break;
hgs
parents: 28
diff changeset
   170
    }
hgs
parents: 28
diff changeset
   171
    return value;
19
d9aefe59d544 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   172
}
d9aefe59d544 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   173
d9aefe59d544 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   174
d9aefe59d544 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   175
45
hgs
parents: 28
diff changeset
   176
/*!
hgs
parents: 28
diff changeset
   177
    Map Cxe::DeviceOrientation to MCameraOrientation.
hgs
parents: 28
diff changeset
   178
*/
hgs
parents: 28
diff changeset
   179
MCameraOrientation::TOrientation
hgs
parents: 28
diff changeset
   180
        CxeSettingsMapperSymbian::Map2CameraOrientation(Cxe::DeviceOrientation
hgs
parents: 28
diff changeset
   181
                                                        uiOrientation)
19
d9aefe59d544 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   182
{
45
hgs
parents: 28
diff changeset
   183
    MCameraOrientation::TOrientation cameraOrientation;
hgs
parents: 28
diff changeset
   184
hgs
parents: 28
diff changeset
   185
    switch (uiOrientation) {
hgs
parents: 28
diff changeset
   186
        case Orientation90:
hgs
parents: 28
diff changeset
   187
            cameraOrientation = MCameraOrientation::EOrientation90;
hgs
parents: 28
diff changeset
   188
            break;
hgs
parents: 28
diff changeset
   189
        case Orientation180:
hgs
parents: 28
diff changeset
   190
            cameraOrientation = MCameraOrientation::EOrientation180;
hgs
parents: 28
diff changeset
   191
            break;
hgs
parents: 28
diff changeset
   192
        case Orientation270:
hgs
parents: 28
diff changeset
   193
            cameraOrientation = MCameraOrientation::EOrientation270;
hgs
parents: 28
diff changeset
   194
            break;
hgs
parents: 28
diff changeset
   195
        case Orientation0: // default
hgs
parents: 28
diff changeset
   196
        default:
hgs
parents: 28
diff changeset
   197
            cameraOrientation = MCameraOrientation::EOrientation0;
hgs
parents: 28
diff changeset
   198
            break;
hgs
parents: 28
diff changeset
   199
        }
hgs
parents: 28
diff changeset
   200
    return cameraOrientation;
19
d9aefe59d544 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   201
}
d9aefe59d544 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   202
45
hgs
parents: 28
diff changeset
   203
/*!
hgs
parents: 28
diff changeset
   204
    Helper data structure to define how MIME types are mapped to
hgs
parents: 28
diff changeset
   205
    MCameraUseCaseHint enumerations.
hgs
parents: 28
diff changeset
   206
*/
hgs
parents: 28
diff changeset
   207
class CxeCodecMapping
hgs
parents: 28
diff changeset
   208
{
hgs
parents: 28
diff changeset
   209
public:
hgs
parents: 28
diff changeset
   210
    CxeCodecMapping(const char *regexp, MCameraUseCaseHint::TVideoCodec codec,
hgs
parents: 28
diff changeset
   211
                    MCameraUseCaseHint::TVideoProfile profile) :
hgs
parents: 28
diff changeset
   212
    mRegExp(regexp),
hgs
parents: 28
diff changeset
   213
    mCodec(codec),
hgs
parents: 28
diff changeset
   214
    mProfile(profile)
19
d9aefe59d544 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   215
    {
45
hgs
parents: 28
diff changeset
   216
    // No implementation needed
19
d9aefe59d544 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   217
    }
d9aefe59d544 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   218
45
hgs
parents: 28
diff changeset
   219
public:
hgs
parents: 28
diff changeset
   220
    QString mRegExp;
hgs
parents: 28
diff changeset
   221
    MCameraUseCaseHint::TVideoCodec mCodec;
hgs
parents: 28
diff changeset
   222
    MCameraUseCaseHint::TVideoProfile mProfile;
hgs
parents: 28
diff changeset
   223
};
19
d9aefe59d544 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   224
45
hgs
parents: 28
diff changeset
   225
/*!
hgs
parents: 28
diff changeset
   226
    Map video codec MIME type from ICM to enumerations used by the
hgs
parents: 28
diff changeset
   227
    MCameraUseCaseHint custom interface
19
d9aefe59d544 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   228
45
hgs
parents: 28
diff changeset
   229
    \param[in] videoDetails CxeVideoDetails defining the current video quality.
hgs
parents: 28
diff changeset
   230
    \param[out] codec       Reference where to store the video codec info.
hgs
parents: 28
diff changeset
   231
                            MCameraUseCaseHint::ECodecUnknown if not known.
hgs
parents: 28
diff changeset
   232
    \param[out] profile     Reference where to store the video profile info.
hgs
parents: 28
diff changeset
   233
                            MCameraUseCaseHint::EProfileUnknown if not known.
hgs
parents: 28
diff changeset
   234
*/
hgs
parents: 28
diff changeset
   235
void CxeSettingsMapperSymbian::Map2UseCaseHintVideoParameters(
hgs
parents: 28
diff changeset
   236
        const CxeVideoDetails &videoDetails,
hgs
parents: 28
diff changeset
   237
        MCameraUseCaseHint::TVideoCodec &codec,
hgs
parents: 28
diff changeset
   238
        MCameraUseCaseHint::TVideoProfile &profile)
19
d9aefe59d544 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   239
{
45
hgs
parents: 28
diff changeset
   240
    typedef QPair<MCameraUseCaseHint::TVideoCodec,
hgs
parents: 28
diff changeset
   241
                  MCameraUseCaseHint::TVideoProfile> CxeCodecAndProfile;
hgs
parents: 28
diff changeset
   242
hgs
parents: 28
diff changeset
   243
    codec = MCameraUseCaseHint::ECodecUnknown;
hgs
parents: 28
diff changeset
   244
    profile = MCameraUseCaseHint::EProfileUnknown;
hgs
parents: 28
diff changeset
   245
hgs
parents: 28
diff changeset
   246
    // Create a mapping table for mapping from the MIME type string
hgs
parents: 28
diff changeset
   247
    // to MCameraUseCaseHint codec and profile enums using QRegExp. Specific
hgs
parents: 28
diff changeset
   248
    // rules should be before more generic ones because the map is iterated in
hgs
parents: 28
diff changeset
   249
    // order.
hgs
parents: 28
diff changeset
   250
    QList<CxeCodecMapping> mappingTable;
19
d9aefe59d544 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   251
45
hgs
parents: 28
diff changeset
   252
    mappingTable << CxeCodecMapping("^video/H263-2000",
hgs
parents: 28
diff changeset
   253
                                    MCameraUseCaseHint::ECodecH263,
hgs
parents: 28
diff changeset
   254
                                    MCameraUseCaseHint::EProfileH263P0L10)
hgs
parents: 28
diff changeset
   255
hgs
parents: 28
diff changeset
   256
                 << CxeCodecMapping("^video/H264.*profile-level-id=42801E",
hgs
parents: 28
diff changeset
   257
                                    MCameraUseCaseHint::ECodecH264,
hgs
parents: 28
diff changeset
   258
                                    MCameraUseCaseHint::EProfileH264BpL3)
hgs
parents: 28
diff changeset
   259
hgs
parents: 28
diff changeset
   260
                 << CxeCodecMapping("^video/H264.*profile-level-id=42801F",
hgs
parents: 28
diff changeset
   261
                                    MCameraUseCaseHint::ECodecH264,
hgs
parents: 28
diff changeset
   262
                                    MCameraUseCaseHint::EProfileH264BpL3_1)
hgs
parents: 28
diff changeset
   263
hgs
parents: 28
diff changeset
   264
                 << CxeCodecMapping("^video/H264", // Other H.264 profile
hgs
parents: 28
diff changeset
   265
                                    MCameraUseCaseHint::ECodecH264,
hgs
parents: 28
diff changeset
   266
                                    MCameraUseCaseHint::EProfileUnknown)
19
d9aefe59d544 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   267
45
hgs
parents: 28
diff changeset
   268
                 << CxeCodecMapping("^video/mp4v-es.*profile-level-id=2",
hgs
parents: 28
diff changeset
   269
                                    MCameraUseCaseHint::ECodecMpeg4,
hgs
parents: 28
diff changeset
   270
                                    MCameraUseCaseHint::EProfileMPEG4SpL2)
19
d9aefe59d544 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   271
45
hgs
parents: 28
diff changeset
   272
                 << CxeCodecMapping("^video/mp4v-es.*profile-level-id=3",
hgs
parents: 28
diff changeset
   273
                                    MCameraUseCaseHint::ECodecMpeg4,
hgs
parents: 28
diff changeset
   274
                                    MCameraUseCaseHint::EProfileMPEG4SpL3)
hgs
parents: 28
diff changeset
   275
hgs
parents: 28
diff changeset
   276
                 << CxeCodecMapping("^video/mp4v-es.*profile-level-id=4",
hgs
parents: 28
diff changeset
   277
                                    MCameraUseCaseHint::ECodecMpeg4,
hgs
parents: 28
diff changeset
   278
                                    MCameraUseCaseHint::EProfileMPEG4SpL4a)
hgs
parents: 28
diff changeset
   279
hgs
parents: 28
diff changeset
   280
                 << CxeCodecMapping("^video/mp4v-es", // Other MPEG-4 profile
hgs
parents: 28
diff changeset
   281
                                    MCameraUseCaseHint::ECodecMpeg4,
hgs
parents: 28
diff changeset
   282
                                    MCameraUseCaseHint::EProfileUnknown);
19
d9aefe59d544 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   283
45
hgs
parents: 28
diff changeset
   284
    bool found = false;
hgs
parents: 28
diff changeset
   285
    for (int i = 0; i < mappingTable.count() && !found; i++) {
hgs
parents: 28
diff changeset
   286
        QRegExp regExp(mappingTable[i].mRegExp, Qt::CaseInsensitive);
hgs
parents: 28
diff changeset
   287
        if (regExp.indexIn(videoDetails.mVideoCodecMimeType) >= 0) {
hgs
parents: 28
diff changeset
   288
            found = true;
hgs
parents: 28
diff changeset
   289
            codec = mappingTable[i].mCodec;
hgs
parents: 28
diff changeset
   290
            profile = mappingTable[i].mProfile;
hgs
parents: 28
diff changeset
   291
hgs
parents: 28
diff changeset
   292
            CX_DEBUG(("Matched codec %d, profile 0x%x for '%s'", codec, profile,
hgs
parents: 28
diff changeset
   293
                     videoDetails.mVideoCodecMimeType.toAscii().constData()));
hgs
parents: 28
diff changeset
   294
        }
19
d9aefe59d544 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   295
    }
45
hgs
parents: 28
diff changeset
   296
hgs
parents: 28
diff changeset
   297
    if (!found) {
hgs
parents: 28
diff changeset
   298
        CX_DEBUG(("No codec/profile found for '%s'",
hgs
parents: 28
diff changeset
   299
                 videoDetails.mVideoCodecMimeType.toAscii().constData()));
hgs
parents: 28
diff changeset
   300
    }
19
d9aefe59d544 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   301
}
d9aefe59d544 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   302
d9aefe59d544 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   303
// end of file