Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
avfcamerautility_p.h File Reference
#include <QtCore/qglobal.h>
#include <QtCore/qdebug.h>
#include <QtCore/qlist.h>
#include <QtCore/qpair.h>
#include <QtCore/qsize.h>
#include "qcameradevice.h"
#include <AVFoundation/AVFoundation.h>
+ Include dependency graph for avfcamerautility_p.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  AVFConfigurationLock
 
struct  AVFObjectDeleter
 
class  AVFScopedPointer< T >
 
class  AVFScopedPointer< dispatch_queue_t >
 

Typedefs

typedef QPair< qreal, qrealAVFPSRange
 

Functions

AVFPSRange qt_connection_framerates (AVCaptureConnection *videoConnection)
 
AVCaptureDeviceFormat * qt_convert_to_capture_device_format (AVCaptureDevice *captureDevice, const QCameraFormat &format, const std::function< bool(uint32_t)> &cvFormatValidator=nullptr)
 
QList< AVCaptureDeviceFormat * > qt_unique_device_formats (AVCaptureDevice *captureDevice, FourCharCode preferredFormat)
 
QSize qt_device_format_resolution (AVCaptureDeviceFormat *format)
 
QSize qt_device_format_high_resolution (AVCaptureDeviceFormat *format)
 
QSize qt_device_format_pixel_aspect_ratio (AVCaptureDeviceFormat *format)
 
QList< AVFPSRangeqt_device_format_framerates (AVCaptureDeviceFormat *format)
 
AVCaptureDeviceFormat * qt_find_best_resolution_match (AVCaptureDevice *captureDevice, const QSize &res, FourCharCode preferredFormat, bool stillImage=true)
 
AVCaptureDeviceFormat * qt_find_best_framerate_match (AVCaptureDevice *captureDevice, FourCharCode preferredFormat, 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)
 
AVFPSRange qt_current_framerates (AVCaptureDevice *captureDevice, AVCaptureConnection *videoConnection)
 
void qt_set_framerate_limits (AVCaptureDevice *captureDevice, AVCaptureConnection *videoConnection, qreal minFPS, qreal maxFPS)
 
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)
 

Typedef Documentation

◆ AVFPSRange

Definition at line 131 of file avfcamerautility_p.h.

Function Documentation

◆ qt_connection_framerates()

AVFPSRange qt_connection_framerates ( AVCaptureConnection *  videoConnection)

Definition at line 22 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 format,
const std::function< bool(uint32_t)> &  cvFormatValidator = nullptr 
)

Definition at line 99 of file avfcamerautility.mm.

References QAVFHelpers::fromCVPixelFormat(), QSize::height(), QCameraFormat::maxFrameRate, QCameraFormat::minFrameRate, QCameraFormat::pixelFormat, QCameraFormat::resolution, and QSize::width().

+ Here is the call graph for this function:

◆ qt_current_framerates()

AVFPSRange qt_current_framerates ( AVCaptureDevice *  captureDevice,
AVCaptureConnection *  videoConnection 
)

Definition at line 560 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()

QList< AVFPSRange > qt_device_format_framerates ( AVCaptureDeviceFormat *  format)

Definition at line 192 of file avfcamerautility.mm.

References Q_ASSERT, and QList< T >::reserve().

+ Here is the call graph for this function:

◆ qt_device_format_high_resolution()

QSize qt_device_format_high_resolution ( AVCaptureDeviceFormat *  format)

Definition at line 180 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 208 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 171 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  preferredFormat,
Float64  fps 
)

Definition at line 301 of file avfcamerautility.mm.

References QList< T >::begin(), QList< T >::end(), epsilon, QList< T >::erase(), Float64, i, match(), Q_ASSERT, qAbs(), qt_unique_device_formats(), and QList< T >::size().

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 res,
FourCharCode  preferredFormat,
bool  stillImage = true 
)

Definition at line 234 of file avfcamerautility.mm.

References area(), QList< T >::first(), i, QSize::isNull(), QSize::isValid(), next, Q_ASSERT, qAbs(), qt_device_format_high_resolution(), qt_device_format_resolution(), qt_unique_device_formats(), request, QList< T >::reserve(), and QList< T >::size().

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 346 of file avfcamerautility.mm.

References e, 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 378 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 391 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 402 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()

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

Definition at line 552 of file avfcamerautility.mm.

References Q_ASSERT, Q_UNUSED, and qt_set_framerate_limits().

+ 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 612 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 643 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 680 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 581 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()

QList< AVCaptureDeviceFormat * > qt_unique_device_formats ( AVCaptureDevice *  captureDevice,
FourCharCode  preferredFormat 
)

Definition at line 127 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: