Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linux-dvb] I found a way to display still .jpg and .ppm s on the TV



Marcus,

what do videoPlay(fd) in load_iframe and play_file_video(filefd, fd) in
main refer to?

I have commented that out so that it compiles however providing standard
jpg both (352x288 and 768x576) to the executable just produces a black
screen for 3 seconds.

Any hint?

Regards,

Robert

Are you aware that there is a call in the DVB API where you can send
an I-frame to be displayed as a still picture?

So you could do something like this:

int videoStillPicture(int fd, struct videoDisplayStillPicture *sp)
{
           int ans;

           if ( (ans = ioctl(fd,VIDEO_STILLPICTURE, sp) < 0)){
                     perror("VIDEO STILLPICTURE: ");
                     return -1;
           }

           return 0;
}

void load_iframe(int filefd, int fd)
{
           struct stat st;
           struct videoDisplayStillPicture sp;

           fstat(filefd, &st);

           sp.iFrame = (char *) malloc(st.st_size);
           sp.size = st.st_size;
           printf("I-frame size: %d\n", sp.size);

           if(!sp.iFrame) {
                     printf("No memory for I-Frame\n");
                     return;
           }

           printf("read: %d bytes\n",read(filefd,sp.iFrame,sp.size));
           videoStillPicture(fd,&sp);

           sleep(3); //hold picture for 3 secs and then start replay again
           videoPlay(fd);
}

main(int argc, char **argv)
{
           int fd;
           int filefd;

           if (argc < 2) return -1;

           if ( (filefd = open(argv[1],O_RDONLY)) < 0){
                     perror("File open:");
                     return -1;
           }
           if((fd = open("/dev/ost/video",O_RDWR|O_NONBLOCK)) < 0){
                     perror("VIDEO DEVICE: ");
                     return -1;
           }

           load_iframe(filefd, fd);
           play_file_video(filefd, fd);
           close(fd);
           close(filefd);
           return 0;
}



--- 
Info:
To unsubscribe send a mail to listar@linuxtv.org with "unsubscribe linux-dvb" as subject.



Home | Main Index | Thread Index