Skip to content

Commit

Permalink
Revert "[omxplayer] Add ability to dump out audio/video data for late…
Browse files Browse the repository at this point in the history
…r debugging"

This reverts commit 417416b.
  • Loading branch information
popcornmix committed Nov 3, 2014
1 parent 3131218 commit c930319
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 112 deletions.
10 changes: 0 additions & 10 deletions language/English/strings.po
Expand Up @@ -2892,16 +2892,6 @@ msgctxt "#697"
msgid "Verbose logging for OMXPLAYER"
msgstr ""

#: xbmc/settings/AdvancedSettings.cpp
msgctxt "#698"
msgid "Dump video frames to debug file"
msgstr ""

#: xbmc/settings/AdvancedSettings.cpp
msgctxt "#699"
msgid "Dump audio frames to debug file"
msgstr ""

#empty strings from id 680 to 699

msgctxt "#700"
Expand Down
2 changes: 0 additions & 2 deletions xbmc/commons/ilog.h
Expand Up @@ -54,8 +54,6 @@
#define LOGUPNP (1 << (LOGMASKBIT + 9))
#define LOGCEC (1 << (LOGMASKBIT + 10))
#define LOGOMXPLAYER (1 << (LOGMASKBIT+11))
#define LOGDUMPVIDEO (1 << (LOGMASKBIT+12))
#define LOGDUMPAUDIO (1 << (LOGMASKBIT+13))

#include "utils/params_check_macros.h"

Expand Down
49 changes: 0 additions & 49 deletions xbmc/cores/omxplayer/OMXAudio.cpp
Expand Up @@ -55,49 +55,6 @@ using namespace std;
#define AUDIO_DECODE_OUTPUT_BUFFER (32*1024)
static const char rounded_up_channels_shift[] = {0,0,1,2,2,3,3,3,3};

