Ignore:
Timestamp:
May 3, 2016, 5:25:45 PM (9 years ago)
Author:
Silvan Scherrer
Message:

smplayer: update trunk to version 16.4

Location:
smplayer/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • smplayer/trunk

  • smplayer/trunk/src/prefperformance.cpp

    r165 r176  
    11/*  smplayer, GUI front-end for mplayer.
    2     Copyright (C) 2006-2014 Ricardo Villalba <rvm@users.sourceforge.net>
     2    Copyright (C) 2006-2016 Ricardo Villalba <rvm@users.sourceforge.net>
    33
    44    This program is free software; you can redistribute it and/or modify
     
    2222#include "global.h"
    2323#include "preferences.h"
    24 
    25 #ifdef YOUTUBE_SUPPORT
    26 #include "retrieveyoutubeurl.h"
    27 #endif
     24#include "playerid.h"
    2825
    2926using namespace Global;
     
    3431        setupUi(this);
    3532
     33        hwdec_combo->addItem(tr("None"), "no");
     34        hwdec_combo->addItem(tr("Auto"), "auto");
     35        #ifdef Q_OS_LINUX
     36        hwdec_combo->addItem("vdpau", "vdpau");
     37        hwdec_combo->addItem("vaapi", "vaapi");
     38        hwdec_combo->addItem("vaapi-copy", "vaapi-copy");
     39        #endif
     40        #ifdef Q_OS_OSX
     41        hwdec_combo->addItem("vda", "vda");
     42        #endif
     43        #ifdef Q_OS_WIN
     44        hwdec_combo->addItem("dxva2-copy", "dxva2-copy");
     45        #endif
     46
    3647        // Priority is only for windows, so we disable for other systems
    3748#ifndef Q_OS_WIN
     
    4354#endif
    4455
    45 #ifdef YOUTUBE_SUPPORT
    46         yt_quality_combo->addItem( "240p (flv)", RetrieveYoutubeUrl::FLV_240p );
    47 
    48         yt_quality_combo->addItem( "360p (flv)", RetrieveYoutubeUrl::FLV_360p );
    49         yt_quality_combo->addItem( "360p (mp4)", RetrieveYoutubeUrl::MP4_360p );
    50         yt_quality_combo->addItem( "360p (webm)", RetrieveYoutubeUrl::WEBM_360p );
    51 
    52         yt_quality_combo->addItem( "480p (flv)", RetrieveYoutubeUrl::FLV_480p );
    53         yt_quality_combo->addItem( "480p (webm)", RetrieveYoutubeUrl::WEBM_480p );
    54 
    55         yt_quality_combo->addItem( "720p (mp4)", RetrieveYoutubeUrl::MP4_720p );
    56         yt_quality_combo->addItem( "720p (webm)", RetrieveYoutubeUrl::WEBM_720p );
    57 
    58         yt_quality_combo->addItem( "1080p (mp4)", RetrieveYoutubeUrl::MP4_1080p );
    59         yt_quality_combo->addItem( "1080p (webm)", RetrieveYoutubeUrl::WEBM_1080p );
    60 #else
    61         yt_label->hide();
    62         yt_quality_combo->hide();
    63         yt_line->hide();
     56#ifndef OBSOLETE_FAST_AUDIO_CHANGE
     57        fast_audio_label->hide();
     58        fast_audio_combo->hide();
    6459#endif
    6560
     
    113108        setFastChapterSeeking( pref->fast_chapter_change );
    114109#endif
     110#ifdef OBSOLETE_FAST_AUDIO_CHANGE
    115111        setFastAudioSwitching( pref->fast_audio_change );
     112#endif
    116113        setThreads( pref->threads );
    117 
    118 #ifdef YOUTUBE_SUPPORT
    119         setYTQuality( pref->yt_quality );
    120 #endif
     114        setHwdec( pref->hwdec );
    121115}
    122116
     
    139133        TEST_AND_SET(pref->fast_chapter_change, fastChapterSeeking());
    140134#endif
     135#ifdef OBSOLETE_FAST_AUDIO_CHANGE
    141136        pref->fast_audio_change = fastAudioSwitching();
     137#endif
    142138        TEST_AND_SET(pref->threads, threads());
    143 
    144 #ifdef YOUTUBE_SUPPORT
    145         pref->yt_quality = YTQuality();
    146 #endif
     139        TEST_AND_SET(pref->hwdec, hwdec());
    147140}
    148141
     
    245238#endif
    246239
     240#ifdef OBSOLETE_FAST_AUDIO_CHANGE
    247241void PrefPerformance::setFastAudioSwitching(Preferences::OptionState value) {
    248242        fast_audio_combo->setState(value);
     
    252246        return fast_audio_combo->state();
    253247}
     248#endif
    254249
    255250void PrefPerformance::setThreads(int v) {
     
    261256}
    262257
    263 #ifdef YOUTUBE_SUPPORT
    264 void PrefPerformance::setYTQuality(int q) {
    265         yt_quality_combo->setCurrentIndex(yt_quality_combo->findData(q));
    266 }
    267 
    268 int PrefPerformance::YTQuality() {
    269         int index = yt_quality_combo->currentIndex();
    270     return yt_quality_combo->itemData(index).toInt();
    271 }
    272 #endif
     258void PrefPerformance::setHwdec(const QString & v) {
     259        int idx = hwdec_combo->findData(v);
     260        if (idx < 0) idx = 0;
     261        hwdec_combo->setCurrentIndex(idx);
     262}
     263
     264QString PrefPerformance::hwdec() {
     265        int idx = hwdec_combo->currentIndex();
     266        return hwdec_combo->itemData(idx).toString();
     267}
    273268
    274269void PrefPerformance::createHelp() {
     
    280275#ifdef Q_OS_WIN
    281276        setWhatsThis(priority_combo, tr("Priority"),
    282                 tr("Set process priority for mplayer according to the predefined "
     277                tr("Set process priority for %1 according to the predefined "
    283278           "priorities available under Windows.<br>"
    284            "<b>Warning:</b> Using realtime priority can cause system lockup."));
     279           "<b>Warning:</b> Using realtime priority can cause system lockup.").arg(PLAYER_NAME));
    285280#endif
    286281
     
    296291           "MPEG-1/2 and H.264") );
    297292
    298         setWhatsThis(coreavc_check, tr("Use CoreAVC if no other codec specified"),
    299                 tr("Try to use non-free CoreAVC codec when no other codec is specified "
    300            "and non-VDPAU video output selected. Requires MPlayer build with CoreAVC support."));
     293        setWhatsThis(hwdec_combo, tr("Hardware decoding"),
     294                tr("Sets the hardware video decoding API. "
     295                   "If hardware decoding is not possible, software decoding will be used instead.") + " " +
     296                tr("Available options:") +
     297                        "<ul>"
     298                        "<li>" + tr("None: only software decoding will be used.") + "</li>"
     299                        "<li>" + tr("Auto: it tries to automatically enable hardware decoding using the first available method.") + "</li>"
     300                        #ifdef Q_OS_LINUX
     301                        "<li>" + tr("vdpau: for the vdpau and opengl video outputs.") + "</li>"
     302                        "<li>" + tr("vaapi: for the opengl and vaapi video outputs. For Intel GPUs only.") + "</li>"
     303                        "<li>" + tr("vaapi-copy: it copies video back into system RAM. For Intel GPUs only.") + "</li>"
     304                        #endif
     305                        #ifdef Q_OS_WIN
     306                        "<li>" + tr("dxva2-copy: it copies video back to system RAM. Experimental.") + "</li>"
     307                        #endif
     308                        "</ul>"
     309                #ifdef MPLAYER_SUPPORT
     310                + tr("This option only works with mpv.")
     311                #endif
     312                );
    301313
    302314        setWhatsThis(loopfilter_combo, tr("Skip loop filter"),
     
    316328           "greater.").arg(pref->HD_height) +"<br>" );
    317329
     330        setWhatsThis(coreavc_check, tr("Use CoreAVC if no other codec specified"),
     331                tr("Try to use the non-free CoreAVC codec when no other codec is specified "
     332           "and a non-VDPAU video output is selected.") +" "+
     333        tr("Requires a %1 build with CoreAVC support.").arg(PLAYER_NAME));
     334
     335#ifdef OBSOLETE_FAST_AUDIO_CHANGE
    318336        setWhatsThis(fast_audio_combo, tr("Fast audio track switching"),
    319337                tr("Possible values:<br> "
     
    324342           "<b>Auto</b>: SMPlayer will decide what to do according to the "
    325343           "MPlayer version." ) );
     344#endif
    326345
    327346#if !SMART_DVD_CHAPTERS
     
    331350#endif
    332351
    333 #ifdef YOUTUBE_SUPPORT
    334         setWhatsThis(yt_quality_combo, tr("Youtube quality"),
    335                 tr("Select the preferred quality for youtube videos.") );
    336 #endif
    337 
    338352        addSectionTitle(tr("Cache"));
    339353
Note: See TracChangeset for help on using the changeset viewer.