資源簡介
使用OpenGL實現紋理播放視頻技術,源代碼,經調試后,可以直接運行
代碼片段和文件信息
/*
?*?Copyright?1993-2014?NVIDIA?Corporation.??All?rights?reserved.
?*
?*?Please?refer?to?the?NVIDIA?end?user?license?agreement?(EULA)?associated
?*?with?this?source?code?for?terms?and?conditions?that?govern?your?use?of
?*?this?software.?Any?use?reproduction?disclosure?or?distribution?of
?*?this?software?and?related?documentation?outside?the?terms?of?the?EULA
?*?is?strictly?prohibited.
?*
?*/
/*?CUmoduleManager?manages?loading?CUBIN?initializing?CUBIN?kernel?function
?*?initializating?CUDA?kernel?function?pointers?and?obtaining?global?memory
?*?addresses?(i.e.?constants).
?*/
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?“cudaModuleMgr.h“
#define?ERROR_BUFFER_SIZE?256
using?namespace?std;
//?CUDA?Module?Manager?(C?implementation)
//??????filename_module?-?CUDA?or?PTX?file?path
//??????exec_path???????-?execution?path
//??????nKernels????????-?total?#?of?different?CUDA?kernel?functions?in?the?CUBIN/OTX
//??????nGlobalMem??????-?total?#?of?Global?Memory?arrays?defined?in?the?CUBIN/PTX?(i.e.?constants)
//??????nTexRef?????????-?total?#?of?Texture?References?arrays?defined?in?the?CUBIN/PTX?(i.e.?texture?arrays)
extern?“C“
bool?modInitCTX(sCtxModule?*pCtx?const?char?*filename?const?char?*exec_path?int?nKernels?int?nGlobalMem?int?nTexRef)
{
????pCtx->nMaxKernels_???=?nKernels;
????pCtx->nMaxGlobalMem_?=?nGlobalMem;
????pCtx->nMaxTexRef_????=?nTexRef;
????pCtx->mModuleName????=?filename;
????CUresult?cuStatus;
????int?file_size?=?0;
????string?module_path;
????string?ptx_source;
????char?*actual_path?=?sdkFindFilePath(pCtx->mModuleName.c_str()?exec_path);
????if?(actual_path)
????{
????????module_path?=?actual_path;
????}
????else
????{
????????printf(“>>?modInitCTX()?<%36s>?not?found!\n“?pCtx->mModuleName.c_str());
????????return?false;
????}
????if?(module_path.empty())
????{
????????printf(“>>?modInitCTX()?<%36s>?not?found!\n“?pCtx->mModuleName.c_str());
????????return?false;
????}
????else
????{
????????FILE?*fp?=?fopen(module_path.c_str()?“rb“);
????????fseek(fp?0?SEEK_END);
????????int?file_size?=?ftell(fp);
????????char?*buf?=?new?char[file_size+1];
????????fseek(fp?0?SEEK_SET);
????????fread(buf?sizeof(char)?file_size?fp);
????????fclose(fp);
????????buf[file_size]?=?‘\0‘;
????????ptx_source?=?buf;
????????delete?[]?buf;
????}
????if?(pCtx->mModuleName.rfind(“.ptx“)?!=?string::npos)
????{
????????//?in?this?branch?we?use?compilation?with?parameters
????????const?unsigned?int?jitNumOptions?=?3;
????????CUjit_option?*jitOptions?=?new?CUjit_option[jitNumOptions];
????????void?**jitOptVals?=?new?void?*[jitNumOptions];
????????//?set?up?size?of?compilation?log?buffer
????????jitOptions[0]?=?CU_JIT_INFO_LOG_BUFFER_SIZE_BYTES;
????????int?jitLogBufferSize?=?1024;
????????jitOptVals[0]?=?(void?*)(size_t)jitLog
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2014-03-14?06:38??3_Imaging\
?????目錄???????????0??2014-03-14?06:38??3_Imaging\cudaDecodeGL\
?????文件????????1250??2013-08-23?21:29??3_Imaging\cudaDecodeGL\cudaDecodeGL_vs2008.sln
?????文件???????11597??2013-09-25?07:35??3_Imaging\cudaDecodeGL\cudaDecodeGL_vs2008.vcproj
?????文件????????1251??2014-01-17?10:19??3_Imaging\cudaDecodeGL\cudaDecodeGL_vs2010.sln
?????文件????????6409??2014-01-17?10:19??3_Imaging\cudaDecodeGL\cudaDecodeGL_vs2010.vcxproj
?????文件????????1251??2014-01-17?10:19??3_Imaging\cudaDecodeGL\cudaDecodeGL_vs2012.sln
?????文件????????6454??2014-01-17?10:19??3_Imaging\cudaDecodeGL\cudaDecodeGL_vs2012.vcxproj
?????文件???????11370??2014-01-17?10:19??3_Imaging\cudaDecodeGL\cudaModuleMgr.cpp
?????文件????????4132??2014-01-17?10:19??3_Imaging\cudaDecodeGL\cudaModuleMgr.h
?????文件????????5851??2014-01-17?10:19??3_Imaging\cudaDecodeGL\cudaProcessfr
?????文件????????2280??2014-01-17?10:19??3_Imaging\cudaDecodeGL\cudaProcessfr
?????目錄???????????0??2014-03-14?06:38??3_Imaging\cudaDecodeGL\data\
?????文件???????13585??2014-03-14?03:08??3_Imaging\cudaDecodeGL\data\NV12ToARGB_drvapi32.ptx
?????文件???????13829??2014-03-14?05:13??3_Imaging\cudaDecodeGL\data\NV12ToARGB_drvapi64.ptx
?????文件????14286020??2013-08-23?21:29??3_Imaging\cudaDecodeGL\data\plush1_720p_10s.m2v
?????目錄???????????0??2014-03-14?06:38??3_Imaging\cudaDecodeGL\doc\
?????文件??????690671??2013-09-05?10:23??3_Imaging\cudaDecodeGL\doc\nvcuvid.pdf
?????文件????????4372??2014-01-17?10:19??3_Imaging\cudaDecodeGL\fr
?????文件????????2735??2014-01-17?10:19??3_Imaging\cudaDecodeGL\fr
?????文件????????6948??2014-01-17?10:19??3_Imaging\cudaDecodeGL\ImageGL.cpp
?????文件????????4498??2014-01-17?10:19??3_Imaging\cudaDecodeGL\ImageGL.h
?????文件????????8074??2014-01-17?10:19??3_Imaging\cudaDecodeGL\NV12ToARGB_drvapi.cu
?????文件???????42851??2014-01-17?10:19??3_Imaging\cudaDecodeGL\videoDecodeGL.cpp
?????文件????????6024??2014-01-17?10:19??3_Imaging\cudaDecodeGL\VideoDecoder.cpp
?????文件????????2309??2014-01-17?10:19??3_Imaging\cudaDecodeGL\VideoDecoder.h
?????文件????????4168??2014-01-17?10:19??3_Imaging\cudaDecodeGL\VideoParser.cpp
?????文件????????3702??2014-01-17?10:19??3_Imaging\cudaDecodeGL\VideoParser.h
?????文件????????7046??2014-01-17?10:19??3_Imaging\cudaDecodeGL\VideoSource.cpp
?????文件????????5005??2014-01-17?10:19??3_Imaging\cudaDecodeGL\VideoSource.h
?????目錄???????????0??2014-03-14?06:38??Bin\
............此處省略64個文件信息
評論
共有 條評論