Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Player.Process info label changes #10069

Merged
merged 6 commits into from
Jul 5, 2016
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
42 changes: 22 additions & 20 deletions xbmc/GUIInfoManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5166,6 +5166,14 @@ int CGUIInfoManager::TranslateSingleString(const std::string &strCondition, bool
if (prop.name == player_times[i].str)
return AddMultiInfo(GUIInfo(player_times[i].val, TranslateTimeFormat(prop.param())));
}
if (prop.name == "process" && prop.num_params())
{
for (size_t i = 0; i < sizeof(player_process) / sizeof(infomap); i++)
{
if (prop.param() == player_process[i].str)
return player_process[i].val;
}
}
if (prop.num_params() == 1)
{
for (size_t i = 0; i < sizeof(player_param) / sizeof(infomap); i++)
Expand Down Expand Up @@ -5336,21 +5344,15 @@ int CGUIInfoManager::TranslateSingleString(const std::string &strCondition, bool
return AddMultiInfo(GUIInfo(player_times[i].val, TranslateTimeFormat(prop.param())));
}
if (prop.name == "content" && prop.num_params())
{
return AddMultiInfo(GUIInfo(VIDEOPLAYER_CONTENT, ConditionalStringParameter(prop.param()), 0));
}
for (size_t i = 0; i < sizeof(videoplayer) / sizeof(infomap); i++)
{
if (prop.name == videoplayer[i].str)
return videoplayer[i].val;
}
}
else if (cat.name == "player_process")
{
for (size_t i = 0; i < sizeof(player_process) / sizeof(infomap); i++)
{
if (prop.name == player_process[i].str)
return player_process[i].val;
}
}
else if (cat.name == "slideshow")
{
for (size_t i = 0; i < sizeof(slideshow) / sizeof(infomap); i++)
Expand Down Expand Up @@ -6039,12 +6041,24 @@ std::string CGUIInfoManager::GetLabel(int info, int contextWindow, std::string *
case PLAYER_PROCESS_VIDEODAR:
strLabel = StringUtils::FormatNumber(CServiceBroker::GetDataCacheCore().GetVideoDAR());
break;
case PLAYER_PROCESS_VIDEOWIDTH:
strLabel = StringUtils::FormatNumber(CServiceBroker::GetDataCacheCore().GetVideoWidth());
break;
case PLAYER_PROCESS_VIDEOHEIGHT:
strLabel = StringUtils::FormatNumber(CServiceBroker::GetDataCacheCore().GetVideoHeight());
break;
case PLAYER_PROCESS_AUDIODECODER:
strLabel = CServiceBroker::GetDataCacheCore().GetAudioDecoderName();
break;
case PLAYER_PROCESS_AUDIOCHANNELS:
strLabel = CServiceBroker::GetDataCacheCore().GetAudioChannels();
break;
case PLAYER_PROCESS_AUDIOSAMPLERATE:
strLabel = StringUtils::FormatNumber(CServiceBroker::GetDataCacheCore().GetAudioSampleRate());
break;
case PLAYER_PROCESS_AUDIOBITSPERSAMPLE:
strLabel = StringUtils::FormatNumber(CServiceBroker::GetDataCacheCore().GetAudioBitsPerSampe());
break;
case RDS_AUDIO_LANG:
case RDS_CHANNEL_COUNTRY:
case RDS_TITLE:
Expand Down Expand Up @@ -6607,18 +6621,6 @@ bool CGUIInfoManager::GetInt(int &value, int info, int contextWindow, const CGUI
case SYSTEM_BATTERY_LEVEL:
value = g_powerManager.BatteryLevel();
return true;
case PLAYER_PROCESS_VIDEOWIDTH:
value = CServiceBroker::GetDataCacheCore().GetVideoWidth();
return true;
case PLAYER_PROCESS_VIDEOHEIGHT:
value = CServiceBroker::GetDataCacheCore().GetVideoHeight();
return true;
case PLAYER_PROCESS_AUDIOSAMPLERATE:
value = CServiceBroker::GetDataCacheCore().GetAudioSampleRate();
return true;
case PLAYER_PROCESS_AUDIOBITSPERSAMPLE:
value = CServiceBroker::GetDataCacheCore().GetAudioBitsPerSampe();
return true;
}
return false;
}
Expand Down
15 changes: 13 additions & 2 deletions xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,10 @@ enum AVPixelFormat CDVDVideoCodecFFmpeg::GetFormat( struct AVCodecContext * avct
// if frame threading is enabled hw accel is not allowed
if(ctx->m_decoderState != STATE_HW_SINGLE)
{
return avcodec_default_get_format(avctx, fmt);
AVPixelFormat defaultFmt = avcodec_default_get_format(avctx, fmt);
pixFmtName = av_get_pix_fmt_name(defaultFmt);
ctx->m_processInfo.SetVideoPixelFormat(pixFmtName ? pixFmtName : "");
return defaultFmt;
}

// fix an ffmpeg issue here, it calls us with an invalid profile
Expand Down Expand Up @@ -395,7 +398,6 @@ bool CDVDVideoCodecFFmpeg::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options

UpdateName();

m_processInfo.SetVideoDecoderName(m_name, m_pHardware ? true : false);
m_processInfo.SetVideoDimensions(m_pCodecContext->coded_width, m_pCodecContext->coded_height);
return true;
}
Expand Down Expand Up @@ -510,6 +512,8 @@ void CDVDVideoCodecFFmpeg::UpdateName()
if(m_pHardware)
m_name += "-" + m_pHardware->Name();

m_processInfo.SetVideoDecoderName(m_name, m_pHardware ? true : false);

CLog::Log(LOGDEBUG, "CDVDVideoCodecFFmpeg - Updated codec: %s", m_name.c_str());
}

