Skip to content

Commit

Permalink
MMAL: Report deinterlace method to processinfo overlay
Browse files Browse the repository at this point in the history
  • Loading branch information
popcornmix committed Nov 4, 2016
1 parent d35ef2d commit 7a4c03e
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 deletions.
3 changes: 1 addition & 2 deletions xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp
Expand Up @@ -57,6 +57,7 @@ using namespace KODI::MESSAGING;

#define VERBOSE 0

void CMMALBuffer::SetVideoDeintMethod(std::string method) { if (m_pool) m_pool->SetVideoDeintMethod(method); }

CMMALVideoBuffer::CMMALVideoBuffer(CMMALVideo *omv, std::shared_ptr<CMMALPool> pool)
: CMMALBuffer(pool), m_omv(omv)
Expand Down Expand Up @@ -376,8 +377,6 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options)
if (hints.workaround_bugs & FF_BUG_GMC_UNSUPPORTED)
return false;

m_processInfo.SetVideoDeintMethod("none");

std::list<EINTERLACEMETHOD> deintMethods;
deintMethods.push_back(EINTERLACEMETHOD::VS_INTERLACEMETHOD_AUTO);
deintMethods.push_back(EINTERLACEMETHOD::VS_INTERLACEMETHOD_MMAL_ADVANCED);
Expand Down
1 change: 1 addition & 0 deletions xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.h
Expand Up @@ -66,6 +66,7 @@ class CMMALBuffer : public IDVDResourceCounted<CMMALBuffer>
bool m_rendered;
bool m_stills;
std::shared_ptr<CMMALPool> m_pool;
void SetVideoDeintMethod(std::string method);
const char *GetStateName() {
static const char *names[] = { "MMALStateNone", "MMALStateHWDec", "MMALStateFFDec", "MMALStateDeint", };
if ((size_t)m_state < vcos_countof(names))
Expand Down
Expand Up @@ -550,6 +550,7 @@ void CMMALRenderer::Run()
{
if (buffer->length > 0)
{
EINTERLACEMETHOD last_interlace_method = m_interlace_method;
EINTERLACEMETHOD interlace_method = CMediaSettings::GetInstance().GetCurrentVideoSettings().m_InterlaceMethod;
if (interlace_method == VS_INTERLACEMETHOD_AUTO)
{
Expand Down Expand Up @@ -586,6 +587,22 @@ void CMMALRenderer::Run()
else if (m_deint_input || interlace)
CheckConfigurationDeint(omvb->m_width, omvb->m_height, omvb->m_aligned_width, omvb->m_aligned_height, omvb->m_encoding, interlace_method);

if (!m_deint_input)
m_interlace_method = VS_INTERLACEMETHOD_NONE;

if (last_interlace_method == m_interlace_method)
;
else if (m_interlace_method == VS_INTERLACEMETHOD_MMAL_ADVANCED)
omvb->SetVideoDeintMethod("adv(x2)");
else if (m_interlace_method == VS_INTERLACEMETHOD_MMAL_ADVANCED_HALF)
omvb->SetVideoDeintMethod("adv(x1)");
else if (m_interlace_method == VS_INTERLACEMETHOD_MMAL_BOB)
omvb->SetVideoDeintMethod("bob(x2)");
else if (m_interlace_method == VS_INTERLACEMETHOD_MMAL_BOB_HALF)
omvb->SetVideoDeintMethod("bob(x1)");
else
omvb->SetVideoDeintMethod("none");

if (m_deint_input)
{
MMAL_STATUS_T status = mmal_port_send_buffer(m_deint_input, omvb->mmal_buffer);
Expand Down Expand Up @@ -1210,7 +1227,7 @@ void CMMALRenderer::DestroyDeinterlace()
CLog::Log(LOGERROR, "%s::%s Failed to disable deinterlace output port(status=%x %s)", CLASSNAME, __func__, status, mmal_status_to_string(status));
}
m_deint_output = nullptr;
m_interlace_method = VS_INTERLACEMETHOD_NONE;
m_interlace_method = VS_INTERLACEMETHOD_MAX;
m_deint_width = 0;
m_deint_height = 0;
m_deint_aligned_width = 0;
Expand Down
Expand Up @@ -67,6 +67,7 @@ class CMMALPool : public std::enable_shared_from_this<CMMALPool>
void SetFormat(uint32_t mmal_format, uint32_t width, uint32_t height, uint32_t aligned_width, uint32_t aligned_height, uint32_t size, AVCodecContext *avctx)
{ m_mmal_format = mmal_format; m_width = width; m_height = height; m_aligned_width = aligned_width; m_aligned_height = aligned_height; m_size = size, m_avctx = avctx; m_software = true; }
bool IsSoftware() { return m_software; }
void SetVideoDeintMethod(std::string method) { if (m_processInfo) m_processInfo->SetVideoDeintMethod(method); }
protected:
uint32_t m_mmal_format, m_width, m_height, m_aligned_width, m_aligned_height, m_size;
AVCodecContext *m_avctx;
Expand Down

0 comments on commit 7a4c03e

Please sign in to comment.