From 36463e44d631ef460c81e0ea8335e730f5e1d411 Mon Sep 17 00:00:00 2001 From: Babosa Date: Fri, 19 Apr 2019 11:14:55 +0800 Subject: [PATCH] update EasyPusher.sln --- EasyPusher_File/EasyPusher_File.vcxproj | 4 +- EasyPusher_File/EasyPusher_File.vcxproj.user | 2 +- EasyPusher_File/main.cpp | 40 +++--------------- EasyPusher_RTSP/EasyPusher_RTSP.vcxproj | 4 +- EasyPusher_RTSP/EasyPusher_RTSP.vcxproj.user | 2 +- .../Include/EasyRTSPClientAPI.h | 14 +++---- EasyPusher_RTSP/main.cpp | 41 +++---------------- win/EasyPusher.sln | 6 --- 8 files changed, 23 insertions(+), 90 deletions(-) diff --git a/EasyPusher_File/EasyPusher_File.vcxproj b/EasyPusher_File/EasyPusher_File.vcxproj index 2cb1983..7187c3d 100644 --- a/EasyPusher_File/EasyPusher_File.vcxproj +++ b/EasyPusher_File/EasyPusher_File.vcxproj @@ -61,7 +61,7 @@ true true ws2_32.lib;wsock32.lib;winmm.lib;libEasyPusher.lib - ../Lib/ + ../Lib/x86 @@ -82,7 +82,7 @@ true true ws2_32.lib;wsock32.lib;winmm.lib;libEasyPusher.lib - ../Lib/ + ../Lib/x86 diff --git a/EasyPusher_File/EasyPusher_File.vcxproj.user b/EasyPusher_File/EasyPusher_File.vcxproj.user index b0e9608..e74896e 100644 --- a/EasyPusher_File/EasyPusher_File.vcxproj.user +++ b/EasyPusher_File/EasyPusher_File.vcxproj.user @@ -1,7 +1,7 @@  - path=%path%;..\Lib + path=%path%;..\Lib\x86 WindowsLocalDebugger diff --git a/EasyPusher_File/main.cpp b/EasyPusher_File/main.cpp index c6579ac..92b87e1 100644 --- a/EasyPusher_File/main.cpp +++ b/EasyPusher_File/main.cpp @@ -24,10 +24,9 @@ using namespace std; #include #ifdef _WIN32 -#define KEY "6A36334A743469576B5A754154645A6270436D794A65784659584E355548567A6147567958305A4A544555755A58686C567778576F502B6C3430566863336C4559584A33615735555A57467453584E55614756435A584E30514449774D54686C59584E35" #include "getopt.h" #else //linux -#define KEY "6A36334A74354F576B596F412F4E5262704373447066426C59584E356348567A6147567958325A7062475658444661672F36586A5257467A65555268636E6470626C526C5957314A6331526F5A554A6C633352414D6A41784F47566863336B3D" + #include "unistd.h" #include #endif @@ -81,7 +80,7 @@ bool g_bThreadLiving[MAX_TRACK_NUM]; CMp4_root_box g_root; FILE * g_fin = NULL; FILE* g_finA = NULL; -Easy_Pusher_Handle g_fPusherHandle = 0; +Easy_Handle g_fPusherHandle = 0; CRITICAL_SECTION m_cs; bool g_bVideoStart = false; EASY_MEDIA_INFO_T mediainfo; @@ -239,7 +238,7 @@ int main(int argc, char * argv[]) } char szIP[16] = {0}; - Easy_Pusher_Handle fPusherHandle = 0; + Easy_Handle fPusherHandle = 0; int buf_size = 1024*512; char *pbuf = (char *) malloc(buf_size); @@ -297,36 +296,7 @@ int main(int argc, char * argv[]) g_mp4TrackThread[nAudioTrackId] = (HANDLE)_beginthreadex(NULL, 0, AudioThread, (void*)nAudioTrackId,0,0); g_bThreadLiving[nAudioTrackId] = true; } - - int isActivated = EasyPusher_Activate(KEY); - switch(isActivated) - { - case EASY_ACTIVATE_INVALID_KEY: - printf("KEY is EASY_ACTIVATE_INVALID_KEY!\n"); - break; - case EASY_ACTIVATE_TIME_ERR: - printf("KEY is EASY_ACTIVATE_TIME_ERR!\n"); - break; - case EASY_ACTIVATE_PROCESS_NAME_LEN_ERR: - printf("KEY is EASY_ACTIVATE_PROCESS_NAME_LEN_ERR!\n"); - break; - case EASY_ACTIVATE_PROCESS_NAME_ERR: - printf("KEY is EASY_ACTIVATE_PROCESS_NAME_ERR!\n"); - break; - case EASY_ACTIVATE_VALIDITY_PERIOD_ERR: - printf("KEY is EASY_ACTIVATE_VALIDITY_PERIOD_ERR!\n"); - break; - case EASY_ACTIVATE_SUCCESS: - printf("KEY is EASY_ACTIVATE_SUCCESS!\n"); - break; - } - - if(EASY_ACTIVATE_SUCCESS != isActivated) - { - getchar(); - return -1; - } - + g_fPusherHandle = EasyPusher_Create(); if(g_fPusherHandle == NULL) @@ -611,7 +581,7 @@ unsigned int _stdcall AudioThread(void* lParam) // #endif // int ch; // char szIP[16] = {0}; -// Easy_Pusher_Handle fPusherHandle = 0; +// Easy_Handle fPusherHandle = 0; // EASY_MEDIA_INFO_T mediainfo; // // int buf_size = 1024*512; diff --git a/EasyPusher_RTSP/EasyPusher_RTSP.vcxproj b/EasyPusher_RTSP/EasyPusher_RTSP.vcxproj index ba6108e..4f31f1f 100644 --- a/EasyPusher_RTSP/EasyPusher_RTSP.vcxproj +++ b/EasyPusher_RTSP/EasyPusher_RTSP.vcxproj @@ -62,7 +62,7 @@ Console true ws2_32.lib;wsock32.lib;winmm.lib;libEasyPusher.lib;libEasyRTSPClient.lib - ../Lib/;./libEasyRTSPClient/Lib/ + ../Lib/x86;./libEasyRTSPClient/Lib/ @@ -88,7 +88,7 @@ true true ws2_32.lib;wsock32.lib;winmm.lib;libEasyPusher.lib;libEasyRTSPClient.lib - ../Lib/;./libEasyRTSPClient/Lib/ + ../Lib/x86;./libEasyRTSPClient/Lib/ diff --git a/EasyPusher_RTSP/EasyPusher_RTSP.vcxproj.user b/EasyPusher_RTSP/EasyPusher_RTSP.vcxproj.user index 41a6483..26e3245 100644 --- a/EasyPusher_RTSP/EasyPusher_RTSP.vcxproj.user +++ b/EasyPusher_RTSP/EasyPusher_RTSP.vcxproj.user @@ -1,7 +1,7 @@  - path=%path%;..\Lib;.\libEasyRTSPClient\Lib + path=%path%;..\Lib\x86;.\libEasyRTSPClient\Lib WindowsLocalDebugger diff --git a/EasyPusher_RTSP/libEasyRTSPClient/Include/EasyRTSPClientAPI.h b/EasyPusher_RTSP/libEasyRTSPClient/Include/EasyRTSPClientAPI.h index eb4a0f3..a9875e2 100644 --- a/EasyPusher_RTSP/libEasyRTSPClient/Include/EasyRTSPClientAPI.h +++ b/EasyPusher_RTSP/libEasyRTSPClient/Include/EasyRTSPClientAPI.h @@ -18,32 +18,32 @@ _pBuf: »Øµ÷µÄÊý¾Ý²¿·Ö£¬¾ßÌåÓ÷¨¿´Demo _frameInfo: Ö¡½á¹¹Êý¾Ý */ -typedef int (Easy_APICALL *RTSPSourceCallBack)( int _channelId, void *_channelPtr, int _frameType, char *pBuf, RTSP_FRAME_INFO* _frameInfo); +typedef int (Easy_APICALL *RTSPSourceCallBack)( int _channelId, void *_channelPtr, int _frameType, char *pBuf, EASY_FRAME_INFO* _frameInfo); #ifdef __cplusplus extern "C" { #endif /* »ñÈ¡×îºóÒ»´Î´íÎóµÄ´íÎóÂë */ - Easy_API int Easy_APICALL EasyRTSP_GetErrCode(Easy_RTSP_Handle handle); + Easy_API int Easy_APICALL EasyRTSP_GetErrCode(Easy_Handle handle); /* ¼¤»î */ Easy_API int Easy_APICALL EasyRTSP_Activate(char *license); /* ´´½¨RTSPClient¾ä±ú ·µ»Ø0±íʾ³É¹¦£¬·µ»Ø·Ç0±íʾʧ°Ü */ - Easy_API int Easy_APICALL EasyRTSP_Init(Easy_RTSP_Handle *handle); + Easy_API int Easy_APICALL EasyRTSP_Init(Easy_Handle *handle); /* ÊÍ·ÅRTSPClient ²ÎÊýΪRTSPClient¾ä±ú */ - Easy_API int Easy_APICALL EasyRTSP_Deinit(Easy_RTSP_Handle *handle); + Easy_API int Easy_APICALL EasyRTSP_Deinit(Easy_Handle *handle); /* ÉèÖÃÊý¾Ý»Øµ÷ */ - Easy_API int Easy_APICALL EasyRTSP_SetCallback(Easy_RTSP_Handle handle, RTSPSourceCallBack _callback); + Easy_API int Easy_APICALL EasyRTSP_SetCallback(Easy_Handle handle, RTSPSourceCallBack _callback); /* ´ò¿ªÍøÂçÁ÷ */ - Easy_API int Easy_APICALL EasyRTSP_OpenStream(Easy_RTSP_Handle handle, int _channelid, char *_url, EASY_RTP_CONNECT_TYPE _connType, unsigned int _mediaType, char *_username, char *_password, void *userPtr, int _reconn/*1000±íʾ³¤Á¬½Ó,¼´Èç¹ûÍøÂç¶Ï¿ª×Ô¶¯ÖØÁ¬, ÆäËüֵΪÁ¬½Ó´ÎÊý*/, int outRtpPacket/*ĬÈÏΪ0,¼´»Øµ÷Êä³öÍêÕûµÄÖ¡, Èç¹ûΪ1,ÔòÊä³öRTP°ü*/, int heartbeatType/*0x00:²»·¢ËÍÐÄÌø 0x01:OPTIONS 0x02:GET_PARAMETER*/, int _verbosity/*ÈÕÖ¾´òÓ¡Êä³öµÈ¼¶£¬0±íʾ²»Êä³ö*/); + Easy_API int Easy_APICALL EasyRTSP_OpenStream(Easy_Handle handle, int _channelid, char *_url, EASY_RTP_CONNECT_TYPE _connType, unsigned int _mediaType, char *_username, char *_password, void *userPtr, int _reconn/*1000±íʾ³¤Á¬½Ó,¼´Èç¹ûÍøÂç¶Ï¿ª×Ô¶¯ÖØÁ¬, ÆäËüֵΪÁ¬½Ó´ÎÊý*/, int outRtpPacket/*ĬÈÏΪ0,¼´»Øµ÷Êä³öÍêÕûµÄÖ¡, Èç¹ûΪ1,ÔòÊä³öRTP°ü*/, int heartbeatType/*0x00:²»·¢ËÍÐÄÌø 0x01:OPTIONS 0x02:GET_PARAMETER*/, int _verbosity/*ÈÕÖ¾´òÓ¡Êä³öµÈ¼¶£¬0±íʾ²»Êä³ö*/); /* ¹Ø±ÕÍøÂçÁ÷ */ - Easy_API int Easy_APICALL EasyRTSP_CloseStream(Easy_RTSP_Handle handle); + Easy_API int Easy_APICALL EasyRTSP_CloseStream(Easy_Handle handle); #ifdef __cplusplus } diff --git a/EasyPusher_RTSP/main.cpp b/EasyPusher_RTSP/main.cpp index 8442ecb..e5c17a0 100644 --- a/EasyPusher_RTSP/main.cpp +++ b/EasyPusher_RTSP/main.cpp @@ -12,12 +12,10 @@ *±¾KeyΪ3¸öÔÂÁÙʱÊÚȨLicense£¬ÈçÐèÉÌҵʹÓã¬ÇëÓʼþÖÁsupport@easydarwin.org×ÉѯÉÌÒµÊÚȨ·½°¸¡£ */ #ifdef _WIN32 -#define KEY "6A36334A743469576B5A73414B735662704472563465784659584E355548567A6147567958314A55553141755A58686C567778576F502F683430566863336C4559584A33615735555A57467453584E55614756435A584E30514449774D54686C59584E35" -#define EasyRTSPClient_KEY "79393674363469576B5A754165385A6270446D455965784659584E355548567A6147567958314A55553141755A58686C567778576F502F683430566863336C4559584A33615735555A57467453584E55614756435A584E30514449774D54686C59584E35" +#define EasyRTSPClient_KEY "79393674363469576B5A7541725370636F3956524575784659584E355548567A6147567958314A55553141755A58686C567778576F5036533430566863336C4559584A33615735555A57467453584E55614756435A584E30514449774D54686C59584E35" #include "getopt.h" #else //linux -#define KEY "6A36334A74354F576B596F416E396462704368677066426C59584E356348567A6147567958334A3063334258444661672F36586A5257467A65555268636E6470626C526C5957314A6331526F5A554A6C633352414D6A41784F47566863336B3D" -#define EasyRTSPClient_KEY "7939367436354F576B596F412F4E526270437344772F426C59584E356348567A6147567958334A3063334258444661672F38506A5257467A65555268636E6470626C526C5957314A6331526F5A554A6C633352414D6A41784F47566863336B3D" +#define EasyRTSPClient_KEY "79393674363469576B5A7541725370636F3956524576426C59584E356348567A6147567958334A3063334258444661672F704C6A5257467A65555268636E6470626C526C5957314A6331526F5A554A6C633352414D6A41784F47566863336B3D" #include "unistd.h" #include #endif @@ -30,8 +28,8 @@ char* ConfigName = "easypusher_rtsp.sdp";//Default Stream Name char* ConfigRTSPURL = "rtsp://admin:admin@192.168.1.222/22"; //RTSP Source URL(With username:password@) char* ProgName; //Program Name -Easy_Pusher_Handle fPusherHandle = 0; //libEasyPusher Handle -Easy_RTSP_Handle fRTSPHandle = 0; //libEasyRTSPClient Handle +Easy_Handle fPusherHandle = 0; //libEasyPusher Handle +Easy_Handle fRTSPHandle = 0; //libEasyRTSPClient Handle EASY_MEDIA_INFO_T* fSourceMediaInfo = NULL; @@ -49,7 +47,7 @@ int __EasyPusher_Callback(int _id, EASY_PUSH_STATE_T _state, EASY_AV_Frame *_fra } /* EasyRTSPClient Callback */ -int Easy_APICALL __RTSPSourceCallBack( int _chid, void *_chPtr, int _mediatype, char *pbuf, RTSP_FRAME_INFO *frameinfo) +int Easy_APICALL __RTSPSourceCallBack( int _chid, void *_chPtr, int _mediatype, char *pbuf, EASY_FRAME_INFO *frameinfo) { if (_mediatype == EASY_SDK_VIDEO_FRAME_FLAG) { @@ -162,35 +160,6 @@ int main(int argc, char * argv[]) } } - isActivated = EasyPusher_Activate(KEY); - switch(isActivated) - { - case EASY_ACTIVATE_INVALID_KEY: - printf("KEY is EASY_ACTIVATE_INVALID_KEY!\n"); - break; - case EASY_ACTIVATE_TIME_ERR: - printf("KEY is EASY_ACTIVATE_TIME_ERR!\n"); - break; - case EASY_ACTIVATE_PROCESS_NAME_LEN_ERR: - printf("KEY is EASY_ACTIVATE_PROCESS_NAME_LEN_ERR!\n"); - break; - case EASY_ACTIVATE_PROCESS_NAME_ERR: - printf("KEY is EASY_ACTIVATE_PROCESS_NAME_ERR!\n"); - break; - case EASY_ACTIVATE_VALIDITY_PERIOD_ERR: - printf("KEY is EASY_ACTIVATE_VALIDITY_PERIOD_ERR!\n"); - break; - case EASY_ACTIVATE_SUCCESS: - printf("KEY is EASY_ACTIVATE_SUCCESS!\n"); - break; - } - - if(EASY_ACTIVATE_SUCCESS != isActivated) - { - getchar(); - return -1; - } - if(EASY_ACTIVATE_SUCCESS != EasyRTSP_Activate(EasyRTSPClient_KEY)) { getchar(); diff --git a/win/EasyPusher.sln b/win/EasyPusher.sln index b5f3c19..b34ef40 100644 --- a/win/EasyPusher.sln +++ b/win/EasyPusher.sln @@ -5,8 +5,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EasyPusher_FILE", "..\EasyP EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EasyPusher_RTSP", "..\EasyPusher_RTSP\EasyPusher_RTSP.vcxproj", "{2C677677-3CEC-43BF-90C5-CC4246894BE5}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EasyPusher_SDK", "..\EasyPusher_SDK\EasyPusher_SDK.vcxproj", "{A83368AC-FC3A-42DE-BE2E-388D4CE21E32}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -21,10 +19,6 @@ Global {2C677677-3CEC-43BF-90C5-CC4246894BE5}.Debug|Win32.Build.0 = Debug|Win32 {2C677677-3CEC-43BF-90C5-CC4246894BE5}.Release|Win32.ActiveCfg = Release|Win32 {2C677677-3CEC-43BF-90C5-CC4246894BE5}.Release|Win32.Build.0 = Release|Win32 - {A83368AC-FC3A-42DE-BE2E-388D4CE21E32}.Debug|Win32.ActiveCfg = Debug|Win32 - {A83368AC-FC3A-42DE-BE2E-388D4CE21E32}.Debug|Win32.Build.0 = Debug|Win32 - {A83368AC-FC3A-42DE-BE2E-388D4CE21E32}.Release|Win32.ActiveCfg = Release|Win32 - {A83368AC-FC3A-42DE-BE2E-388D4CE21E32}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE