Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qwindowscamera.cpp File Reference
#include "qwindowscamera_p.h"
#include "qsemaphore.h"
#include "qmutex.h"
#include <private/qmemoryvideobuffer_p.h>
#include <private/qwindowsmfdefs_p.h>
#include <private/qwindowsmultimediautils_p.h>
#include <mfapi.h>
#include <mfidl.h>
#include <mferror.h>
#include <mfreadwrite.h>
#include <system_error>
+ Include dependency graph for qwindowscamera.cpp:

Go to the source code of this file.

Classes

class  CameraReaderCallback
 
class  ActiveCamera
 

Functions

static ComPtr< IMFSourceReader > createCameraReader (IMFMediaSource *mediaSource, const ComPtr< CameraReaderCallback > &callback)
 
static ComPtr< IMFMediaSource > createCameraSource (const QString &deviceId)
 
static int calculateVideoFrameStride (IMFMediaType *videoType, int width)
 
static bool setCameraReaderFormat (IMFSourceReader *sourceReader, IMFMediaType *videoType)
 
static ComPtr< IMFMediaType > findVideoType (IMFSourceReader *reader, const QCameraFormat &format)
 

Function Documentation

◆ calculateVideoFrameStride()

static int calculateVideoFrameStride ( IMFMediaType *  videoType,
int  width 
)
static

Definition at line 117 of file qwindowscamera.cpp.

References QWindowsMultimediaUtils::errorString(), Q_ASSERT, qAbs(), and qWarning.

Referenced by ActiveCamera::setFormat().

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

◆ createCameraReader()

static ComPtr< IMFSourceReader > createCameraReader ( IMFMediaSource *  mediaSource,
const ComPtr< CameraReaderCallback > &  callback 
)
static

Definition at line 76 of file qwindowscamera.cpp.

References qWarning.

Referenced by ActiveCamera::create().

+ Here is the caller graph for this function:

◆ createCameraSource()

static ComPtr< IMFMediaSource > createCameraSource ( const QString deviceId)
static

Definition at line 96 of file qwindowscamera.cpp.

References MFCreateDeviceSource(), QMM_MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_VIDCAP_GUID, qWarning, and QString::utf16().

Referenced by ActiveCamera::create().

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

◆ findVideoType()

static ComPtr< IMFMediaType > findVideoType ( IMFSourceReader *  reader,
const QCameraFormat format 
)
static

Definition at line 147 of file qwindowscamera.cpp.

References i, and QWindowsMultimediaUtils::pixelFormatFromMediaSubtype().

Referenced by ActiveCamera::setFormat().

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

◆ setCameraReaderFormat()

static bool setCameraReaderFormat ( IMFSourceReader *  sourceReader,
IMFMediaType *  videoType 
)
static

Definition at line 134 of file qwindowscamera.cpp.

References QWindowsMultimediaUtils::errorString(), Q_ASSERT, and qWarning.

Referenced by ActiveCamera::setFormat().

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