Add compile time configurable trickspeed packets dump.

This commit is contained in:
Johns 2013-07-29 19:14:32 +02:00
parent 171a3f4dc9
commit 8ff65a011a
3 changed files with 21 additions and 0 deletions

View File

@ -1,6 +1,7 @@
User johns
Date:
Add compile time configurable trickspeed packets dump.
Fix bug #1410: wrong spelled AC-3 and E-AC-3.
Add compile time selectable h264 trickspeed workaround.
Use ffmpeg new names AVCodecID, AV_CODEC_... .

View File

@ -36,6 +36,7 @@ CONFIG += -DUSE_PIP # PIP support
#CONFIG += -DUSE_TS_VIDEO # build new ts video parser
#CONFIG += -DUSE_MPEG_COMPLETE # support only complete mpeg packets
#CONFIG += -DH264_EOS_TRICKSPEED # insert seq end packets for trickspeed
#CONDIF += -DDUMP_TRICKSPEED # dump trickspeed packets
CONFIG += -DUSE_VDR_SPU # use VDR SPU decoder.
#CONFIG += -DUSE_SOFTLIMIT # (tobe removed) limit the buffer fill

View File

@ -22,6 +22,7 @@
#define noUSE_SOFTLIMIT ///< add soft buffer limits to Play..
#define noUSE_PIP ///< include PIP support + new API
#define DUMP_TRICKSPEED ///< dump raw trickspeed packets
#include <sys/types.h>
#include <sys/stat.h>
@ -2224,6 +2225,24 @@ int PlayVideo3(VideoStream * stream, const uint8_t * data, int size)
&& check[1] == 0x09 && !check[3] && !check[4]) {
// old PES HDTV recording z == 2 -> stronger check!
if (stream->CodecID == AV_CODEC_ID_H264) {
#ifdef DUMP_TRICKSPEED
if (stream->TrickSpeed) {
char buf[1024];
int fd;
static int FrameCounter;
snprintf(buf, sizeof(buf), "frame_%06d_%08d.raw", getpid(),
FrameCounter++);
if ((fd =
open(buf, O_WRONLY | O_CLOEXEC | O_CREAT | O_TRUNC,
0666)) >= 0) {
if (write(fd, data + 9 + n, size - 9 - n)) {
// this construct is to remove the annoying warning
}
close(fd);
}
}
#endif
#ifdef H264_EOS_TRICKSPEED
// this should improve ffwd+frew, but produce crash in ffmpeg
// with some streams