public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <j.w.r.degoede@hhs.nl>
To: Jean-Francois Moine <moinejf@free.fr>
Cc: Linux and Kernel Video <video4linux-list@redhat.com>
Subject: Patch: gspca-pac73xx-sof-detect.patch
Date: Fri, 22 Aug 2008 23:28:07 +0200	[thread overview]
Message-ID: <48AF2F67.5000900@hhs.nl> (raw)

[-- Attachment #1: Type: text/plain, Size: 348 bytes --]

Hi,

This patch adjusts the pac73xx sof detection, we were throwing away 2 bytes 
after the sof, but one of those 2 actually is the first magic marker for the 
first MCU, as we may need those markers in the future pass the 2 bytes to 
userspace, this also simplifies the code :)

Signed-off-by: Hans de Goede <j.w.r.degoede@hhs.nl>

Regards,

Hans

[-- Attachment #2: gspca-pac73xx-sof-detect.patch --]
[-- Type: text/plain, Size: 1611 bytes --]

Adjust pac73xx sof detection, we were throwing away 2 bytes after the sof,
but one of those 2 actually is the first magic marker for the first MCU, as
we may need those markers in the future pass the 2 bytes to userspace, this
also simplifies the code :)

Signed-off-by: Hans de Goede <j.w.r.degoede@hhs.nl>

p.s.

Matching userspace code has now been committed to my tree:
http://linuxtv.org/hg/~hgoede/v4l-dvb
diff -r 55d686bc5075 linux/drivers/media/video/gspca/pac7311.c
--- a/linux/drivers/media/video/gspca/pac7311.c	Fri Aug 22 22:51:29 2008 +0200
+++ b/linux/drivers/media/video/gspca/pac7311.c	Fri Aug 22 22:54:13 2008 +0200
@@ -70,7 +70,6 @@
 #define SENSOR_PAC7311 1
 
 	u8 sof_read;
-	u8 header_read;
 	u8 autogain_ignore_frames;
 
 	atomic_t avg_lum;
@@ -759,8 +758,6 @@
 /* Include pac common sof detection functions */
 #include "pac_common.h"
 
-#define HEADER_LENGTH 2
-
 /* this function is run at interrupt level */
 static void sd_pkt_scan(struct gspca_dev *gspca_dev,
 			struct gspca_frame *frame,	/* target */
@@ -834,22 +831,7 @@
 		gspca_frame_add(gspca_dev, INTER_PACKET, frame, tmpbuf, 4);
 		gspca_frame_add(gspca_dev, INTER_PACKET, frame,
 			pac7311_jpeg_header2, sizeof(pac7311_jpeg_header2));
-
-		sd->header_read = 0;
 	}
-
-	if (sd->header_read < HEADER_LENGTH) {
-		/* skip the variable part of the sof header */
-		int needed = HEADER_LENGTH - sd->header_read;
-		if (len <= needed) {
-			sd->header_read += len;
-			return;
-		}
-		data += needed;
-		len -= needed;
-		sd->header_read = HEADER_LENGTH;
-	}
-
 	gspca_frame_add(gspca_dev, INTER_PACKET, frame, data, len);
 }
 

[-- Attachment #3: Type: text/plain, Size: 164 bytes --]

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

                 reply	other threads:[~2008-08-22 21:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48AF2F67.5000900@hhs.nl \
    --to=j.w.r.degoede@hhs.nl \
    --cc=moinejf@free.fr \
    --cc=video4linux-list@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox