Skip to content

Commit

Permalink
make some change
Browse files Browse the repository at this point in the history
  • Loading branch information
leixiaohua1020 committed Aug 28, 2014
1 parent 14a63e1 commit 94c79a2
Show file tree
Hide file tree
Showing 13 changed files with 87 additions and 35 deletions.
2 changes: 0 additions & 2 deletions Dfanalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1033,8 +1033,6 @@ void Dfanalysis::OnBnClickedDfanalysisAuto()
{
if(m_dfanalysisauto.GetCheck()==1){
CString resloader;
resloader.LoadString(IDS_MSGBOX_RESCONSUM);
AfxMessageBox(resloader);
GetDlgItem(IDC_DFANALYSIS_AUTO_INTERFRAMENUM)->EnableWindow(TRUE);
GetDlgItem(IDC_DFANALYSIS_AUTO_OK)->EnableWindow(TRUE);
}else{
Expand Down
3 changes: 0 additions & 3 deletions Rawanalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -964,9 +964,6 @@ int Rawanalysis::show_color_component(int nameid){
void Rawanalysis::OnBnClickedRawanalysisAuto()
{
if(m_rawanalysisauto.GetCheck()==1){
CString resloader;
resloader.LoadString(IDS_MSGBOX_RESCONSUM);
AfxMessageBox(resloader);
GetDlgItem(IDC_RAWANALYSIS_AUTO_INTERFRAMENUM)->EnableWindow(TRUE);
GetDlgItem(IDC_RAWANALYSIS_AUTO_OK)->EnableWindow(TRUE);
}else{
Expand Down
Binary file modified VideoEye.aps
Binary file not shown.
Binary file modified VideoEye.rc
Binary file not shown.
Binary file modified VideoEye.suo
Binary file not shown.
9 changes: 5 additions & 4 deletions VideoEye.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
<CharacterSet>Unicode</CharacterSet>
<UseOfMfc>Static</UseOfMfc>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
Expand Down Expand Up @@ -60,7 +60,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>.\lib;</AdditionalLibraryDirectories>
<AdditionalDependencies>avcodec.lib;avformat.lib;avutil.lib;avdevice.lib;avfilter.lib;postproc.lib;swresample.lib;swscale.lib;SDL.lib;tinyxml.lib;Winmm.lib;Ws2_32.lib;opencv_core231.lib;opencv_highgui231.lib;opencv_imgproc231.lib;opencv_objdetect231.lib</AdditionalDependencies>
<IgnoreSpecificDefaultLibraries>LIBCMT.lib;</IgnoreSpecificDefaultLibraries>
<IgnoreSpecificDefaultLibraries>libcmt.lib</IgnoreSpecificDefaultLibraries>
<StackCommitSize>
</StackCommitSize>
<StackReserveSize>10000000</StackReserveSize>
Expand All @@ -85,7 +85,7 @@
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>.\include;</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
Expand All @@ -95,7 +95,8 @@
<AdditionalLibraryDirectories>.\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>avcodec.lib;avformat.lib;avutil.lib;avdevice.lib;avfilter.lib;postproc.lib;swresample.lib;swscale.lib;SDL.lib;tinyxml.lib;Winmm.lib;Ws2_32.lib;opencv_core231.lib;opencv_highgui231.lib;opencv_imgproc231.lib;opencv_objdetect231.lib;%(AdditionalDependencies)</AdditionalDependencies>
<StackReserveSize>10000000</StackReserveSize>
<IgnoreSpecificDefaultLibraries>LIBCMT.lib;</IgnoreSpecificDefaultLibraries>
<IgnoreSpecificDefaultLibraries>
</IgnoreSpecificDefaultLibraries>
</Link>
<Midl>
<MkTypLibCompatible>false</MkTypLibCompatible>
Expand Down
37 changes: 18 additions & 19 deletions VideoEyeDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,8 @@ ON_COMMAND(ID_LANG_EN, &CVideoEyeDlg::OnLangEn)
ON_COMMAND(IDCANCEL, &CVideoEyeDlg::OnCancel)
ON_COMMAND(ID_SYSINFO, &CVideoEyeDlg::OnSysinfo)
ON_WM_CTLCOLOR()
ON_COMMAND(ID_WINDOWSTRETCH_KEEPRATIO, &CVideoEyeDlg::OnWindowstretchKeepratio)
ON_COMMAND(ID_WINDOWSTRETCH_RESIZE, &CVideoEyeDlg::OnWindowstretchResize)
END_MESSAGE_MAP()


Expand Down Expand Up @@ -327,13 +329,7 @@ BOOL CVideoEyeDlg::OnInitDialog()
//支持在系统中右键打开----------------------
//当传入参数的时候


#ifdef _UNICODE
USES_CONVERSION;
wchar_t* argvPath = __targv[1];
#else
char* argvPath = __targv[1];
#endif
TCHAR* argvPath = __targv[1];

if(argvPath != NULL){
//设置路径
Expand Down Expand Up @@ -522,18 +518,9 @@ void CVideoEyeDlg::OnDropFiles(HDROP hDropInfo)
{
CDialogEx::OnDropFiles(hDropInfo);

char* pFilePathName =(char *)malloc(MAX_URL_LENGTH);
::DragQueryFileA(hDropInfo, 0, pFilePathName,MAX_URL_LENGTH); // 获取拖放文件的完整文件名,最关键!
CString FilePathName;

#ifdef _UNICODE
USES_CONVERSION;
FilePathName.Format(_T("%s"),A2W(pFilePathName));
#else
FilePathName.Format(_T("%s"),pFilePathName);
#endif
m_inputurl.SetWindowText(FilePathName);

LPTSTR pFilePathName =(LPTSTR)malloc(MAX_URL_LENGTH);
::DragQueryFile(hDropInfo, 0, pFilePathName,MAX_URL_LENGTH); // 获取拖放文件的完整文件名,最关键!
m_inputurl.SetWindowText(pFilePathName);
::DragFinish(hDropInfo); // 注意这个不能少,它用于释放Windows 为处理文件拖放而分配的内存
free(pFilePathName);
}
Expand Down Expand Up @@ -1323,3 +1310,15 @@ HBRUSH CVideoEyeDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
// TODO: 如果默认的不是所需画笔,则返回另一个画笔
return hbr;
}


void CVideoEyeDlg::OnWindowstretchKeepratio()
{
ve_stretch(0);
}


void CVideoEyeDlg::OnWindowstretchResize()
{
ve_stretch(1);
}
2 changes: 2 additions & 0 deletions VideoEyeDlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -234,4 +234,6 @@ class CVideoEyeDlg : public CDialogEx
afx_msg void OnCancel();
afx_msg void OnSysinfo();
afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
afx_msg void OnWindowstretchKeepratio();
afx_msg void OnWindowstretchResize();
};
2 changes: 1 addition & 1 deletion config.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
#define HAVE_ROUND 1
#define HAVE_ROUNDF 1
#define HAVE_SDL 0
#define HAVE_SDL_VIDEO_SIZE 0
#define HAVE_SDL_VIDEO_SIZE 1
#define HAVE_SETMODE 0
#define HAVE_SOCKLEN_T 1
#define HAVE_SOUNDCARD_H 0
Expand Down
Binary file modified resource.h
Binary file not shown.
41 changes: 36 additions & 5 deletions ve_play.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,8 @@ static int rdftspeed = 20;
static char *vfilters = NULL;
#endif



/* current context */
static int is_full_screen;
static int64_t audio_callback_time;
Expand All @@ -318,6 +320,10 @@ int dataoutput_h264_ft;
#define VE_SEEK_BAR_EVENT (SDL_USEREVENT + 4)
int seek_bar_pos;


//�Ƿ�����-------------------------
#define VE_STRETCH_EVENT (SDL_USEREVENT + 5)
int is_stretch=1;
//--------------------------------
//ר�����õı�ǣ��ڳ���Ҫ�˳���ʱ�����1
static int exit_remark=0;
Expand Down Expand Up @@ -1142,9 +1148,11 @@ static void video_image_display(VideoState *is)
}
}
//������ʾ����λ�ã����ַ�����
//calculate_display_rect(&rect, is->xleft, is->ytop, is->width, is->height, vp);
calculate_display_rect_f(&rect, is->xleft, is->ytop, is->width, is->height, vp);

if(is_stretch==0){
calculate_display_rect(&rect, is->xleft, is->ytop, is->width, is->height, vp);
}else if(is_stretch==1){
calculate_display_rect_f(&rect, is->xleft, is->ytop, is->width, is->height, vp);
}
SDL_DisplayYUVOverlay(vp->bmp, &rect);
}
}
Expand Down Expand Up @@ -3573,6 +3581,13 @@ void ve_seek_bar(int pos){
SDL_PushEvent(&event);
}

void ve_stretch(int stretch){
SDL_Event event;
event.type = VE_STRETCH_EVENT;
SDL_PushEvent(&event);
is_stretch=stretch;
}



static void toggle_audio_display(VideoState *is,int mode)
Expand Down Expand Up @@ -3619,6 +3634,8 @@ static void event_loop(VideoState *cur_stream)
switch (event.key.keysym.sym) {
case SDLK_ESCAPE:
case SDLK_q:
//�൱�ڵ�����ֹͣ��
dlg->PostMessage(WM_COMMAND, MAKEWPARAM(IDC_STOP, BN_CLICKED), NULL);
do_exit(cur_stream);
break;
case SDLK_f:
Expand Down Expand Up @@ -3742,13 +3759,19 @@ static void event_loop(VideoState *cur_stream)
stream_seek(cur_stream, ts, 0, 0);
}
break;
case SDL_VIDEORESIZE:
case SDL_VIDEORESIZE:{
screen = SDL_SetVideoMode(event.resize.w, event.resize.h, 0,
SDL_HWSURFACE|SDL_RESIZABLE|SDL_ASYNCBLIT|SDL_HWACCEL);
screen_width = cur_stream->width = event.resize.w;
screen_height = cur_stream->height = event.resize.h;
//Refresh----------
int bgcolor = SDL_MapRGB(screen->format, 0x00, 0x00, 0x00);
fill_rectangle(screen,cur_stream->xleft, cur_stream->ytop, cur_stream->width, cur_stream->height,bgcolor);
SDL_UpdateRect(screen, cur_stream->xleft, cur_stream->ytop, cur_stream->width, cur_stream->height);
//-----------------
cur_stream->force_refresh = 1;
break;
}
case SDL_QUIT:
case FF_QUIT_EVENT:
//�൱�ڵ�����ֹͣ��
Expand Down Expand Up @@ -3777,7 +3800,14 @@ static void event_loop(VideoState *cur_stream)

break;
}

case VE_STRETCH_EVENT:{
//ˢ��--------------------
int bgcolor = SDL_MapRGB(screen->format, 0x00, 0x00, 0x00);
fill_rectangle(screen,cur_stream->xleft, cur_stream->ytop, cur_stream->width, cur_stream->height,bgcolor);
SDL_UpdateRect(screen, cur_stream->xleft, cur_stream->ytop, cur_stream->width, cur_stream->height);
//--
break;
}
default:
break;
}
Expand Down Expand Up @@ -4105,6 +4135,7 @@ int ve_play(LPVOID lpParam)

g_is = is;
//��ʼ��һЩ����-------------
autoexit=1;
dataoutput_h264_ft=1;
//const char *info=(char *)malloc(500);
//info=avformat_configuration();
Expand Down
4 changes: 3 additions & 1 deletion ve_play.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,6 @@ int ve_play(LPVOID lpParam);
//--------
int ve_reset_index();
//播放进度
void ve_seek_bar(int pos);
void ve_seek_bar(int pos);

void ve_stretch(int stretch);
22 changes: 22 additions & 0 deletions 问题.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
��Ƶ/��Ƶʵʱ�����Dz���̫ռ�ڴ��ˣ��ܷ�ijɿɿ��صģ�������ɫ��ʱ�򣬵�һ�г������ڲ���̫�����ʵ����Ϊ��ɫ
��Ƶ/��Ƶʵʱ���������������ã�������Define�ɹ̶��ġ�
�������ٲ�����ʱ�򣬻���������������������ʲôԭ��
����������֡����Ƶ���ŵ�֡��һ�£���ν����

ԭʼ���������У����������÷�ʽ�Ƿ�Ҫʹ��RadioButton�����Ǹ�����PropertyGrid���ã�
��֡��������У��Ƿ�Ҫһ����������Ǹ���ͳ����Ϣ�����Ǹ����ɶ����壿

�����¹������ӣ�
IO��ͳ�ƣ�ԭ�����еģ�
ͼ����










ңԶ�����ӣ���Ƶ�������۹���

0 comments on commit 94c79a2

Please sign in to comment.