Bug #97 ยป postprocess_video_settings.patch
xbmc/cores/dvdplayer/DVDPlayerVideo.cpp (working copy) | ||
---|---|---|
CLog::Log(LOGNOTICE, "running thread: video_thread");
|
||
DVDVideoPicture picture;
|
||
int postprocess_mode = g_guiSettings.GetInt("videoplayer.postprocess");
|
||
CDVDVideoPPFFmpeg mPostProcess("");
|
||
CStdString sPostProcessType;
|
||
... | ... | |
sPostProcessType += g_advancedSettings.m_videoPPFFmpegDeint;
|
||
}
|
||
if ((postprocess_mode == VIDEO_POSTPROCESS_ALWAYS) ||
|
||
((postprocess_mode == VIDEO_POSTPROCESS_SD_CONTENT) &&
|
||
(picture.iWidth <= 720)))
|
||
if (g_stSettings.m_currentVideoSettings.m_PostProcess)
|
||
{
|
||
if (!sPostProcessType.empty())
|
||
sPostProcessType += ",";
|
||
// This is what mplayer uses for its "high-quality filter combination"
|
||
sPostProcessType += g_advancedSettings.m_videoPPFFmpegPostProc;
|
||
}
|
||
xbmc/GUIDialogVideoSettings.cpp (working copy) | ||
---|---|---|
#define VIDEO_SETTINGS_NON_INTERLEAVED 15
|
||
#define VIDEO_SETTINGS_NO_CACHE 16
|
||
#define VIDEO_SETTINGS_FORCE_INDEX 17
|
||
#define VIDEO_SETTINGS_POSTPROCESS 18
|
||
void CGUIDialogVideoSettings::CreateSettings()
|
||
{
|
||
... | ... | |
AddSlider(VIDEO_SETTINGS_BRIGHTNESS, 464, &g_stSettings.m_currentVideoSettings.m_Brightness, 0, 1, 100, FormatInteger);
|
||
AddSlider(VIDEO_SETTINGS_CONTRAST, 465, &g_stSettings.m_currentVideoSettings.m_Contrast, 0, 1, 100, FormatInteger);
|
||
AddSlider(VIDEO_SETTINGS_GAMMA, 466, &g_stSettings.m_currentVideoSettings.m_Gamma, 0, 1, 100, FormatInteger);
|
||
AddSeparator(8);
|
||
AddButton(VIDEO_SETTINGS_MAKE_DEFAULT, 12376);
|
||
m_flickerFilter = g_guiSettings.GetInt("videoplayer.flicker");
|
||
... | ... | |
AddBool(VIDEO_SETTINGS_NO_CACHE, 431, &g_stSettings.m_currentVideoSettings.m_NoCache);
|
||
AddButton(VIDEO_SETTINGS_FORCE_INDEX, 12009);
|
||
}
|
||
if (g_application.GetCurrentPlayer() == EPC_DVDPLAYER)
|
||
{
|
||
AddBool(VIDEO_SETTINGS_POSTPROCESS, 16400, &g_stSettings.m_currentVideoSettings.m_PostProcess);
|
||
}
|
||
}
|
||
void CGUIDialogVideoSettings::OnSettingChanged(SettingInfo &setting)
|
xbmc/GUISettings.cpp (working copy) | ||
---|---|---|
AddInt(7, "videoplayer.flicker", 13100, 1, 0, 1, 5, SPIN_CONTROL_INT_PLUS, -1, TEXT_OFF);
|
||
AddBool(8, "videoplayer.soften", 215, false);
|
||
AddFloat(9, "videoplayer.errorinaspect", 22021, 3.0f, 0.0f, 1.0f, 20.0f);
|
||
AddInt(10, "videoplayer.postprocess", 16400, VIDEO_POSTPROCESS_DISABLED, VIDEO_POSTPROCESS_DISABLED, 1, VIDEO_POSTPROCESS_ALWAYS, SPIN_CONTROL_TEXT);
|
||
AddSeparator(11, "videoplayer.sep2");
|
||
AddInt(12, "videoplayer.defaultplayer", 22030, PLAYER_MPLAYER, PLAYER_MPLAYER, 1, PLAYER_DVDPLAYER, SPIN_CONTROL_TEXT);
|
||
AddBool(13, "videoplayer.allcodecs", 22025, false);
|
||
AddBool(14, "videoplayer.fast", 22026, false);
|
||
AddSeparator(10, "videoplayer.sep2");
|
||
AddInt(11, "videoplayer.defaultplayer", 22030, PLAYER_MPLAYER, PLAYER_MPLAYER, 1, PLAYER_DVDPLAYER, SPIN_CONTROL_TEXT);
|
||
AddBool(12, "videoplayer.allcodecs", 22025, false);
|
||
AddBool(13, "videoplayer.fast", 22026, false);
|
||
AddCategory(5, "myvideos", 14081);
|
||
AddBool(0, "myvideos.treatstackasfile", 20051, true);
|
xbmc/GUISettings.h (working copy) | ||
---|---|---|
#define RENDER_HQ_RGB_SHADER 2
|
||
#define RENDER_HQ_RGB_SHADERV2 3
|
||
// Post-processing options.
|
||
#define VIDEO_POSTPROCESS_DISABLED 0
|
||
#define VIDEO_POSTPROCESS_SD_CONTENT 1
|
||
#define VIDEO_POSTPROCESS_ALWAYS 2
|
||
// Subtitle colours
|
||
#define SUBTITLE_COLOR_START 0
|
||
#define SUBTITLE_COLOR_END 7
|
xbmc/Settings.cpp (working copy) | ||
---|---|---|
GetFloat(pElement, "volumeamplification", g_stSettings.m_defaultVideoSettings.m_VolumeAmplification, VOLUME_DRC_MINIMUM * 0.01f, VOLUME_DRC_MINIMUM * 0.01f, VOLUME_DRC_MAXIMUM * 0.01f);
|
||
GetFloat(pElement, "noisereduction", g_stSettings.m_defaultVideoSettings.m_NoiseReduction, 0.0f, 0.0f, 1.0f);
|
||
GetFloat(pElement, "sharpness", g_stSettings.m_defaultVideoSettings.m_Sharpness, 0.0f, -1.0f, 1.0f);
|
||
XMLUtils::GetBoolean(pElement, "postprocess", g_stSettings.m_defaultVideoSettings.m_PostProcess);
|
||
XMLUtils::GetBoolean(pElement, "outputtoallspeakers", g_stSettings.m_defaultVideoSettings.m_OutputToAllSpeakers);
|
||
XMLUtils::GetBoolean(pElement, "showsubtitles", g_stSettings.m_defaultVideoSettings.m_SubtitleOn);
|
||
GetFloat(pElement, "brightness", g_stSettings.m_defaultVideoSettings.m_Brightness, 50, 0, 100);
|
||
GetFloat(pElement, "contrast", g_stSettings.m_defaultVideoSettings.m_Contrast, 50, 0, 100);
|
||
GetFloat(pElement, "gamma", g_stSettings.m_defaultVideoSettings.m_Gamma, 20, 0, 100);
|
||
GetFloat(pElement, "audiodelay", g_stSettings.m_defaultVideoSettings.m_AudioDelay, 0.0f, -10.0f, 10.0f);
|
||
GetFloat(pElement, "audiodelay", g_stSettings.m_defaultVideoSettings.m_AudioDelay, 0.0f, -10.0f, 10.0f);
|
||
GetFloat(pElement, "subtitledelay", g_stSettings.m_defaultVideoSettings.m_SubtitleDelay, 0.0f, -10.0f, 10.0f);
|
||
g_stSettings.m_defaultVideoSettings.m_SubtitleCached = false;
|
||
... | ... | |
XMLUtils::SetInt(pNode, "interlacemethod", g_stSettings.m_defaultVideoSettings.m_InterlaceMethod);
|
||
XMLUtils::SetFloat(pNode, "filmgrain", g_stSettings.m_currentVideoSettings.m_FilmGrain);
|
||
XMLUtils::SetInt(pNode, "viewmode", g_stSettings.m_currentVideoSettings.m_ViewMode);
|
||
XMLUtils::GetBoolean(pNode, "postprocess", g_stSettings.m_defaultVideoSettings.m_PostProcess);
|
||
XMLUtils::SetFloat(pNode, "zoomamount", g_stSettings.m_currentVideoSettings.m_CustomZoomAmount);
|
||
XMLUtils::SetFloat(pNode, "pixelratio", g_stSettings.m_currentVideoSettings.m_CustomPixelRatio);
|
||
XMLUtils::SetFloat(pNode, "volumeamplification", g_stSettings.m_currentVideoSettings.m_VolumeAmplification);
|
||
... | ... | |
XMLUtils::SetFloat(pNode, "zoomamount", g_stSettings.m_defaultVideoSettings.m_CustomZoomAmount);
|
||
XMLUtils::SetFloat(pNode, "pixelratio", g_stSettings.m_defaultVideoSettings.m_CustomPixelRatio);
|
||
XMLUtils::SetFloat(pNode, "volumeamplification", g_stSettings.m_defaultVideoSettings.m_VolumeAmplification);
|
||
XMLUtils::GetBoolean(pNode, "postprocess", g_stSettings.m_defaultVideoSettings.m_PostProcess);
|
||
XMLUtils::SetBoolean(pNode, "outputtoallspeakers", g_stSettings.m_defaultVideoSettings.m_OutputToAllSpeakers);
|
||
XMLUtils::SetBoolean(pNode, "showsubtitles", g_stSettings.m_defaultVideoSettings.m_SubtitleOn);
|
||
XMLUtils::SetFloat(pNode, "brightness", g_stSettings.m_defaultVideoSettings.m_Brightness);
|
xbmc/settings/VideoSettings.cpp (working copy) | ||
---|---|---|
m_Brightness = 50.0f;
|
||
m_Contrast = 50.0f;
|
||
m_Gamma = 20.0f;
|
||
m_PostProcess = false;
|
||
m_Sharpness = 0.0f;
|
||
m_NoiseReduction = 0;
|
||
m_VolumeAmplification = 0;
|
||
... | ... | |
if (m_Brightness != right.m_Brightness) return true;
|
||
if (m_Contrast != right.m_Contrast) return true;
|
||
if (m_Gamma != right.m_Gamma) return true;
|
||
if (m_PostProcess != right.m_PostProcess) return true;
|
||
if (m_AudioDelay != right.m_AudioDelay) return true;
|
||
if (m_OutputToAllSpeakers != right.m_OutputToAllSpeakers) return true;
|
||
if (m_ResumeTime != right.m_ResumeTime) return true;
|
xbmc/settings/VideoSettings.h (working copy) | ||
---|---|---|
float m_Gamma;
|
||
float m_NoiseReduction;
|
||
float m_Sharpness;
|
||
bool m_PostProcess;
|
||
float m_AudioDelay;
|
||
int m_ResumeTime;
|
||
bool m_Crop;
|
xbmc/VideoDatabase.cpp (working copy) | ||
---|---|---|
"ViewMode integer,ZoomAmount float, PixelRatio float, AudioStream integer, SubtitleStream integer,"
|
||
"SubtitleDelay float, SubtitlesOn bool, Brightness float, Contrast float, Gamma float,"
|
||
"VolumeAmplification float, AudioDelay float, OutputToAllSpeakers bool, ResumeTime integer, Crop bool, CropLeft integer,"
|
||
"CropRight integer, CropTop integer, CropBottom integer, Sharpness float, NoiseReduction float)\n");
|
||
"CropRight integer, CropTop integer, CropBottom integer, Sharpness float, NoiseReduction float, PostProcess bool)\n");
|
||
m_pDS->exec("CREATE UNIQUE INDEX ix_settings ON settings ( idFile )\n");
|
||
CLog::Log(LOGINFO, "create stacktimes table");
|
||
... | ... | |
settings.m_Contrast = m_pDS->fv("Contrast").get_asFloat();
|
||
settings.m_CustomPixelRatio = m_pDS->fv("PixelRatio").get_asFloat();
|
||
settings.m_NoiseReduction = m_pDS->fv("NoiseReduction").get_asFloat();
|
||
settings.m_PostProcess = m_pDS->fv("PostProcess").get_asBool();
|
||
settings.m_Sharpness = m_pDS->fv("Sharpness").get_asFloat();
|
||
settings.m_CustomZoomAmount = m_pDS->fv("ZoomAmount").get_asFloat();
|
||
settings.m_Gamma = m_pDS->fv("Gamma").get_asFloat();
|
||
... | ... | |
// update the item
|
||
strSQL=FormatSQL("update settings set Interleaved=%i,NoCache=%i,Deinterlace=%i,FilmGrain=%f,ViewMode=%i,ZoomAmount=%f,PixelRatio=%f,"
|
||
"AudioStream=%i,SubtitleStream=%i,SubtitleDelay=%f,SubtitlesOn=%i,Brightness=%f,Contrast=%f,Gamma=%f,"
|
||
"VolumeAmplification=%f,AudioDelay=%f,OutputToAllSpeakers=%i,Sharpness=%f,NoiseReduction=%f,",
|
||
"VolumeAmplification=%f,AudioDelay=%f,OutputToAllSpeakers=%i,Sharpness=%f,NoiseReduction=%f,PostProcess=%i,",
|
||
setting.m_NonInterleaved, setting.m_NoCache, setting.m_InterlaceMethod, setting.m_FilmGrain, setting.m_ViewMode, setting.m_CustomZoomAmount, setting.m_CustomPixelRatio,
|
||
setting.m_AudioStream, setting.m_SubtitleStream, setting.m_SubtitleDelay, setting.m_SubtitleOn,
|
||
setting.m_Brightness, setting.m_Contrast, setting.m_Gamma, setting.m_VolumeAmplification, setting.m_AudioDelay,
|
||
setting.m_OutputToAllSpeakers,setting.m_Sharpness,setting.m_NoiseReduction);
|
||
setting.m_OutputToAllSpeakers,setting.m_Sharpness,setting.m_NoiseReduction,setting.m_PostProcess);
|
||
CStdString strSQL2;
|
||
strSQL2=FormatSQL("ResumeTime=%i,Crop=%i,CropLeft=%i,CropRight=%i,CropTop=%i,CropBottom=%i where idFile=%i\n", setting.m_ResumeTime, setting.m_Crop, setting.m_CropLeft, setting.m_CropRight, setting.m_CropTop, setting.m_CropBottom, idFile);
|
||
strSQL += strSQL2;
|
||
... | ... | |
else
|
||
{ // add the items
|
||
m_pDS->close();
|
||
strSQL=FormatSQL("insert into settings ( idFile,Interleaved,NoCache,Deinterlace,FilmGrain,ViewMode,ZoomAmount,PixelRatio,"
|
||
"AudioStream,SubtitleStream,SubtitleDelay,SubtitlesOn,Brightness,Contrast,Gamma,"
|
||
"VolumeAmplification,AudioDelay,OutputToAllSpeakers,ResumeTime,Crop,CropLeft,CropRight,CropTop,CropBottom,Sharpness,NoiseReduction)"
|
||
" values (%i,%i,%i,%i,%f,%i,%f,%f,%i,%i,%f,%i,%f,%f,%f,%f,%f,",
|
||
strSQL = "INSERT INTO settings ( idFile,Interleaved,NoCache,Deinterlace,FilmGrain,ViewMode,ZoomAmount,PixelRatio,"
|
||
"AudioStream,SubtitleStream,SubtitleDelay,SubtitlesOn,Brightness,Contrast,Gamma,"
|
||
"VolumeAmplification,AudioDelay,OutputToAllSpeakers,ResumeTime,"
|
||
"Crop,CropLeft,CropRight,CropTop,CropBottom,Sharpness,NoiseReduction,PostProcess) "
|
||
"VALUES ";
|
||
strSQL += FormatSQL("(%i,%i,%i,%i,%f,%i,%f,%f,%i,%i,%f,%i,%f,%f,%f,%f,%f,%i,%i,%i,%i,%i,%i,%i,%f,%f,%i)",
|
||
idFile, setting.m_NonInterleaved, setting.m_NoCache, setting.m_InterlaceMethod, setting.m_FilmGrain, setting.m_ViewMode, setting.m_CustomZoomAmount, setting.m_CustomPixelRatio,
|
||
setting.m_AudioStream, setting.m_SubtitleStream, setting.m_SubtitleDelay, setting.m_SubtitleOn,
|
||
setting.m_Brightness, setting.m_Contrast, setting.m_Gamma, setting.m_VolumeAmplification, setting.m_AudioDelay);
|
||
CStdString strSQL2;
|
||
strSQL2=FormatSQL("%i,%i,%i,%i,%i,%i,%i,%f,%f)\n", setting.m_OutputToAllSpeakers, setting.m_ResumeTime, setting.m_Crop, setting.m_CropLeft, setting.m_CropRight,
|
||
setting.m_CropTop, setting.m_CropBottom, setting.m_Sharpness, setting.m_NoiseReduction);
|
||
strSQL += strSQL2;
|
||
setting.m_Brightness, setting.m_Contrast, setting.m_Gamma, setting.m_VolumeAmplification, setting.m_AudioDelay,
|
||
setting.m_OutputToAllSpeakers, setting.m_ResumeTime, setting.m_Crop, setting.m_CropLeft, setting.m_CropRight,
|
||
setting.m_CropTop, setting.m_CropBottom, setting.m_Sharpness, setting.m_NoiseReduction, setting.m_PostProcess);
|
||
m_pDS->exec(strSQL.c_str());
|
||
}
|
||
}
|
||
... | ... | |
m_pDS->exec("DELETE FROM streamdetails");
|
||
m_pDS->exec("ALTER table streamdetails add iVideoDuration integer");
|
||
}
|
||
if (iVersion < 35)
|
||
{
|
||
m_pDS->exec("ALTER table settings add PostProcess bool");
|
||
}
|
||
}
|
||
catch (...)
|
||
{
|
xbmc/VideoDatabase.h (working copy) | ||
---|---|---|
private:
|
||
virtual bool CreateTables();
|
||
virtual bool UpdateOldVersion(int version);
|
||
virtual int GetMinVersion() const { return 34; };
|
||
virtual int GetMinVersion() const { return 35; };
|
||
const char *GetDefaultDBName() const { return "MyVideos34.db"; };
|
||
void ConstructPath(CStdString& strDest, const CStdString& strPath, const CStdString& strFileName);
|