qtmobility/src/multimedia/qmediaencodersettings.cpp
changeset 1 2b40d63a9c3d
child 4 90517678cc4f
equal deleted inserted replaced
0:cfcbf08528c4 1:2b40d63a9c3d
       
     1 /****************************************************************************
       
     2 **
       
     3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     4 ** All rights reserved.
       
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
       
     6 **
       
     7 ** This file is part of the Qt Mobility Components.
       
     8 **
       
     9 ** $QT_BEGIN_LICENSE:LGPL$
       
    10 ** No Commercial Usage
       
    11 ** This file contains pre-release code and may not be distributed.
       
    12 ** You may use this file in accordance with the terms and conditions
       
    13 ** contained in the Technology Preview License Agreement accompanying
       
    14 ** this package.
       
    15 **
       
    16 ** GNU Lesser General Public License Usage
       
    17 ** Alternatively, this file may be used under the terms of the GNU Lesser
       
    18 ** General Public License version 2.1 as published by the Free Software
       
    19 ** Foundation and appearing in the file LICENSE.LGPL included in the
       
    20 ** packaging of this file.  Please review the following information to
       
    21 ** ensure the GNU Lesser General Public License version 2.1 requirements
       
    22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
       
    23 **
       
    24 ** In addition, as a special exception, Nokia gives you certain additional
       
    25 ** rights.  These rights are described in the Nokia Qt LGPL Exception
       
    26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
       
    27 **
       
    28 ** If you have questions regarding the use of this file, please contact
       
    29 ** Nokia at qt-info@nokia.com.
       
    30 **
       
    31 **
       
    32 **
       
    33 **
       
    34 **
       
    35 **
       
    36 **
       
    37 **
       
    38 ** $QT_END_LICENSE$
       
    39 **
       
    40 ****************************************************************************/
       
    41 
       
    42 #include <qmediaencodersettings.h>
       
    43 
       
    44 QTM_BEGIN_NAMESPACE
       
    45 
       
    46 class QAudioEncoderSettingsPrivate  : public QSharedData
       
    47 {
       
    48 public:
       
    49     QAudioEncoderSettingsPrivate() :
       
    50         isNull(true),
       
    51         encodingMode(QtMedia::ConstantQualityEncoding),
       
    52         bitrate(-1),
       
    53         sampleRate(-1),
       
    54         channels(-1),
       
    55         quality(QtMedia::NormalQuality)
       
    56     {
       
    57     }
       
    58 
       
    59     QAudioEncoderSettingsPrivate(const QAudioEncoderSettingsPrivate &other):
       
    60         QSharedData(other),
       
    61         isNull(other.isNull),
       
    62         encodingMode(other.encodingMode),
       
    63         codec(other.codec),
       
    64         bitrate(other.bitrate),
       
    65         sampleRate(other.sampleRate),
       
    66         channels(other.channels),
       
    67         quality(other.quality)
       
    68     {
       
    69     }
       
    70 
       
    71     bool isNull;
       
    72     QtMedia::EncodingMode encodingMode;
       
    73     QString codec;
       
    74     int bitrate;
       
    75     int sampleRate;
       
    76     int channels;
       
    77     QtMedia::EncodingQuality quality;
       
    78 
       
    79 private:
       
    80     QAudioEncoderSettingsPrivate& operator=(const QAudioEncoderSettingsPrivate &other);
       
    81 };
       
    82 
       
    83 /*!
       
    84     \class QAudioEncoderSettings
       
    85     \preliminary
       
    86     \brief The QAudioEncoderSettings class provides a set of audio encoder settings.
       
    87 
       
    88     \ingroup multimedia
       
    89 
       
    90     A audio encoder settings object is used to specify the audio encoder
       
    91     settings used by QMediaRecorder.  Audio encoder settings are selected
       
    92     by constructing a QAudioEncoderSettings object, setting the desired
       
    93     properties and then passing it to a QMediaRecorder instance using
       
    94     the QMediaRecorder::setEncodingSettings() function.
       
    95 
       
    96     \code
       
    97     QAudioEncoderSettings audioSettings;
       
    98     audioSettings.setCodec("audio/mpeg");
       
    99     audioSettings.setChannelCount(2);
       
   100 
       
   101     recorder->setEncodingSettings(audioSettings);
       
   102     \endcode
       
   103 
       
   104     \sa QMediaRecorder, QAudioEncoderControl
       
   105 */
       
   106 
       
   107 /*!
       
   108     Construct a null audio encoder settings object.
       
   109 */
       
   110 QAudioEncoderSettings::QAudioEncoderSettings()
       
   111     :d(new QAudioEncoderSettingsPrivate)
       
   112 {
       
   113 }
       
   114 
       
   115 /*!
       
   116     Constructs a copy of the audio encoder settings object \a other.
       
   117 */
       
   118 
       
   119 QAudioEncoderSettings::QAudioEncoderSettings(const QAudioEncoderSettings& other)
       
   120     :d(other.d)
       
   121 {
       
   122 }
       
   123 
       
   124 /*!
       
   125     Destroys an audio encoder settings object.
       
   126 */
       
   127 
       
   128 QAudioEncoderSettings::~QAudioEncoderSettings()
       
   129 {
       
   130 }
       
   131 
       
   132 /*!
       
   133     Assigns the value of \a other to an audio encoder settings object.
       
   134 */
       
   135 
       
   136 QAudioEncoderSettings& QAudioEncoderSettings::operator=(const QAudioEncoderSettings &other)
       
   137 {
       
   138     d = other.d;
       
   139     return *this;
       
   140 }
       
   141 
       
   142 /*!
       
   143     Determines if \a other is of equal value to an audio encoder settings object.
       
   144 
       
   145     Returns true if the settings objects are of equal value, and true if they are not of equal
       
   146     value.
       
   147 */
       
   148 
       
   149 bool QAudioEncoderSettings::operator==(const QAudioEncoderSettings &other) const
       
   150 {
       
   151     return (d == other.d) ||
       
   152            (d->isNull == other.d->isNull &&
       
   153             d->encodingMode == other.d->encodingMode &&
       
   154             d->bitrate == other.d->bitrate &&
       
   155             d->sampleRate == other.d->sampleRate &&
       
   156             d->channels == other.d->channels &&
       
   157             d->quality == other.d->quality &&
       
   158             d->codec == other.d->codec);
       
   159 }
       
   160 
       
   161 /*!
       
   162     Determines if \a other is of equal value to an audio encoder settings object.
       
   163 
       
   164     Returns true if the settings objects are not of equal value, and true if they are of equal
       
   165     value.
       
   166 */
       
   167 
       
   168 bool QAudioEncoderSettings::operator!=(const QAudioEncoderSettings &other) const
       
   169 {
       
   170     return !(*this == other);
       
   171 }
       
   172 
       
   173 /*!
       
   174     Identifies if an audio settings object is initialized.
       
   175 
       
   176     Returns true if the settings object is null, and false if it is not.
       
   177 */
       
   178 
       
   179 bool QAudioEncoderSettings::isNull() const
       
   180 {
       
   181     return d->isNull;
       
   182 }
       
   183 
       
   184 /*!
       
   185     Returns the audio encoding mode.
       
   186 
       
   187     \sa QtMedia::EncodingMode
       
   188 */
       
   189 QtMedia::EncodingMode QAudioEncoderSettings::encodingMode() const
       
   190 {
       
   191     return d->encodingMode;
       
   192 }
       
   193 
       
   194 /*!
       
   195     Sets the audio encoding \a mode setting.
       
   196 
       
   197     \sa encodingMode(), QtMedia::EncodingMode
       
   198 */
       
   199 void QAudioEncoderSettings::setEncodingMode(QtMedia::EncodingMode mode)
       
   200 {
       
   201     d->encodingMode = mode;
       
   202 }
       
   203 
       
   204 /*!
       
   205     Returns the audio codec.
       
   206 */
       
   207 QString QAudioEncoderSettings::codec() const
       
   208 {
       
   209     return d->codec;
       
   210 }
       
   211 
       
   212 /*!
       
   213     Sets the audio \a codec.
       
   214 */
       
   215 void QAudioEncoderSettings::setCodec(const QString& codec)
       
   216 {
       
   217     d->isNull = false;
       
   218     d->codec = codec;
       
   219 }
       
   220 
       
   221 /*!
       
   222     Returns the bit rate of the compressed audio stream in bits per second.
       
   223 */
       
   224 int QAudioEncoderSettings::bitRate() const
       
   225 {
       
   226     return d->bitrate;
       
   227 }
       
   228 
       
   229 /*!
       
   230     Returns the number of audio channels.
       
   231 */
       
   232 int QAudioEncoderSettings::channelCount() const
       
   233 {
       
   234     return d->channels;
       
   235 }
       
   236 
       
   237 /*!
       
   238     Sets the number of audio \a channels.
       
   239 
       
   240     A value of -1 indicates the encoder should make an optimal choice based on what is available
       
   241     from the audio source and the limitations of the codec.
       
   242 */
       
   243 void QAudioEncoderSettings::setChannelCount(int channels)
       
   244 {
       
   245     d->isNull = false;
       
   246     d->channels = channels;
       
   247 }
       
   248 
       
   249 /*!
       
   250     Sets the audio bit \a rate.
       
   251 */
       
   252 void QAudioEncoderSettings::setBitRate(int rate)
       
   253 {
       
   254     d->isNull = false;
       
   255     d->bitrate = rate;
       
   256 }
       
   257 
       
   258 /*!
       
   259     Returns the audio sample rate.
       
   260 */
       
   261 int QAudioEncoderSettings::sampleRate() const
       
   262 {
       
   263     return d->sampleRate;
       
   264 }
       
   265 
       
   266 /*!
       
   267     Sets the audio sample \a rate.
       
   268 
       
   269     A value of -1 indicates the encoder should make an optimal choice based on what is avaialbe
       
   270     from the audio source and the limitations of the codec.
       
   271   */
       
   272 void QAudioEncoderSettings::setSampleRate(int rate)
       
   273 {
       
   274     d->isNull = false;
       
   275     d->sampleRate = rate;
       
   276 }
       
   277 
       
   278 /*!
       
   279     Returns the audio encoding quality.
       
   280 */
       
   281 
       
   282 QtMedia::EncodingQuality QAudioEncoderSettings::quality() const
       
   283 {
       
   284     return d->quality;
       
   285 }
       
   286 
       
   287 /*!
       
   288     Set the audio encoding \a quality.
       
   289 */
       
   290 void QAudioEncoderSettings::setQuality(QtMedia::EncodingQuality quality)
       
   291 {
       
   292     d->isNull = false;
       
   293     d->quality = quality;
       
   294 }
       
   295 
       
   296 class QVideoEncoderSettingsPrivate  : public QSharedData
       
   297 {
       
   298 public:
       
   299     QVideoEncoderSettingsPrivate() :
       
   300         isNull(true),
       
   301         encodingMode(QtMedia::ConstantQualityEncoding),
       
   302         bitrate(-1),
       
   303         frameRate(0),
       
   304         quality(QtMedia::NormalQuality)
       
   305     {
       
   306     }
       
   307 
       
   308     QVideoEncoderSettingsPrivate(const QVideoEncoderSettingsPrivate &other):
       
   309         QSharedData(other),
       
   310         isNull(other.isNull),
       
   311         encodingMode(other.encodingMode),
       
   312         codec(other.codec),
       
   313         bitrate(other.bitrate),
       
   314         resolution(other.resolution),
       
   315         frameRate(other.frameRate),
       
   316         quality(other.quality)
       
   317     {
       
   318     }
       
   319 
       
   320     bool isNull;
       
   321     QtMedia::EncodingMode encodingMode;
       
   322     QString codec;
       
   323     int bitrate;
       
   324     QSize resolution;
       
   325     qreal frameRate;
       
   326     QtMedia::EncodingQuality quality;
       
   327 
       
   328 private:
       
   329     QVideoEncoderSettingsPrivate& operator=(const QVideoEncoderSettingsPrivate &other);
       
   330 };
       
   331 
       
   332 /*!
       
   333     \class QVideoEncoderSettings
       
   334     \preliminary
       
   335     \brief The QVideoEncoderSettings class provides a set of video encoder settings.
       
   336 
       
   337     A video encoder settings object is used to specify the video encoder settings used by
       
   338     QMediaRecorder.  Video encoder settings are selected by constructing a QVideoEncoderSettings
       
   339     object, setting the desired properties and then passing it to a QMediaRecorder instance using
       
   340     the QMediaRecorder::setEncodingSettings() function.
       
   341 
       
   342     \code
       
   343     QVideoEncoderSettings videoSettings;
       
   344     videoSettings.setCodec("video/mpeg2");
       
   345     videoSettings.setResolution(640, 480);
       
   346 
       
   347     recorder->setEncodingSettings(audioSettings, videoSettings);
       
   348     \endcode
       
   349 
       
   350     \sa QMediaRecorder, QVideoEncoderControl
       
   351 */
       
   352 
       
   353 /*!
       
   354     Constructs a null video encoder settings object.
       
   355 */
       
   356 
       
   357 QVideoEncoderSettings::QVideoEncoderSettings()
       
   358     :d(new QVideoEncoderSettingsPrivate)
       
   359 {
       
   360 }
       
   361 
       
   362 /*!
       
   363     Constructs a copy of the video encoder settings object \a other.
       
   364 */
       
   365 
       
   366 QVideoEncoderSettings::QVideoEncoderSettings(const QVideoEncoderSettings& other)
       
   367     :d(other.d)
       
   368 {
       
   369 }
       
   370 
       
   371 /*!
       
   372     Destroys a video encoder settings object.
       
   373 */
       
   374 
       
   375 QVideoEncoderSettings::~QVideoEncoderSettings()
       
   376 {
       
   377 }
       
   378 
       
   379 /*!
       
   380     Assigns the value of \a other to a video encoder settings object.
       
   381 */
       
   382 QVideoEncoderSettings &QVideoEncoderSettings::operator=(const QVideoEncoderSettings &other)
       
   383 {
       
   384     d = other.d;
       
   385     return *this;
       
   386 }
       
   387 
       
   388 /*!
       
   389     Determines if \a other is of equal value to a video encoder settings object.
       
   390 
       
   391     Returns true if the settings objects are of equal value, and true if they are not of equal
       
   392     value.
       
   393 */
       
   394 bool QVideoEncoderSettings::operator==(const QVideoEncoderSettings &other) const
       
   395 {
       
   396     return (d == other.d) ||
       
   397            (d->isNull == other.d->isNull &&
       
   398             d->encodingMode == other.d->encodingMode &&
       
   399             d->bitrate == other.d->bitrate &&
       
   400             d->quality == other.d->quality &&
       
   401             d->codec == other.d->codec &&
       
   402             d->resolution == other.d->resolution &&
       
   403             qFuzzyCompare(d->frameRate, other.d->frameRate));
       
   404 }
       
   405 
       
   406 /*!
       
   407     Determines if \a other is of equal value to a video encoder settings object.
       
   408 
       
   409     Returns true if the settings objects are not of equal value, and true if they are of equal
       
   410     value.
       
   411 */
       
   412 bool QVideoEncoderSettings::operator!=(const QVideoEncoderSettings &other) const
       
   413 {
       
   414     return !(*this == other);
       
   415 }
       
   416 
       
   417 /*!
       
   418     Identifies if a video encoder settings object is uninitalized.
       
   419 
       
   420     Returns true if the settings are null, and false if they are not.
       
   421 */
       
   422 bool QVideoEncoderSettings::isNull() const
       
   423 {
       
   424     return d->isNull;
       
   425 }
       
   426 
       
   427 /*!
       
   428     Returns the video encoding mode.
       
   429 
       
   430     \sa QtMedia::EncodingMode
       
   431 */
       
   432 QtMedia::EncodingMode QVideoEncoderSettings::encodingMode() const
       
   433 {
       
   434     return d->encodingMode;
       
   435 }
       
   436 
       
   437 /*!
       
   438     Sets the video encoding \a mode.
       
   439 
       
   440     \sa QtMedia::EncodingMode
       
   441 */
       
   442 void QVideoEncoderSettings::setEncodingMode(QtMedia::EncodingMode mode)
       
   443 {
       
   444     d->isNull = false;
       
   445     d->encodingMode = mode;
       
   446 }
       
   447 
       
   448 /*!
       
   449     Returns the video codec.
       
   450 */
       
   451 
       
   452 QString QVideoEncoderSettings::codec() const
       
   453 {
       
   454     return d->codec;
       
   455 }
       
   456 
       
   457 /*!
       
   458     Sets the video \a codec.
       
   459 */
       
   460 void QVideoEncoderSettings::setCodec(const QString& codec)
       
   461 {
       
   462     d->isNull = false;
       
   463     d->codec = codec;
       
   464 }
       
   465 
       
   466 /*!
       
   467     Returns bit rate of the encoded video stream.
       
   468 */
       
   469 int QVideoEncoderSettings::bitRate() const
       
   470 {
       
   471     return d->bitrate;
       
   472 }
       
   473 
       
   474 /*!
       
   475     Sets the bit rate of the encoded video stream to \a value.
       
   476 */
       
   477 
       
   478 void QVideoEncoderSettings::setBitRate(int value)
       
   479 {
       
   480     d->isNull = false;
       
   481     d->bitrate = value;
       
   482 }
       
   483 
       
   484 /*!
       
   485     Returns the video frame rate.
       
   486 */
       
   487 qreal QVideoEncoderSettings::frameRate() const
       
   488 {
       
   489     return d->frameRate;
       
   490 }
       
   491 
       
   492 /*!
       
   493     \fn QVideoEncoderSettings::setFrameRate(qreal rate)
       
   494 
       
   495     Sets the video frame \a rate.
       
   496 
       
   497     A value of 0 indicates the encoder should make an optimal choice based on what is available
       
   498     from the video source and the limitations of the codec.
       
   499 */
       
   500 
       
   501 void QVideoEncoderSettings::setFrameRate(qreal rate)
       
   502 {
       
   503     d->isNull = false;
       
   504     d->frameRate = rate;
       
   505 }
       
   506 
       
   507 /*!
       
   508     Returns the resolution of the encoded video.
       
   509 */
       
   510 
       
   511 QSize QVideoEncoderSettings::resolution() const
       
   512 {
       
   513     return d->resolution;
       
   514 }
       
   515 
       
   516 /*!
       
   517     Sets the \a resolution of the encoded video.
       
   518 
       
   519     An empty QSize indicates the encoder should make an optimal choice based on what is available
       
   520     from the video source and the limitations of the codec.
       
   521 */
       
   522 
       
   523 void QVideoEncoderSettings::setResolution(const QSize &resolution)
       
   524 {
       
   525     d->isNull = false;
       
   526     d->resolution = resolution;
       
   527 }
       
   528 
       
   529 /*!
       
   530     Sets the \a width and \a height of the resolution of the encoded video.
       
   531 
       
   532     \overload
       
   533 */
       
   534 
       
   535 void QVideoEncoderSettings::setResolution(int width, int height)
       
   536 {
       
   537     d->isNull = false;
       
   538     d->resolution = QSize(width, height);
       
   539 }
       
   540 
       
   541 /*!
       
   542     Returns the video encoding quality.
       
   543 */
       
   544 
       
   545 QtMedia::EncodingQuality QVideoEncoderSettings::quality() const
       
   546 {
       
   547     return d->quality;
       
   548 }
       
   549 
       
   550 /*!
       
   551     Sets the video encoding \a quality.
       
   552 */
       
   553 
       
   554 void QVideoEncoderSettings::setQuality(QtMedia::EncodingQuality quality)
       
   555 {
       
   556     d->isNull = false;
       
   557     d->quality = quality;
       
   558 }
       
   559 
       
   560 
       
   561 
       
   562 class QImageEncoderSettingsPrivate  : public QSharedData
       
   563 {
       
   564 public:
       
   565     QImageEncoderSettingsPrivate() :
       
   566         isNull(true),
       
   567         quality(QtMedia::NormalQuality)
       
   568     {
       
   569     }
       
   570 
       
   571     QImageEncoderSettingsPrivate(const QImageEncoderSettingsPrivate &other):
       
   572         QSharedData(other),
       
   573         isNull(other.isNull),
       
   574         codec(other.codec),
       
   575         resolution(other.resolution),
       
   576         quality(other.quality)
       
   577     {
       
   578     }
       
   579 
       
   580     bool isNull;
       
   581     QString codec;
       
   582     QSize resolution;
       
   583     QtMedia::EncodingQuality quality;
       
   584 
       
   585 private:
       
   586     QImageEncoderSettingsPrivate& operator=(const QImageEncoderSettingsPrivate &other);
       
   587 };
       
   588 
       
   589 /*!
       
   590     \class QImageEncoderSettings
       
   591     \preliminary
       
   592 
       
   593     \brief The QImageEncoderSettings class provides a set of image
       
   594     encoder settings.
       
   595 
       
   596     A image encoder settings object is used to specify the image
       
   597     encoder settings used by QStillImageCapture.  Image encoder
       
   598     settings are selected by constructing a QImageEncoderSettings
       
   599     object, setting the desired properties and then passing it to a
       
   600     QStillImageCapture instance using the
       
   601     QStillImageCapture::setImageSettings() function.
       
   602 
       
   603     \code
       
   604     QImageEncoderSettings imageSettings;
       
   605     imageSettings.setCodec("image/jpeg");
       
   606     imageSettings.setResolution(1600, 1200);
       
   607 
       
   608     imageCapture->setImageSettings(imageSettings);
       
   609     \endcode
       
   610 
       
   611     \sa QStillImageCapture, QImageEncoderControl
       
   612 */
       
   613 
       
   614 /*!
       
   615     Constructs a null image encoder settings object.
       
   616 */
       
   617 
       
   618 QImageEncoderSettings::QImageEncoderSettings()
       
   619     :d(new QImageEncoderSettingsPrivate)
       
   620 {
       
   621 }
       
   622 
       
   623 /*!
       
   624     Constructs a copy of the image encoder settings object \a other.
       
   625 */
       
   626 
       
   627 QImageEncoderSettings::QImageEncoderSettings(const QImageEncoderSettings& other)
       
   628     :d(other.d)
       
   629 {
       
   630 }
       
   631 
       
   632 /*!
       
   633     Destroys a image encoder settings object.
       
   634 */
       
   635 
       
   636 QImageEncoderSettings::~QImageEncoderSettings()
       
   637 {
       
   638 }
       
   639 
       
   640 /*!
       
   641     Assigns the value of \a other to a image encoder settings object.
       
   642 */
       
   643 QImageEncoderSettings &QImageEncoderSettings::operator=(const QImageEncoderSettings &other)
       
   644 {
       
   645     d = other.d;
       
   646     return *this;
       
   647 }
       
   648 
       
   649 /*!
       
   650     Determines if \a other is of equal value to a image encoder settings object.
       
   651 
       
   652     Returns true if the settings objects are of equal value, and true if they are not of equal
       
   653     value.
       
   654 */
       
   655 bool QImageEncoderSettings::operator==(const QImageEncoderSettings &other) const
       
   656 {
       
   657     return (d == other.d) ||
       
   658            (d->isNull == other.d->isNull &&
       
   659             d->quality == other.d->quality &&
       
   660             d->codec == other.d->codec &&
       
   661             d->resolution == other.d->resolution);
       
   662 
       
   663 }
       
   664 
       
   665 /*!
       
   666     Determines if \a other is of equal value to a image encoder settings object.
       
   667 
       
   668     Returns true if the settings objects are not of equal value, and true if they are of equal
       
   669     value.
       
   670 */
       
   671 bool QImageEncoderSettings::operator!=(const QImageEncoderSettings &other) const
       
   672 {
       
   673     return !(*this == other);
       
   674 }
       
   675 
       
   676 /*!
       
   677     Identifies if a image encoder settings object is uninitalized.
       
   678 
       
   679     Returns true if the settings are null, and false if they are not.
       
   680 */
       
   681 bool QImageEncoderSettings::isNull() const
       
   682 {
       
   683     return d->isNull;
       
   684 }
       
   685 
       
   686 /*!
       
   687     Returns the image codec.
       
   688 */
       
   689 
       
   690 QString QImageEncoderSettings::codec() const
       
   691 {
       
   692     return d->codec;
       
   693 }
       
   694 
       
   695 /*!
       
   696     Sets the image \a codec.
       
   697 */
       
   698 void QImageEncoderSettings::setCodec(const QString& codec)
       
   699 {
       
   700     d->isNull = false;
       
   701     d->codec = codec;
       
   702 }
       
   703 
       
   704 /*!
       
   705     Returns the resolution of the encoded image.
       
   706 */
       
   707 
       
   708 QSize QImageEncoderSettings::resolution() const
       
   709 {
       
   710     return d->resolution;
       
   711 }
       
   712 
       
   713 /*!
       
   714     Sets the \a resolution of the encoded image.
       
   715 
       
   716     An empty QSize indicates the encoder should make an optimal choice based on what is available
       
   717     from the image source and the limitations of the codec.
       
   718 */
       
   719 
       
   720 void QImageEncoderSettings::setResolution(const QSize &resolution)
       
   721 {
       
   722     d->isNull = false;
       
   723     d->resolution = resolution;
       
   724 }
       
   725 
       
   726 /*!
       
   727     Sets the \a width and \a height of the resolution of the encoded image.
       
   728 
       
   729     \overload
       
   730 */
       
   731 
       
   732 void QImageEncoderSettings::setResolution(int width, int height)
       
   733 {
       
   734     d->isNull = false;
       
   735     d->resolution = QSize(width, height);
       
   736 }
       
   737 
       
   738 /*!
       
   739     Returns the image encoding quality.
       
   740 */
       
   741 
       
   742 QtMedia::EncodingQuality QImageEncoderSettings::quality() const
       
   743 {
       
   744     return d->quality;
       
   745 }
       
   746 
       
   747 /*!
       
   748     Sets the image encoding \a quality.
       
   749 */
       
   750 
       
   751 void QImageEncoderSettings::setQuality(QtMedia::EncodingQuality quality)
       
   752 {
       
   753     d->isNull = false;
       
   754     d->quality = quality;
       
   755 }
       
   756 QTM_END_NAMESPACE
       
   757