Permalink
Browse files

Revert "[omxplayer] Add ability to dump out audio/video data for late…

…r debugging"

This reverts commit 5a1f52c8c845fb77150dd585cecb3c4869729b9f.
  • Loading branch information...
popcornmix committed Jan 18, 2016
1 parent a3f91fe commit 36a13ff31ddc92219c3085f11d73e4faa2bad795
@@ -2995,16 +2995,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 681 to 699
msgctxt "#700"
View
@@ -54,8 +54,6 @@
#define LOGCEC (1 << (LOGMASKBIT + 9))
#define LOGVIDEO (1 << (LOGMASKBIT + 10))
#define LOGOMXPLAYER (1 << (LOGMASKBIT + 16))
#define LOGDUMPVIDEO (1 << (LOGMASKBIT + 17))
#define LOGDUMPAUDIO (1 << (LOGMASKBIT + 18))
#include "utils/params_check_macros.h"
@@ -36,7 +36,6 @@
#include "linux/XMemUtils.h"
#include "settings/AdvancedSettings.h"
#include "filesystem/SpecialProtocol.h"
#include "settings/MediaSettings.h"
#include "settings/Settings.h"
#include "guilib/LocalizeStrings.h"
@@ -56,49 +55,6 @@ extern "C" {
#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, CSpecialProtocol::TranslatePath("special://logpath").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
//////////////////////////////////////////////////////////////////////
@@ -903,7 +859,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)
{
@@ -939,8 +894,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() )
@@ -1221,7 +1174,6 @@ unsigned int COMXAudio::AddPackets(const void* data, unsigned int len, double dt
if(demuxer_samples_sent == demuxer_samples)
omx_buffer->nFlags |= OMX_BUFFERFLAG_ENDOFFRAME;
dump_omx_buffer(omx_buffer);
omx_err = m_omx_decoder.EmptyThisBuffer(omx_buffer);
if (omx_err != OMX_ErrorNone)
{
@@ -1461,7 +1413,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)
{
@@ -30,7 +30,6 @@
#include "linux/XMemUtils.h"
#include "DVDDemuxers/DVDDemuxUtils.h"
#include "settings/AdvancedSettings.h"
#include "filesystem/SpecialProtocol.h"
#include "settings/MediaSettings.h"
#include "cores/VideoPlayer/VideoRenderers/RenderManager.h"
#include "xbmc/guilib/GraphicContext.h"
@@ -66,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, CSpecialProtocol::TranslatePath("special://logpath").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(CRenderManager& renderManager) : m_video_codec_name("")
, m_renderManager(renderManager)
{
@@ -160,7 +116,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)
{
@@ -714,7 +669,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)
@@ -833,7 +787,6 @@ int COMXVideo::Decode(uint8_t *pData, int iSize, double dts, double pts, bool &s
if(demuxer_bytes == 0)
omx_buffer->nFlags |= OMX_BUFFERFLAG_ENDOFFRAME;
dump_omx_buffer(omx_buffer);
omx_err = m_omx_decoder.EmptyThisBuffer(omx_buffer);
if (omx_err != OMX_ErrorNone)
{
@@ -961,7 +914,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)
{
@@ -1362,10 +1362,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)

0 comments on commit 36a13ff

Please sign in to comment.