while (!feof (INPF)) { Nallen = Getnextnal (INPF, Buf); Consumed_bytes= Decode_frame (c, Picture, &got_picture, Buf, Nallen); printf ("ddd6\n"); #if 1 unsigned char a1[1000000];//save RGB16 memset (A1, 0, sizeof (A1)); Char *pppp= (char *) (picture->data); Displayyuv_16 ((unsigned int *) A1, Picture->data[0], picture->data[1], picture->data[2]// Turn the avframe format picture into RGB16 format , C->width, c->height,picture->linesize[0],picture->linesize[2], iwidth); Image= QImage (A1, Iwidth, Iheight, QIMAGE::FORMAT_RGB16); Copy the RGB16 format picture to the Qimage. Widget->update (); Call Refresh //Blog front "QT Interface Refresh screen" There is talk printf ("Update1 0k\n"); Usleep (100000); Continue #endif #if 0 //* for (i=0; i<c->height; i++) Fwrite (picture->data[0] + i * picture->linesize[0], 1, c->width, OUTF); for (i=0; i<c->height/2; i++) Fwrite (picture->data[1] + i * picture->linesize[1], 1, C->WIDTH/2, OUTF); for (i=0; i<c->height/2; i++) Fwrite (picture->data[2] + i * picture->linesize[2], 1, C->WIDTH/2, OUTF); return 0; // */ #endif /* if (ibytespixel==2) { unsigned int *rgb = (unsigned int*) (Iddraw->begindraw ()); Displayyuv_16 (RGB, picture->data[0], picture->data[1], picture->data[2], c->width, C->height, Picture->linesize[0], picture->linesize[1], iwidth); Iddraw->enddraw (); } else if (ibytespixel==3) { unsigned char *rgb = (unsigned char*) (Iddraw->begindraw ()); Displayyuv_24 (RGB, picture->data[0], picture->data[1], picture->data[2], c->width, C->height, Picture->linesize[0], picture->linesize[1], iwidth); Iddraw->enddraw (); } else if (ibytespixel==4) { unsigned int *rgb = (unsigned int*) (Iddraw->begindraw ()); Displayyuv_32 (RGB, picture->data[0], picture->data[1], picture->data[2], c->width, C->height, Picture->linesize[0], picture->linesize[1], iwidth); Iddraw->enddraw (); } // */ //} } |