Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
62 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
meta-oe/recipes-multimedia/showiframe/showiframe/showiframe-sh4.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 { |