?? em86xx.cpp
字號:
RMem86xxDecoder::~RMem86xxDecoder(){ RMDBGLOG((QBDBG, "*********************************** Em86xx decoder : Destruct *********************************** \n")); if(m_pDH != NULL){ DHDone(m_pDH); m_pDH = NULL; }// Close(); if(m_pDCC != NULL){ DCCClose(m_pDCC); m_pDCC = NULL; } if(m_pInstance != NULL){ RUADestroyInstance(m_pInstance); m_pInstance = NULL; }// delete m_audioStreamConverter; RMDBGLOG((QBDBG, "*********************************** Em86xx decoder : Finish Destruct *********************************** \n"));}void RMem86xxDecoder::CleanallAndExit (RMbool tryToRecover /* = FALSE */){ RMDBGLOG((QBDBG, "Em86xx decoder : Cleanall and exit \n"));#ifdef __ERRHANDLE if(tryToRecover) { RMDBGLOG((ENABLE, "Em86xx decoder : Don't exit(1).\n")); return; }#endif //TODO - it should go in curacao.cpp cleanup delete this; // close and release everything exit(1);}//#ifndef WITH_MONO//RMstatus RMem86xxDecoder::Open(typeMediaPlayer playerType, RMascii *url, RMcallback callback, void *userData)//#else//RMstatus RMem86xxDecoder::Open(typeMediaPlayer playerType, RMascii *not_used_1, void *not_used_2, void *not_used_3)//#endif//{// RMbool dvd, vcd;// RMstatus status = RM_ERROR;// typeVideoProfile profile = MPEG2_PROFILE;// RMbool useHwDemux = FALSE;// RMbool launch_decoder = FALSE;//// RMuint32 video_bts_fifo_size;// RMuint32 video_xfer_fifo_buffer_count;// RMuint32 audio_bts_fifo_size;// RMuint32 audio_xfer_fifo_buffer_count;//// RMDBGLOG((QBDBG, "*********************************** Em86xx decoder : Open *********************************** \n"));//// if(m_initialized) {// RMDBGLOG((ENABLE, "!!!!! Already open !!!!!\n"));// return RM_ERROR;// }//// if(playerType == FILE_PLAYER){//#ifndef WITH_MONO// if((url == NULL) ||// (callback == NULL))// return RM_ERROR;//// profile = get_profile(url);////#ifdef CURACAO_HWDEMUX// useHwDemux = TRUE;//#else// useHwDemux = FALSE;//#endif// launch_decoder = FALSE;//#endif// }// else {// profile = MPEG2_PROFILE;// useHwDemux = (playerType == DVDVIDEO_PLAYER)?TRUE://#ifdef VCD_SOFT_DEMUX// (playerType == VCD_PLAYER)?FALSE://#else// (playerType == VCD_PLAYER)?TRUE://#endif// (playerType == DVDAUDIO_PLAYER)?TRUE:FALSE;//// launch_decoder = TRUE;// }//// dvd = (playerType == DVDAUDIO_PLAYER)?TRUE:(playerType == DVDVIDEO_PLAYER)?TRUE:FALSE;// vcd = (playerType == VCD_PLAYER)?TRUE:FALSE;//// if(playerType == FILE_PLAYER){//#ifndef WITH_MONO// RMascii finalUrl[1024];// unsigned int audio_pool_addr;// unsigned int audio_buffer_count;// unsigned int audio_buffer_size;// unsigned int video_pool_addr;// unsigned int video_buffer_count;// unsigned int video_buffer_size;//// video_bts_fifo_size = VIDEO_BITSTREAM_FIFO_SIZE;// video_xfer_fifo_buffer_count = FILE_VIDEO_XFER_FIFO_BUFFER_COUNT;// audio_bts_fifo_size = AUDIO_BITSTREAM_FIFO_SIZE;// audio_xfer_fifo_buffer_count = FILE_AUDIO_XFER_FIFO_BUFFER_COUNT;//// status = OpenDecoder(profile, m_useHDProfile, dvd, vcd, useHwDemux,// video_bts_fifo_size,// video_xfer_fifo_buffer_count,// audio_bts_fifo_size,// audio_xfer_fifo_buffer_count,// launch_decoder);// if (status == RM_OK){//#ifdef CURACAO_HWDEMUX// RMDBGLOG((QBDBG, "*********************************** Em86xx decoder : Open, OpenDecoder succeeded FILE_PLAYER & HWDEMUX\n"));// if(m_pBufferPool == 0){// /* open pool with 0 (DRAM copy) instead of m_hw_demux (DRAM no copy)*/// status = RUAOpenPool(m_pInstance, 0, FILE_DMA_BUFFER_COUNT, FILE_DMA_BUFFER_SIZE_LOG2,// RUA_POOL_DIRECTION_SEND, &m_pBufferPool);// if(status != RM_OK){// RMDBGLOG((ENABLE, "!!!!! Error opening DEMUX DMA pool - %s !!!!!!\n", RMstatusToString(status)));// CleanallAndExit();// }//// audio_pool_addr = (unsigned int)m_pBufferPool;// audio_buffer_count = FILE_DMA_BUFFER_COUNT;// audio_buffer_size = 1 << FILE_DMA_BUFFER_SIZE_LOG2;//// video_pool_addr = (unsigned int)m_pBufferPool;// video_buffer_count = FILE_DMA_BUFFER_COUNT;// video_buffer_size = 1 << FILE_DMA_BUFFER_SIZE_LOG2;//#else// RMDBGLOG((QBDBG, "*********************************** Em86xx decoder : Open, OpenDecoder succeeded FILE_PLAYER & SOFTDEMUX\n"));// // open a "system" DMA pool from where to send the audio data chuncks// if(m_pAudioBufferPool == 0){// status = RUAOpenPool(m_pInstance, 0, FILE_DMA_BUFFER_COUNT4AUDIO, FILE_DMA_BUFFER_SIZE_LOG2,// RUA_POOL_DIRECTION_SEND, &m_pAudioBufferPool);// if(status != RM_OK){// RMDBGLOG((ENABLE, "!!!!! Error opening AUDIO DMA pool - %s !!!!!\n", RMstatusToString(status)));// CleanallAndExit();// }//// }//// if(m_pVideoBufferPool == 0) {// // open a "system" DMA pool from where to send the video data chuncks// status = RUAOpenPool(m_pInstance, 0, FILE_DMA_BUFFER_COUNT4VIDEO, FILE_DMA_BUFFER_SIZE_LOG2,// RUA_POOL_DIRECTION_SEND, &m_pVideoBufferPool);// if(status != RM_OK){// RMDBGLOG((ENABLE, "!!!!! Error opening VIDEO DMA pool - %s !!!!!\n", RMstatusToString(status)));// CleanallAndExit();// }// }//// audio_pool_addr = (unsigned int)m_pAudioBufferPool;// audio_buffer_count = FILE_DMA_BUFFER_COUNT4AUDIO;// audio_buffer_size = 1 << FILE_DMA_BUFFER_SIZE_LOG2;//// video_pool_addr = (unsigned int)m_pVideoBufferPool;// video_buffer_count = FILE_DMA_BUFFER_COUNT4VIDEO;// video_buffer_size = 1 << FILE_DMA_BUFFER_SIZE_LOG2;// RMDBGLOG((ENABLE, "dma buffer pool for audio, bufsize %lu, bufcount %lu\n",// audio_buffer_size,// audio_buffer_count));// RMDBGLOG((ENABLE, "dma buffer pool for video, bufsize %lu, bufcount %lu\n",// video_buffer_size,// video_buffer_count));////#endif // curacao_hwdemux////#ifdef NO_STC// // construct the url to open adding the board number to use// if(m_SPDIFMode == OutputSpdif_Disable){// sprintf((char*)finalUrl,"[86:%ld,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d]%s",// (long int)m_boardNumber,(unsigned int)m_pInstance, (unsigned int)m_pDCC,// (unsigned int)m_pVideoSource, (unsigned int)m_pAudioSource, (unsigned int)m_surfaceID, 0, 0,// video_pool_addr, video_buffer_count, video_buffer_size,// audio_pool_addr, audio_buffer_count, audio_buffer_size,// (char*)url);// }// else {// sprintf((char*)finalUrl,"[86:%ld,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d]%s,spdifOutput=1",// (long int)m_boardNumber,(unsigned int)m_pInstance, (unsigned int)m_pDCC,// (unsigned int)m_pVideoSource, (unsigned int)m_pAudioSource, (unsigned int)m_surfaceID, 0, 0,// video_pool_addr, video_buffer_count, video_buffer_size,// audio_pool_addr, audio_buffer_count, audio_buffer_size,// (char*)url);// }//#else //stc// // construct the url to open adding the board number to use// if(m_SPDIFMode == OutputSpdif_Disable){// sprintf((char*)finalUrl,"[86:%ld,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d]%s",// (long int)m_boardNumber,(unsigned int)m_pInstance, (unsigned int)m_pDCC,// (unsigned int)m_pVideoSource, (unsigned int)m_pAudioSource, (unsigned int)m_surfaceID, 0, 0,// video_pool_addr, video_buffer_count, video_buffer_size,// audio_pool_addr, audio_buffer_count, audio_buffer_size,// (unsigned int)m_pStcSource, (char*)url);// }// else {// sprintf((char*)finalUrl,"[86:%ld,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d]%s,spdifOutput=1",// (long int)m_boardNumber,(unsigned int)m_pInstance, (unsigned int)m_pDCC,// (unsigned int)m_pVideoSource, (unsigned int)m_pAudioSource, (unsigned int)m_surfaceID, 0, 0,// video_pool_addr, video_buffer_count, video_buffer_size,// audio_pool_addr, audio_buffer_count, audio_buffer_size,// (unsigned int)m_pStcSource, (char*)url);// }//#endif // no_stc//// RMDBGLOG((QBDBG, "FINAL URL = %s\n", (char*)finalUrl));//// status = RMFOpenUrlControlInterface(finalUrl, &m_ctrl, callback, userData);//// if(m_volume != 0xFFFFFFFF){// SetVolume(m_volume);// }//// if(status != RM_OK){// Close();// }// }//#endif // w/out mono// }// else{// video_bts_fifo_size = VIDEO_BITSTREAM_FIFO_SIZE;// video_xfer_fifo_buffer_count = VIDEO_XFER_FIFO_BUFFER_COUNT;// audio_bts_fifo_size = AUDIO_BITSTREAM_FIFO_SIZE;// audio_xfer_fifo_buffer_count = AUDIO_XFER_FIFO_BUFFER_COUNT;//// status = OpenDecoder(profile, m_useHDProfile, dvd, vcd, useHwDemux,// video_bts_fifo_size,// video_xfer_fifo_buffer_count,// audio_bts_fifo_size,// audio_xfer_fifo_buffer_count,// launch_decoder);//// if (status == RM_OK){// if(m_pBufferPool == 0){// if(useHwDemux){// RMDBGLOG((QBDBG, "*********************************** Em86xx decoder : Open, OpenDecoder succeeded DVD_PLAYER & HWDEMUX\n"));// /* open pool with 0 (DRAM copy) instead of m_hw_demux (DRAM no copy)*/// status = RUAOpenPool(m_pInstance, 0, DMA_BUFFER_COUNT, DMA_BUFFER_SIZE_LOG2,// RUA_POOL_DIRECTION_SEND, &m_pBufferPool);// }// else {// RMDBGLOG((QBDBG, "*********************************** Em86xx decoder : Open, OpenDecoder succeeded DVD_PLAYER & SOFTDEMUX\n"));// status = RUAOpenPool(m_pInstance, 0, DMA_BUFFER_COUNT, DMA_BUFFER_SIZE_LOG2,// RUA_POOL_DIRECTION_SEND, &m_pBufferPool);// }//// if(status != RM_OK){// RMDBGLOG((ENABLE, "!!!!!! Error opening DEMUX DMA pool - %s!!!!!!\n", RMstatusToString(status)));// CleanallAndExit();// }// }//// status = RM_OK;// }// }//// if(status == RM_OK)// m_initialized = TRUE;// else// RMDBGLOG((QBDBG, "*********************************** Em86xx decoder : Open failed\n"));//// RMDBGLOG((QBDBG, "*********************************** Em86xx decoder : finish Open *********************************** \n"));//// return status;//}////RMstatus RMem86xxDecoder::OpenDecoder(typeVideoProfile profile,// RMbool hdtv,// RMbool dvd,// RMbool vcd,// RMbool useHwDemux,// RMuint32 video_bts_fifo_size,// RMuint32 video_xfer_fifo_buffer_count,// RMuint32 audio_bts_fifo_size,// RMuint32 audio_xfer_fifo_buffer_count,// RMbool launch_decoders)//{// struct DCCVideoProfile video_profile;// struct DCCAudioProfile audio_profile;// struct DCCDemuxProfile demuxProfile;// RMstatus status;// RMuint32 DemuxProgramId;// RMuint32 video_buffer_count;// RMuint32 audio_buffer_count;// RMuint32 spu_buffer_count;//// RMDBGLOG((QBDBG, "*********************************** Em86xx decoder : OpenDecoder *********************************** \n"));//// // DN: temp fix for 3296 (otherwise, the decoder would hang when opened the second time)// // must use DCCInitMode_LeaveDisplay here to keep the existing OSD intact// status = DCCInitMicroCodeEx(m_pDCC, DCCInitMode_LeaveDisplay);// if (status != RM_OK) {// RMDBGLOG((ENABLE, "Cannot initialize microcode %s\n", RMstatusToString(status)));// return status;// }//// RMDBGLOG((QBDBG, "Loading microcode for %s, %s\n",// dvd ? "DVD" :// (profile == MPEG2_PROFILE) ? "MPEG2" :// (profile == MPEG2_TRANSPORT_PROFILE) ? "MPEG2" :// (profile == MP4_PROFILE) ? "MPEG4" :// (profile == DIVX3_PROFILE) ? "DIVX3" :// (profile == WMV_PROFILE) ? "WMV" : "UNKNOWN",// hdtv ? "HDTV" :// "SDTV"));//// if(dvd){// video_profile.MPEGProfile = Profile_MPEG2_DVD;// m_video_codec = VideoDecoder_Codec_MPEG2_DVD;// }// else {// if(profile == WMV_PROFILE) {//// video_profile.MPEGProfile = Profile_WMV_816P;//// m_video_codec = VideoDecoder_Codec_WMV_816P;// video_profile.MPEGProfile = Profile_WMV_HD;// m_video_codec = VideoDecoder_Codec_WMV_HD;// }// else {// if(profile == MP4_PROFILE){// if(hdtv){// video_profile.MPEGProfile = Profile_MPEG4_HD;// m_video_codec = VideoDecoder_Codec_MPEG4_HD;// }// else {// video_profile.MPEGProfile = Profile_MPEG4_SD;// m_video_codec = VideoDecoder_Codec_MPEG4_SD;// }// }// else if((profile == MPEG2_TRANSPORT_PROFILE) ||// (profile == MPEG2_PROFILE)){// if(hdtv){// video_profile.MPEGProfile = Profile_MPEG2_HD;// m_video_codec = VideoDecoder_Codec_MPEG2_HD;// }// else {// video_profile.MPEGProfile = Profile_MPEG2_SD;// m_video_codec = VideoDecoder_Codec_MPEG2_SD;// }// }// else if(profile == DIVX3_PROFILE){// if(hdtv){// video_profile.MPEGProfile = Profile_DIVX3_HD;// m_video_codec = VideoDecoder_Codec_DIVX3_HD;// }// else {// video_profile.MPEGProfile = Profile_DIVX3_SD;// m_video_codec = VideoDecoder_Codec_DIVX3_SD;// }// }// else {// RMDBGLOG((ENABLE,"!!!!!! Invalid video profile !!!!!!\n"));// return RM_ERROR;// }// }// }//// RMDBGLOG((QBDBG, "Video profile : %s\n",// (video_profile.MPEGProfile == Profile_MPEG2_DVD) ? "Profile_DVD" :// (video_profile.MPEGProfile == Profile_MPEG2_HD) ? "Profile_MPEG2_HD" :
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -