Skip to content

Commit

Permalink
Remove ClearPicture from VPV and all Codecs
Browse files Browse the repository at this point in the history
  • Loading branch information
peak3d authored and popcornmix committed May 13, 2017
1 parent 9985531 commit 462799f
Show file tree
Hide file tree
Showing 12 changed files with 1 addition and 64 deletions.
10 changes: 0 additions & 10 deletions xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodec.h
Expand Up @@ -161,16 +161,6 @@ class CDVDVideoCodec
*/
virtual VCReturn GetPicture(VideoPicture* pVideoPicture) = 0;

/**
* returns true if successfull
* the data is cleared to zero
*/
virtual bool ClearPicture(VideoPicture* pVideoPicture)
{
memset(pVideoPicture, 0, sizeof(VideoPicture));
return true;
}

/**
* will be called by video player indicating the playback speed. see DVD_PLAYSPEED_NORMAL,
* DVD_PLAYSPEED_PAUSE and friends.
Expand Down
10 changes: 0 additions & 10 deletions xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAmlogic.cpp
Expand Up @@ -394,16 +394,6 @@ CDVDVideoCodec::VCReturn CDVDVideoCodecAmlogic::GetPicture(VideoPicture* pVideoP
return retVal;
}

bool CDVDVideoCodecAmlogic::ClearPicture(VideoPicture *pVideoPicture)
{
if (pVideoPicture->hwPic)
{
static_cast<CDVDAmlogicInfo*>(pVideoPicture->hwPic)->Release();
pVideoPicture->hwPic = nullptr;
}
return true;
}

void CDVDVideoCodecAmlogic::SetCodecControl(int flags)
{
if (m_codecControlFlags != flags)
Expand Down
Expand Up @@ -75,7 +75,6 @@ class CDVDVideoCodecAmlogic : public CDVDVideoCodec
virtual bool AddData(const DemuxPacket &packet) override;
virtual void Reset() override;
virtual VCReturn GetPicture(VideoPicture* pVideoPicture) override;
virtual bool ClearPicture(VideoPicture* pVideoPicture) override;
virtual void SetSpeed(int iSpeed) override;
virtual void SetCodecControl(int flags) override;
virtual const char* GetName(void) override { return (const char*)m_pFormatName; }
Expand Down
8 changes: 0 additions & 8 deletions xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecIMX.cpp
Expand Up @@ -100,14 +100,6 @@ unsigned CDVDVideoCodecIMX::GetAllowedReferences()
return RENDER_QUEUE_SIZE;
}

bool CDVDVideoCodecIMX::ClearPicture(DVDVideoPicture* pDvdVideoPicture)
{
if (pDvdVideoPicture)
SAFE_RELEASE(pDvdVideoPicture->IMXBuffer);

return true;
}

bool CIMXCodec::VpuAllocBuffers(VpuMemInfo *pMemBlock)
{
int i, size;
Expand Down
1 change: 0 additions & 1 deletion xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecIMX.h
Expand Up @@ -431,7 +431,6 @@ class CDVDVideoCodecIMX : public CDVDVideoCodec

// Methods from CDVDVideoCodec which require overrides
virtual bool Open(CDVDStreamInfo &hints, CDVDCodecOptions &options);
virtual bool ClearPicture(DVDVideoPicture *pDvdVideoPicture);

virtual int Decode(BYTE *pData, int iSize, double dts, double pts) { return m_IMXCodec->Decode(pData, iSize, dts, pts); }

Expand Down
Expand Up @@ -195,12 +195,6 @@ bool CDVDVideoCodecOpenMax::GetPicture(DVDVideoPicture* pDvdVideoPicture)
return VC_PICTURE | VC_BUFFER;
}

bool CDVDVideoCodecOpenMax::ClearPicture(DVDVideoPicture* pDvdVideoPicture)
{
return m_omx_decoder->ClearPicture(pDvdVideoPicture);
}


////////////////////////////////////////////////////////////////////////////////////////////
bool CDVDVideoCodecOpenMax::bitstream_convert_init(void *in_extradata, int in_extrasize)
{
Expand Down
Expand Up @@ -35,7 +35,6 @@ class CDVDVideoCodecOpenMax : public CDVDVideoCodec
virtual int Decode(uint8_t *pData, int iSize, double dts, double pts);
virtual void Reset(void);
virtual bool GetPicture(DVDVideoPicture *pDvdVideoPicture);
virtual bool ClearPicture(DVDVideoPicture* pDvdVideoPicture);
virtual void SetDropState(bool bDrop);
virtual const char* GetName(void) { return (const char*)m_pFormatName; }

Expand Down
2 changes: 1 addition & 1 deletion xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.h
Expand Up @@ -97,7 +97,6 @@ class CMMALVideo : public CDVDVideoCodec
virtual bool AddData(const DemuxPacket &packet) override;
virtual void Reset(void) override;
virtual CDVDVideoCodec::VCReturn GetPicture(VideoPicture *pDvdVideoPicture) override;
virtual bool ClearPicture(VideoPicture* pDvdVideoPicture);
virtual unsigned GetAllowedReferences() override { return 4; }
virtual const char* GetName(void) override { return m_pFormatName ? m_pFormatName:"mmal-xxx"; }
virtual void SetCodecControl(int flags) override;
Expand Down Expand Up @@ -131,6 +130,7 @@ class CMMALVideo : public CDVDVideoCodec
bool Initialize( const std::string &decoder_name);
void PortSettingsChanged(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer);
bool SendCodecConfigData();
bool ClearPicture(VideoPicture* pVideoPicture);

CDVDStreamInfo m_hints;
float m_fps;
Expand Down
9 changes: 0 additions & 9 deletions xbmc/cores/VideoPlayer/DVDCodecs/Video/OpenMaxVideo.cpp
Expand Up @@ -425,15 +425,6 @@ void COpenMaxVideo::Reset(void)
::Sleep(100);
}

bool COpenMaxVideo::ClearPicture(DVDVideoPicture* pDvdVideoPicture)
{
if (pDvdVideoPicture->openMaxBufferHolder) {
pDvdVideoPicture->openMaxBufferHolder->Release();
pDvdVideoPicture->openMaxBufferHolder = 0;
}
return true;
}

void COpenMaxVideo::ReleaseBuffer(OpenMaxVideoBuffer* releaseBuffer)
{
if (!releaseBuffer)
Expand Down
1 change: 0 additions & 1 deletion xbmc/cores/VideoPlayer/DVDCodecs/Video/OpenMaxVideo.h
Expand Up @@ -101,7 +101,6 @@ class COpenMaxVideo : public COpenMax, public IDVDResourceCounted<COpenMaxVideo>
int Decode(uint8_t *pData, int iSize, double dts, double pts);
void Reset(void);
int GetPicture(DVDVideoPicture *pDvdVideoPicture);
bool ClearPicture(DVDVideoPicture *pDvdVideoPicture);
void ReleaseBuffer(OpenMaxVideoBuffer *buffer);
void SetDropState(bool bDrop);
protected:
Expand Down
6 changes: 0 additions & 6 deletions xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp
Expand Up @@ -203,7 +203,6 @@ void CVideoPlayerVideo::OpenStream(CDVDStreamInfo &hint, CDVDVideoCodec* codec)
}
else if (m_pVideoCodec)
{
m_pVideoCodec->ClearPicture(&m_picture);
delete m_pVideoCodec;
m_pVideoCodec = nullptr;
}
Expand Down Expand Up @@ -251,7 +250,6 @@ void CVideoPlayerVideo::CloseStream(bool bWaitForBuffers)
CLog::Log(LOGNOTICE, "deleting video codec");
if (m_pVideoCodec)
{
m_pVideoCodec->ClearPicture(&m_picture);
delete m_pVideoCodec;
m_pVideoCodec = NULL;
}
Expand Down Expand Up @@ -526,10 +524,6 @@ void CVideoPlayerVideo::Process()
// all data is used by the decoder, we can safely free it now
pMsg->Release();
}

// we need to let decoder release any picture retained resources.
if (m_pVideoCodec)
m_pVideoCodec->ClearPicture(&m_picture);
}

bool CVideoPlayerVideo::ProcessDecoderOutput(double &frametime, double &pts)
Expand Down
10 changes: 0 additions & 10 deletions xbmc/cores/omxplayer/OMXVideoCodec.h
Expand Up @@ -178,16 +178,6 @@ class COMXVideoCodec
virtual bool GetPicture(DVDVideoPicture* pDvdVideoPicture) = 0;


/*
* returns true if successfull
* the data is cleared to zero
*/
virtual bool ClearPicture(DVDVideoPicture* pDvdVideoPicture)
{
memset(pDvdVideoPicture, 0, sizeof(DVDVideoPicture));
return true;
}

/*
* returns true if successfull
* the data is valid until the next Decode call
Expand Down

0 comments on commit 462799f

Please sign in to comment.