Skip to content

Commit

Permalink
refact: remove unused member in basedec
Browse files Browse the repository at this point in the history
m_renderTarget
m_lastReference
m_forwardReference
m_enableNativeBuffersFlag
  • Loading branch information
xuguangxin committed Mar 10, 2016
1 parent 08ff138 commit 00618b6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 45 deletions.
39 changes: 3 additions & 36 deletions decoder/vaapidecoder_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,9 @@ inline void unrefAllocator(SurfaceAllocator* allocator)
allocator->unref(allocator);
}

VaapiDecoderBase::VaapiDecoderBase():
m_renderTarget(NULL),
m_lastReference(NULL),
m_forwardReference(NULL),
m_VAStarted(false),
m_currentPTS(INVALID_PTS), m_enableNativeBuffersFlag(false)
VaapiDecoderBase::VaapiDecoderBase()
: m_VAStarted(false)
, m_currentPTS(INVALID_PTS)
{
INFO("base: construct()");
m_externalDisplay.handle = 0,
Expand Down Expand Up @@ -146,9 +143,6 @@ void VaapiDecoderBase::stop(void)
terminateVA();

m_currentPTS = INVALID_PTS;
m_renderTarget = NULL;
m_lastReference = NULL;
m_forwardReference = NULL;

m_lowDelay = false;
m_rawOutput = false;
Expand All @@ -165,9 +159,6 @@ void VaapiDecoderBase::flush(void)
}

m_currentPTS = INVALID_PTS;
m_renderTarget = NULL;
m_lastReference = NULL;
m_forwardReference = NULL;
}

struct BufferRecycler
Expand Down Expand Up @@ -219,35 +210,11 @@ const VideoFormatInfo *VaapiDecoderBase::getFormatInfo(void)
return &m_videoFormatInfo;
}

Decode_Status VaapiDecoderBase::updateReference(void)
{
// update reference frames
if (m_renderTarget->referenceFrame) {
// managing reference for MPEG4/H.263/WMV.
// AVC should manage reference frame in a different way
if (m_forwardReference != NULL) {
// this foward reference is no longer needed
m_forwardReference->asReferernce = false;
}
// Forware reference for either P or B frame prediction
m_forwardReference = m_lastReference;
m_renderTarget->asReferernce = true;

// the last reference frame.
m_lastReference = m_renderTarget;
}
return DECODE_SUCCESS;
}

Decode_Status
VaapiDecoderBase::setupVA(uint32_t numSurface, VAProfile profile)
{
INFO("base: setup VA");

if (m_enableNativeBuffersFlag == true) {
numSurface = 20; //NATIVE_WINDOW_COUNT;
}

if (m_VAStarted) {
return DECODE_SUCCESS;
}
Expand Down
9 changes: 0 additions & 9 deletions decoder/vaapidecoder_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,6 @@ class VaapiDecoderBase:public IVideoDecoder {
DecSurfacePoolPtr m_surfacePool;
SharedPtr<SurfaceAllocator> m_allocator;
SharedPtr<SurfaceAllocator> m_externalAllocator;
/* the current render target for decoder */
// XXX, not useful. decoding bases on VaapiPicture, rendering bases on IVideoDecoder->getOutput()
VideoSurfaceBuffer *m_renderTarget;

/* reference picture, h264 will not use */
// XXX, not used. reference frame management base on VaapiPicture
VideoSurfaceBuffer *m_lastReference;
VideoSurfaceBuffer *m_forwardReference;

bool m_VAStarted;

Expand All @@ -110,7 +102,6 @@ class VaapiDecoderBase:public IVideoDecoder {
private:
bool m_lowDelay;
bool m_rawOutput;
bool m_enableNativeBuffersFlag;
#ifdef __ENABLE_DEBUG__
int renderPictureCount;
#endif
Expand Down

0 comments on commit 00618b6

Please sign in to comment.