Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 04 Apr 1998 13:25:15 -0800
From:      Amancio Hasty <hasty@rah.star-gate.com>
To:        Luigi Rizzo <luigi@labinfo.iet.unipi.it>
Cc:        multimedia@FreeBSD.ORG
Subject:   Re: problems with signals on capture with bt848 driver 
Message-ID:  <199804042125.NAA29768@rah.star-gate.com>
In-Reply-To: Your message of "Sat, 04 Apr 1998 14:45:24 %2B0200." <199804041245.OAA29386@labinfo.iet.unipi.it> 

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multipart MIME message.

--==_Exmh_10769161940
Content-Type: text/plain; charset=us-ascii

Try this small program. It uses signals to determine when to write 
a frame to disk.

	Have Fun,
	Amancio


--==_Exmh_10769161940
Content-Type: text/plain ; name="yuv12capture.c"; charset=us-ascii
Content-Description: yuv12capture.c
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="yuv12capture.c"

LyogQ2FwdHVyZSB5dXYgZnJhbWVzIHN1aXRhYmxlIGZvciBtcGVnIGVuY29vZGUgCiAqIGl0
IGNhcHR1cmVzIHl1djEyIGZyYW1lcyB0byBhIGZpbGUKICovCgovKiBDb3B5cmlnaHQgKGMp
IDE5OTcgQW1hbmNpbyBIYXN0eQogKiBBbGwgcmlnaHRzIHJlc2VydmVkLgogKgogKiBSZWRp
c3RyaWJ1dGlvbiBhbmQgdXNlIGluIHNvdXJjZSBhbmQgYmluYXJ5IGZvcm1zLCB3aXRoIG9y
IHdpdGhvdXQKICogbW9kaWZpY2F0aW9uLCBhcmUgcGVybWl0dGVkIHByb3ZpZGVkIHRoYXQg
dGhlIGZvbGxvd2luZyBjb25kaXRpb25zCiAqIGFyZSBtZXQ6CiAqIDEuIFJlZGlzdHJpYnV0
aW9ucyBvZiBzb3VyY2UgY29kZSBtdXN0IHJldGFpbiB0aGUgYWJvdmUgY29weXJpZ2h0CiAq
ICAgIG5vdGljZSwgdGhpcyBsaXN0IG9mIGNvbmRpdGlvbnMgYW5kIHRoZSBmb2xsb3dpb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weXV2XyA9PSAgLTEpIHJldHVybiAoMCk7CglmcmFtZXMg
PSAtMTsKCWMgPSAzMTsKCWlvY3RsKGJ0ODQ4LCBNRVRFT1JTU0lHTkFMLCAmYyk7CglzaWdu
YWwoMzEsIChzaWdfdCkgZG9fd3JpdGUpOwoJc2lnbmFsKFNJR0lOVCwgIChzaWdfdCkgZG9u
ZSk7CgoJICBjID0gTUVURU9SX0NBUF9DT05USU5PVVMgOwoJICBpb2N0bChidDg0OCwgTUVU
RU9SQ0FQVFVSLCAmYyk7CgkgIHdoaWxlIChmcmFtZXMgPCAoRlJBTUVTKzIpKSB7fTsKCglj
bG9zZShidDg0OCk7CglleGl0KDApOwp9Cgo=

--==_Exmh_10769161940--



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-multimedia" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199804042125.NAA29768>