Skip to content

Commit

Permalink
Bump to ffmepg 2.8.6, fixed volume range, added duration changed signal.
Browse files Browse the repository at this point in the history
  • Loading branch information
carlonluca committed Mar 18, 2016
1 parent 6320659 commit 1ee342a
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ OpenMAXILPlayerControl::OpenMAXILPlayerControl(QObject *parent)
this, SLOT(onMediaStatusChanged(OMX_MediaProcessor::OMX_MediaStatus)));
connect(m_mediaProcessor, SIGNAL(metadataChanged(QVariantMap)),
this, SIGNAL(metaDataChanged(QVariantMap)));
connect(m_mediaProcessor, SIGNAL(streamLengthChanged(qint64)),
this, SIGNAL(durationChanged(qint64)));
}

/*------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion piomxtextures_samples/video_simple.qml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Rectangle {
Qt.quit();
}

uri = arguments[2];
uri = arguments[1];
}

Video {
Expand Down
12 changes: 11 additions & 1 deletion piomxtextures_src/omx_mediaprocessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ OMX_MediaProcessor::OMX_MediaProcessor(OMX_EGLBufferProviderSh provider) :
m_pendingPause(false),
m_subtitle_index(0),
m_audio_index(0),
m_streamLength(0),
m_incrMs(0),
m_audioConfig(new OMXAudioConfig()),
m_videoConfig(new OMXVideoConfig()),
Expand Down Expand Up @@ -449,6 +450,15 @@ bool OMX_MediaProcessor::setFilenameInt(const QString& filename)
}

setState(STATE_STOPPED);

const qint64 streamLength = this->streamLength();
log_debug("New stream length: %lld.", streamLength);

if (m_streamLength != streamLength) {
m_streamLength = streamLength;
emit streamLengthChanged(streamLength);
}

return true;
}

Expand Down Expand Up @@ -654,7 +664,7 @@ void OMX_MediaProcessor::setVolume(long volume, bool linear)
{
QMutexLocker locker(&m_sendCmd);

#define VOL_MAX 2
#define VOL_MAX 1
#define VOL_MIN 0

m_volume = volume/100.0*(VOL_MAX - VOL_MIN);
Expand Down
2 changes: 2 additions & 0 deletions piomxtextures_src/omx_mediaprocessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ public slots:
void errorOccurred(OMX_MediaProcessor::OMX_MediaProcessorError error);
void stateChanged(OMX_MediaProcessor::OMX_MediaProcessorState state);
void mediaStatusChanged(OMX_MediaProcessor::OMX_MediaStatus status);
void streamLengthChanged(qint64 length);

private slots:
void init();
Expand Down Expand Up @@ -227,6 +228,7 @@ private slots:

int m_subtitle_index;
int m_audio_index;
int m_streamLength;

QMutex m_mutexPending;
QWaitCondition m_waitPendingCommand;
Expand Down
2 changes: 1 addition & 1 deletion piomxtextures_tools/compile_ffmpeg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ fi

cd 3rdparty/ffmpeg
rm -rf ffmpeg_src
git clone git://source.ffmpeg.org/ffmpeg ffmpeg_src -bn2.8.5 --depth=1
git clone git://source.ffmpeg.org/ffmpeg ffmpeg_src -bn2.8.6 --depth=1
cd ffmpeg_src;

export PATH="$COMPILER_PATH":$PATH
Expand Down

0 comments on commit 1ee342a

Please sign in to comment.