dshow: try to improve multithreading code for RAW sample grabbing
commitc7d9a5cdacd1afb15ca73a42dbb48f7407bfb8e9
authorEdouard Gomez <ed.gomez@free.fr>
Tue, 14 Oct 2008 22:04:30 +0000 (15 00:04 +0200)
committerJean-Baptiste Kempf <jb@videolan.org>
Wed, 15 Oct 2008 23:49:31 +0000 (16 01:49 +0200)
tree814a6c982d4b2a2efd2d177ff3543f809bfb133c
parent0dd04d073d5f4c653e03064273985ce51cebd43c
dshow: try to improve multithreading code for RAW sample grabbing

# HG changeset patch
# User Edouard Gomez <ed.gomez@free.fr>
# Date 1224021637 -7200
# Node ID 0c4727aa17ba532172cae4aded7d16d70ea4ea53
# Parent  8e7c3f94407dc1500438237ac6bf3d484bfba742
dshow: try to improve multithreading code for RAW sample grabbing

This patch tries to address two theoritical problems:
 - The filter capturepin should not lock p_sys->lock. By chance, win32 mt
   locking is recursive by default.
    - Do not lock again, this makes things clearer for poor POSIX coders like
      me.
 - The current code does not try to push samples as fast as it receives them.
   This is caused by the arbitrary msleep call which can differ sample delivery
   with up to 10ms delay. Moreover, only a single sample at a time was processed
   either for audio or for video.
    - Use MT condition instead of sleep so no artificial delay is introduced in
      the delivery chain.
    - Process all available samples at once.

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
modules/access/dshow/dshow.cpp
modules/access/dshow/filter.cpp
modules/access/dshow/filter.h