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

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 QAVSTREAMFRAME_H
0009 #define QAVSTREAMFRAME_H
0010 
0011 #include <QtAVPlayer/qtavplayerglobal.h>
0012 #include <QtAVPlayer/qavstream.h>
0013 #include <memory>
0014 
0015 QT_BEGIN_NAMESPACE
0016 
0017 class QAVStreamFramePrivate;
0018 class QAVStreamFrame
0019 {
0020 public:
0021     QAVStreamFrame();
0022     QAVStreamFrame(const QAVStreamFrame &other);
0023     ~QAVStreamFrame();
0024     QAVStreamFrame &operator=(const QAVStreamFrame &other);
0025 
0026     QAVStream stream() const;
0027     void setStream(const QAVStream &stream);
0028     operator bool() const;
0029 
0030     double pts() const;
0031     double duration() const;
0032 
0033     // Receives a data from the codec from the stream
0034     int receive();
0035 
0036 protected:
0037     QAVStreamFrame(QAVStreamFramePrivate &d);
0038 
0039     std::unique_ptr<QAVStreamFramePrivate> d_ptr;
0040     Q_DECLARE_PRIVATE(QAVStreamFrame)
0041 };
0042 
0043 QT_END_NAMESPACE
0044 
0045 #endif