Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qffmpegcodec_p.h
Go to the documentation of this file.
1// Copyright (C) 2021 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 QFFMPEGCODEC_P_H
5#define QFFMPEGCODEC_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#include "qshareddata.h"
19#include "qqueue.h"
20#include "private/qmultimediautils_p.h"
21#include "qffmpeg_p.h"
22#include "qffmpeghwaccel_p.h"
23
25
26namespace QFFmpeg {
27
28class Codec
29{
30 struct Data
31 {
32 Data(AVCodecContextUPtr context, AVStream *stream,
33 std::unique_ptr<QFFmpeg::HWAccel> hwAccel);
34 ~Data();
36 AVCodecContextUPtr context;
37 AVStream *stream = nullptr;
38 std::unique_ptr<QFFmpeg::HWAccel> hwAccel;
39 };
40
41public:
42 static QMaybe<Codec> create(AVStream *);
43
44 AVCodecContext *context() const { return d->context.get(); }
45 AVStream *stream() const { return d->stream; }
46 uint streamIndex() const { return d->stream->index; }
47 HWAccel *hwAccel() const { return d->hwAccel.get(); }
48 qint64 toMs(qint64 ts) const { return timeStampMs(ts, d->stream->time_base).value_or(0); }
49 qint64 toUs(qint64 ts) const { return timeStampUs(ts, d->stream->time_base).value_or(0); }
50
51private:
52 Codec(Data *data) : d(data) { }
54};
55
56} // namespace QFFmpeg
57
59
60#endif // QFFMPEGCODEC_P_H
\inmodule QtCore
Definition qatomic.h:112
T * get() const noexcept
AVStream * stream() const
AVCodecContext * context() const
qint64 toMs(qint64 ts) const
qint64 toUs(qint64 ts) const
uint streamIndex() const
HWAccel * hwAccel() const
std::unique_ptr< AVCodecContext, AVDeleter< decltype(&avcodec_free_context), &avcodec_free_context > > AVCodecContextUPtr
Definition qffmpeg_p.h:129
std::optional< qint64 > timeStampMs(qint64 ts, AVRational base)
Definition qffmpeg_p.h:41
std::optional< qint64 > timeStampUs(qint64 ts, AVRational base)
Definition qffmpeg_p.h:46
Combined button and popup list for selecting options.
EGLStreamKHR stream
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLint ref
unsigned int uint
Definition qtypes.h:29
long long qint64
Definition qtypes.h:55
view create()