Expand Down Expand Up @@ -955,6 +959,11 @@ int CDVDVideoCodecFFmpeg::FilterOpen(const std::string& filters, bool scale)

avfilter_inout_free(&outputs);
avfilter_inout_free(&inputs);

if (filters.compare(0,5,"yadif") == 0)
{
m_processInfo.SetVideoDeintMethod(filters);
}
}
else
{
Expand All @@ -963,6 +972,8 @@ int CDVDVideoCodecFFmpeg::FilterOpen(const std::string& filters, bool scale)
CLog::Log(LOGERROR, "CDVDVideoCodecFFmpeg::FilterOpen - avfilter_link");
return result;
}

m_processInfo.SetVideoDeintMethod("none");
}

if ((result = avfilter_graph_config(m_pFilterGraph, nullptr)) < 0)
Expand Down
8 changes: 8 additions & 0 deletions xbmc/cores/VideoPlayer/Process/ProcessInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@ void CProcessInfo::SetAudioDecoderName(std::string name)
CSingleLock lock(m_audioCodecSection);

m_audioDecoderName = name;

CServiceBroker::GetDataCacheCore().SetAudioDecoderName(m_audioDecoderName);
}

std::string CProcessInfo::GetAudioDecoderName()
Expand All @@ -215,6 +217,8 @@ void CProcessInfo::SetAudioChannels(std::string channels)
CSingleLock lock(m_audioCodecSection);

m_audioChannels = channels;

CServiceBroker::GetDataCacheCore().SetAudioChannels(m_audioChannels);
}

std::string CProcessInfo::GetAudioChannels()
Expand All @@ -229,6 +233,8 @@ void CProcessInfo::SetAudioSampleRate(int sampleRate)
CSingleLock lock(m_audioCodecSection);

m_audioSampleRate = sampleRate;

CServiceBroker::GetDataCacheCore().SetAudioSampleRate(m_audioSampleRate);
}

int CProcessInfo::GetAudioSampleRate()
Expand All @@ -243,6 +249,8 @@ void CProcessInfo::SetAudioBitsPerSample(int bitsPerSample)
CSingleLock lock(m_audioCodecSection);

m_audioBitsPerSample = bitsPerSample;

CServiceBroker::GetDataCacheCore().SetAudioBitsPerSample(m_audioBitsPerSample);
}

int CProcessInfo::GetAudioBitsPerSampe()
Expand Down