dvb.media_addon: Support dumping of the raw mpeg ts data.

- Main purpose is to debug a/v synchronization issues by playing the dumped
  mpeg ts data in alternative video players (like ffplay or MediaPlayer) and
  see how those behave.

- The commit diffs shows some coding style violations (max. line length) that
  show up throughout the whole DVBMediaNode class. Those will be fixed in the
  next commit to keep a clean separation between the different code changes.
This commit is contained in:
Colin Günther 2014-08-24 20:52:16 +02:00
parent bf29cdd777
commit 75a6d51e8a
2 changed files with 15 additions and 1 deletions

View File

@ -54,6 +54,7 @@
//#define DUMP_VIDEO
//#define DUMP_AUDIO
//#define DUMP_RAW_AUDIO
//#define DUMP_MPEG_TS
#include "DVBMediaNode.h"
@ -195,6 +196,9 @@ DVBMediaNode::DVBMediaNode(
#ifdef DUMP_RAW_AUDIO
fRawAudioFile = open("/boot/home/dvb-audio.raw", O_RDWR | O_CREAT | O_TRUNC);
#endif
#ifdef DUMP_MPEG_TS
fMpegTsFile = open("/boot/home/dvb-mpeg.ts", O_RDWR | O_CREAT | O_TRUNC);
#endif
}
@ -234,6 +238,9 @@ DVBMediaNode::~DVBMediaNode()
#ifdef DUMP_RAW_AUDIO
close(fRawAudioFile);
#endif
#ifdef DUMP_MPEG_TS
close(fMpegTsFile);
#endif
}
@ -1423,6 +1430,12 @@ DVBMediaNode::mpeg_ts_thread()
// TRACE("mpeg ts packet, size %6ld, start_time %14Ld\n", packet->Size(), packet->TimeStamp());
#ifdef DUMP_MPEG_TS
lock.Lock();
write(fMpegTsFile, packet->Data(), packet->Size());
lock.Unlock();
#endif
delete packet;
}
}
@ -1483,7 +1496,7 @@ DVBMediaNode::enc_video_thread()
#ifdef DUMP_VIDEO
const uint8 *data;
int8 *data;
size_t size;
if (B_OK != pes_extract(packet->Data(), packet->Size(), &data, &size)) {
TRACE("video pes_extract failed\n");

View File

@ -284,6 +284,7 @@ private:
int fVideoFile;
int fAudioFile;
int fRawAudioFile;
int fMpegTsFile;
};
#endif // __DVB_MEDIA_NODE_H