public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* Re: capture.c example (multiple inputs)
@ 2008-10-07 13:57 Brian Phelps
  2008-10-07 14:52 ` Daniel Glöckner
  0 siblings, 1 reply; 4+ messages in thread
From: Brian Phelps @ 2008-10-07 13:57 UTC (permalink / raw)
  To: video4linux-list

I did some digging and it looks like this single chip bt878 card must
cut the frame rate when switching inputs.  Is this correct?

I found a 4-chip version from bluecherry.com that seems to do this at
full 30 FPS per channel.

On Tue, Oct 7, 2008 at 9:15 AM, Brian Phelps <lm317t@gmail.com> wrote:
> Hi, I have a 4 input Hauppage ImpactVCB.
>
> I have modified capture.c to display frames from an input using SDL
> and the mmap method and this seems to work great.  I would like to
> modify capture.c to display video using 2 inputs.  The problem is that
> if I change inputs, I have to wait for another frame to enter the
> buffer.  This cuts the frame rate in half.
>
> How do I capture frames from two inputs without cutting the frame rate?
>
>
> static void
> mainloop                        (void)
> {
>   unsigned int count;
>
>   count = 1000;
>
>   //Frame_timer = SDL_AddTimer(INTERVAL, process_image, NULL);
>   while (count-- > 0)
>   {
>      for (;;)
>      {
>         fd_set fds;
>         struct timeval tv;
>         int r;
>
>         FD_ZERO (&fds);
>         FD_SET (fd, &fds);
>
>         /* Timeout. */
>         tv.tv_sec = 2;
>         tv.tv_usec = 0;
>
>         r = select (fd + 1, &fds, NULL, NULL, &tv);
>
>         if (-1 == r)
>         {
>            if (EINTR == errno)
>               continue;
>
>            errno_exit ("select");
>         }
>
>         if (0 == r)
>         {
>            fprintf (stderr, "select timeout\n");
>            exit (EXIT_FAILURE);
>         }
>
> //         if (read_frame (0))
>         {
>            ;
>            //r = select (fd + 1, &fds, NULL, NULL, &tv);
>         }
>
>
>         while(read_frame (0)==0)  // I modified read_frame to change
> the input: read_frame(int input_number)
>            r = select (fd + 1, &fds, NULL, NULL, &tv);
>
>         while(read_frame (1)==0)
>            r = select (fd + 1, &fds, NULL, NULL, &tv);
>            break;
>
>         /* EAGAIN - continue select loop. */
>      }
>      printf("Count is %d\n", count);
>   }
> }
>



-- 
Brian Phelps
System Design Engineer
Custom Light and Sound
919-286-0011
http://customlightandsound.com

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-10-07 18:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-07 13:57 capture.c example (multiple inputs) Brian Phelps
2008-10-07 14:52 ` Daniel Glöckner
2008-10-07 16:34   ` Brian Phelps
2008-10-07 18:37     ` Daniel Glöckner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox