Update MediaClient
This commit is contained in:
313
MediaClient/SrtTest/SrtTest.cpp
Normal file
313
MediaClient/SrtTest/SrtTest.cpp
Normal file
@@ -0,0 +1,313 @@
|
||||
/***************************************************************************************
|
||||
*
|
||||
* IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
|
||||
*
|
||||
* By downloading, copying, installing or using the software you agree to this license.
|
||||
* If you do not agree to this license, do not download, install,
|
||||
* copy or use the software.
|
||||
*
|
||||
* Copyright (C) 2014-2024, Happytimesoft Corporation, all rights reserved.
|
||||
*
|
||||
* Redistribution and use in binary forms, with or without modification, are permitted.
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed
|
||||
* under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
||||
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
|
||||
* language governing permissions and limitations under the License.
|
||||
*
|
||||
****************************************************************************************/
|
||||
|
||||
#include "sys_inc.h"
|
||||
#include "srt_cln.h"
|
||||
#include "hqueue.h"
|
||||
#include "media_format.h"
|
||||
|
||||
|
||||
/**********************************************************/
|
||||
HQUEUE * g_queue;
|
||||
|
||||
int g_flag = 0;
|
||||
pthread_t g_tid = 0;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int event;
|
||||
CSrtClient * srt;
|
||||
} EVENT_PARAMS;
|
||||
|
||||
/**********************************************************/
|
||||
|
||||
/**
|
||||
* @desc : srt notify callback
|
||||
*
|
||||
* @params :
|
||||
* event : event type
|
||||
* puser : user parameter
|
||||
*/
|
||||
int srt_notify_callback(int event, void * puser)
|
||||
{
|
||||
printf("%s, event = %d\r\n", __FUNCTION__, event);
|
||||
|
||||
CSrtClient * p_srt = (CSrtClient *) puser;
|
||||
|
||||
if (SRT_EVE_VIDEOREADY == event)
|
||||
{
|
||||
int vcodec = p_srt->video_codec();
|
||||
if (vcodec != VIDEO_CODEC_NONE)
|
||||
{
|
||||
char codec_str[20] = {'\0'};
|
||||
|
||||
switch (vcodec)
|
||||
{
|
||||
case VIDEO_CODEC_H264:
|
||||
strcpy(codec_str, "H264");
|
||||
break;
|
||||
|
||||
case VIDEO_CODEC_H265:
|
||||
strcpy(codec_str, "H265");
|
||||
break;
|
||||
|
||||
case VIDEO_CODEC_MP4:
|
||||
strcpy(codec_str, "MP4");
|
||||
break;
|
||||
}
|
||||
|
||||
printf("video codec is %s\r\n", codec_str);
|
||||
}
|
||||
}
|
||||
else if (SRT_EVE_AUDIOREADY == event)
|
||||
{
|
||||
int acodec = p_srt->audio_codec();
|
||||
if (acodec != AUDIO_CODEC_NONE)
|
||||
{
|
||||
char codec_str[20] = {'\0'};
|
||||
|
||||
switch (acodec)
|
||||
{
|
||||
case AUDIO_CODEC_G711A:
|
||||
strcpy(codec_str, "G711A");
|
||||
break;
|
||||
|
||||
case AUDIO_CODEC_G711U:
|
||||
strcpy(codec_str, "G711U");
|
||||
break;
|
||||
|
||||
case AUDIO_CODEC_AAC:
|
||||
strcpy(codec_str, "AAC");
|
||||
break;
|
||||
}
|
||||
|
||||
printf("audio codec is %s\r\n", codec_str);
|
||||
printf("audio sample rate is %d\r\n", p_srt->get_audio_samplerate());
|
||||
printf("audio channels is %d\r\n", p_srt->get_audio_channels());
|
||||
}
|
||||
}
|
||||
|
||||
EVENT_PARAMS params;
|
||||
|
||||
params.event = event;
|
||||
params.srt = p_srt;
|
||||
|
||||
if (!hqBufPut(g_queue, (char *) ¶ms))
|
||||
{
|
||||
printf("hqBufPut failed\r\n");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @desc : srt audio data callback
|
||||
*
|
||||
* @params :
|
||||
* pdata : audio data buffer
|
||||
* len : audio data buffer length
|
||||
* ts : timestamp
|
||||
* seq : sequential
|
||||
* puser : user parameter
|
||||
*/
|
||||
int srt_audio_callback(uint8 * pdata, int len, uint32 ts, void * puser)
|
||||
{
|
||||
CSrtClient * p_srt = (CSrtClient *) puser;
|
||||
|
||||
printf("%s, len = %d, ts = %u\r\n", __FUNCTION__, len, ts);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @desc : srt video data callback
|
||||
*
|
||||
* @params :
|
||||
* pdata : video data buffer
|
||||
* len : video data buffer length
|
||||
* ts : timestamp
|
||||
* seq : sequential
|
||||
* puser : user parameter
|
||||
*/
|
||||
int srt_video_callback(uint8 * pdata, int len, uint32 ts, void * puser)
|
||||
{
|
||||
CSrtClient * p_srt = (CSrtClient *) puser;
|
||||
|
||||
printf("%s, len = %d, ts = %u\r\n", __FUNCTION__, len, ts);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void srt_setup(CSrtClient * p_srt)
|
||||
{
|
||||
p_srt->set_notify_cb(srt_notify_callback, p_srt);
|
||||
p_srt->set_audio_cb(srt_audio_callback);
|
||||
p_srt->set_video_cb(srt_video_callback);
|
||||
}
|
||||
|
||||
void srt_reconn(CSrtClient * p_srt)
|
||||
{
|
||||
char url[256], user[64], pass[64];
|
||||
|
||||
strcpy(url, p_srt->get_url());
|
||||
strcpy(user, p_srt->get_user());
|
||||
strcpy(pass, p_srt->get_pass());
|
||||
|
||||
printf("srt_reconn, url = %s, user = %s, pass = %s\r\n", url, user, pass);
|
||||
|
||||
p_srt->srt_close();
|
||||
|
||||
srt_setup(p_srt);
|
||||
|
||||
p_srt->srt_start(url, user, pass);
|
||||
}
|
||||
|
||||
void * srt_notify_handler(void * argv)
|
||||
{
|
||||
EVENT_PARAMS params;
|
||||
|
||||
while (g_flag)
|
||||
{
|
||||
if (hqBufGet(g_queue, (char *) ¶ms))
|
||||
{
|
||||
if (params.event == -1 || params.srt == NULL)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
if (SRT_EVE_STOPPED == params.event ||
|
||||
SRT_EVE_CONNFAIL == params.event ||
|
||||
SRT_EVE_NOSIGNAL == params.event ||
|
||||
SRT_EVE_NODATA == params.event)
|
||||
{
|
||||
srt_reconn(params.srt);
|
||||
|
||||
usleep(100*1000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
g_tid = 0;
|
||||
|
||||
printf("%s exit\r\n", __FUNCTION__);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#define SRT_CLN_NUM 1
|
||||
|
||||
int main(int argc, char * argv[])
|
||||
{
|
||||
if (argc < 2)
|
||||
{
|
||||
printf("usage: %s url\r\n", argv[0]);
|
||||
return -1;
|
||||
}
|
||||
|
||||
log_init("srttest.log");
|
||||
log_set_level(HT_LOG_DBG);
|
||||
|
||||
network_init();
|
||||
|
||||
// create event queue
|
||||
g_queue = hqCreate(SRT_CLN_NUM * 4, sizeof(EVENT_PARAMS), HQ_PUT_WAIT | HQ_GET_WAIT);
|
||||
if (NULL == g_queue)
|
||||
{
|
||||
printf("create queue failed\r\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
// create event handler thread
|
||||
g_flag = 1;
|
||||
g_tid = sys_os_create_thread((void *)srt_notify_handler, NULL);
|
||||
if (g_tid == 0)
|
||||
{
|
||||
printf("create srt notify handler thread failed\r\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
CSrtClient * srt = new CSrtClient[SRT_CLN_NUM];
|
||||
|
||||
for (int i = 0; i < SRT_CLN_NUM; i++)
|
||||
{
|
||||
srt_setup(&srt[i]);
|
||||
|
||||
char * p_user = NULL;
|
||||
char * p_pass = NULL;
|
||||
|
||||
if (argc >= 3)
|
||||
{
|
||||
p_user = argv[2];
|
||||
}
|
||||
|
||||
if (argc >= 4)
|
||||
{
|
||||
p_pass = argv[3];
|
||||
}
|
||||
|
||||
BOOL ret = srt[i].srt_start(argv[1], p_user, p_pass);
|
||||
|
||||
printf("srt %d start ret = %d\r\n", i, ret);
|
||||
|
||||
usleep(100 * 1000);
|
||||
}
|
||||
|
||||
for (;;)
|
||||
{
|
||||
if (getchar() == 'q')
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
usleep(1000*1000); // 1s
|
||||
}
|
||||
|
||||
for (int i = 0; i < SRT_CLN_NUM; i++)
|
||||
{
|
||||
srt[i].srt_close();
|
||||
}
|
||||
|
||||
delete[] srt;
|
||||
|
||||
g_flag = 0;
|
||||
|
||||
EVENT_PARAMS params;
|
||||
|
||||
params.event = -1;
|
||||
params.srt = NULL;
|
||||
|
||||
hqBufPut(g_queue, (char *) ¶ms);
|
||||
|
||||
// waiting for event handler thread to exit
|
||||
while (g_tid)
|
||||
{
|
||||
usleep(10*1000);
|
||||
}
|
||||
|
||||
hqDelete(g_queue);
|
||||
g_queue = NULL;
|
||||
|
||||
// close log
|
||||
log_close();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
174
MediaClient/SrtTest/SrtTest.vcxproj
Normal file
174
MediaClient/SrtTest/SrtTest.vcxproj
Normal file
@@ -0,0 +1,174 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="SrtTest.cpp" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{A2E369F0-71DD-4F38-B177-F66305199F56}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>SrtTest</RootNamespace>
|
||||
<ProjectName>SrtTest</ProjectName>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<TargetName>$(ProjectName)</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;HT_STATIC;METADATA;REPLAY;OVER_HTTP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\MediaClient;..\MediaClient\bm;..\MediaClient\rtp;..\MediaClient\srt;..\MediaClient\media;..\MediaClient\libsrt\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DisableSpecificWarnings>4996</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>..\MediaClient\libsrt\lib\x86;$(SolutionDir)$(Platform)\$(Configuration)\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>srt.lib;SrtClientLibrary.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)\$(ProjectName).exe</OutputFile>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;HT_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\MediaClient;..\MediaClient\bm;..\MediaClient\rtp;..\MediaClient\srt;..\MediaClient\media;..\MediaClient\libsrt\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DisableSpecificWarnings>4996</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>..\MediaClient\libsrt\lib\x64;$(SolutionDir)$(Platform)\$(Configuration)\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>srt.lib;SrtClientLibrary.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)\$(ProjectName).exe</OutputFile>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;HT_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\MediaClient;..\MediaClient\bm;..\MediaClient\rtp;..\MediaClient\srt;..\MediaClient\media;..\MediaClient\libsrt\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DisableSpecificWarnings>4996</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalLibraryDirectories>..\MediaClient\libsrt\lib\x86;$(SolutionDir)$(Platform)\$(Configuration)\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>srt.lib;SrtClientLibrary.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)\$(ProjectName).exe</OutputFile>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;HT_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\MediaClient;..\MediaClient\bm;..\MediaClient\rtp;..\MediaClient\srt;..\MediaClient\media;..\MediaClient\libsrt\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DisableSpecificWarnings>4996</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalLibraryDirectories>..\MediaClient\libsrt\lib\x64;$(SolutionDir)$(Platform)\$(Configuration)\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>srt.lib;SrtClientLibrary.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)\$(ProjectName).exe</OutputFile>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
61
MediaClient/SrtTest/mac.mk
Normal file
61
MediaClient/SrtTest/mac.mk
Normal file
@@ -0,0 +1,61 @@
|
||||
################OPTION###################
|
||||
OUTPUT = srttest
|
||||
CCOMPILE = gcc
|
||||
CPPCOMPILE = g++
|
||||
COMPILEOPTION += -c -O3 -fPIC -Wall
|
||||
COMPILEOPTION += -DIOS
|
||||
LINK = g++
|
||||
LINKOPTION = -g -o $(OUTPUT)
|
||||
INCLUDEDIR += -I../MediaClient
|
||||
INCLUDEDIR += -I../MediaClient/bm
|
||||
INCLUDEDIR += -I../MediaClient/media
|
||||
INCLUDEDIR += -I../MediaClient/rtp
|
||||
INCLUDEDIR += -I../MediaClient/srt
|
||||
INCLUDEDIR += -I../MediaClient/libsrt/include
|
||||
LIBDIRS += -L../MediaClient
|
||||
LIBDIRS += -L../MediaClient/libsrt/lib/linux
|
||||
LIBDIRS += -L../MediaClient/openssl/lib/linux
|
||||
|
||||
OBJS = SrtTest.o
|
||||
|
||||
SHAREDLIB += -lsrtclient
|
||||
SHAREDLIB += -lsrt
|
||||
|
||||
SHAREDLIB += -lcrypto
|
||||
SHAREDLIB += -lssl
|
||||
|
||||
SHAREDLIB += -lpthread
|
||||
|
||||
APPENDLIB =
|
||||
|
||||
################OPTION END################
|
||||
|
||||
$(OUTPUT):$(OBJS) $(APPENDLIB)
|
||||
$(LINK) $(LINKOPTION) $(LIBDIRS) $(OBJS) $(SHAREDLIB) $(APPENDLIB)
|
||||
|
||||
clean:
|
||||
rm -f $(OBJS)
|
||||
rm -f $(OUTPUT)
|
||||
all: clean $(OUTPUT)
|
||||
.PRECIOUS:%.cpp %.cc %.cxx %.c %.m %.mm
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .cpp .cc .cxx .c .m .mm .o
|
||||
|
||||
.cpp.o:
|
||||
$(CPPCOMPILE) -c -o $*.o $(COMPILEOPTION) $(INCLUDEDIR) $*.cpp
|
||||
|
||||
.cc.o:
|
||||
$(CCOMPILE) -c -o $*.o $(COMPILEOPTION) $(INCLUDEDIR) $*.cc
|
||||
|
||||
.cxx.o:
|
||||
$(CPPCOMPILE) -c -o $*.o $(COMPILEOPTION) $(INCLUDEDIR) $*.cxx
|
||||
|
||||
.c.o:
|
||||
$(CCOMPILE) -c -o $*.o $(COMPILEOPTION) $(INCLUDEDIR) $*.c
|
||||
|
||||
.m.o:
|
||||
$(CCOMPILE) -c -o $*.o $(COMPILEOPTION) $(INCLUDEDIR) $*.m
|
||||
|
||||
.mm.o:
|
||||
$(CPPCOMPILE) -c -o $*.o $(COMPILEOPTION) $(INCLUDEDIR) $*.mm
|
||||
|
||||
15
MediaClient/SrtTest/stdafx.h
Normal file
15
MediaClient/SrtTest/stdafx.h
Normal file
@@ -0,0 +1,15 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <ws2tcpip.h>
|
||||
#include <ws2ipdef.h>
|
||||
#include <winsock2.h>
|
||||
#include <mmsystem.h>
|
||||
|
||||
#include <io.h>
|
||||
#include <iphlpapi.h>
|
||||
#include <vfw.h>
|
||||
|
||||
#include <tchar.h>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user