下面的代码是一个演示代码,演示了如何解码一帧512×512以内的xvid编码帧mKJE:)=<本文来自:V电G玩S天K空Y
其中Test1.dat文件内容就是一帧xvid编码的影片帧,我们将使用内置的解码引擎对其解码mKJE:)=<本文来自:V电G玩S天K空Y
#include <pspctrl.h> mKJE:)=<本文来自:V电G玩S天K空Y #include <pspdisplay.h> mKJE:)=<本文来自:V电G玩S天K空Y #include <pspdebug.h> mKJE:)=<本文来自:V电G玩S天K空Y #include <psppower.h> mKJE:)=<本文来自:V电G玩S天K空Y #include <stdio.h> mKJE:)=<本文来自:V电G玩S天K空Y #include <stdlib.h> mKJE:)=<本文来自:V电G玩S天K空Y #include <pspkernel.h> mKJE:)=<本文来自:V电G玩S天K空Y #include <pspctrl.h> mKJE:)=<本文来自:V电G玩S天K空Y #include <psppower.h> mKJE:)=<本文来自:V电G玩S天K空Y #include <pspdebug.h> mKJE:)=<本文来自:V电G玩S天K空Y #include <psprtc.h> mKJE:)=<本文来自:V电G玩S天K空Y #include <pspsdk.h> mKJE:)=<本文来自:V电G玩S天K空Y #include <pspaudiocodec.h> mKJE:)=<本文来自:V电G玩S天K空Y #include <pspaudio.h> mKJE:)=<本文来自:V电G玩S天K空Y #include <string.h> mKJE:)=<本文来自:V电G玩S天K空Y #include <malloc.h> mKJE:)=<本文来自:V电G玩S天K空Y #include <pspmpeg.h> mKJE:)=<本文来自:V电G玩S天K空Y #include "pspvideocodec.h" mKJE:)=<本文来自:V电G玩S天K空Y mKJE:)=<本文来自:V电G玩S天K空Y int SetupCallbacks(); mKJE:)=<本文来自:V电G玩S天K空Y mKJE:)=<本文来自:V电G玩S天K空Y PSP_MODULE_INFO("videocodec test", 0x1000, 1, 1); mKJE:)=<本文来自:V电G玩S天K空Y PSP_MAIN_THREAD_ATTR(0); mKJE:)=<本文来自:V电G玩S天K空Y mKJE:)=<本文来自:V电G玩S天K空Y __attribute__ ((constructor)) mKJE:)=<本文来自:V电G玩S天K空Y void loaderInit(){ mKJE:)=<本文来自:V电G玩S天K空Y pspKernelSetKernelPC(); mKJE:)=<本文来自:V电G玩S天K空Y pspSdkInstallNoDeviceCheckPatch(); mKJE:)=<本文来自:V电G玩S天K空Y pspSdkInstallNoPlainModuleCheckPatch(); mKJE:)=<本文来自:V电G玩S天K空Y pspSdkInstallKernelLoadModulePatch(); mKJE:)=<本文来自:V电G玩S天K空Y } mKJE:)=<本文来自:V电G玩S天K空Y mKJE:)=<本文来自:V电G玩S天K空Y SceCtrlData input; mKJE:)=<本文来自:V电G玩S天K空Y mKJE:)=<本文来自:V电G玩S天K空Y unsigned long Video_Codec_BufferMP4V[96] __attribute__((aligned(64))); mKJE:)=<本文来自:V电G玩S天K空Y unsigned long Video_Codec_BufferAVC1[96] __attribute__((aligned(64))); mKJE:)=<本文来自:V电G玩S天K空Y unsigned long Video_YCrCbCopy_SrcBufferMP4V[24] __attribute__((aligned(64))); mKJE:)=<本文来自:V电G玩S天K空Y unsigned long Video_YCrCbCopy_DestBufferMP4V[24] __attribute__((aligned(64))); mKJE:)=<本文来自:V电G玩S天K空Y unsigned char YBuffer[512*512] __attribute__((aligned(64))); mKJE:)=<本文来自:V电G玩S天K空Y unsigned char CrBuffer[512*128] __attribute__((aligned(64))); mKJE:)=<本文来自:V电G玩S天K空Y unsigned char CbBuffer[512*128] __attribute__((aligned(64))); mKJE:)=<本文来自:V电G玩S天K空Y mKJE:)=<本文来自:V电G玩S天K空Y mKJE:)=<本文来自:V电G玩S天K空Y int main(void) mKJE:)=<本文来自:V电G玩S天K空Y { mKJE:)=<本文来自:V电G玩S天K空Y SetupCallbacks(); mKJE:)=<本文来自:V电G玩S天K空Y mKJE:)=<本文来自:V电G玩S天K空Y pspDebugScreenInit(); mKJE:)=<本文来自:V电G玩S天K空Y pspDebugScreenSetXY(0, 2); mKJE:)=<本文来自:V电G玩S天K空Y //scePowerSetClockFrequency(120,120,60); mKJE:)=<本文来自:V电G玩S天K空Y //scePowerSetCpuClockFrequency(120); mKJE:)=<本文来自:V电G玩S天K空Y //scePowerSetBusClockFrequency(60); mKJE:)=<本文来自:V电G玩S天K空Y u32 cpu = scePowerGetCpuClockFrequency(); mKJE:)=<本文来自:V电G玩S天K空Y u32 bus = scePowerGetBusClockFrequency(); mKJE:)=<本文来自:V电G玩S天K空Y mKJE:)=<本文来自:V电G玩S天K空Y pspDebugScreenPrintf("cpu=%d, bus=%d\n", cpu, bus); mKJE:)=<本文来自:V电G玩S天K空Y mKJE:)=<本文来自:V电G玩S天K空Y pspDebugScreenPrintf("Press any key to exit.\n"); mKJE:)=<本文来自:V电G玩S天K空Y mKJE:)=<本文来自:V电G玩S天K空Y int result; mKJE:)=<本文来自:V电G玩S天K空Y mKJE:)=<本文来自:V电G玩S天K空Y result = pspSdkLoadStartModule("flash0:/kd/me_for_vsh.prx", PSP_MEMORY_PARTITION_KERNEL); mKJE:)=<本文来自:V电G玩S天K空Y if (result < 0 ) goto wait; mKJE:)=<本文来自:V电G玩S天K空Y mKJE:)=<本文来自:V电G玩S天K空Y result = pspSdkLoadStartModule("flash0:/kd/videocodec.prx", PSP_MEMORY_PARTITION_KERNEL); mKJE:)=<本文来自:V电G玩S天K空Y if (result < 0 ) goto wait; mKJE:)=<本文来自:V电G玩S天K空Y mKJE:)=<本文来自:V电G玩S天K空Y result = pspSdkLoadStartModule("flash0:/kd/audiocodec.prx", PSP_MEMORY_PARTITION_KERNEL); mKJE:)=<本文来自:V电G玩S天K空Y if (result < 0 ) goto wait; mKJE:)=<本文来自:V电G玩S天K空Y mKJE:)=<本文来自:V电G玩S天K空Y result = pspSdkLoadStartModule("flash0:/kd/mpegbase.prx", PSP_MEMORY_PARTITION_KERNEL); mKJE:)=<本文来自:V电G玩S天K空Y if (result < 0 ) goto wait; mKJE:)=<本文来自:V电G玩S天K空Y mKJE:)=<本文来自:V电G玩S天K空Y result = pspSdkLoadStartModule("flash0:/kd/mpeg_vsh.prx", PSP_MEMORY_PARTITION_USER); mKJE:)=<本文来自:V电G玩S天K空Y if (result < 0 ) goto wait; mKJE:)=<本文来自:V电G玩S天K空Y mKJE:)=<本文来自:V电G玩S天K空Y pspSdkFixupImports(result); mKJE:)=<本文来自:V电G玩S天K空Y mKJE:)=<本文来自:V电G玩S天K空Y sceMpegInit(); mKJE:)=<本文来自:V电G玩S天K空Y mKJE:)=<本文来自:V电G玩S天K空Y FILE* fp = fopen("ms0:/Test1.dat", "rb"); mKJE:)=<本文来自:V电G玩S天K空Y fseek(fp, 0, PSP_SEEK_END); mKJE:)=<本文来自:V电G玩S天K空Y long fsize = ftell(fp); mKJE:)=<本文来自:V电G玩S天K空Y long buffer_size = fsize; mKJE:)=<本文来自:V电G玩S天K空Y int mod_64 = buffer_size & 0x3f; mKJE:)=<本文来自:V电G玩S天K空Y if (mod_64 != 0) buffer_size += 64 - mod_64; mKJE:)=<本文来自:V电G玩S天K空Y unsigned char* file_buffer = memalign(64, buffer_size); mKJE:)=<本文来自:V电G玩S天K空Y fseek(fp, 0, PSP_SEEK_SET); mKJE:)=<本文来自:V电G玩S天K空Y fread(file_buffer, fsize, 1, fp); mKJE:)=<本文来自:V电G玩S天K空Y fclose(fp); mKJE:)=<本文来自:V电G玩S天K空Y mKJE:)=<本文来自:V电G玩S天K空Y mKJE:)=<本文来自:V电G玩S天K空Y memset(Video_Codec_BufferMP4V, 0, sizeof(Video_Codec_BufferMP4V)); mKJE:)=<本文来自:V电G玩S天K空Y mKJE:)=<本文来自:V电G玩S天K空Y int res ; mKJE:)=<本文来自:V电G玩S天K空Y int i; mKJE:)=<本文来自:V电G玩S天K空Y mKJE:)=<本文来自:V电G玩S天K空Y //---------------------------------------------------------------------------------// mKJE:)=<本文来自:V电G玩S天K空Y Video_Codec_BufferMP4V[4] = (unsigned long)(((void*)Video_Codec_BufferMP4V) + 128 ); mKJE:)=<本文来自:V电G玩S天K空Y Video_Codec_BufferMP4V[11] = 512; mKJE:)=<本文来自:V电G玩S天K空Y Video_Codec_BufferMP4V[12] = 512; mKJE:)=<本文来自:V电G玩S天K空Y Video_Codec_BufferMP4V[13] = 512*512; mKJE:)=<本文来自:V电G玩S天K空Y mKJE:)=<本文来自:V电G玩S天K空Y fp = fopen("ms0:/sceVideocodecOpen(mp4v).dat", "wb"); mKJE:)=<本文来自:V电G玩S天K空Y for(i=0;i<96;i++) { mKJE:)=<本文来自:V电G玩S天K空Y fwrite( &Video_Codec_BufferMP4V[i], sizeof(unsigned int), 1, fp); mKJE:)=<本文来自:V电G玩S天K空Y } mKJE:)=<本文来自:V电G玩S天K空Y fclose(fp); mKJE:)=<本文来自:V电G玩S天K空Y if ( (res = sceVideocodecOpen(Video_Codec_BufferMP4V, 0x1)) < 0 ) { mKJE:)=<本文来自:V电G玩S天K空Y pspDebugScreenPrintf("sceVideocodecOpen=0x%08X\n", res); mKJE:)=<本文来自:V电G玩S天K空Y goto wait; mKJE:)=<本文来自:V电G玩S天K空Y } mKJE:)=<本文来自:V电G玩S天K空Y pspDebugScreenPrintf("sceVideocodecOpen=0x%08X\n", res); mKJE:)=<本文来自:V电G玩S天K空Y mKJE:)=<本文来自:V电G玩S天K空Y //---------------------------------------------------------------------------------// mKJE:)=<本文来自:V电G玩S天K空Y Video_Codec_BufferMP4V[7] = 16384; mKJE:)=<本文来自:V电G玩S天K空Y mKJE:)=<本文来自:V电G玩S天K空Y fp = fopen("ms0:/sceVideocodecGetEDRAM(mp4v).dat", "wb"); mKJE:)=<本文来自:V电G玩S天K空Y for(i=0;i<96;i++) { mKJE:)=<本文来自:V电G玩S天K空Y fwrite( &Video_Codec_BufferMP4V[i], sizeof(unsigned int), 1, fp); mKJE:)=<本文来自:V电G玩S天K空Y } mKJE:)=<本文来自:V电G玩S天K空Y fclose(fp); mKJE:)=<本文来自:V电G玩S天K空Y if ( (res = sceVideocodecGetEDRAM(Video_Codec_BufferMP4V, 0x1)) < 0 ) { mKJE:)=<本文来自:V电G玩S天K空Y pspDebugScreenPrintf("sceVideocodecGetEDRAM=0x%08X\n", res); mKJE:)=<本文来自:V电G玩S天K空Y goto wait; mKJE:)=<本文来自:V电G玩S天K空Y } mKJE:)=<本文来自:V电G玩S天K空Y pspDebugScreenPrintf("sceVideocodecGetEDRAM=0x%08X\n", res); mKJE:)=<本文来自:V电G玩S天K空Y mKJE:)=<本文来自:V电G玩S天K空Y //---------------------------------------------------------------------------------// mKJE:)=<本文来自:V电G玩S天K空Y fp = fopen("ms0:/sceVideocodecInit(mp4v).dat", "wb"); mKJE:)=<本文来自:V电G玩S天K空Y for(i=0;i<96;i++) { mKJE:)=<本文来自:V电G玩S天K空Y fwrite( &Video_Codec_BufferMP4V[i], sizeof(unsigned int), 1, fp); mKJE:)=<本文来自:V电G玩S天K空Y } mKJE:)=<本文来自:V电G玩S天K空Y fclose(fp); mKJE:)=<本文来自:V电G玩S天K空Y if ( (res = sceVideocodecInit(Video_Codec_BufferMP4V, 0x1)) < 0 ) { mKJE:)=<本文来自:V电G玩S天K空Y pspDebugScreenPrintf("sceVideocodecInit=0x%08X\n", res); mKJE:)=<本文来自:V电G玩S天K空Y goto wait; mKJE:)=<本文来自:V电G玩S天K空Y } mKJE:)=<本文来自:V电G玩S天K空Y pspDebugScreenPrintf("sceVideocodecInit=0x%08X\n", res); mKJE:)=<本文来自:V电G玩S天K空Y mKJE:)=<本文来自:V电G玩S天K空Y //---------------------------------------------------------------------------------// mKJE:)=<本文来自:V电G玩S天K空Y Video_Codec_BufferMP4V[34] = 7; mKJE:)=<本文来自:V电G玩S天K空Y Video_Codec_BufferMP4V[36] = 0; mKJE:)=<本文来自:V电G玩S天K空Y mKJE:)=<本文来自:V电G玩S天K空Y fp = fopen("ms0:/sceVideocodecStop(mp4v).dat", "wb"); mKJE:)=<本文来自:V电G玩S天K空Y for(i=0;i<96;i++) { mKJE:)=<本文来自:V电G玩S天K空Y fwrite( &Video_Codec_BufferMP4V[i], sizeof(unsigned int), 1, fp); mKJE:)=<本文来自:V电G玩S天K空Y } mKJE:)=<本文来自:V电G玩S天K空Y fclose(fp); mKJE:)=<本文来自:V电G玩S天K空Y if ( (res = sceVideocodecStop(Video_Codec_BufferMP4V, 0x1)) < 0 ) { mKJE:)=<本文来自:V电G玩S天K空Y pspDebugScreenPrintf("sceVideocodecStop=0x%08X\n", res); mKJE:)=<本文来自:V电G玩S天K空Y goto wait; mKJE:)=<本文来自:V电G玩S天K空Y } mKJE:)=<本文来自:V电G玩S天K空Y pspDebugScreenPrintf("sceVideocodecStop=0x%08X\n", res); mKJE:)=<本文来自:V电G玩S天K空Y mKJE:)=<本文来自:V电G玩S天K空Y //---------------------------------------------------------------------------------// mKJE:)=<本文来自:V电G玩S天K空Y Video_Codec_BufferMP4V[9] = file_buffer; mKJE:)=<本文来自:V电G玩S天K空Y Video_Codec_BufferMP4V[10] = fsize; mKJE:)=<本文来自:V电G玩S天K空Y Video_Codec_BufferMP4V[14] = 7; mKJE:)=<本文来自:V电G玩S天K空Y mKJE:)=<本文来自:V电G玩S天K空Y fp = fopen("ms0:/sceVideocodecDecode(mp4v).dat", "wb"); mKJE:)=<本文来自:V电G玩S天K空Y for(i=0;i<96;i++) { mKJE:)=<本文来自:V电G玩S天K空Y fwrite( &Video_Codec_BufferMP4V[i], sizeof(unsigned int), 1, fp); mKJE:)=<本文来自:V电G玩S天K空Y } mKJE:)=<本文来自:V电G玩S天K空Y fclose(fp); mKJE:)=<本文来自:V电G玩S天K空Y if ( (res = sceVideocodecDecode(Video_Codec_BufferMP4V, 0x1)) < 0 ) { mKJE:)=<本文来自:V电G玩S天K空Y pspDebugScreenPrintf("sceVideocodecDecode=0x%08X\n", res); mKJE:)=<本文来自:V电G玩S天K空Y goto wait; mKJE:)=<本文来自:V电G玩S天K空Y } mKJE:)=<本文来自:V电G玩S天K空Y pspDebugScreenPrintf("sceVideocodecDecode=0x%08X\n", res); mKJE:)=<本文来自:V电G玩S天K空Y mKJE:)=<本文来自:V电G玩S天K空Y /**************************************************************************** mKJE:)=<本文来自:V电G玩S天K空Y Video_Codec_BufferMP4V[44] : frame width mKJE:)=<本文来自:V电G玩S天K空Y Video_Codec_BufferMP4V[45] : frame height mKJE:)=<本文来自:V电G玩S天K空Y Video_Codec_BufferMP4V[53] : maybe Ybuffer start address in ME ram mKJE:)=<本文来自:V电G玩S天K空Y Video_Codec_BufferMP4V[54] : maybe CrBuffer start address in ME ram mKJE:)=<本文来自:V电G玩S天K空Y Video_Codec_BufferMP4V[55] : maybe CbBuffer start address in ME ram mKJE:)=<本文来自:V电G玩S天K空Y Video_Codec_BufferMP4V[56] : frame padding width mKJE:)=<本文来自:V电G玩S天K空Y Video_Codec_BufferMP4V[57] : (frame padding width) >> 1 mKJE:)=<本文来自:V电G玩S天K空Y *****************************************************************************/ mKJE:)=<本文来自:V电G玩S天K空Y mKJE:)=<本文来自:V电G玩S天K空Y Video_YCrCbCopy_DestBufferMP4V[0] = (Video_Codec_BufferMP4V[45]+15) >> 4; mKJE:)=<本文来自:V电G玩S天K空Y Video_YCrCbCopy_DestBufferMP4V[1] = (Video_Codec_BufferMP4V[56]+15) >> 4; mKJE:)=<本文来自:V电G玩S天K空Y Video_YCrCbCopy_DestBufferMP4V[4] = YBuffer; mKJE:)=<本文来自:V电G玩S天K空Y Video_YCrCbCopy_DestBufferMP4V[5] = (unsigned long)(((void*)YBuffer) + 512*512 ); mKJE:)=<本文来自:V电G玩S天K空Y Video_YCrCbCopy_DestBufferMP4V[6] = CrBuffer; mKJE:)=<本文来自:V电G玩S天K空Y Video_YCrCbCopy_DestBufferMP4V[7] = CbBuffer; mKJE:)=<本文来自:V电G玩S天K空Y Video_YCrCbCopy_DestBufferMP4V[8] = (unsigned long)(((void*)CrBuffer) + 512*128 ); mKJE:)=<本文来自:V电G玩S天K空Y Video_YCrCbCopy_DestBufferMP4V[9] = (unsigned long)(((void*)CbBuffer) + 512*128 ); mKJE:)=<本文来自:V电G玩S天K空Y Video_YCrCbCopy_DestBufferMP4V[10] = Video_Codec_BufferMP4V[45]; mKJE:)=<本文来自:V电G玩S天K空Y Video_YCrCbCopy_DestBufferMP4V[11] = Video_Codec_BufferMP4V[44]; mKJE:)=<本文来自:V电G玩S天K空Y Video_YCrCbCopy_DestBufferMP4V[12] = 512; mKJE:)=<本文来自:V电G玩S天K空Y mKJE:)=<本文来自:V电G玩S天K空Y Video_YCrCbCopy_SrcBufferMP4V[0] = (Video_Codec_BufferMP4V[45]+15) & 0xFFFFFFF0; mKJE:)=<本文来自:V电G玩S天K空Y Video_YCrCbCopy_SrcBufferMP4V[1] = (Video_Codec_BufferMP4V[44]+15) & 0xFFFFFFF0; mKJE:)=<本文来自:V电G玩S天K空Y Video_YCrCbCopy_SrcBufferMP4V[2] = 0; mKJE:)=<本文来自:V电G玩S天K空Y Video_YCrCbCopy_SrcBufferMP4V[3] = 1; mKJE:)=<本文来自:V电G玩S天K空Y Video_YCrCbCopy_SrcBufferMP4V[4] = Video_Codec_BufferMP4V[53]; mKJE:)=<本文来自:V电G玩S天K空Y Video_YCrCbCopy_SrcBufferMP4V[5] = Video_YCrCbCopy_SrcBufferMP4V[4] + (Video_Codec_BufferMP4V[56] * (Video_YCrCbCopy_SrcBufferMP4V[0] >> 1)); mKJE:)=<本文来自:V电G玩S天K空Y Video_YCrCbCopy_SrcBufferMP4V[6] = Video_Codec_BufferMP4V[54]; mKJE:)=<本文来自:V电G玩S天K空Y Video_YCrCbCopy_SrcBufferMP4V[7] = Video_Codec_BufferMP4V[55]; mKJE:)=<本文来自:V电G玩S天K空Y Video_YCrCbCopy_SrcBufferMP4V[8] = Video_YCrCbCopy_SrcBufferMP4V[6] + (Video_Codec_BufferMP4V[57] * (Video_YCrCbCopy_SrcBufferMP4V[0] >> 2)); mKJE:)=<本文来自:V电G玩S天K空Y Video_YCrCbCopy_SrcBufferMP4V[9] = Video_YCrCbCopy_SrcBufferMP4V[7] + (Video_Codec_BufferMP4V[57] * (Video_YCrCbCopy_SrcBufferMP4V[0] >> 2)); mKJE:)=<本文来自:V电G玩S天K空Y Video_YCrCbCopy_SrcBufferMP4V[10] = 0; mKJE:)=<本文来自:V电G玩S天K空Y Video_YCrCbCopy_SrcBufferMP4V[11] = 0; mKJE:)=<本文来自:V电G玩S天K空Y mKJE:)=<本文来自:V电G玩S天K空Y fp = fopen("ms0:/sceMpegBaseYCrCbCopyVme(mp4v).dat", "wb"); mKJE:)=<本文来自:V电G玩S天K空Y for(i=0;i<12;i++) { mKJE:)=<本文来自:V电G玩S天K空Y fwrite( &Video_YCrCbCopy_SrcBufferMP4V[i], sizeof(unsigned int), 1, fp); mKJE:)=<本文来自:V电G玩S天K空Y } mKJE:)=<本文来自:V电G玩S天K空Y for(i=0;i<12;i++) { mKJE:)=<本文来自:V电G玩S天K空Y fwrite( &Video_YCrCbCopy_DestBufferMP4V[i], sizeof(unsigned int), 1, fp); mKJE:)=<本文来自:V电G玩S天K空Y } mKJE:)=<本文来自:V电G玩S天K空Y fclose(fp); mKJE:)=<本文来自:V电G玩S天K空Y mKJE:)=<本文来自:V电G玩S天K空Y res = sceMpegBaseYCrCbCopyVme(Video_YCrCbCopy_DestBufferMP4V, Video_YCrCbCopy_SrcBufferMP4V, 3); mKJE:)=<本文来自:V电G玩S天K空Y pspDebugScreenPrintf("sceMpegBaseYCrCbCopyVme=0x%08X\n", res); mKJE:)=<本文来自:V电G玩S天K空Y mKJE:)=<本文来自:V电G玩S天K空Y fp = fopen("ms0:/YBuffer(mp4v).dat", "wb"); mKJE:)=<本文来自:V电G玩S天K空Y fwrite( YBuffer, 512*512 , 1, fp); mKJE:)=<本文来自:V电G玩S天K空Y fclose(fp); mKJE:)=<本文来自:V电G玩S天K空Y mKJE:)=<本文来自:V电G玩S天K空Y fp = fopen("ms0:/CrBuffer(mp4v).dat", "wb"); mKJE:)=<本文来自:V电G玩S天K空Y fwrite( CrBuffer, 512*128 , 1, fp); mKJE:)=<本文来自:V电G玩S天K空Y fclose(fp); mKJE:)=<本文来自:V电G玩S天K空Y mKJE:)=<本文来自:V电G玩S天K空Y fp = fopen("ms0:/CbBuffer(mp4v).dat", "wb"); mKJE:)=<本文来自:V电G玩S天K空Y fwrite( CbBuffer, 512*128 , 1, fp); mKJE:)=<本文来自:V电G玩S天K空Y fclose(fp); mKJE:)=<本文来自:V电G玩S天K空Y mKJE:)=<本文来自:V电G玩S天K空Y mKJE:)=<本文来自:V电G玩S天K空Y //---------------------------------------------------------------------------------// mKJE:)=<本文来自:V电G玩S天K空Y sceCtrlReadBufferPositive(&input, 1); mKJE:)=<本文来自:V电G玩S天K空Y while(!(input.Buttons & PSP_CTRL_TRIANGLE)) mKJE:)=<本文来自:V电G玩S天K空Y { mKJE:)=<本文来自:V电G玩S天K空Y sceKernelDelayThread(10000); // wait 10 milliseconds mKJE:)=<本文来自:V电G玩S天K空Y sceCtrlReadBufferPositive(&input, 1); mKJE:)=<本文来自:V电G玩S天K空Y } mKJE:)=<本文来自:V电G玩S天K空Y mKJE:)=<本文来自:V电G玩S天K空Y fp = fopen("ms0:/mp4vend.dat", "wb"); mKJE:)=<本文来自:V电G玩S天K空Y for(i=0;i<96;i++) { mKJE:)=<本文来自:V电G玩S天K空Y pspDebugScreenPrintf("0x%08X ", Video_Codec_BufferMP4V[i]); mKJE:)=<本文来自:V电G玩S天K空Y fwrite( &Video_Codec_BufferMP4V[i], sizeof(unsigned int), 1, fp); mKJE:)=<本文来自:V电G玩S天K空Y } mKJE:)=<本文来自:V电G玩S天K空Y pspDebugScreenPrintf("\n"); mKJE:)=<本文来自:V电G玩S天K空Y fclose(fp); mKJE:)=<本文来自:V电G玩S天K空Y mKJE:)=<本文来自:V电G玩S天K空Y wait: mKJE:)=<本文来自:V电G玩S天K空Y sceCtrlReadBufferPositive(&input, 1); mKJE:)=<本文来自:V电G玩S天K空Y while(!(input.Buttons & PSP_CTRL_TRIANGLE)) mKJE:)=<本文来自:V电G玩S天K空Y { mKJE:)=<本文来自:V电G玩S天K空Y sceKernelDelayThread(10000); // wait 10 milliseconds mKJE:)=<本文来自:V电G玩S天K空Y sceCtrlReadBufferPositive(&input, 1); mKJE:)=<本文来自:V电G玩S天K空Y } mKJE:)=<本文来自:V电G玩S天K空Y mKJE:)=<本文来自:V电G玩S天K空Y sceKernelExitGame(); mKJE:)=<本文来自:V电G玩S天K空Y return 0; mKJE:)=<本文来自:V电G玩S天K空Y } mKJE:)=<本文来自:V电G玩S天K空Y mKJE:)=<本文来自:V电G玩S天K空Y mKJE:)=<本文来自:V电G玩S天K空Y /* Exit callback */ mKJE:)=<本文来自:V电G玩S天K空Y int exit_callback(int arg1, int arg2, void *common) mKJE:)=<本文来自:V电G玩S天K空Y { mKJE:)=<本文来自:V电G玩S天K空Y sceKernelExitGame(); mKJE:)=<本文来自:V电G玩S天K空Y return 0; mKJE:)=<本文来自:V电G玩S天K空Y } mKJE:)=<本文来自:V电G玩S天K空Y mKJE:)=<本文来自:V电G玩S天K空Y mKJE:)=<本文来自:V电G玩S天K空Y /* Callback thread */ mKJE:)=<本文来自:V电G玩S天K空Y int CallbackThread(SceSize args, void *argp) mKJE:)=<本文来自:V电G玩S天K空Y { mKJE:)=<本文来自:V电G玩S天K空Y int cbid; mKJE:)=<本文来自:V电G玩S天K空Y mKJE:)=<本文来自:V电G玩S天K空Y cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL); mKJE:)=<本文来自:V电G玩S天K空Y sceKernelRegisterExitCallback(cbid); mKJE:)=<本文来自:V电G玩S天K空Y mKJE:)=<本文来自:V电G玩S天K空Y sceKernelSleepThreadCB(); mKJE:)=<本文来自:V电G玩S天K空Y mKJE:)=<本文来自:V电G玩S天K空Y return 0; mKJE:)=<本文来自:V电G玩S天K空Y } mKJE:)=<本文来自:V电G玩S天K空Y mKJE:)=<本文来自:V电G玩S天K空Y mKJE:)=<本文来自:V电G玩S天K空Y /* Sets up the callback thread and returns its thread id */ mKJE:)=<本文来自:V电G玩S天K空Y int SetupCallbacks(void) mKJE:)=<本文来自:V电G玩S天K空Y { mKJE:)=<本文来自:V电G玩S天K空Y int thid = 0; mKJE:)=<本文来自:V电G玩S天K空Y mKJE:)=<本文来自:V电G玩S天K空Y thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, 0, 0); mKJE:)=<本文来自:V电G玩S天K空Y if(thid >= 0) mKJE:)=<本文来自:V电G玩S天K空Y { mKJE:)=<本文来自:V电G玩S天K空Y sceKernelStartThread(thid, 0, 0); mKJE:)=<本文来自:V电G玩S天K空Y } mKJE:)=<本文来自:V电G玩S天K空Y mKJE:)=<本文来自:V电G玩S天K空Y return thid; mKJE:)=<本文来自:V电G玩S天K空Y } mKJE:)=<本文来自:V电G玩S天K空Y |


