srs_xcode工程调试

作者: 45f0c6e690c1 | 来源:发表于2018-05-12 13:57 被阅读133次

1》左边是可运行的,右是是原工程,把st-1.9 utest research文件夹删除引用

image

2》先执行./configure --osx && make

编译出libhttp_parser.a libssl.a libcrypto.a,不知道为什么libst.a没编译出来

自己下载 git clone https://github.com/ossrs/state-threads.git; make darwin-optimized

编译出来的libst.a 映射到工程里去,如图

image

3》#include<openssl/hmac.h>报错找不到

image

4》变量重命名


diff --git a/trunk/src/main/srs_main_ingest_hls.cpp b/trunk/src/main/srs_main_ingest_hls.cpp

index 3321e29c..0fae5f25 100644

--- a/trunk/src/main/srs_main_ingest_hls.cpp

+++ b/trunk/src/main/srs_main_ingest_hls.cpp

@@ -55,18 +55,18 @@ int proxy_hls2rtmp(std::string hls, std::string rtmp);

 // never subscribe handler in constructor,

 // instead, subscribe handler in initialize method.

 // kernel module.

-ISrsLog* _srs_log = new SrsFastLog();

-ISrsThreadContext* _srs_context = new ISrsThreadContext();

+ISrsLog* m_srs_log = new SrsFastLog();

+ISrsThreadContext* m_srs_context = new ISrsThreadContext();

 // app module.

-SrsConfig* _srs_config = NULL;

-SrsServer* _srs_server = NULL;

+SrsConfig* m_srs_config = NULL;

+SrsServer* m_srs_server = NULL;

 #if defined(SRS_AUTO_HTTP_CORE)

 /**

 * main entrance.

 */

-int main(int argc, char** argv) 

+int m_main(int argc, char** argv)

 {

     // TODO: support both little and big endian.

     srs_assert(srs_is_little_endian());

@@ -83,7 +83,7 @@ int main(int argc, char** argv)

     exit(-1);

 #endif

-    srs_trace("srs_ingest_hls base on %s, to ingest hls live to srs", RTMP_SIG_SRS_SERVER);

+  srs_trace("srs_ingest_hls base on %s, to ingest hls live to srs", RTMP_SIG_SRS_SERVER);

     // parse user options.

     std::string in_hls_url, out_rtmp_url;

@@ -1301,7 +1301,7 @@ int SrsIngestSrsOutput::connect_app(string ep_server, string ep_port)

     data->set("srs_authors", SrsAmf0Any::str(RTMP_SIG_SRS_AUTHROS));

     // for edge to directly get the id of client.

     data->set("srs_pid", SrsAmf0Any::number(getpid()));

-    data->set("srs_id", SrsAmf0Any::number(_srs_context->get_id()));

+    data->set("srs_id", SrsAmf0Any::number(m_srs_context->get_id()));

     // local ip of edge

     std::vector ips = srs_get_local_ipv4_ips();

@@ -1412,7 +1412,7 @@ int proxy_hls2rtmp(string hls, string rtmp)

 #else

-int main(int argc, char** argv)

+int m_main(int argc, char** argv)

 {

 #ifndef SRS_AUTO_HTTP_CORE

     srs_error("ingest requires http-api or http-server");

5》给运行程序传参数,点srs_xcode->edit scheme


F5F67369-E9ED-4016-83E5-36E573DF26C2.png

6》daemon off 要加上

diff --git a/trunk/conf/srs.conf b/trunk/conf/srs.conf
index da062849..c47fd11b 100644
--- a/trunk/conf/srs.conf
+++ b/trunk/conf/srs.conf
@@ -3,8 +3,8 @@
 
 listen              1935;
 max_connections     1000;
-srs_log_tank        file;
-srs_log_file        ./objs/srs.log;
+srs_log_tank        console;
+srs_log_file        /Users/wzw200/Downloads/srs/trunk/objs/srs.log;
 http_api {
     enabled         on;
     listen          1985;
@@ -20,3 +20,6 @@ stats {
 }
 vhost __defaultVhost__ {
 }
+
+pid                 /Users/wzw200/Downloads/srs/trunk/objs/srs.pid;
+daemon              off;

7>运行程序,然后执行命令
ffmpeg -framerate 30 -video_size 1280:720 -pixel_format yuyv422 -f avfoundation -i "0:0" -acodec aac -ar 48000 -b:a 96K -strict -2 -vcodec h264 -g 20 -r 20 -b:v 800k -s 1280:720 -f flv rtmp://127.0.0.1/live/livestream

ffplay rtmp://127.0.0.1/live/livestream

相关文章

  • srs_xcode工程调试

    1》左边是可运行的,右是是原工程,把st-1.9 utest research文件夹删除引用 2》先执行./con...

  • 3.30

    建筑智能化工程的调试检测要求 本部分包括调试检测实施,自动监控设备的检测机安全防范工程的调试检测要求 调试检测实施...

  • 自定义Cordova plugin总结

    调试,直接打开cordova工程调试 For ios, go to platforms/ios and open ...

  • Android Debug 之Source Code does

    这个问题可能源于你有多个类似工程(大多为库工程),然后在调试的时候调试的工程和和目标工程不一致导致的(比如主工程引...

  • 使用 GDB 调试 Android 应用

    GNU 工程调试器(GDB)是一个常用的 Unix 调试器。本文详述使用 gdb 调试 Android 应用和进程...

  • VSCode调试 React Native

    工程准备 新建测试工程 完成后 用VSCode打开工程 调试 1. 安装React Native Tools 如果...

  • iOS开发技能之lldb常用命令

    lldb命令调试 首先我们创建一个简单工程来调试这些命令。打断点,下方就可以进行lldb调试。 p & po po...

  • 通风与空调系统的调试

    通风与空调工程安装完毕,必须进行系统的测定和调整(简称调试)。系统调试包括:设备单机试运转及调试,系统无生产负荷的...

  • Android library native 代码不能调试解决方

    android native开发会碰到native代码无法调试问题,而app主工程中的native代码是可以调试的...

  • ReactNative工程篇-调试

    1.背景 RN的调试是开发过程必不可少的环节,熟悉调试工具能有效提升开发效率。下面介绍笔者团队内在RN开发中用过的...

网友评论

    本文标题:srs_xcode工程调试

    本文链接:https://www.haomeiwen.com/subject/ooacdftx.html