Skip to content

Commit

Permalink
MythPlayer: New GetPlaybackData method.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Kendall committed Jun 4, 2011
1 parent 933cd94 commit 3c1fee6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
21 changes: 21 additions & 0 deletions mythtv/libs/libmythtv/mythplayer.cpp
Expand Up @@ -4314,6 +4314,27 @@ int MythPlayer::GetStatusbarPos(void) const
return((int)spos);
}

void MythPlayer::GetPlaybackData(InfoMap &infoMap)
{
QString samplerate = RingBuffer::BitrateToString(audio.GetSampleRate());
infoMap.insert("samplerate", samplerate);
infoMap.insert("filename", player_ctx->buffer->GetSafeFilename());
infoMap.insert("decoderrate", player_ctx->buffer->GetDecoderRate());
infoMap.insert("storagerate", player_ctx->buffer->GetStorageRate());
infoMap.insert("bufferavail", player_ctx->buffer->GetAvailableBuffer());
infoMap.insert("avsync",
QString::number((float)avsync_avg / (float)frame_interval, 'f', 2));
if (videoOutput)
{
QString frames = QString("%1/%2").arg(videoOutput->ValidVideoFrames())
.arg(videoOutput->FreeVideoFrames());
infoMap.insert("videoframes", frames);
}
if (decoder)
infoMap["videodecoder"] = decoder->GetCodecDecoderName();
GetCodecDescription(infoMap);
}

int MythPlayer::GetSecondsBehind(void) const
{
if (!player_ctx->recorder)
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/mythplayer.h
Expand Up @@ -144,7 +144,7 @@ class MTV_PUBLIC MythPlayer
QSize GetVideoSize(void) const { return video_disp_dim; }
float GetVideoAspect(void) const { return video_aspect; }
float GetFrameRate(void) const { return video_frame_rate; }

void GetPlaybackData(InfoMap &infoMap);
bool IsAudioNeeded(void) { return !using_null_videoout && player_ctx->IsAudioNeeded(); }
uint GetVolume(void) { return audio.GetVolume(); }
int GetSecondsBehind(void) const;
Expand Down

0 comments on commit 3c1fee6

Please sign in to comment.