Skip to content

Commit

Permalink
update EasyPusher.sln
Browse files Browse the repository at this point in the history
  • Loading branch information
babosa committed Apr 19, 2019
1 parent 0ba02d9 commit 36463e4
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 90 deletions.
4 changes: 2 additions & 2 deletions EasyPusher_File/EasyPusher_File.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<Profile>true</Profile>
<AdditionalDependencies>ws2_32.lib;wsock32.lib;winmm.lib;libEasyPusher.lib</AdditionalDependencies>
<AdditionalLibraryDirectories>../Lib/</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>../Lib/x86</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
Expand All @@ -82,7 +82,7 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>ws2_32.lib;wsock32.lib;winmm.lib;libEasyPusher.lib</AdditionalDependencies>
<AdditionalLibraryDirectories>../Lib/</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>../Lib/x86</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion EasyPusher_File/EasyPusher_File.vcxproj.user
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LocalDebuggerEnvironment>path=%path%;..\Lib</LocalDebuggerEnvironment>
<LocalDebuggerEnvironment>path=%path%;..\Lib\x86</LocalDebuggerEnvironment>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
Expand Down
40 changes: 5 additions & 35 deletions EasyPusher_File/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,9 @@ using namespace std;
#include <stdio.h>

#ifdef _WIN32
#define KEY "6A36334A743469576B5A754154645A6270436D794A65784659584E355548567A6147567958305A4A544555755A58686C567778576F502B6C3430566863336C4559584A33615735555A57467453584E55614756435A584E30514449774D54686C59584E35"
#include "getopt.h"
#else //linux
#define KEY "6A36334A74354F576B596F412F4E5262704373447066426C59584E356348567A6147567958325A7062475658444661672F36586A5257467A65555268636E6470626C526C5957314A6331526F5A554A6C633352414D6A41784F47566863336B3D"

#include "unistd.h"
#include <signal.h>
#endif
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions EasyPusher_RTSP/EasyPusher_RTSP.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>ws2_32.lib;wsock32.lib;winmm.lib;libEasyPusher.lib;libEasyRTSPClient.lib</AdditionalDependencies>
<AdditionalLibraryDirectories>../Lib/;./libEasyRTSPClient/Lib/</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>../Lib/x86;./libEasyRTSPClient/Lib/</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
Expand All @@ -88,7 +88,7 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>ws2_32.lib;wsock32.lib;winmm.lib;libEasyPusher.lib;libEasyRTSPClient.lib</AdditionalDependencies>
<AdditionalLibraryDirectories>../Lib/;./libEasyRTSPClient/Lib/</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>../Lib/x86;./libEasyRTSPClient/Lib/</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion EasyPusher_RTSP/EasyPusher_RTSP.vcxproj.user
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LocalDebuggerEnvironment>path=%path%;..\Lib;.\libEasyRTSPClient\Lib</LocalDebuggerEnvironment>
<LocalDebuggerEnvironment>path=%path%;..\Lib\x86;.\libEasyRTSPClient\Lib</LocalDebuggerEnvironment>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
Expand Down
14 changes: 7 additions & 7 deletions EasyPusher_RTSP/libEasyRTSPClient/Include/EasyRTSPClientAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
41 changes: 5 additions & 36 deletions EasyPusher_RTSP/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,10 @@
*本Key为3个月临时授权License,如需商业使用,请邮件至[email protected]咨询商业授权方案。
*/
#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 <signal.h>
#endif
Expand All @@ -30,8 +28,8 @@ char* ConfigName = "easypusher_rtsp.sdp";//Default Stream Name
char* ConfigRTSPURL = "rtsp://admin:[email protected]/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;

Expand All @@ -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)
{
Expand Down Expand Up @@ -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();
Expand Down
6 changes: 0 additions & 6 deletions win/EasyPusher.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 36463e4

Please sign in to comment.