Mailing List archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: OSD and images
Ralph Metzler wrote:
> Sorry, stupid mistake on my part.
>
> In gpioirq() in "case DATA_BMP_LOAD:" add:
>
> if (len>6*1024)
> len=6*1024;
>
Thanx.
I have another problem.
If I playback from file and at the same time display images
driver hangs. This usually happens after displaying few images.
I attached software for testing this, first argument is filename.
I hope you can solve this.
Matjaz
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include "../DVB/driver/dvb_v4l.h"
#include "../DVB/libdvb/OSD.h"
int dev, fd, i;
char tmp[2048];
int main (int argc, char *argv[]){
if (argc != 2){
printf("usage:\ntest filename\n");
return(1);
}
dev = open("/dev/video", O_RDWR);
if(!fork()){
char bmp[720*574];
for(i=0; i<720*574; i++)
bmp[i]=(i/25)&3;
for(i=0; i<10; i++){
sleep(1);
OSDOpen(dev, 100, 420, 640, 500, 2, 0);
OSDSetColor(dev, 0, 0, 0, 0, 255);
OSDSetColor(dev, 1, 0, 255, 0, 255);
OSDSetColor(dev, 2, 0, 0, 100, 255);
OSDSetColor(dev, 3, 255, 0, 0, 255);
OSDSetBlock(dev, 0, 0, 400, 70, 500, bmp);
sleep(1);
OSDClose(dev);
}
close(dev);
exit(0);
}
fd = open (argv[1], O_RDONLY);
if(fd<0){
printf("can't open file %s\n", (argv[1]));
return(1);
}
while(read(fd, tmp, 2048)==2048)
write(dev, tmp, 2048);
close(dev);
close(fd);
return 0;
}
Home |
Main Index |
Thread Index