//#define DEBUG_PLAYBACK
static void dump_omx_buffer(OMX_BUFFERHEADERTYPE *omx_buffer)
{
if (!(g_advancedSettings.CanLogComponent(LOGDUMPAUDIO)))
return;
static FILE *fp;
if (!omx_buffer)
{
if (fp)
{
fclose(fp);
fp = NULL;
}
return;
}
if (!fp)
{
char filename[1024];
strcpy(filename, g_advancedSettings.m_logFolder.c_str());
strcat(filename, "audio.dat");
#ifdef DEBUG_PLAYBACK
fp = fopen(filename, "rb");
#else
fp = fopen(filename, "wb");
#endif
}
if (fp)
{
#ifdef DEBUG_PLAYBACK
OMX_BUFFERHEADERTYPE omx = {0};
int s = fread(&omx, sizeof omx, 1, fp);
omx_buffer->nFilledLen = omx.nFilledLen;
omx_buffer->nFlags = omx.nFlags;
omx_buffer->nTimeStamp = omx.nTimeStamp;
if (s==1)
fread(omx_buffer->pBuffer, omx_buffer->nFilledLen, 1, fp);
#else
if (fwrite(omx_buffer, sizeof *omx_buffer, 1, fp) == 1)
fwrite(omx_buffer->pBuffer, omx_buffer->nFilledLen, 1, fp);
#endif
}
}

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -910,7 +867,6 @@ bool COMXAudio::Initialize(AEAudioFormat format, OMXClock *clock, CDVDStreamInfo
memcpy((unsigned char *)omx_buffer->pBuffer, &m_wave_header, omx_buffer->nFilledLen);
omx_buffer->nFlags = OMX_BUFFERFLAG_CODECCONFIG | OMX_BUFFERFLAG_ENDOFFRAME;

dump_omx_buffer(omx_buffer);
omx_err = m_omx_decoder.EmptyThisBuffer(omx_buffer);
if (omx_err != OMX_ErrorNone)
{
Expand Down Expand Up @@ -943,7 +899,6 @@ bool COMXAudio::Initialize(AEAudioFormat format, OMXClock *clock, CDVDStreamInfo
memcpy((unsigned char *)omx_buffer->pBuffer, m_extradata, omx_buffer->nFilledLen);
omx_buffer->nFlags = OMX_BUFFERFLAG_CODECCONFIG | OMX_BUFFERFLAG_ENDOFFRAME;

dump_omx_buffer(omx_buffer);
omx_err = m_omx_decoder.EmptyThisBuffer(omx_buffer);
if (omx_err != OMX_ErrorNone)
{
Expand Down Expand Up @@ -980,8 +935,6 @@ bool COMXAudio::Deinitialize()
{
CSingleLock lock (m_critSection);

dump_omx_buffer(NULL);

if ( m_omx_tunnel_clock_analog.IsInitialized() )
m_omx_tunnel_clock_analog.Deestablish();
if ( m_omx_tunnel_clock_hdmi.IsInitialized() )
Expand Down Expand Up @@ -1270,7 +1223,6 @@ unsigned int COMXAudio::AddPackets(const void* data, unsigned int len, double dt
int nRetry = 0;
while(true)
{
dump_omx_buffer(omx_buffer);
omx_err = m_omx_decoder.EmptyThisBuffer(omx_buffer);
if (omx_err == OMX_ErrorNone)
{
Expand Down Expand Up @@ -1518,7 +1470,6 @@ void COMXAudio::SubmitEOS()

omx_buffer->nFlags = OMX_BUFFERFLAG_ENDOFFRAME | OMX_BUFFERFLAG_EOS | OMX_BUFFERFLAG_TIME_UNKNOWN;

dump_omx_buffer(omx_buffer);
omx_err = m_omx_decoder.EmptyThisBuffer(omx_buffer);
if (omx_err != OMX_ErrorNone)
{
Expand Down
47 changes: 0 additions & 47 deletions xbmc/cores/omxplayer/OMXVideo.cpp
Expand Up @@ -65,49 +65,6 @@

#define MAX_TEXT_LENGTH 1024

//#define DEBUG_PLAYBACK
static void dump_omx_buffer(OMX_BUFFERHEADERTYPE *omx_buffer)
{
if (!(g_advancedSettings.CanLogComponent(LOGDUMPVIDEO)))
return;
static FILE *fp;
if (!omx_buffer)
{
if (fp)
{
fclose(fp);
fp = NULL;
}
return;
}
if (!fp)
{
char filename[1024];
strcpy(filename, g_advancedSettings.m_logFolder.c_str());
strcat(filename, "video.dat");
#ifdef DEBUG_PLAYBACK
fp = fopen(filename, "rb");
#else
fp = fopen(filename, "wb");
#endif
}
if (fp)
{
#ifdef DEBUG_PLAYBACK
OMX_BUFFERHEADERTYPE omx = {0};
int s = fread(&omx, sizeof omx, 1, fp);
omx_buffer->nFilledLen = omx.nFilledLen;
omx_buffer->nFlags = omx.nFlags;
omx_buffer->nTimeStamp = omx.nTimeStamp;
if (s==1)
fread(omx_buffer->pBuffer, omx_buffer->nFilledLen, 1, fp);
#else
if (fwrite(omx_buffer, sizeof *omx_buffer, 1, fp) == 1)
fwrite(omx_buffer->pBuffer, omx_buffer->nFilledLen, 1, fp);
#endif
}
}

COMXVideo::COMXVideo() : m_video_codec_name("")
{
m_is_open = false;
Expand Down Expand Up @@ -163,7 +120,6 @@ bool COMXVideo::SendDecoderConfig()
memcpy((unsigned char *)omx_buffer->pBuffer, m_extradata, omx_buffer->nFilledLen);
omx_buffer->nFlags = OMX_BUFFERFLAG_CODECCONFIG | OMX_BUFFERFLAG_ENDOFFRAME;

dump_omx_buffer(omx_buffer);
omx_err = m_omx_decoder.EmptyThisBuffer(omx_buffer);
if (omx_err != OMX_ErrorNone)
{
Expand Down Expand Up @@ -756,7 +712,6 @@ bool COMXVideo::Open(CDVDStreamInfo &hints, OMXClock *clock, EDEINTERLACEMODE de
void COMXVideo::Close()
{
CSingleLock lock (m_critSection);
dump_omx_buffer(NULL);
m_omx_tunnel_clock.Deestablish();
m_omx_tunnel_decoder.Deestablish();
if(m_deinterlace)
Expand Down Expand Up @@ -851,7 +806,6 @@ int COMXVideo::Decode(uint8_t *pData, int iSize, double pts)
int nRetry = 0;
while(true)
{
dump_omx_buffer(omx_buffer);
omx_err = m_omx_decoder.EmptyThisBuffer(omx_buffer);
if (omx_err == OMX_ErrorNone)
{
Expand Down Expand Up @@ -982,7 +936,6 @@ void COMXVideo::SubmitEOS()

omx_buffer->nFlags = OMX_BUFFERFLAG_ENDOFFRAME | OMX_BUFFERFLAG_EOS | OMX_BUFFERFLAG_TIME_UNKNOWN;

dump_omx_buffer(omx_buffer);
omx_err = m_omx_decoder.EmptyThisBuffer(omx_buffer);
if (omx_err != OMX_ErrorNone)
{
Expand Down
4 changes: 0 additions & 4 deletions xbmc/settings/AdvancedSettings.cpp
Expand Up @@ -1388,10 +1388,6 @@ void CAdvancedSettings::SettingOptionsLoggingComponentsFiller(const CSetting *se
#ifdef TARGET_RASPBERRY_PI
list.push_back(std::make_pair(g_localizeStrings.Get(697), LOGOMXPLAYER));
#endif
#ifdef TARGET_RASPBERRY_PI
list.push_back(std::make_pair(g_localizeStrings.Get(698), LOGDUMPVIDEO));
list.push_back(std::make_pair(g_localizeStrings.Get(699), LOGDUMPAUDIO));
#endif
}

void CAdvancedSettings::setExtraLogLevel(const std::vector<CVariant> &components)
Expand Down

0 comments on commit c930319

Please sign in to comment.