Netcam Modulo 16 Patch

Uploaded by KennethLavrsen on behalf of PeterHolik who posted it on the mailing list.

Introduction

Motion cannot handle image dimensions unless they are a multiple of 16.

This is normally not a problem because all normal camera image size are multiples of 16.

But when you use a Netcam which may be the jpeg type the image could be scaled to anything.

Today Motion may fail when connected to such an image.

Description of Patch

The patch introduces a check for mulitiple of 16 and

  • Logs an error message
  • Exits the thread

Installation of Patch

patch < filename

Change History of Patch

Discussion and Comments

The patch came to late to be included in 3.2.2. We want to test it and maybe discuss if this is how we long term want to handle this. Maybe there is a way to make it work?

Patch is put on TWiki so we do not forget it.

-- KennethLavrsen - 13 Aug 2005


I took the liberty of uploading the diff file as well.

Two comments about the patch: Thanks - I forgot that - Kenneth
  1. I would prefer using % 16 vs. & 0x0F, since the former is much easier to understand in the code. They both result in the same assembler code, so increasing clarity has no performance penalty.
  2. Accepting this patch would simplify the rotate feature, since we could use one reverse function always (the fast quad one) instead of choosing one depending on image dimensions.

-- PerJonsson - 13 Aug 2005

Patch has been integrated with the following changes.

Will be in 3.2.4_snap1 and in 20050822 daily.

-- KennethLavrsen - 21 Aug 2005
Topic revision: r7 - 20 Dec 2005 - 22:10:03 - KennethLavrsen
 
Motion - Netcam Modulo 16 Patch
Copyright © 1999-2012 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Please do not email Kenneth for support questions (read why). Use the Support Requests page or join the Mailing List.