Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
avfcamerautility.mm File Reference

(b8047fbd788ce09afe4f5fef079099488c9ed42d)

#include "avfcamerautility_p.h"
#include "avfcameradebug_p.h"
#include <QtCore/qvector.h>
#include <QtCore/qpair.h>
#include <private/qmultimediautils_p.h>
#include <private/qcameradevice_p.h>
#include "avfvideobuffer_p.h"
#include "qavfhelpers_p.h"
#include <functional>
#include <algorithm>
#include <limits>
#include <tuple>
+ Include dependency graph for avfcamerautility.mm:

Go to the source code of this file.

Functions

QT_BEGIN_NAMESPACE AVFPSRange qt_connection_framerates (AVCaptureConnection *videoConnection)
 
AVCaptureDeviceFormat * qt_convert_to_capture_device_format (AVCaptureDevice *captureDevice, const QCameraFormat &cameraFormat, const std::function< bool(uint32_t)> &cvFormatValidator)
 
QVector< AVCaptureDeviceFormat * > qt_unique_device_formats (AVCaptureDevice *captureDevice, FourCharCode filter)
 
QSize qt_device_format_resolution (AVCaptureDeviceFormat *format)
 
QSize qt_device_format_high_resolution (AVCaptureDeviceFormat *format)
 
QVector< AVFPSRangeqt_device_format_framerates (AVCaptureDeviceFormat *format)
 
QSize qt_device_format_pixel_aspect_ratio (AVCaptureDeviceFormat *format)
 
AVCaptureDeviceFormat * qt_find_best_resolution_match (AVCaptureDevice *captureDevice, const QSize &request, FourCharCode filter, bool stillImage)
 
AVCaptureDeviceFormat * qt_find_best_framerate_match (AVCaptureDevice *captureDevice, FourCharCode filter, Float64 fps)
 
AVFrameRateRange * qt_find_supported_framerate_range (AVCaptureDeviceFormat *format, Float64 fps)
 
bool qt_format_supports_framerate (AVCaptureDeviceFormat *format, qreal fps)
 
bool qt_formats_are_equal (AVCaptureDeviceFormat *f1, AVCaptureDeviceFormat *f2)
 
bool qt_set_active_format (AVCaptureDevice *captureDevice, AVCaptureDeviceFormat *format, bool preserveFps)
 
void qt_set_framerate_limits (AVCaptureConnection *videoConnection, qreal minFPS, qreal maxFPS)
 
CMTime qt_adjusted_frame_duration (AVFrameRateRange *range, qreal fps)
 
void qt_set_framerate_limits (AVCaptureDevice *captureDevice, qreal minFPS, qreal maxFPS)
 
void qt_set_framerate_limits (AVCaptureDevice *captureDevice, AVCaptureConnection *videoConnection, qreal minFPS, qreal maxFPS)
 
AVFPSRange qt_current_framerates (AVCaptureDevice *captureDevice, AVCaptureConnection *videoConnection)
 
QList< AudioValueRange > qt_supported_sample_rates_for_format (int codecId)
 
QList< AudioValueRange > qt_supported_bit_rates_for_format (int codecId)
 
std::optional< QList< UInt32 > > qt_supported_channel_counts_for_format (int codecId)
 
QList< UInt32 > qt_supported_channel_layout_tags_for_format (int codecId, int noChannels)
 

Function Documentation

◆ qt_adjusted_frame_duration()

CMTime qt_adjusted_frame_duration ( AVFrameRateRange * range,
qreal fps )

Definition at line 488 of file avfcamerautility.mm.

References Q_ASSERT, and qRealToFraction().

Referenced by qt_set_framerate_limits().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qt_connection_framerates()

QT_BEGIN_NAMESPACE AVFPSRange qt_connection_framerates ( AVCaptureConnection * videoConnection)

Definition at line 23 of file avfcamerautility.mm.

References Float64, and Q_ASSERT.

◆ qt_convert_to_capture_device_format()

AVCaptureDeviceFormat * qt_convert_to_capture_device_format ( AVCaptureDevice * captureDevice,
const QCameraFormat & cameraFormat,
const std::function< bool(uint32_t)> & cvFormatValidator )

Definition at line 100 of file avfcamerautility.mm.

References CvPixelFormatInvalid, Float64, QCameraFormatPrivate::handle(), and QAVFHelpers::toCVPixelFormat().

+ Here is the call graph for this function:

◆ qt_current_framerates()

AVFPSRange qt_current_framerates ( AVCaptureDevice * captureDevice,
AVCaptureConnection * videoConnection )

Definition at line 576 of file avfcamerautility.mm.

References Float64, Q_ASSERT, and Q_UNUSED.

Referenced by avfVideoSettings(), and qt_set_active_format().

+ Here is the caller graph for this function:

◆ qt_device_format_framerates()

QVector< AVFPSRange > qt_device_format_framerates ( AVCaptureDeviceFormat * format)

Definition at line 208 of file avfcamerautility.mm.

References Q_ASSERT.

◆ qt_device_format_high_resolution()

QSize qt_device_format_high_resolution ( AVCaptureDeviceFormat * format)

Definition at line 196 of file avfcamerautility.mm.

References Q_ASSERT.

Referenced by AVFImageCapture::applySettings(), AVFImageCapture::imageSettings(), and qt_find_best_resolution_match().

+ Here is the caller graph for this function:

◆ qt_device_format_pixel_aspect_ratio()

QSize qt_device_format_pixel_aspect_ratio ( AVCaptureDeviceFormat * format)

