vlc | branch: master | David Fuhrmann <[email protected]> | Wed May  9 
18:47:00 2018 +0200| [79871d5ba02fdab121fc7f5d721f1aa0ee233133] | committer: 
David Fuhrmann

macosx: Add option to disable hardware accel. to simple preference

Add option to simple prefs for enabling or disabling the videotoolbox
hardware acceleration decoder.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=79871d5ba02fdab121fc7f5d721f1aa0ee233133
---

 modules/gui/macosx/UI/SimplePreferences.xib   | 35 +++++++++++++++++++--------
 modules/gui/macosx/VLCSimplePrefsController.h |  1 +
 modules/gui/macosx/VLCSimplePrefsController.m |  5 ++++
 3 files changed, 31 insertions(+), 10 deletions(-)

diff --git a/modules/gui/macosx/UI/SimplePreferences.xib 
b/modules/gui/macosx/UI/SimplePreferences.xib
index 036ed61910..9723f8ae6d 100644
--- a/modules/gui/macosx/UI/SimplePreferences.xib
+++ b/modules/gui/macosx/UI/SimplePreferences.xib
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" 
toolsVersion="10117" systemVersion="17D102" targetRuntime="MacOSX.Cocoa" 
propertyAccessControl="none" useAutolayout="YES">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" 
toolsVersion="10117" systemVersion="17E202" targetRuntime="MacOSX.Cocoa" 
propertyAccessControl="none" useAutolayout="YES">
     <dependencies>
         <development version="7000" identifier="xcode"/>
         <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" 
version="10117"/>
@@ -48,6 +48,7 @@
                 <outlet property="input_cachelevelPopup" destination="2580" 
id="lts-mx-3Kh"/>
                 <outlet property="input_cachelevel_customLabel" 
destination="3162" id="fbZ-oF-HKW"/>
                 <outlet property="input_cachingBox" destination="2572" 
id="EC7-3Y-jc1"/>
+                <outlet property="input_hardwareAccelerationCheckbox" 
destination="E3R-AI-QGD" id="I73-W4-R8Y"/>
                 <outlet property="input_muxBox" destination="2585" 
id="Yng-39-8zd"/>
                 <outlet property="input_netBox" destination="2563" 
id="xSD-ks-oYK"/>
                 <outlet property="input_postprocLabel" destination="2592" 
id="Qs8-Ac-u30"/>
@@ -1294,10 +1295,10 @@ Gw
             <point key="canvasLocation" x="265" y="1524.5"/>
         </customView>
         <customView translatesAutoresizingMaskIntoConstraints="NO" id="2562" 
userLabel="Input &amp; Codecs">
-            <rect key="frame" x="0.0" y="0.0" width="572" height="422"/>
+            <rect key="frame" x="0.0" y="0.0" width="572" height="452"/>
             <subviews>
                 <box title="Record directory or filename" borderType="line" 
translatesAutoresizingMaskIntoConstraints="NO" id="3623">
-                    <rect key="frame" x="17" y="342" width="538" height="60"/>
+                    <rect key="frame" x="17" y="372" width="538" height="60"/>
                     <view key="contentView" id="7b2-vV-8CM">
                         <rect key="frame" x="1" y="1" width="536" height="44"/>
                         <autoresizingMask key="autoresizingMask" 
widthSizable="YES" heightSizable="YES"/>
@@ -1341,7 +1342,7 @@ Gw
                     </constraints>
                 </box>
                 <box title="Network" 
translatesAutoresizingMaskIntoConstraints="NO" id="2563">
-                    <rect key="frame" x="17" y="276" width="538" height="62"/>
+                    <rect key="frame" x="17" y="306" width="538" height="62"/>
                     <view key="contentView" id="1lv-cw-XiH">
                         <rect key="frame" x="2" y="2" width="534" height="45"/>
                         <autoresizingMask key="autoresizingMask" 
widthSizable="YES" heightSizable="YES"/>
@@ -1368,7 +1369,7 @@ Gw
                     </constraints>
                 </box>
                 <box title="Caching" 
translatesAutoresizingMaskIntoConstraints="NO" id="2572">
-                    <rect key="frame" x="17" y="183" width="538" height="88"/>
+                    <rect key="frame" x="17" y="213" width="538" height="88"/>
                     <view key="contentView" id="deK-kX-Lvr">
                         <rect key="frame" x="2" y="2" width="534" height="71"/>
                         <autoresizingMask key="autoresizingMask" 
widthSizable="YES" heightSizable="YES"/>
@@ -1425,9 +1426,9 @@ Gw
                     </view>
                 </box>
                 <box title="Codecs / Muxers" 
translatesAutoresizingMaskIntoConstraints="NO" id="2585">
-                    <rect key="frame" x="17" y="16" width="538" height="160"/>
+                    <rect key="frame" x="17" y="16" width="538" height="190"/>
                     <view key="contentView" id="30i-kg-rYI">
