[Sumover-dev] [svn commit] r4230 - vic/branches/mpeg4/video
sumover-dev at cs.ucl.ac.uk
sumover-dev at cs.ucl.ac.uk
Sat Jul 26 13:44:51 BST 2008
Author: douglask
Date: Sat Jul 26 13:44:47 2008
New Revision: 4230
Modified:
vic/branches/mpeg4/video/grabber-video4linux.cpp
Log:
D1_WIDTH of 720 doesn't work with webcams and PAL capture cards,
now defaults to NTSC_WIDTH of 640 if PAL/SECAM not selected.
Modified: vic/branches/mpeg4/video/grabber-video4linux.cpp
==============================================================================
--- vic/branches/mpeg4/video/grabber-video4linux.cpp (original)
+++ vic/branches/mpeg4/video/grabber-video4linux.cpp Sat Jul 26 13:44:47 2008
@@ -356,14 +356,6 @@
max_width_ = capability.maxwidth;
max_height_ = capability.maxheight;
- if(max_width_ >= D1_WIDTH || max_height_ >= D1_HEIGHT){
- base_width_ = D1_WIDTH;
- base_height_ = D1_HEIGHT;
- }else{
- base_width_ = max_width_;
- base_height_ = max_height_;
- }
-
channels = (struct video_channel *)
calloc(capability.channels, sizeof(struct video_channel));
for (i = 0; i < capability.channels; i++) {
@@ -1061,10 +1053,24 @@
struct video_channel channel;
debug_msg("V4L: format\n");
- if(decimate_!=1){
- width_ = CIF_WIDTH * 2 / decimate_;
- height_ = CIF_HEIGHT * 2 / decimate_;
- }else{
+ base_width_ = max_width_;
+ base_height_ = max_height_;
+ if (norm_ == VIDEO_MODE_PAL || norm_ == VIDEO_MODE_SECAM) {
+ if (max_width_ >= PAL_WIDTH && max_height_ == PAL_HEIGHT) {
+ base_width_ = PAL_WIDTH;
+ base_height_ = PAL_HEIGHT;
+ }
+ } else {
+ if (max_width_ >= NTSC_WIDTH && max_height_ >= NTSC_HEIGHT) {
+ base_width_ = NTSC_WIDTH;
+ base_height_ = NTSC_HEIGHT;
+ }
+ }
+
+ if (decimate_ != 1) {
+ width_ = CIF_WIDTH * 2 / decimate_;
+ height_ = CIF_HEIGHT * 2 / decimate_;
+ } else {
width_ = base_width_;
height_ = base_height_;
}
More information about the Sumover-dev
mailing list