资源简介
使用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个文件信息
相关资源
- OpenGL物理碰撞效果
- OpenGL小游戏
- OpenGL超级宝典第五版pdf及其随书源码
- OpenGL读取bunny文件+斯坦福兔子
- OpenGL开发的教室场景可以漫游
- OpenGL高级编程与可视化系统开发-系统
- opengl读取.obj三维模型,arcball实现鼠标
- OpenGL超级宝典 第5版 中文版 完整书签
- Computer Graphics with OpenGL 4th edition 高清
- OpenGL 4.0 Shading Language Cookbook及完整源
- Computer_Graphics_with_OpenGL_4th_ed.pdf
- opengl读入obj文件并实现平移旋转贴图
- OGL模型加载
- OPENGL 经典案例 整套
- opengl包含16个鼠标控制点的Bezier曲面
- qt下opengl的三维视角转换算法
- OpenGL鱼眼镜头特效的视频播放器 基于
- opengl实现bezier曲面的纹理贴图、鼠标
- assimp.dll
- OpenGL SDK
- OpenGL读取点云文件并绘制
- 计算机图形学大作业
- OpenCV与OpenGL实现增强现实
- 3d opengl 飞行射击游戏源码和论文
- 20个可读的obj模型文件
- opengl实现模型读取以及光照,移动等
- Opengl实现旗帜飘扬效果
- OpenGL星星公转自转
- OpenGL显示三维点云图像
- opengl绘制太阳、地球、月球
评论
共有 条评论