Commit 0a54fa8d authored by Kateryna Kostiuk's avatar Kateryna Kostiuk Committed by Philippe Gorley

Hardware acceleration: add UI

Add checkbox to toggle hardware acceleration in video preferences
Reviewed-by: Philippe Gorley's avatarPhilippe Gorley <philippe.gorley@savoirfairelinux.com>

Change-Id: I4c4b26ceac05e407cbaee5e68920db844c63147d
parent 3420b858
......@@ -36,6 +36,7 @@
@property (assign) IBOutlet NSPopUpButton* videoDevicesList;
@property (assign) IBOutlet NSPopUpButton* sizesList;
@property (assign) IBOutlet NSPopUpButton* ratesList;
@property (assign) IBOutlet NSButton *enableHardwareAccelerationButton;
@property BOOL shouldHandlePreview;
......@@ -111,6 +112,9 @@ QMetaObject::Connection previewStopped;
[previewView.layer setContentsGravity:kCAGravityResizeAspect];
[previewView.layer setFrame:previewView.frame];
[previewView.layer setBounds:previewView.frame];
[self.enableHardwareAccelerationButton setState:Video::ConfigurationProxy::getDecodingAccelerated()];
}
- (IBAction)chooseDevice:(id)sender {
......@@ -131,6 +135,11 @@ QMetaObject::Connection previewStopped;
Video::ConfigurationProxy::rateSelectionModel().setCurrentIndex(qIdx, QItemSelectionModel::ClearAndSelect);
}
- (IBAction)toggleHardwareAcceleration:(NSButton *)sender {
bool enabled = [sender state]==NSOnState;
Video::ConfigurationProxy::setDecodingAccelerated(enabled);
}
- (void) connectPreviewSignals
{
QObject::disconnect(frameUpdated);
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment