Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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, AVFormatContext *formatContext,
33 std::unique_ptr<QFFmpeg::HWAccel> hwAccel);
35 AVCodecContextUPtr context;
36 AVStream *stream = nullptr;
37 AVRational pixelAspectRatio = { 0, 1 };
38 std::unique_ptr<QFFmpeg::HWAccel> hwAccel;
39 };
40
41public:
42 static QMaybe<Codec> create(AVStream *stream, AVFormatContext *formatContext);
43
44 AVRational pixelAspectRatio(AVFrame *frame) const;
45
46 AVCodecContext *context() const { return d->context.get(); }
47 AVStream *stream() const { return d->stream; }
48 uint streamIndex() const { return d->stream->index; }
49 HWAccel *hwAccel() const { return d->hwAccel.get(); }
50 qint64 toMs(qint64 ts) const { return timeStampMs(ts, d->stream->time_base).value_or(0); }
51 qint64 toUs(qint64 ts) const { return timeStampUs(ts, d->stream->time_base).value_or(0); }
52
53private:
54 Codec(Data *data) : d(data) { }
55 QExplicitlySharedDataPointer<Data> d;
56};
57
58} // namespace QFFmpeg
59
61
62#endif // QFFMPEGCODEC_P_H
\inmodule QtCore
Definition qatomic.h:112
AVStream * stream() const
AVRational pixelAspectRatio(AVFrame *frame) 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:144
std::optional< qint64 > timeStampMs(qint64 ts, AVRational base)
Definition qffmpeg_p.h:49
std::optional< qint64 > timeStampUs(qint64 ts, AVRational base)
Definition qffmpeg_p.h:54
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:34
long long qint64
Definition qtypes.h:60
QFrame frame
[0]
view create()