File indexing completed on 2025-01-19 03:57:04

0001 /*********************************************************
0002  * Copyright (C) 2020, Val Doroshchuk <valbok@gmail.com> *
0003  *                                                       *
0004  * This file is part of QtAVPlayer.                      *
0005  * Free Qt Media Player based on FFmpeg.                 *
0006  *********************************************************/
0007 
0008 #ifndef QAVHWDEVICE_P_H
0009 #define QAVHWDEVICE_P_H
0010 
0011 //
0012 //  W A R N I N G
0013 //  -------------
0014 //
0015 // This file is not part of the Qt API. It exists purely as an
0016 // implementation detail. This header file may change from version to
0017 // version without notice, or even be removed.
0018 //
0019 // We mean it.
0020 //
0021 
0022 #include "qavvideoframe.h"
0023 #include "qtavplayerglobal.h"
0024 
0025 extern "C" {
0026 #include <libavformat/avformat.h>
0027 #include <libavutil/hwcontext.h>
0028 }
0029 
0030 QT_BEGIN_NAMESPACE
0031 
0032 struct AVCodecContext;
0033 class QAVVideoBuffer;
0034 class QAVHWDevice
0035 {
0036 public:
0037     QAVHWDevice() = default;
0038     virtual ~QAVHWDevice() = default;
0039 
0040     virtual void init(AVCodecContext *) { }
0041     virtual AVPixelFormat format() const = 0;
0042     virtual AVHWDeviceType type() const = 0;
0043     virtual QAVVideoBuffer *videoBuffer(const QAVVideoFrame &frame) const = 0;
0044 
0045 private:
0046     Q_DISABLE_COPY(QAVHWDevice)
0047 };
0048 
0049 QT_END_NAMESPACE
0050 
0051 #endif