equal
deleted
inserted
replaced
37 ** |
37 ** |
38 ** $QT_END_LICENSE$ |
38 ** $QT_END_LICENSE$ |
39 ** |
39 ** |
40 ****************************************************************************/ |
40 ****************************************************************************/ |
41 |
41 |
42 #include <qmediaencodersettings.h> |
42 #include "qmediaencodersettings.h" |
43 |
43 |
44 QTM_BEGIN_NAMESPACE |
44 QTM_BEGIN_NAMESPACE |
45 |
45 |
46 class QAudioEncoderSettingsPrivate : public QSharedData |
46 class QAudioEncoderSettingsPrivate : public QSharedData |
47 { |
47 { |
192 } |
192 } |
193 |
193 |
194 /*! |
194 /*! |
195 Sets the audio encoding \a mode setting. |
195 Sets the audio encoding \a mode setting. |
196 |
196 |
|
197 If QtMedia::ConstantQualityEncoding is set, |
|
198 the quality encoding parameter is used and bit rate is ignored, |
|
199 otherwise the bitrate is used. |
|
200 |
|
201 The audio codec, channels count and sample rate settings |
|
202 are used in all the encoding modes. |
|
203 |
197 \sa encodingMode(), QtMedia::EncodingMode |
204 \sa encodingMode(), QtMedia::EncodingMode |
198 */ |
205 */ |
199 void QAudioEncoderSettings::setEncodingMode(QtMedia::EncodingMode mode) |
206 void QAudioEncoderSettings::setEncodingMode(QtMedia::EncodingMode mode) |
200 { |
207 { |
201 d->encodingMode = mode; |
208 d->encodingMode = mode; |
245 d->isNull = false; |
252 d->isNull = false; |
246 d->channels = channels; |
253 d->channels = channels; |
247 } |
254 } |
248 |
255 |
249 /*! |
256 /*! |
250 Sets the audio bit \a rate. |
257 Sets the audio bit \a rate in bits per second. |
251 */ |
258 */ |
252 void QAudioEncoderSettings::setBitRate(int rate) |
259 void QAudioEncoderSettings::setBitRate(int rate) |
253 { |
260 { |
254 d->isNull = false; |
261 d->isNull = false; |
255 d->bitrate = rate; |
262 d->bitrate = rate; |
256 } |
263 } |
257 |
264 |
258 /*! |
265 /*! |
259 Returns the audio sample rate. |
266 Returns the audio sample rate in Hz. |
260 */ |
267 */ |
261 int QAudioEncoderSettings::sampleRate() const |
268 int QAudioEncoderSettings::sampleRate() const |
262 { |
269 { |
263 return d->sampleRate; |
270 return d->sampleRate; |
264 } |
271 } |
265 |
272 |
266 /*! |
273 /*! |
267 Sets the audio sample \a rate. |
274 Sets the audio sample \a rate in Hz. |
268 |
275 |
269 A value of -1 indicates the encoder should make an optimal choice based on what is avaialbe |
276 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. |
277 from the audio source and the limitations of the codec. |
271 */ |
278 */ |
272 void QAudioEncoderSettings::setSampleRate(int rate) |
279 void QAudioEncoderSettings::setSampleRate(int rate) |
284 return d->quality; |
291 return d->quality; |
285 } |
292 } |
286 |
293 |
287 /*! |
294 /*! |
288 Set the audio encoding \a quality. |
295 Set the audio encoding \a quality. |
|
296 |
|
297 Setting the audio quality parameter allows backend to choose the balanced |
|
298 set of encoding parameters to achieve the desired quality level. |
|
299 |
|
300 The \a quality settings parameter is only used in the |
|
301 \l {QtMedia::ConstantQualityEncoding}{constant quality} \l{encodingMode()}{encoding mode}. |
289 */ |
302 */ |
290 void QAudioEncoderSettings::setQuality(QtMedia::EncodingQuality quality) |
303 void QAudioEncoderSettings::setQuality(QtMedia::EncodingQuality quality) |
291 { |
304 { |
292 d->isNull = false; |
305 d->isNull = false; |
293 d->quality = quality; |
306 d->quality = quality; |
435 } |
448 } |
436 |
449 |
437 /*! |
450 /*! |
438 Sets the video encoding \a mode. |
451 Sets the video encoding \a mode. |
439 |
452 |
|
453 If QtMedia::ConstantQualityEncoding is set, |
|
454 the quality encoding parameter is used and bit rate is ignored, |
|
455 otherwise the bitrate is used. |
|
456 |
|
457 The rest of encoding settings are respected regardless of encoding mode. |
|
458 |
440 \sa QtMedia::EncodingMode |
459 \sa QtMedia::EncodingMode |
441 */ |
460 */ |
442 void QVideoEncoderSettings::setEncodingMode(QtMedia::EncodingMode mode) |
461 void QVideoEncoderSettings::setEncodingMode(QtMedia::EncodingMode mode) |
443 { |
462 { |
444 d->isNull = false; |
463 d->isNull = false; |
462 d->isNull = false; |
481 d->isNull = false; |
463 d->codec = codec; |
482 d->codec = codec; |
464 } |
483 } |
465 |
484 |
466 /*! |
485 /*! |
467 Returns bit rate of the encoded video stream. |
486 Returns bit rate of the encoded video stream in bits per second. |
468 */ |
487 */ |
469 int QVideoEncoderSettings::bitRate() const |
488 int QVideoEncoderSettings::bitRate() const |
470 { |
489 { |
471 return d->bitrate; |
490 return d->bitrate; |
472 } |
491 } |
547 return d->quality; |
566 return d->quality; |
548 } |
567 } |
549 |
568 |
550 /*! |
569 /*! |
551 Sets the video encoding \a quality. |
570 Sets the video encoding \a quality. |
|
571 |
|
572 Setting the video quality parameter allows backend to choose the balanced |
|
573 set of encoding parameters to achieve the desired quality level. |
|
574 |
|
575 The \a quality settings parameter is only used in the |
|
576 \l {QtMedia::ConstantQualityEncoding}{constant quality} \l{encodingMode()}{encoding mode}. |
552 */ |
577 */ |
553 |
578 |
554 void QVideoEncoderSettings::setQuality(QtMedia::EncodingQuality quality) |
579 void QVideoEncoderSettings::setQuality(QtMedia::EncodingQuality quality) |
555 { |
580 { |
556 d->isNull = false; |
581 d->isNull = false; |