Skip to content

Commit

Permalink
MediaCodec: Mark all MediaCodec decoded frames as progressive
Browse files Browse the repository at this point in the history
- as noted in the code, this may not always be correct and will need
further work if deinterlacing does not happen.
  • Loading branch information
mark-kendall committed Jun 7, 2019
1 parent f98c728 commit 4ba03a7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
15 changes: 15 additions & 0 deletions mythtv/libs/libmythtv/mythmediacodeccontext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,18 @@ AVPixelFormat MythMediaCodecContext::GetFormat(AVCodecContext*, const AVPixelFor
}
return AV_PIX_FMT_NONE;
}

/*! \brief Mark all MediaCodec decoded frames as progressive,
*
* \note This may not be appropriate for all devices
*/
void MythMediaCodecContext::PostProcessFrame(AVCodecContext*, VideoFrame* Frame)
{
if (!Frame)
return;
Frame->interlaced_frame = 0;
Frame->interlaced_reversed = 0;
Frame->top_field_first = 0;
Frame->deinterlace_inuse = DEINT_BASIC | DEINT_DRIVER;
Frame->deinterlace_inuse2x = 0;
}
1 change: 1 addition & 0 deletions mythtv/libs/libmythtv/mythmediacodeccontext.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class MythMediaCodecContext : public MythCodecContext
uint StreamType,
AVPixelFormat &PixFmt);
static AVPixelFormat GetFormat (AVCodecContext*, const AVPixelFormat *PixFmt);
void PostProcessFrame (AVCodecContext*, VideoFrame*) override;

private:
static int InitialiseDecoder (AVCodecContext *Context);
Expand Down

0 comments on commit 4ba03a7

Please sign in to comment.