Beispiel #1
0
char* play() {
    Alert("vplay\n");
    delay=1000000000/ot->dmx->fps;
    next=sceKernelGetSystemTimeWide();
    for(u32 s=0; (s<ot->dmx->Vlen); s++) {
        if(ot->sys->pad&PSP_CTRL_CIRCLE)break;
        ot->me->nal.nal=ot->dmx->getVSample(s,&ot->me->nal.nalLen);
        ot->me->nal.mode=s?0:3;
        sceMpegGetAvcNalAu(Mpeg,&ot->me->nal,ot->me->mpegAu);
        if(sceMpegAvcDecode(Mpeg,ot->me->mpegAu,ot->lcd->size,0,&ot->me->pics)<0) {
            blitErr();    //("VdecErr");
            continue;
        }
        sceMpegAvcDecodeDetail2(Mpeg,&ot->me->d);//  ot->me->d = *Mpeg[414]<7?*Mpeg[424]+0x2C:*Mpeg[419];
        SceMpegAvcMode mode= {-1,ot->lcd->type};
        sceMpegAvcDecodeMode(&ot->me->mpeg,&mode);
        for(int i=0; i<ot->me->pics; i++) {
            Mp4AvcYuvStruct*yuv=ot->me->d->yuv+i;
            Mp4AvcCscStruct csc= {(ot->me->d->info->height+15)>>4,(ot->me->d->info->width+15)>>4,0,0,yuv->b0,yuv->b1,yuv->b2,yuv->b3,yuv->b4,yuv->b5,yuv->b6,yuv->b7};
            sceMpegBaseCscAvc(swapBuffer(),0,ot->lcd->size, &csc);
            if(ot->gui)Draw(2);//draw some overlay stuff
        }
    }
    return NULL;
}
char* seek(int t,int o) {
    Alert("vseek\n");
    return NULL;
}
Beispiel #2
0
int LPP_Mp4Play(LPP_Mp4 *vd, unsigned int frame_count) {
    if(frame_count > vd->reader.file.number_of_video_frames) return -1;

    Mp4AvcDecoderStruct *avc = vd->avc;

    vd->nal.sps_buffer = avc->mpeg_sps_pps_buffer;
	vd->nal.sps_size        = avc->mpeg_sps_size;
	vd->nal.pps_buffer      = avc->mpeg_sps_pps_buffer+avc->mpeg_sps_size;
	vd->nal.pps_size        = avc->mpeg_pps_size;
	vd->nal.nal_prefix_size = avc->mpeg_nal_prefix_size;

	if (mp4_read_get_video(&(vd->reader), frame_count, &(vd->v_packet)))
	{
	    return (-1);
	}

	vd->nal.nal_buffer = vd->v_packet.video_buffer;
	vd->nal.nal_size = vd->v_packet.video_length;

	frame_count ? (vd->nal.mode=0) : (vd->nal.mode=3);

	sceMpegGetAvcNalAu(&avc->mpeg, &vd->nal, avc->mpeg_au);
	sceMpegAvcDecode(&avc->mpeg, avc->mpeg_au, 512, 0, &avc->mpeg_pic_num);
	sceMpegAvcDecodeDetail2(&avc->mpeg, &avc->mpeg_detail2);

	if (avc->mpeg_pic_num > 0) {
	    int i;
		for(i = 0; i < avc->mpeg_pic_num; i++) {
		    Mp4AvcCscStruct csc;

			csc.height = (avc->mpeg_detail2->info_buffer->height+15) >> 4;
			csc.width = (avc->mpeg_detail2->info_buffer->width+15) >> 4;
			csc.mode0 = 0;
			csc.mode1 = 0;
			csc.buffer0 = avc->mpeg_detail2->yuv_buffer->buffer0;
			csc.buffer1 = avc->mpeg_detail2->yuv_buffer->buffer1;
			csc.buffer2 = avc->mpeg_detail2->yuv_buffer->buffer2;
			csc.buffer3 = avc->mpeg_detail2->yuv_buffer->buffer3;
			csc.buffer4 = avc->mpeg_detail2->yuv_buffer->buffer4;
			csc.buffer5 = avc->mpeg_detail2->yuv_buffer->buffer5;
			csc.buffer6 = avc->mpeg_detail2->yuv_buffer->buffer6;
			csc.buffer7 = avc->mpeg_detail2->yuv_buffer->buffer7;
			if(!sceMpegBaseCscAvc(LPPG_GetFrameBuffer(),0,(avc->mpeg_mode == 4) ? 512 : 768, &csc));
		}
	}