Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Daniel Nachbaur <daniel.nachbaur@epfl.ch>

cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
project(Deflect VERSION 0.12.0)
project(Deflect VERSION 0.12.1)
set(Deflect_VERSION_ABI 5)

list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMake
Expand Down
13 changes: 11 additions & 2 deletions apps/DesktopStreamer/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
#include <QMessageBox>
#include <QPainter>
#include <QScreen>
#include <QToolTip>

#include <algorithm>
#include <cmath>
Expand Down Expand Up @@ -109,6 +110,11 @@ MainWindow::MainWindow()
connect( _remoteControlCheckBox, &QCheckBox::clicked,
this, &MainWindow::_onStreamEventsBoxClicked );

connect( _qualitySlider, &QSlider::valueChanged, []( const int value )
{
QToolTip::showText( QCursor::pos(), QString::number( value ) + "/100" );
});

connect( _actionAdvancedSettings, &QAction::triggered,
this, &MainWindow::_showAdvancedSettings );

Expand Down Expand Up @@ -242,6 +248,9 @@ void MainWindow::_showAdvancedSettings( const bool visible )

_streamIdLineEdit->setVisible( visible );
_streamIdLabel->setVisible( visible );

_qualitySlider->setVisible( visible );
_qualityLabel->setVisible( visible );
}

void MainWindow::_updateStreams()
Expand Down Expand Up @@ -359,12 +368,12 @@ void MainWindow::_shareDesktopUpdate()

for( auto i = _streams.begin(); i != _streams.end(); )
{
const std::string& error = i->second->update();
const auto error = i->second->update( _qualitySlider->value( ));
if( error.empty( ))
++i;
else
{
_statusbar->showMessage( QString( error.c_str( )));
_statusbar->showMessage( QString::fromStdString( error ));
i = _streams.erase( i );
}
}
Expand Down
23 changes: 23 additions & 0 deletions apps/DesktopStreamer/MainWindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,29 @@
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="_qualityLabel">
<property name="text">
<string>JPEG quality</string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QSlider" name="_qualitySlider">
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>100</number>
</property>
<property name="value">
<number>75</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
</layout>
</item>
</layout>
Expand Down
7 changes: 4 additions & 3 deletions apps/DesktopStreamer/Stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ bool processEvents( const bool interact )
return true;
}

std::string update()
std::string update( const int quality )
{
QPixmap pixmap;

Expand Down Expand Up @@ -169,6 +169,7 @@ std::string update()
image.width(), image.height(),
deflect::BGRA );
deflectImage.compressionPolicy = deflect::COMPRESSION_ON;
deflectImage.compressionQuality = std::max( 1, std::min( quality, 100 ));

if( !_stream.send( deflectImage ) || !_stream.finishFrame( ))
return "Streaming failure, connection closed";
Expand Down Expand Up @@ -279,9 +280,9 @@ Stream::Stream( const MainWindow& parent, const QPersistentModelIndex window,
Stream::~Stream()
{}

std::string Stream::update()
std::string Stream::update( const int quality )
{
return _impl->update();
return _impl->update( quality );
}

bool Stream::processEvents( const bool interact )
Expand Down
3 changes: 2 additions & 1 deletion apps/DesktopStreamer/Stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,10 @@ class Stream : public deflect::Stream

/**
* Send an update to the server.
* @param quality the quality setting for compression [1; 100]
* @return an empty string on success, the error message otherwise.
*/
std::string update();
std::string update( int quality );

/**
* Process all pending events.
Expand Down
5 changes: 5 additions & 0 deletions doc/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ Changelog {#Changelog}

## Deflect 0.12

### 0.12.1 (git master)

* [145](https://github.com/BlueBrain/Deflect/pull/145):
DesktopStreamer: new slider to adjust the JPEG quality in advanced settings.

### 0.12.0 (09-12-2016)

* [143](https://github.com/BlueBrain/Deflect/pull/143):
Expand Down