I get a problem when loading data from AVFrame to openGL:

```
 int target_width = 320;
                int target_height = 240;
                img_convert_ctx = sws_getContext(pCodecCtx->width, pCodecCtx->height,
                                           pCodecCtx->pix_fmt,
                                           target_width, target_height, PIX_FMT_RGBA, SWS_FAST_BILINEAR,
                                           NULL, NULL, NULL);
                if(img_convert_ctx == NULL) {
                    LOGE("could not initialize conversion context\n");
                    return;
                }
                sws_scale(img_convert_ctx, (const uint8_t* const*)pFrame->data, pFrame->linesize, 0, pCodecCtx->height, pFrameRGB->data, pFrameRGB->linesize);
                //free(data);
                int line=target_width*target_height*4;
                data=(char*)malloc(line);
                if (!data)
                    LOGE("create data frame fail");
                LOGE("successful data");
                filldata(data,pFrameRGB,target_width,target_height);

```

with function filldata as:

```
    static void filldata(char *data,AVFrame *pFrame,int w,int h)
{uint8_t *frameLine;
    int  yy;
    int i=0;

for (yy = 0; yy < h; yy++) {

frameLine = (uint8_t *)pFrame->data[0] + (yy * pFrame->linesize[0]);

int xx;

for (xx = 0; xx < w; xx++) {
            int in_offset = xx * 4;

data[i++] = frameLine[in_offset];

data[i++] = frameLine[in_offset+1];

data[i++] = frameLine[in_offset+2];

data[i++] = frameLine[in_offset+3];
        }
    }
}

```

After that i use data to transfer to 

```
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, *wi, *he, 0, GL_RGBA, GL_UNSIGNED_BYTE, (GLvoid*)data);

```

but it cannot show texture, maybe data above and data in function gltextimage2D are different.
Please help me figure out what is the format for gltextimage2D so i can configure data to show texture. OR anyone has some sample code to show me.