-                        <rect key="frame" x="2" y="2" width="534" 
height="143"/>
+                        <rect key="frame" x="2" y="2" width="534" 
height="173"/>
                         <autoresizingMask key="autoresizingMask" 
widthSizable="YES" heightSizable="YES"/>
                         <subviews>
                             <textField horizontalHuggingPriority="251" 
verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" 
id="2592">
@@ -1525,6 +1526,16 @@ Gw
                                     <action selector="inputSettingChanged:" 
target="-2" id="I6O-un-hHx"/>
                                 </connections>
                             </popUpButton>
+                            <button 
translatesAutoresizingMaskIntoConstraints="NO" id="E3R-AI-QGD">
+                                <rect key="frame" x="14" y="145" width="201" 
height="18"/>
+                                <buttonCell key="cell" type="check" 
title="Enable hardware acceleration" bezelStyle="regularSquare" 
imagePosition="left" state="on" inset="2" id="atu-5u-S8s">
+                                    <behavior key="behavior" 
changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
+                                    <font key="font" metaFont="system"/>
+                                </buttonCell>
+                                <connections>
+                                    <action selector="inputSettingChanged:" 
target="-2" id="FzO-lc-XLf"/>
+                                </connections>
+                            </button>
                         </subviews>
                         <constraints>
                             <constraint firstItem="2589" 
firstAttribute="centerY" secondItem="2587" secondAttribute="centerY" 
id="4D0-CS-wLd"/>
@@ -1532,22 +1543,26 @@ Gw
                             <constraint firstItem="3434" 
firstAttribute="leading" secondItem="2593" secondAttribute="leading" 
id="DbT-Jq-Nxe"/>
                             <constraint firstItem="2592" 
firstAttribute="centerY" secondItem="2587" secondAttribute="centerY" 
id="Fkm-jR-oMF"/>
                             <constraint firstItem="2594" 
firstAttribute="leading" secondItem="2593" secondAttribute="trailing" 
constant="17" id="H8f-vv-gko"/>
+                            <constraint firstAttribute="trailing" 
relation="greaterThanOrEqual" secondItem="lem-yf-jZB" 
secondAttribute="trailing" constant="16" id="HZA-Ho-JPS"/>
                             <constraint firstAttribute="trailing" 
secondItem="2589" secondAttribute="trailing" constant="17" id="HmN-hM-nt0"/>
                             <constraint firstItem="lem-yf-jZB" 
firstAttribute="leading" secondItem="3434" secondAttribute="leading" 
id="IpM-8a-E67"/>
                             <constraint firstItem="2593" firstAttribute="top" 
secondItem="2592" secondAttribute="bottom" constant="16" id="JOz-5x-WGX"/>
                             <constraint firstItem="lem-yf-jZB" 
firstAttribute="top" secondItem="3434" secondAttribute="bottom" constant="16" 
id="RYW-Uf-buV"/>
                             <constraint firstItem="3434" firstAttribute="top" 
secondItem="2593" secondAttribute="bottom" constant="16" id="Tam-yC-51c"/>
+                            <constraint firstAttribute="trailing" 
relation="greaterThanOrEqual" secondItem="E3R-AI-QGD" 
secondAttribute="trailing" constant="16" id="UeL-aj-4Ov"/>
+                            <constraint firstItem="E3R-AI-QGD" 
firstAttribute="top" secondItem="30i-kg-rYI" secondAttribute="top" 
constant="12" id="Uiy-Rc-Z9G"/>
                             <constraint firstItem="3435" 
firstAttribute="width" secondItem="2594" secondAttribute="width" 
id="V0T-ah-xQd"/>
                             <constraint firstItem="3434" 
firstAttribute="centerY" secondItem="3435" secondAttribute="centerY" 
id="WV5-Nx-zJo"/>
-                            <constraint firstItem="2592" 
firstAttribute="leading" secondItem="30i-kg-rYI" secondAttribute="leading" 
constant="16" id="dQB-hm-G2h"/>
+                            <constraint firstItem="E3R-AI-QGD" 
firstAttribute="leading" secondItem="2592" secondAttribute="leading" 
id="Y0f-uz-v0S"/>
+                            <constraint firstItem="2592" firstAttribute="top" 
secondItem="E3R-AI-QGD" secondAttribute="bottom" constant="16" id="b0d-c4-Hi8"/>
                             <constraint firstItem="3435" 
firstAttribute="leading" secondItem="3434" secondAttribute="trailing" 
constant="17" id="eZZ-2v-na1"/>
                             <constraint firstItem="3435" 
firstAttribute="leading" secondItem="2594" secondAttribute="leading" 
id="h44-ac-8ao"/>
-                            <constraint firstItem="2592" firstAttribute="top" 
secondItem="30i-kg-rYI" secondAttribute="top" constant="12" id="hWU-Qa-oAW"/>
                             <constraint firstItem="2587" 
firstAttribute="leading" secondItem="2592" secondAttribute="trailing" 
constant="17" id="ihi-eb-hxM"/>
                             <constraint firstItem="2593" 