Definition at line 224 of file avfcamerautility.mm.

References Q_ASSERT, Q_FUNC_INFO, qAbs(), qCDebug, and qRealToFraction().

+ Here is the call graph for this function:

◆ qt_device_format_resolution()

QSize qt_device_format_resolution ( AVCaptureDeviceFormat * format)

Definition at line 187 of file avfcamerautility.mm.

Referenced by AVFImageCapture::imageSettings(), qt_find_best_resolution_match(), and qt_unique_device_formats().

+ Here is the caller graph for this function:

◆ qt_find_best_framerate_match()

AVCaptureDeviceFormat * qt_find_best_framerate_match ( AVCaptureDevice * captureDevice,
FourCharCode filter,
Float64 fps )

Definition at line 317 of file avfcamerautility.mm.

References epsilon, Float64, i, match(), Q_ASSERT, qAbs(), and qt_unique_device_formats().

Referenced by avfVideoSettings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qt_find_best_resolution_match()

AVCaptureDeviceFormat * qt_find_best_resolution_match ( AVCaptureDevice * captureDevice,
const QSize & request,
FourCharCode filter,
bool stillImage )

Definition at line 250 of file avfcamerautility.mm.

References area(), i, next, Q_ASSERT, qAbs(), qt_device_format_high_resolution(), qt_device_format_resolution(), qt_unique_device_formats(), and request.

Referenced by AVFImageCapture::applySettings(), and avfVideoSettings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qt_find_supported_framerate_range()

AVFrameRateRange * qt_find_supported_framerate_range ( AVCaptureDeviceFormat * format,
Float64 fps )

Definition at line 362 of file avfcamerautility.mm.

References epsilon, Float64, i, match(), Q_ASSERT, and qAbs().

Referenced by qt_set_framerate_limits().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qt_format_supports_framerate()

bool qt_format_supports_framerate ( AVCaptureDeviceFormat * format,
qreal fps )

Definition at line 394 of file avfcamerautility.mm.

References epsilon.

Referenced by avfVideoSettings().

+ Here is the caller graph for this function:

◆ qt_formats_are_equal()

bool qt_formats_are_equal ( AVCaptureDeviceFormat * f1,
AVCaptureDeviceFormat * f2 )

Definition at line 407 of file avfcamerautility.mm.

Referenced by qt_set_active_format().

+ Here is the caller graph for this function:

◆ qt_set_active_format()

bool qt_set_active_format ( AVCaptureDevice * captureDevice,
AVCaptureDeviceFormat * format,
bool preserveFps )

Definition at line 418 of file avfcamerautility.mm.

References lock, qt_current_framerates(), qt_formats_are_equal(), qt_set_framerate_limits(), and qWarning.

Referenced by AVFImageCapture::applySettings(), and avfVideoSettings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qt_set_framerate_limits() [1/3]

void qt_set_framerate_limits ( AVCaptureConnection * videoConnection,
qreal minFPS,
qreal maxFPS )

Definition at line 457 of file avfcamerautility.mm.

References Q_ASSERT, Q_FUNC_INFO, and qCDebug.

Referenced by avfVideoSettings(), qt_set_active_format(), and qt_set_framerate_limits().

+ Here is the caller graph for this function:

◆ qt_set_framerate_limits() [2/3]

void qt_set_framerate_limits ( AVCaptureDevice * captureDevice,
AVCaptureConnection * videoConnection,
qreal minFPS,
qreal maxFPS )

Definition at line 568 of file avfcamerautility.mm.

References Q_ASSERT, Q_UNUSED, and qt_set_framerate_limits().

+ Here is the call graph for this function:

◆ qt_set_framerate_limits() [3/3]

void qt_set_framerate_limits ( AVCaptureDevice * captureDevice,
qreal minFPS,
qreal maxFPS )

Definition at line 507 of file avfcamerautility.mm.

References lock, Q_ASSERT, Q_FUNC_INFO, qCDebug, qt_adjusted_frame_duration(), and qt_find_supported_framerate_range().

+ Here is the call graph for this function:

◆ qt_supported_bit_rates_for_format()

QList< AudioValueRange > qt_supported_bit_rates_for_format ( int codecId)

Definition at line 628 of file avfcamerautility.mm.

References codecId(), and i.

Referenced by avfAudioSettings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qt_supported_channel_counts_for_format()

std::optional< QList< UInt32 > > qt_supported_channel_counts_for_format ( int codecId)

Definition at line 659 of file avfcamerautility.mm.

References codecId(), and i.

Referenced by avfAudioSettings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qt_supported_channel_layout_tags_for_format()

QList< UInt32 > qt_supported_channel_layout_tags_for_format ( int codecId,
int noChannels )

Definition at line 696 of file avfcamerautility.mm.

References codecId(), and i.

Referenced by avfAudioSettings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qt_supported_sample_rates_for_format()

QList< AudioValueRange > qt_supported_sample_rates_for_format ( int codecId)

Definition at line 597 of file avfcamerautility.mm.

References codecId(), and i.

Referenced by avfAudioSettings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qt_unique_device_formats()

QVector< AVCaptureDeviceFormat * > qt_unique_device_formats ( AVCaptureDevice * captureDevice,
FourCharCode filter )

Definition at line 143 of file avfcamerautility.mm.

References codec, i, QSize::isNull(), QSize::isValid(), Q_ASSERT, and qt_device_format_resolution().

Referenced by qt_find_best_framerate_match(), and qt_find_best_resolution_match().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: