资源简介
视频水印嵌入算法源程序(VC实现,对话框界面)
视频水印嵌入算法源程序(VC实现,对话框界面)
视频水印嵌入算法源程序(VC实现,对话框界面)
代码片段和文件信息
// AviRW.cpp: implementation of the CAviRW class.
//
//////////////////////////////////////////////////////////////////////
#include “stdafx.h“
#include “MarkAVI.h“
#include “AviRW.h“
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
#define MAX_STREAM (10)
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CAviRW::CAviRW()
{
}
CAviRW::~CAviRW()
{
}
bool CAviRW::SetMark(CString sSrcFile
CString sDesFile
LONG nPx
LONG nPy
MARKINFO *pMark
)
{
CLogOut log;
log.Init(“d:\\log.txt“);
HRESULT hr;
PAVIFILE psrcfile = NULL;
PAVIFILE pdesfile = NULL;
AVIFILEINFO fi;
PAVISTREAM psrcstr[MAX_STREAM];
PAVISTREAM pdesstr[MAX_STREAM];
AVISTREAMINFO stri[MAX_STREAM];
LPVOID lpFormat[MAX_STREAM];
LONG cbFormat[MAX_STREAM];
DWORD i = 0;
//init
memset(&i 0sizeof(AVIFILEINFO));
memset(psrcstr 0sizeof(PAVISTREAM)*MAX_STREAM);
memset(pdesstr 0sizeof(PAVISTREAM)*MAX_STREAM);
memset(stri 0sizeof(AVISTREAMINFO)*MAX_STREAM);
memset(lpFormat 0sizeof(LPVOID)*MAX_STREAM);
memset(cbFormat 0sizeof(LONG)*MAX_STREAM);
//0 AVIFileInit();
AVIFileInit();
//1 open src file
hr = AVIFileOpen(
&psrcfile // returned file pointer
sSrcFile // file name
OF_READ // mode to open file with
NULL);
hr = AVIFileInfo(
psrcfile
&fi
sizeof(AVIFILEINFO)
);
//1 open src stream
//1 get src stream info
for(i=0;i {
hr = AVIFileGetStream(
psrcfile
&psrcstr[i]
0//streamtypeVIDEO
i //LONG lParam
);
hr = AVIStreamInfo(
psrcstr[i]
&stri[i]
sizeof(AVISTREAMINFO)
);
//get stream format
//get size of format
hr = AVIStreamReadFormat(
psrcstr[i]
0
NULL
&cbFormat[i]
);
lpFormat[i] = malloc(cbFormat[i]);
//get format info
hr = AVIStreamReadFormat(
psrcstr[i]
0
lpFormat[i]
&cbFormat[i]
);
}
//2 open des file
hr = AVIFileOpen(
&pdesfile // returned file pointer
sDesFile // file name
OF_CREATE|OF_WRITE // mode to open file with
NULL);
//2 create des stream
//2 set des stream info
for(i=0;i {
hr = AVIFileCreateStream(
pdesfile
&pdesstr[i]
&stri[i] //LONG lParam
);
hr = AVIStreamSetFormat(
pdesstr[i]
0
lpFormat[i]
cbFormat[i]
);
}
for(i=0;i {
long nLength = stri[i].dwLength;//= AVIStreamLength(psrcstr[i]);
long nStart = stri[i].dwStart;
//if this stream is streamtypeVIDEO <----------------------------------
if(streamtypeVIDEO==stri[i].fccType)
{
for(long j = nStart;
j< nStart+nLength;
j++)
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2005-05-23 22:44 MarkAVI
文件 11025 2005-05-11 00:14 MarkAVI\AviRW.cpp
文件 1956 2005-05-11 00:07 MarkAVI\AviRW.h
文件 6815 2005-04-27 08:31 MarkAVI\CDIB.C
文件 1676 2005-05-06 20:11 MarkAVI\LogOut.cpp
文件 646 2005-05-06 20:11 MarkAVI\LogOut.h
文件 36336 2005-05-23 22:18 MarkAVI\MarkAVI.aps
文件 2384 2005-05-23 22:44 MarkAVI\MarkAVI.clw
文件 2077 2005-04-24 10:10 MarkAVI\MarkAVI.cpp
文件 4428 2005-05-11 00:26 MarkAVI\MarkAVI.dsp
文件 537 2005-04-24 10:10 MarkAVI\MarkAVI.dsw
文件 1335 2005-04-24 10:10 MarkAVI\MarkAVI.h
文件 99328 2005-05-23 22:44 MarkAVI\MarkAVI.ncb
文件 54784 2005-05-23 22:44 MarkAVI\MarkAVI.opt
文件 848 2005-05-23 22:19 MarkAVI\MarkAVI.plg
文件 5908 2005-05-23 22:18 MarkAVI\MarkAVI.rc
文件 7069 2005-05-21 13:10 MarkAVI\MarkAVIDlg.cpp
文件 1460 2005-05-10 22:43 MarkAVI\MarkAVIDlg.h
文件 3597 2005-04-24 10:10 MarkAVI\ReadMe.txt
目录 0 2005-04-24 10:10 MarkAVI\res
文件 1078 2005-04-24 10:10 MarkAVI\res\MarkAVI.ico
文件 399 2005-04-24 10:10 MarkAVI\res\MarkAVI.rc2
文件 1007 2005-05-10 22:46 MarkAVI\resource.h
文件 209 2005-04-24 10:10 MarkAVI\StdAfx.cpp
文件 1054 2005-04-24 10:10 MarkAVI\StdAfx.h
----------- --------- ---------- ----- ----
245956 25
评论
共有 条评论