All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Ringel <stefan.ringel@arcor.de>
To: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>
Subject: Re: tm6000 calculating urb buffer
Date: Tue, 04 May 2010 17:38:53 +0200	[thread overview]
Message-ID: <4BE03F8D.1050905@arcor.de> (raw)
In-Reply-To: <4BDB3017.9070101@arcor.de>

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

Am 30.04.2010 21:31, schrieb Stefan Ringel:
> Am 30.04.2010 18:34, schrieb Stefan Ringel:
>   
>> Hi Mauro,
>>
>> Today I'm writing directly to you, because it doesn't work the mailing
>> list. I thought over the calculating urb buffer and I have follow idea:
>>
>> buffer = endpoint fifo size (3072 Bytes) * block size (184 Bytes)
>>
>> The actually calculating is a video frame size (image = width * hight *
>> 2 Bytes/Pixel), so that this buffer has to begin and to end an
>> uncomplete block. followed blocks are setting the logic to an err_mgs
>> block, so that going to lost frames.
>>
>>   
>>     
> I forgot a log with old calculating.
>
>   


-- 
Stefan Ringel <stefan.ringel@arcor.de>


[-- Attachment #2: datagram_urb_to_videobuf --]
[-- Type: text/plain, Size: 2238 bytes --]

tm6000

datagram from urb to videobuf

urb           copy to     temp         copy to         1. videobuf
                         buffer                        2. audiobuf
                                                       3. vbi
184 Packets   ------->   184 * 3072    ---------->     4. etc.
a 3072 bytes               bytes
               184 *                   3072 *
             3072 bytes              180 bytes
                                (184 bytes - 4 bytes
                                    header )
                                    
                                    
step 1

copy from urb to temp buffer

snip
----
for (i = 0; i < urb->number_of_packets; i++) {
	int status = urb->iso_frame_desc[i].status;
	
	if (status<0) {
		print_err_status (dev,i,status);
		continue;
	}

	len=urb->iso_frame_desc[i].actual_length;

	memcpy (t_buf[i*len], urb->transfer_buffer[i*len], len);
	copied += len;
	if (copied >= size || !buf)
		break;

}

if (!urb->iso_frame_desc[i].status) {
	if ((buf->fmt->fourcc)==V4L2_PIX_FMT_TM6000) {
		rc=copy_multiplexed(t_buf, outp, len, urb, &buf);
		if (rc<=0)
			return rc;
	} else {
		copy_streams(t_buf, outp, len, urb, &buf);
	}
}
---
snip

step 2

copy from temp buffer into videobuffer

snip
---

for (i=0;i<3072;i++) {
	switch(cmd) {
		case TM6000_URB_MSG_VIDEO:
			/* Fills video buffer */
			memcpy(&out_p[(line << 1 + field) * block * 180],
				ptr[(i*184)+4], 180);
			printk (KERN_INFO "cmd=%s, size=%d\n",
			tm6000_msg_type[cmd],size);
			break;
		case TM6000_URB_MSG_PTS:
			printk (KERN_INFO "cmd=%s, size=%d\n",
			tm6000_msg_type[cmd],size);
			break;
		case TM6000_URB_MSG_AUDIO:
			/* Need some code to process audio */
			printk ("%ld: cmd=%s, size=%d\n", jiffies,
			tm6000_msg_type[cmd],size);
			break;
		default:
			dprintk (dev, V4L2_DEBUG_ISOC, "cmd=%s, size=%d\n",
			printk (KERN_INFO "cmd=%s, size=%d\n",
			tm6000_msg_type[cmd],size);
		}
	}
}

---
snip

This is a schemata to copy in videobuf.

temp_buf = fifo size * block size

viodeobuf = hight * wight * 2


Questions

1. Is it right if I copy the block without header to videobufer?
2. Can I full the videobuffer have more temp_bufs?
3. How are the actually data schema from urb to videobuffer?

       reply	other threads:[~2010-05-04 15:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4BDB067E.4070501@arcor.de>
     [not found] ` <4BDB3017.9070101@arcor.de>
2010-05-04 15:38   ` Stefan Ringel [this message]
2010-05-04 18:25     ` tm6000 calculating urb buffer Mauro Carvalho Chehab
2010-05-04 19:13       ` Stefan Ringel
2010-05-04 19:50         ` Mauro Carvalho Chehab
2010-05-04 19:58           ` Stefan Ringel
2010-05-05  6:07             ` Mauro Carvalho Chehab

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=4BE03F8D.1050905@arcor.de \
    --to=stefan.ringel@arcor.de \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.