summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohns <johns98@gmx.net>2013-07-29 19:14:32 +0200
committerJohns <johns98@gmx.net>2013-07-29 19:14:32 +0200
commit8ff65a011a6e6a76167734b21c3eb7dac9a905b1 (patch)
tree2f22610ec8f7a6a67e710b99221ebd801731b2ab
parent171a3f4dc9f54c3e9cc36ef5214b50e8776bade5 (diff)
downloadvdr-plugin-softhddevice-8ff65a011a6e6a76167734b21c3eb7dac9a905b1.tar.gz
vdr-plugin-softhddevice-8ff65a011a6e6a76167734b21c3eb7dac9a905b1.tar.bz2
Add compile time configurable trickspeed packets dump.
-rw-r--r--ChangeLog1
-rw-r--r--Makefile1
-rw-r--r--softhddev.c19
3 files changed, 21 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index eb1de60..405949d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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_... .
diff --git a/Makefile b/Makefile
index 5a9af40..03a86be 100644
--- a/Makefile
+++ b/Makefile
@@ -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
diff --git a/softhddev.c b/softhddev.c
index 964674a..e3787bd 100644
--- a/softhddev.c
+++ b/softhddev.c
@@ -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