Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qavfsamplebufferdelegate_p.h
Go to the documentation of this file.
1// Copyright (C) 2022 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QAVFSAMPLEBUFFERDELEGATE_P_H
5#define QAVFSAMPLEBUFFERDELEGATE_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#import <AVFoundation/AVFoundation.h>
19#import <CoreVideo/CoreVideo.h>
20
21#include <QtCore/qtconfigmacros.h>
22#include <QtCore/qtypes.h>
23
24#include <QtMultimedia/private/qvideotransformation_p.h>
25
26#include <functional>
27#include <memory>
28
29QT_BEGIN_NAMESPACE
30
31class QAVSampleBufferDelegateFrameHandler;
32class QVideoFrame;
33namespace QFFmpeg {
34class HWAccel;
35
40
42 const AVCaptureConnection *)>;
43
44}
45
46QT_END_NAMESPACE
47
48// This type is used by screencapture and camera-capture.
49@interface QAVFSampleBufferDelegate : NSObject <AVCaptureVideoDataOutputSampleBufferDelegate>
50
51// These parameters are called during the captureOutput callback.
52//
53// The handler parameter is called at the end, when the QVideoFrame is constructed and configured.
54//
55// The modifier is called to modify the frame before it is finally sent to the handler.
56// This can be used to i.e add metadata to the frame.
57- (instancetype)initWithFrameHandler:(std::function<void(const QVideoFrame &)>)handler;
58
59// Clears the frame handler, so future samples are discarded.
60// Not thread safe.
61- (void)discardFutureSamples;
62
63// Allows the object to update the QVideoFrame metadata based on rotatation and mirroring.
64// This does NOT rotate the pixel buffer.
65- (void)setTransformationProvider:
66 (const QT_PREPEND_NAMESPACE(QFFmpeg::QAVFSampleBufferDelegateTransformProvider) &)provider;
67
68- (void)captureOutput:(AVCaptureOutput *)captureOutput
69 didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer
70 fromConnection:(AVCaptureConnection *)connection;
71
72- (void)setHWAccel:(std::unique_ptr<QT_PREPEND_NAMESPACE(QFFmpeg::HWAccel)> &&)accel;
73
74- (void)setVideoFormatFrameRate:(qreal)frameRate;
75
76@end
77
78#endif
std::function< QAVFSampleBufferDelegateTransform( const AVCaptureConnection *)> QAVFSampleBufferDelegateTransformProvider
std::conditional_t< QT_FFMPEG_AVIO_WRITE_CONST, const uint8_t *, uint8_t * > AvioWriteBufferType