Search

Technical Discussion Group Forum

This forum is provided for user discussion. While Beacon EmbeddedWorks support staff and engineers participate, Beacon EmbeddedWorks does not guarantee the accuracy of all information within in the Technical Discussion Group (TDG).

The "Articles" forums provide brief Articles written by Beacon EmbeddedWorks engineers that address the most frequently asked technical questions.

To receive email notifications when updates are posted for a Beacon EmbeddedWorks product download, please subscribe to the TDG Forum of interest.

TDG Forum

PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 17 Oct 2008 02:02 AM by  flyingbird_hi@126.com
how to display YUV picture on the LCD
 0 Replies
Sort:
You are not authorized to post a reply.
Author Messages
flyingbird_hi@126.com
New Member
New Member
Posts:


--
17 Oct 2008 02:02 AM
    i want to display the YUV(4:2:0)picture on the LCD.
    i do in the following ways:
    #include <linux/fb.h>
    #include <asm-arm/arch-omap/omapfb.h>
    setup_fb(int width, int height)

    {

    int fb = open("/dev/fb0", O_RDWR);



    if (fb == -1)

    {

    perror("/dev/fb0");

    exit(1);

    }



    if (ioctl(fb, FBIOGET_VSCREENINFO, &sinfo_p0) == -1)

    {

    perror("FBIOGET_VSCREENINFO");

    exit(1);

    }

    if (ioctl(fb, OMAPFB_QUERY_PLANE, &pinfo) == -1)

    {

    perror("OMAPFB_QUERY_PLANE");

    exit(1);

    }



    if (ioctl(fb, OMAPFB_QUERY_MEM, &minfo) == -1)

    {

    perror("OMAPFB_QUERY_MEM");

    exit(1);

    }



    sinfo.xres = FFMIN(sinfo_p0.xres, width) & ~15;

    sinfo.yres = FFMIN(sinfo_p0.xres, height) & ~15;

    sinfo.nonstd = OMAPFB_COLOR_YUV420;



    if (ioctl(fb, FBIOPUT_VSCREENINFO, &sinfo) == -1)

    {

    perror("FBIOPUT_VSCREENINFO");

    exit(1);

    }



    pinfo.enabled = 1;

    pinfo.pos_x = sinfo_p0.xres / 2 - sinfo.xres / 2;

    pinfo.pos_y = sinfo_p0.yres / 2 - sinfo.yres / 2;

    pinfo.out_width = sinfo.xres;

    pinfo.out_height = sinfo.yres;



    if (ioctl(fb, OMAPFB_SETUP_PLANE, &pinfo) == -1)

    {

    perror("OMAPFB_SETUP_PLANE");

    exit(1);

    }



    return fb;

    }



    in the main function:

    {

    fb = setup_fb(320,240);

    fbmem = mmap(NULL, minfo.size, PROT_READ|PROT_WRITE, MAP_SHARED, fb, 0);

    then we read the display YUV to fbmem.

    }

    then it display the "OMAPFB_QUERY_MEM invalid argument"
    can anybody tell me the reason
    You are not authorized to post a reply.