qTox
Version: nightly | Commit: bc751c8e1cac455f9690654fcfe0f560d2d7dfdd
|
#include <cameradevice.h>
Public Member Functions | |
void | open () |
Opens the device again. Never fails. More... | |
bool | close () |
Closes the device. Never fails. More... | |
Static Public Member Functions | |
static CameraDevice * | open (QString devName, VideoMode mode=VideoMode()) |
Opens a device. More... | |
static QVector< QPair< QString, QString > > | getDeviceList () |
Get device list with desciption. More... | |
static QVector< VideoMode > | getVideoModes (QString devName) |
Get the list of video modes for a device. More... | |
static QString | getPixelFormatString (uint32_t pixel_format) |
Get the name of the pixel format of a video mode. More... | |
static bool | betterPixelFormat (uint32_t a, uint32_t b) |
Compare two pixel formats. More... | |
static QString | getDefaultDeviceName () |
Get the default device name. More... | |
static bool | isScreen (const QString &devName) |
Checks if a device name specifies a display. More... | |
Public Attributes | |
const QString | devName |
Short name of the device. More... | |
AVFormatContext * | context |
Context of the open device, must always be valid. More... | |
Private Member Functions | |
CameraDevice (const QString &devName, AVFormatContext *context) | |
Static Private Member Functions | |
static CameraDevice * | open (QString devName, AVDictionary **options) |
static bool | getDefaultInputFormat () |
Sets CameraDevice::iformat to default. More... | |
static QVector< QPair< QString, QString > > | getRawDeviceListGeneric () |
Get raw device list. More... | |
static QVector< VideoMode > | getScreenModes () |
Get list of resolutions and position of screens. More... | |
Private Attributes | |
std::atomic_int | refcount |
Number of times the device was opened. More... | |
Static Private Attributes | |
static QHash< QString, CameraDevice * > | openDevices |
static QMutex | openDeviceLock |
static QMutex | iformatLock |
Maintains an FFmpeg context for open camera devices, takes care of sharing the context accross users and closing the camera device when not in use. The device can be opened recursively, and must then be closed recursively
Definition at line 35 of file cameradevice.h.
|
private |
Definition at line 80 of file cameradevice.cpp.
|
static |
Compare two pixel formats.
a | First pixel format to compare. |
b | Second pixel format to compare. |
Definition at line 498 of file cameradevice.cpp.
bool CameraDevice::close | ( | ) |
Closes the device. Never fails.
Definition at line 260 of file cameradevice.cpp.
|
static |
Get the default device name.
Definition at line 396 of file cameradevice.cpp.
|
staticprivate |
Sets CameraDevice::iformat to default.
Definition at line 511 of file cameradevice.cpp.
|
static |
Get device list with desciption.
Definition at line 343 of file cameradevice.cpp.
|
static |
Get the name of the pixel format of a video mode.
pixel_format | Pixel format to get the name from. |
Definition at line 482 of file cameradevice.cpp.
|
staticprivate |
Get raw device list.
Definition at line 278 of file cameradevice.cpp.
|
staticprivate |
Get list of resolutions and position of screens.
Definition at line 428 of file cameradevice.cpp.
|
static |
Get the list of video modes for a device.
devName | Device name to get nodes from. |
Definition at line 451 of file cameradevice.cpp.
|
static |
Checks if a device name specifies a display.
devName | Device name to check. |
Definition at line 419 of file cameradevice.cpp.
void CameraDevice::open | ( | ) |
Opens the device again. Never fails.
Definition at line 249 of file cameradevice.cpp.
|
staticprivate |
Definition at line 87 of file cameradevice.cpp.
|
static |
Opens a device.
Opens a device, creating a new one if needed If the device is alreay open in another mode, the mode will be ignored and the existing device is used If the mode does not exist, a new device can't be opened.
devName | Device name to open. |
mode | Mode of device to open. |
Definition at line 152 of file cameradevice.cpp.
AVFormatContext * CameraDevice::context |
Context of the open device, must always be valid.
Definition at line 61 of file cameradevice.h.
const QString CameraDevice::devName |
Short name of the device.
Definition at line 60 of file cameradevice.h.
|
staticprivate |
Definition at line 66 of file cameradevice.h.
|
staticprivate |
Definition at line 66 of file cameradevice.h.
|
staticprivate |
Definition at line 65 of file cameradevice.h.
|
private |
Number of times the device was opened.
Definition at line 64 of file cameradevice.h.