使用OpenGL实现纹理播放视频技术,源代码,经调试后,可以直接运行
代码片段和文件信息
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2014-03-14 06:38 3_Imaging
目录 0 2014-03-14 06:38 3_ImagingcudaDecodeGL
文件 1250 2013-08-23 21:29 3_ImagingcudaDecodeGLcudaDecodeGL_vs2008.sln
文件 11597 2013-09-25 07:35 3_ImagingcudaDecodeGLcudaDecodeGL_vs2008.vcproj
文件 1251 2014-01-17 10:19 3_ImagingcudaDecodeGLcudaDecodeGL_vs2010.sln
文件 6409 2014-01-17 10:19 3_ImagingcudaDecodeGLcudaDecodeGL_vs2010.vcxproj
文件 1251 2014-01-17 10:19 3_ImagingcudaDecodeGLcudaDecodeGL_vs2012.sln
文件 6454 2014-01-17 10:19 3_ImagingcudaDecodeGLcudaDecodeGL_vs2012.vcxproj
文件 11370 2014-01-17 10:19 3_ImagingcudaDecodeGLcudaModuleMgr.cpp
文件 4132 2014-01-17 10:19 3_ImagingcudaDecodeGLcudaModuleMgr.h
文件 5851 2014-01-17 10:19 3_ImagingcudaDecodeGLcudaProcessframe.cpp
文件 2280 2014-01-17 10:19 3_ImagingcudaDecodeGLcudaProcessframe.h
目录 0 2014-03-14 06:38 3_ImagingcudaDecodeGLdata
文件 13585 2014-03-14 03:08 3_ImagingcudaDecodeGLdataNV12ToARGB_drvapi32.ptx
文件 13829 2014-03-14 05:13 3_ImagingcudaDecodeGLdataNV12ToARGB_drvapi64.ptx
文件 14286020 2013-08-23 21:29 3_ImagingcudaDecodeGLdataplush1_720p_10s.m2v
目录 0 2014-03-14 06:38 3_ImagingcudaDecodeGLdoc
文件 690671 2013-09-05 10:23 3_ImagingcudaDecodeGLdoc
vcuvid.pdf
文件 4372 2014-01-17 10:19 3_ImagingcudaDecodeGLframeQueue.cpp
文件 2735 2014-01-17 10:19 3_ImagingcudaDecodeGLframeQueue.h
文件 6948 2014-01-17 10:19 3_ImagingcudaDecodeGLImageGL.cpp
文件 4498 2014-01-17 10:19 3_ImagingcudaDecodeGLImageGL.h
文件 8074 2014-01-17 10:19 3_ImagingcudaDecodeGLNV12ToARGB_drvapi.cu
文件 42851 2014-01-17 10:19 3_ImagingcudaDecodeGLvideoDecodeGL.cpp
文件 6024 2014-01-17 10:19 3_ImagingcudaDecodeGLVideoDecoder.cpp
文件 2309 2014-01-17 10:19 3_ImagingcudaDecodeGLVideoDecoder.h
文件 4168 2014-01-17 10:19 3_ImagingcudaDecodeGLVideoParser.cpp
文件 3702 2014-01-17 10:19 3_ImagingcudaDecodeGLVideoParser.h
文件 7046 2014-01-17 10:19 3_ImagingcudaDecodeGLVideoSource.cpp
文件 5005 2014-01-17 10:19 3_ImagingcudaDecodeGLVideoSource.h
目录 0 2014-03-14 06:38 Bin
............此处省略64个文件信息
/*
* 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!
“ pCtx->mModuleName.c_str());
return false;
}
if (module_path.empty())
{
printf(“>> modInitCTX() <%36s> not found!
“ 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] = ‘ ‘;
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_ImagingcudaDecodeGL
文件 1250 2013-08-23 21:29 3_ImagingcudaDecodeGLcudaDecodeGL_vs2008.sln
文件 11597 2013-09-25 07:35 3_ImagingcudaDecodeGLcudaDecodeGL_vs2008.vcproj
文件 1251 2014-01-17 10:19 3_ImagingcudaDecodeGLcudaDecodeGL_vs2010.sln
文件 6409 2014-01-17 10:19 3_ImagingcudaDecodeGLcudaDecodeGL_vs2010.vcxproj
文件 1251 2014-01-17 10:19 3_ImagingcudaDecodeGLcudaDecodeGL_vs2012.sln
文件 6454 2014-01-17 10:19 3_ImagingcudaDecodeGLcudaDecodeGL_vs2012.vcxproj
文件 11370 2014-01-17 10:19 3_ImagingcudaDecodeGLcudaModuleMgr.cpp
文件 4132 2014-01-17 10:19 3_ImagingcudaDecodeGLcudaModuleMgr.h
文件 5851 2014-01-17 10:19 3_ImagingcudaDecodeGLcudaProcessfr
文件 2280 2014-01-17 10:19 3_ImagingcudaDecodeGLcudaProcessfr
目录 0 2014-03-14 06:38 3_ImagingcudaDecodeGLdata
文件 13585 2014-03-14 03:08 3_ImagingcudaDecodeGLdataNV12ToARGB_drvapi32.ptx
文件 13829 2014-03-14 05:13 3_ImagingcudaDecodeGLdataNV12ToARGB_drvapi64.ptx
文件 14286020 2013-08-23 21:29 3_ImagingcudaDecodeGLdataplush1_720p_10s.m2v
目录 0 2014-03-14 06:38 3_ImagingcudaDecodeGLdoc
文件 690671 2013-09-05 10:23 3_ImagingcudaDecodeGLdoc
vcuvid.pdf
文件 4372 2014-01-17 10:19 3_ImagingcudaDecodeGLfr
文件 2735 2014-01-17 10:19 3_ImagingcudaDecodeGLfr
文件 6948 2014-01-17 10:19 3_ImagingcudaDecodeGLImageGL.cpp
文件 4498 2014-01-17 10:19 3_ImagingcudaDecodeGLImageGL.h
文件 8074 2014-01-17 10:19 3_ImagingcudaDecodeGLNV12ToARGB_drvapi.cu
文件 42851 2014-01-17 10:19 3_ImagingcudaDecodeGLvideoDecodeGL.cpp
文件 6024 2014-01-17 10:19 3_ImagingcudaDecodeGLVideoDecoder.cpp
文件 2309 2014-01-17 10:19 3_ImagingcudaDecodeGLVideoDecoder.h
文件 4168 2014-01-17 10:19 3_ImagingcudaDecodeGLVideoParser.cpp
文件 3702 2014-01-17 10:19 3_ImagingcudaDecodeGLVideoParser.h
文件 7046 2014-01-17 10:19 3_ImagingcudaDecodeGLVideoSource.cpp
文件 5005 2014-01-17 10:19 3_ImagingcudaDecodeGLVideoSource.h
目录 0 2014-03-14 06:38 Bin
............此处省略64个文件信息
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。
评论列表(条)