firstAttribute="centerY" secondItem="2594" secondAttribute="centerY" 
id="jae-OS-C7i"/>
                             <constraint firstAttribute="bottom" 
secondItem="lem-yf-jZB" secondAttribute="bottom" constant="18" id="jtV-Af-m7f"/>
                             <constraint firstItem="2589" 
firstAttribute="leading" secondItem="2587" secondAttribute="trailing" 
constant="8" id="pEK-ey-Plq"/>
                             <constraint firstItem="2593" 
firstAttribute="leading" secondItem="2592" secondAttribute="leading" 
id="raR-vS-fzh"/>
+                            <constraint firstItem="E3R-AI-QGD" 
firstAttribute="leading" secondItem="30i-kg-rYI" secondAttribute="leading" 
constant="16" id="v2C-3E-DlJ"/>
                         </constraints>
                     </view>
                 </box>
@@ -2058,7 +2073,7 @@ Gw
                         </textFieldCell>
                     </textField>
                     <textField verticalHuggingPriority="750" 
translatesAutoresizingMaskIntoConstraints="NO" id="2803">
-                        <rect key="frame" x="112" y="54" width="217" 
height="14"/>
+                        <rect key="frame" x="112" y="54" width="218" 
height="14"/>
                         <textFieldCell key="cell" controlSize="small" 
lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" alignment="center" 
title="This combination is already taken by %s" usesSingleLineMode="YES" 
id="3531">
                             <font key="font" metaFont="smallSystem"/>
                             <color key="textColor" name="controlShadowColor" 
catalog="System" colorSpace="catalog"/>
diff --git a/modules/gui/macosx/VLCSimplePrefsController.h 
b/modules/gui/macosx/VLCSimplePrefsController.h
index 926feddeb5..ba4c5db670 100644
--- a/modules/gui/macosx/VLCSimplePrefsController.h
+++ b/modules/gui/macosx/VLCSimplePrefsController.h
@@ -85,6 +85,7 @@
 @property (readwrite, weak) IBOutlet NSBox *input_cachingBox;
 @property (readwrite, weak) IBOutlet NSBox *input_muxBox;
 @property (readwrite, weak) IBOutlet NSBox *input_netBox;
+@property (readwrite, weak) IBOutlet NSButton 
*input_hardwareAccelerationCheckbox;
 @property (readwrite, weak) IBOutlet NSTextField *input_postprocTextField;
 @property (readwrite, weak) IBOutlet NSTextField *input_postprocLabel;
 @property (readwrite, weak) IBOutlet NSTextField *input_skipLoopLabel;
diff --git a/modules/gui/macosx/VLCSimplePrefsController.m 
b/modules/gui/macosx/VLCSimplePrefsController.m
index bfd7183f83..feae10dabf 100644
--- a/modules/gui/macosx/VLCSimplePrefsController.m
+++ b/modules/gui/macosx/VLCSimplePrefsController.m
@@ -294,6 +294,7 @@ create_toolbar_item(NSString *itemIdent, NSString *name, 
NSString *desc, NSStrin
     [_input_cachelevel_customLabel setStringValue: _NS("Use the complete 
preferences to configure custom caching values for each access module.")];
     [_input_muxBox setTitle: _NS("Codecs / Muxers")];
     [_input_netBox setTitle: _NS("Network")];
+    [_input_hardwareAccelerationCheckbox setTitle: _NS("Enable hardware 
acceleration")];
     [_input_postprocLabel setStringValue: _NS("Post-Processing Quality")];
     [_input_skipLoopLabel setStringValue: _NS("Skip the loop filter for H.264 
decoding")];
     [_input_urlhandlerButton setTitle: _NS("Edit default application settings 
for network protocols")];
@@ -677,6 +678,8 @@ static inline const char * __config_GetLabel(vlc_object_t 
*p_this, const char *p
      * input & codecs settings *
      ***************************/
     [self setupField:_input_recordTextField forOption:"input-record-path"];
+
+    [self setupButton:_input_hardwareAccelerationCheckbox forBoolValue: 
"videotoolbox"];
     [_input_postprocTextField setIntValue: config_GetInt("postproc-q")];
     [_input_postprocTextField setToolTip: _NS(config_GetLabel(p_intf, 
"postproc-q"))];
     [self setupButton:_input_skipFramesCheckbox forBoolValue: "skip-frames"];
@@ -993,6 +996,8 @@ static inline void save_string_list(intf_thread_t * p_intf, 
id object, const cha
      ***************************/
     if (_inputSettingChanged) {
         config_PutPsz("input-record-path", [[_input_recordTextField 
stringValue] UTF8String]);
+
+        config_PutInt("videotoolbox", [_input_hardwareAccelerationCheckbox 
state]);
         config_PutInt("postproc-q", [_input_postprocTextField intValue]);
         config_PutInt("skip-frames", [_input_skipFramesCheckbox state]);
 

_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to