Skip to content

Commit

Permalink
fix miniTV und Bootbild sh4
Browse files Browse the repository at this point in the history
  • Loading branch information
kueken committed Nov 28, 2016
1 parent 9866147 commit 378dc7e
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 4 deletions.
4 changes: 0 additions & 4 deletions meta-brands/meta-fulan/recipes-drivers/fulan-dvb-modules.inc
Expand Up @@ -28,17 +28,13 @@ SRC_URI = " \
file://aotom_spark_procfs.patch;patch=1 \
file://silence_tuner_printk.patch;patch=1 \
file://silence_stmfb_printk.patch;patch=1 \
file://disable_video_free_on_release.patch;patch=1 \
file://add_hdmi_colorspace_proc.patch;patch=1 \
file://ddbootup \
file://sh4booster \
file://modules.conf \
file://modules-conf.conf \
file://COPYING \
"
SRC_URI_remove_opennfr = " \
file://disable_video_free_on_release.patch;patch=1 \
"

FILES_${PN} = "${sysconfdir}/init.d ${sysconfdir}/rcS.d ${sysconfdir}/modules-load.d ${sysconfdir}/modprobe.d"
FILES = ""
Expand Down
4 changes: 4 additions & 0 deletions meta-oe/recipes-multimedia/showiframe/showiframe.bb
Expand Up @@ -10,6 +10,10 @@ PR = "r4"

SRC_URI = "file://showiframe.c"

SRC_URI_append_sh4 = " \
file://showiframe-sh4.patch \
"

S = "${WORKDIR}"

do_compile() {
Expand Down
@@ -0,0 +1,58 @@
--- a/showiframe.c 2016-03-14 19:43:01.127209540 +0200
+++ b/showiframe.c 2016-03-14 20:01:14.800632786 +0200
@@ -134,6 +134,8 @@
if (fork() != 0)
return 0;

+ ioctl(fd, VIDEO_SET_FORMAT, VIDEO_FORMAT_16_9);
+
size_t pos = 0;
int seq_end_avail = 0;
/* 0x0 0x0 0x1 0xffffffe0 0x10 0x8 0xffffff80 0xffffff80 0x5 0x21 0x0 0x1 0x0 0x1 */
@@ -149,14 +151,14 @@
read(f, iframe, s.st_size);

#ifndef HAVE_AMLOGIC
- if(iframe[0] == 0x00 && iframe[1] == 0x00 && iframe[2] == 0x00 && iframe[3] == 0x01 && (iframe[4] & 0x0f) == 0x07)
+ /* if(iframe[0] == 0x00 && iframe[1] == 0x00 && iframe[2] == 0x00 && iframe[3] == 0x01 && (iframe[4] & 0x0f) == 0x07)
ioctl(fd, VIDEO_SET_STREAMTYPE, 1); // set to mpeg4
else
- ioctl(fd, VIDEO_SET_STREAMTYPE, 0); // set to mpeg2
- c(ioctl(fd, VIDEO_SELECT_SOURCE, VIDEO_SOURCE_MEMORY));
- c(ioctl(fd, VIDEO_PLAY));
- c(ioctl(fd, VIDEO_CONTINUE));
- c(ioctl(fd, VIDEO_CLEAR_BUFFER));
+ ioctl(fd, VIDEO_SET_STREAMTYPE, 0); // set to mpeg2 */
+ ioctl(fd, VIDEO_SELECT_SOURCE, VIDEO_SOURCE_MEMORY);
+ ioctl(fd, VIDEO_PLAY);
+ ioctl(fd, VIDEO_CONTINUE);
+ ioctl(fd, VIDEO_CLEAR_BUFFER);
#endif
while(pos <= (s.st_size-4) && !(seq_end_avail = (!iframe[pos] && !iframe[pos+1] && iframe[pos+2] == 1 && iframe[pos+3] == 0xB7)))
++pos;
@@ -169,9 +171,22 @@
write_all(fd, seq_end, sizeof(seq_end));
write_all(fd, stuffing, 8192);
#ifndef HAVE_AMLOGIC
- usleep(150000);
- c(ioctl(fd, VIDEO_STOP, 0));
- c(ioctl(fd, VIDEO_SELECT_SOURCE, VIDEO_SOURCE_DEMUX));
+ int end = 0;
+ char progress_ch [4];
+ while (!end)
+ {
+ sleep (1);
+ int progress_fd = open("/proc/progress", O_RDONLY);
+ read(progress_fd, progress_ch, 4);
+ close(progress_fd);
+ progress_ch[3] = '\0';
+ if (atoi(progress_ch) >= 95)
+ end = 1;
+ }
+
+ ioctl(fd, VIDEO_STOP, 0);
+ ioctl(fd, VIDEO_SELECT_SOURCE, VIDEO_SOURCE_DEMUX);
+ close(fd);
#else
struct buf_status vbuf;
do {

0 comments on commit 378dc7e

Please sign in to comment.