Skip to content

Commit

Permalink
Merge pull request #508 from g-maxime/container-data
Browse files Browse the repository at this point in the history
'Provide QAVPlayer::avctx API
  • Loading branch information
valbok authored Dec 21, 2024
2 parents f11e0cd + 4e8767f commit c2cd8d3
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/QtAVPlayer/qavdemuxer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,12 @@ bool QAVDemuxer::setSubtitleStreams(const QList<QAVStream> &streams)
d->currentSubtitleStreams);
}

AVFormatContext *QAVDemuxer::avctx() const
{
Q_D(const QAVDemuxer);
return d->ctx;
}

void QAVDemuxer::unload()
{
Q_D(QAVDemuxer);
Expand Down
2 changes: 2 additions & 0 deletions src/QtAVPlayer/qavdemuxer_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ class QAVDemuxer
QList<QAVStream> currentSubtitleStreams() const;
bool setSubtitleStreams(const QList<QAVStream> &streams);

AVFormatContext *avctx() const;

QAVPacket read();

void decode(const QAVPacket &pkt, QList<QAVFrame> &frames) const;
Expand Down
6 changes: 6 additions & 0 deletions src/QtAVPlayer/qavplayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1005,6 +1005,12 @@ void QAVPlayer::setSubtitleStreams(const QList<QAVStream> &streams)
Q_EMIT subtitleStreamsChanged(d->demuxer.currentSubtitleStreams());
}

AVFormatContext *QAVPlayer::avctx() const
{
Q_D(const QAVPlayer);
return d->demuxer.avctx();
}

QAVPlayer::State QAVPlayer::state() const
{
Q_D(const QAVPlayer);
Expand Down
3 changes: 3 additions & 0 deletions src/QtAVPlayer/qavplayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

QT_BEGIN_NAMESPACE

struct AVFormatContext;
class QAVIODevice;
class QAVPlayerPrivate;
class QAVPlayer : public QObject
Expand Down Expand Up @@ -71,6 +72,8 @@ class QAVPlayer : public QObject
void setSubtitleStream(const QAVStream &stream);
void setSubtitleStreams(const QList<QAVStream> &streams);

AVFormatContext *avctx() const;

State state() const;
MediaStatus mediaStatus() const;
qint64 duration() const;
Expand Down

0 comments on commit c2cd8d3

Please sign in to comment.