How to get every frame data with streamer project and display it

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
steven
Level 4
Level 4
50 replies posted 25 replies posted 10 replies posted

  HI:      in   C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\application\cpp\streamer  project  ,how to get every frame  data and  display it..

0 Likes
1 Solution
JayakrishnaT_76
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hello,

The application Streamer is generally used to find the throughput of data transfer. If you want to display the data that was actually transferred, then it will cause a reduction in throughput.

You can try the following to display the data sent to the host completely:

1. Call the function Display16Bytes with 2 parameters. [Display16Bytes(buffers, rLen);

2. Inside the definition of the function Display16Bytes, change the for loop limit from 16 to rLen.

This will completely display the data that is received by the host.

Best Regards,

Jayakrishna

Best Regards,
Jayakrishna

View solution in original post

0 Likes
9 Replies
JayakrishnaT_76
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hello,

The application Streamer is generally used to find the throughput of data transfer. If you want to display the data that was actually transferred, then it will cause a reduction in throughput.

You can try the following to display the data sent to the host completely:

1. Call the function Display16Bytes with 2 parameters. [Display16Bytes(buffers, rLen);

2. Inside the definition of the function Display16Bytes, change the for loop limit from 16 to rLen.

This will completely display the data that is received by the host.

Best Regards,

Jayakrishna

Best Regards,
Jayakrishna
0 Likes

Jayakrishna:

   thanks you reply . Can  use bulk translate to maximize the frame rate of cx3? If I start two threads in streamer project, one is transmission and the other is display thread. Will this reduce the rate?

0 Likes

Hello,

You can try using another thread for displaying the data. This should improve the throughput compared to the present implementation. But, we do not have reference examples of the same to share for this implementation.

Best Regards,

Jayakrishna

Best Regards,
Jayakrishna
0 Likes

Jayakrishna:

                    in Streamer project  ,how  i  can get  one frame data,    How do I know the end of a frame。

0 Likes

Hello,

For distinguishing one frame from another, you can use the following ways:

1. Count the amount of data received by the host application. When the count reaches the size of the video frame in bytes, you would have completely received that particular video frame.

2. If the video frame size is not a multiple of rlen, then you can use rlen to distinguish the end of frame. The last buffer received by the host application for a particular frame will have a lower value of rlen compared to the rlen of the remaining buffers associated with that frame.

Best Regards,

Jayakrishna

Best Regards,
Jayakrishna
0 Likes
lock attach
Attachments are accessible only for community members.

Jayakrishna:

         

    can give me  a  code  for judge one frame end  and  one frame data output  a buffer,  why  rLen =2097152

if (EndPt->FinishDataXfer(buffers, rLen, &inOvLap, contexts))

{

Successes++;

BytesXferred += rLen;

if (BytesXferred == 2625536)

{

memcpy(gBuffer, buffers, rLen);

}

}

anthoner  thread:

dispalybuffer{

          formshow(gBuffer);  gBuffer is a public type,   i  in  xferloop thread  copy one frame to  gBuffer  ,and  in  display thread  to show this buffer.  

}

0 Likes

Hello,

The approach that you have used now seems to be incorrect. According to this approach, when the bytes transferred reaches the size of the frame, you just copy the last buffer contents into gBuffer and displays it. Which is not correct.

For sending a complete frame to the host, multiple buffers (buffers) will be required.

When the FinishDataXfer API is called for the initial buffers of the frame, the parameter rLen will be same as len. But for the last buffer, rLen will be less than len. Please note that this will happen only if the total frame size in bytes is not a multiple of len. If the total frame size in bytes is a multiple of len, then you cannot use this approach to distinguish the end of frame. In this case, you can count the amount of data received by the host application (just the way you have done, but once the count limit is reached, it should be reset to 0 for tracking the next frames). Also, you need to display all the buffers before the last buffer (the buffer satisfying end of frame condition mentioned above).

Please note that we do not have a sample implementation to share for this requirement as of now.

Best Regards,

Jayakrishna

Best Regards,
Jayakrishna
0 Likes
lock attach
Attachments are accessible only for community members.

Jayakrishna :

    I still can't get an image, I have signed NDA, can you send me an email? zhangyl@irischina.com ,I've been stuck with this problem for days. What I want to achieve is to display real-time images based on the driver.

0 Likes

Hello,

Please try developing the custom host application by referring to the source codes of streamer application and open source UVC players like MPC-HC. The source code for streamer can be referred to understand how the data is read from CX3 and the source code for MPC-HC can be referred to understand how to display the video.

Best Regards,

Jayakrishna

Best Regards,
Jayakrishna
0 Likes