How can I merge the same decoded frame twice on top of one another while decoding using ijkplayer. My decoded frame is of size 4096*2048. I have created a big overlay of size 4096*4096 and want to put the same frame twice on top of one another. Here is the piece of code I used in ijkplayer
int bytes_num = avpicture_get_size(12,4096, 2048);//4096);//4096, 2048);
if(buff==NULL)
{
buff = (uint8_t * ) av_malloc(bytes_num);
}
uint8_t * buff_point;
memcpy(buff_point, src_frame->data, sizeof(src_frame->data));
buff_point += sizeof(src_frame->data);
memcpy(buff_point, src_frame->data, sizeof(src_frame->data));
buff_point += sizeof(src_frame->data);
src_frame->width = 4096; //4096
src_frame->height = 4096;
src_frame->format = 12;
av_image_fill_arrays(src_frame->data, src_frame->linesize, buff, 12/*src_frame->format*/, 4096, 4096/*8192*/, 32);
//creating the overlay
SDL_VoutSetOverlayFormat(ffp->vout, ffp->overlay_format);
vp->bmp = SDL_Vout_CreateOverlay(4096, 4096, 12, ffp->vout);
//filling the overlay with frame
if (SDL_VoutFillFrameYUVOverlay(vp->bmp,src_frame) < 0) {
av_log(NULL, AV_LOG_FATAL, "Cannot initialize the conversion context\n");
exit(1);
}
SDL_VoutDisplayYUVOverlay(ffp->vout, vp->bmp);
src_frame is the decoded frame of type AVFrame*. Can anyone please tell me where I am committing mistake while merging as I can only see a black screen on the android.
Although the pix_fmt
is of YUVJ420P but I can't observe three dataplanes. data[0]
, data[1]
and data[2]
all are null pointers.
can anyone please help me how can I merge two decoded images using ijkplayer and show it on the same surface.