use --with-ffmpeg to compile FFMPEG tool only, use --with-transcode for transcoding
正在显示
8 个修改的文件
包含
37 行增加
和
15 行删除
| @@ -510,6 +510,12 @@ else | @@ -510,6 +510,12 @@ else | ||
| 510 | echo "#undef SRS_FFMPEG" >> $SRS_AUTO_HEADERS_H | 510 | echo "#undef SRS_FFMPEG" >> $SRS_AUTO_HEADERS_H |
| 511 | fi | 511 | fi |
| 512 | 512 | ||
| 513 | +if [ $SRS_TRANSCODE = YES ]; then | ||
| 514 | + echo "#define SRS_TRANSCODE" >> $SRS_AUTO_HEADERS_H | ||
| 515 | +else | ||
| 516 | + echo "#undef SRS_TRANSCODE" >> $SRS_AUTO_HEADERS_H | ||
| 517 | +fi | ||
| 518 | + | ||
| 513 | ##################################################################################### | 519 | ##################################################################################### |
| 514 | # build research code | 520 | # build research code |
| 515 | ##################################################################################### | 521 | ##################################################################################### |
| @@ -76,6 +76,7 @@ do | @@ -76,6 +76,7 @@ do | ||
| 76 | --with-hls) SRS_HLS=YES ;; | 76 | --with-hls) SRS_HLS=YES ;; |
| 77 | --with-nginx) SRS_NGINX=YES ;; | 77 | --with-nginx) SRS_NGINX=YES ;; |
| 78 | --with-ffmpeg) SRS_FFMPEG=YES ;; | 78 | --with-ffmpeg) SRS_FFMPEG=YES ;; |
| 79 | + --with-transcode) SRS_TRANSCODE=YES ;; | ||
| 79 | --with-http-callback) SRS_HTTP_CALLBACK=YES ;; | 80 | --with-http-callback) SRS_HTTP_CALLBACK=YES ;; |
| 80 | --with-http-server) SRS_HTTP_SERVER=YES ;; | 81 | --with-http-server) SRS_HTTP_SERVER=YES ;; |
| 81 | --with-http-api) SRS_HTTP_API=YES ;; | 82 | --with-http-api) SRS_HTTP_API=YES ;; |
| @@ -94,6 +95,7 @@ do | @@ -94,6 +95,7 @@ do | ||
| 94 | --without-hls) SRS_HLS=NO ;; | 95 | --without-hls) SRS_HLS=NO ;; |
| 95 | --without-nginx) SRS_NGINX=NO ;; | 96 | --without-nginx) SRS_NGINX=NO ;; |
| 96 | --without-ffmpeg) SRS_FFMPEG=NO ;; | 97 | --without-ffmpeg) SRS_FFMPEG=NO ;; |
| 98 | + --without-transcode) SRS_TRANSCODE=NO ;; | ||
| 97 | --without-http-callback) SRS_HTTP_CALLBACK=NO ;; | 99 | --without-http-callback) SRS_HTTP_CALLBACK=NO ;; |
| 98 | --without-http-server) SRS_HTTP_SERVER=NO ;; | 100 | --without-http-server) SRS_HTTP_SERVER=NO ;; |
| 99 | --without-http-api) SRS_HTTP_API=NO ;; | 101 | --without-http-api) SRS_HTTP_API=NO ;; |
| @@ -132,6 +134,7 @@ if [ $SRS_ARM_UBUNTU12 = YES ]; then | @@ -132,6 +134,7 @@ if [ $SRS_ARM_UBUNTU12 = YES ]; then | ||
| 132 | if [ $SRS_NGINX = RESERVED ]; then SRS_NGINX=NO; fi | 134 | if [ $SRS_NGINX = RESERVED ]; then SRS_NGINX=NO; fi |
| 133 | if [ $SRS_SSL = RESERVED ]; then SRS_SSL=YES; fi | 135 | if [ $SRS_SSL = RESERVED ]; then SRS_SSL=YES; fi |
| 134 | if [ $SRS_FFMPEG = RESERVED ]; then SRS_FFMPEG=NO; fi | 136 | if [ $SRS_FFMPEG = RESERVED ]; then SRS_FFMPEG=NO; fi |
| 137 | + if [ $SRS_TRANSCODE = RESERVED ]; then SRS_TRANSCODE=NO; fi | ||
| 135 | if [ $SRS_HTTP_CALLBACK = RESERVED ]; then SRS_HTTP_CALLBACK=NO; fi | 138 | if [ $SRS_HTTP_CALLBACK = RESERVED ]; then SRS_HTTP_CALLBACK=NO; fi |
| 136 | if [ $SRS_HTTP_SERVER = RESERVED ]; then SRS_HTTP_SERVER=YES; fi | 139 | if [ $SRS_HTTP_SERVER = RESERVED ]; then SRS_HTTP_SERVER=YES; fi |
| 137 | if [ $SRS_HTTP_API = RESERVED ]; then SRS_HTTP_API=YES; fi | 140 | if [ $SRS_HTTP_API = RESERVED ]; then SRS_HTTP_API=YES; fi |
| @@ -154,6 +157,7 @@ else | @@ -154,6 +157,7 @@ else | ||
| 154 | if [ $SRS_NGINX = RESERVED ]; then SRS_NGINX=NO; fi | 157 | if [ $SRS_NGINX = RESERVED ]; then SRS_NGINX=NO; fi |
| 155 | if [ $SRS_SSL = RESERVED ]; then SRS_SSL=YES; fi | 158 | if [ $SRS_SSL = RESERVED ]; then SRS_SSL=YES; fi |
| 156 | if [ $SRS_FFMPEG = RESERVED ]; then SRS_FFMPEG=NO; fi | 159 | if [ $SRS_FFMPEG = RESERVED ]; then SRS_FFMPEG=NO; fi |
| 160 | + if [ $SRS_TRANSCODE = RESERVED ]; then SRS_TRANSCODE=NO; fi | ||
| 157 | if [ $SRS_HTTP_CALLBACK = RESERVED ]; then SRS_HTTP_CALLBACK=NO; fi | 161 | if [ $SRS_HTTP_CALLBACK = RESERVED ]; then SRS_HTTP_CALLBACK=NO; fi |
| 158 | if [ $SRS_HTTP_SERVER = RESERVED ]; then SRS_HTTP_SERVER=YES; fi | 162 | if [ $SRS_HTTP_SERVER = RESERVED ]; then SRS_HTTP_SERVER=YES; fi |
| 159 | if [ $SRS_HTTP_API = RESERVED ]; then SRS_HTTP_API=YES; fi | 163 | if [ $SRS_HTTP_API = RESERVED ]; then SRS_HTTP_API=YES; fi |
| @@ -178,6 +182,7 @@ if [ $SRS_DEV = YES ]; then | @@ -178,6 +182,7 @@ if [ $SRS_DEV = YES ]; then | ||
| 178 | SRS_NGINX=NO | 182 | SRS_NGINX=NO |
| 179 | SRS_SSL=YES | 183 | SRS_SSL=YES |
| 180 | SRS_FFMPEG=YES | 184 | SRS_FFMPEG=YES |
| 185 | + SRS_TRANSCODE=YES | ||
| 181 | SRS_HTTP_CALLBACK=YES | 186 | SRS_HTTP_CALLBACK=YES |
| 182 | SRS_HTTP_SERVER=YES | 187 | SRS_HTTP_SERVER=YES |
| 183 | SRS_HTTP_API=YES | 188 | SRS_HTTP_API=YES |
| @@ -201,6 +206,7 @@ if [ $SRS_PI = YES ]; then | @@ -201,6 +206,7 @@ if [ $SRS_PI = YES ]; then | ||
| 201 | SRS_NGINX=NO | 206 | SRS_NGINX=NO |
| 202 | SRS_SSL=YES | 207 | SRS_SSL=YES |
| 203 | if [ $SRS_FFMPEG = RESERVED ]; then SRS_FFMPEG=NO; fi | 208 | if [ $SRS_FFMPEG = RESERVED ]; then SRS_FFMPEG=NO; fi |
| 209 | + if [ $SRS_TRANSCODE = RESERVED ]; then SRS_TRANSCODE=NO; fi | ||
| 204 | SRS_HTTP_CALLBACK=NO | 210 | SRS_HTTP_CALLBACK=NO |
| 205 | SRS_HTTP_SERVER=YES | 211 | SRS_HTTP_SERVER=YES |
| 206 | SRS_HTTP_API=YES | 212 | SRS_HTTP_API=YES |
| @@ -223,6 +229,9 @@ if [ $SRS_HTTP_CALLBACK = YES ]; then SRS_HTTP_PARSER=YES; fi | @@ -223,6 +229,9 @@ if [ $SRS_HTTP_CALLBACK = YES ]; then SRS_HTTP_PARSER=YES; fi | ||
| 223 | if [ $SRS_HTTP_SERVER = YES ]; then SRS_HTTP_PARSER=YES; fi | 229 | if [ $SRS_HTTP_SERVER = YES ]; then SRS_HTTP_PARSER=YES; fi |
| 224 | if [ $SRS_HTTP_API = YES ]; then SRS_HTTP_PARSER=YES; fi | 230 | if [ $SRS_HTTP_API = YES ]; then SRS_HTTP_PARSER=YES; fi |
| 225 | 231 | ||
| 232 | +# if transcode specified, try ffmpeg if possible. | ||
| 233 | +if [ $SRS_TRANSCODE = YES ]; then if [ $SRS_FFMPEG = RESERVED ]; then SRS_FFMPEG=YES; fi fi | ||
| 234 | + | ||
| 226 | # parse the jobs for make | 235 | # parse the jobs for make |
| 227 | if [[ "" -eq SRS_JOBS ]]; then | 236 | if [[ "" -eq SRS_JOBS ]]; then |
| 228 | export SRS_JOBS="--jobs" | 237 | export SRS_JOBS="--jobs" |
| @@ -249,8 +258,10 @@ if [ $help = yes ]; then | @@ -249,8 +258,10 @@ if [ $help = yes ]; then | ||
| 249 | --with-http-callback enable http hooks, build cherrypy as demo api server. | 258 | --with-http-callback enable http hooks, build cherrypy as demo api server. |
| 250 | --with-http-server enable http server to delivery http stream. | 259 | --with-http-server enable http server to delivery http stream. |
| 251 | --with-http-api enable http api, to manage SRS by http api. | 260 | --with-http-api enable http api, to manage SRS by http api. |
| 252 | - --with-ffmpeg enable transcoding with ffmpeg. | 261 | + --with-ffmpeg enable transcoding tool ffmpeg. |
| 253 | build ffmpeg at: ./objs/ffmpeg/bin/ffmpeg | 262 | build ffmpeg at: ./objs/ffmpeg/bin/ffmpeg |
| 263 | + --with-transcode enable transcoding features. | ||
| 264 | + user must specifies the transcode tools in conf. | ||
| 254 | --with-librtmp enable srs-librtmp, library for client. | 265 | --with-librtmp enable srs-librtmp, library for client. |
| 255 | --with-bwtc enable SRS bandwidth test client tool. | 266 | --with-bwtc enable SRS bandwidth test client tool. |
| 256 | --with-research build the research tools. | 267 | --with-research build the research tools. |
| @@ -268,7 +279,8 @@ if [ $help = yes ]; then | @@ -268,7 +279,8 @@ if [ $help = yes ]; then | ||
| 268 | --without-http-callback disable http, http hooks callback. | 279 | --without-http-callback disable http, http hooks callback. |
| 269 | --without-http-server disable http server, use external server to delivery http stream. | 280 | --without-http-server disable http server, use external server to delivery http stream. |
| 270 | --without-http-api disable http api, only use console to manage SRS process. | 281 | --without-http-api disable http api, only use console to manage SRS process. |
| 271 | - --without-ffmpeg disable the ffmpeg transcoding feature. | 282 | + --without-ffmpeg disable the ffmpeg transcode tool feature. |
| 283 | + --without-transcode disable the transcoding feature. | ||
| 272 | --without-librtmp disable srs-librtmp, library for client. | 284 | --without-librtmp disable srs-librtmp, library for client. |
| 273 | --without-bwtc disable SRS bandwidth test client tool. | 285 | --without-bwtc disable SRS bandwidth test client tool. |
| 274 | --without-research do not build the research tools. | 286 | --without-research do not build the research tools. |
| @@ -364,6 +376,7 @@ if [ $SRS_HLS = YES ]; then SRS_CONFIGURE="${SRS_CONFIGURE} --with-hls"; else SR | @@ -364,6 +376,7 @@ if [ $SRS_HLS = YES ]; then SRS_CONFIGURE="${SRS_CONFIGURE} --with-hls"; else SR | ||
| 364 | if [ $SRS_NGINX = YES ]; then SRS_CONFIGURE="${SRS_CONFIGURE} --with-nginx"; else SRS_CONFIGURE="${SRS_CONFIGURE} --without-nginx"; fi | 376 | if [ $SRS_NGINX = YES ]; then SRS_CONFIGURE="${SRS_CONFIGURE} --with-nginx"; else SRS_CONFIGURE="${SRS_CONFIGURE} --without-nginx"; fi |
| 365 | if [ $SRS_SSL = YES ]; then SRS_CONFIGURE="${SRS_CONFIGURE} --with-ssl"; else SRS_CONFIGURE="${SRS_CONFIGURE} --without-ssl"; fi | 377 | if [ $SRS_SSL = YES ]; then SRS_CONFIGURE="${SRS_CONFIGURE} --with-ssl"; else SRS_CONFIGURE="${SRS_CONFIGURE} --without-ssl"; fi |
| 366 | if [ $SRS_FFMPEG = YES ]; then SRS_CONFIGURE="${SRS_CONFIGURE} --with-ffmpeg"; else SRS_CONFIGURE="${SRS_CONFIGURE} --without-ffmpeg"; fi | 378 | if [ $SRS_FFMPEG = YES ]; then SRS_CONFIGURE="${SRS_CONFIGURE} --with-ffmpeg"; else SRS_CONFIGURE="${SRS_CONFIGURE} --without-ffmpeg"; fi |
| 379 | +if [ $SRS_TRANSCODE = YES ]; then SRS_CONFIGURE="${SRS_CONFIGURE} --with-transcode"; else SRS_CONFIGURE="${SRS_CONFIGURE} --without-transcode"; fi | ||
| 367 | if [ $SRS_HTTP_CALLBACK = YES ]; then SRS_CONFIGURE="${SRS_CONFIGURE} --with-http-callback"; else SRS_CONFIGURE="${SRS_CONFIGURE} --without-http-callback"; fi | 380 | if [ $SRS_HTTP_CALLBACK = YES ]; then SRS_CONFIGURE="${SRS_CONFIGURE} --with-http-callback"; else SRS_CONFIGURE="${SRS_CONFIGURE} --without-http-callback"; fi |
| 368 | if [ $SRS_HTTP_SERVER = YES ]; then SRS_CONFIGURE="${SRS_CONFIGURE} --with-http-server"; else SRS_CONFIGURE="${SRS_CONFIGURE} --without-http-server"; fi | 381 | if [ $SRS_HTTP_SERVER = YES ]; then SRS_CONFIGURE="${SRS_CONFIGURE} --with-http-server"; else SRS_CONFIGURE="${SRS_CONFIGURE} --without-http-server"; fi |
| 369 | if [ $SRS_HTTP_API = YES ]; then SRS_CONFIGURE="${SRS_CONFIGURE} --with-http-api"; else SRS_CONFIGURE="${SRS_CONFIGURE} --without-http-api"; fi | 382 | if [ $SRS_HTTP_API = YES ]; then SRS_CONFIGURE="${SRS_CONFIGURE} --with-http-api"; else SRS_CONFIGURE="${SRS_CONFIGURE} --without-http-api"; fi |
| @@ -82,9 +82,10 @@ if [ $SRS_UTEST = YES ]; then SrsUtestMakeEntry="(cd ${SRS_OBJS}/utest; \$(MAKE) | @@ -82,9 +82,10 @@ if [ $SRS_UTEST = YES ]; then SrsUtestMakeEntry="(cd ${SRS_OBJS}/utest; \$(MAKE) | ||
| 82 | ##################################################################################### | 82 | ##################################################################################### |
| 83 | # colorful summary | 83 | # colorful summary |
| 84 | SrsHlsSummaryColor="\${YELLOW}{disabled} "; if [ $SRS_HLS = YES ]; then SrsHlsSummaryColor="\${GREEN}"; fi | 84 | SrsHlsSummaryColor="\${YELLOW}{disabled} "; if [ $SRS_HLS = YES ]; then SrsHlsSummaryColor="\${GREEN}"; fi |
| 85 | -SrsNginxSummaryColor="\${YELLOW}{disabled} "; if [ $SRS_NGINX = YES ]; then SrsNginxSummaryColor="\${GREEN}"; fi | 85 | +SrsNginxSummaryColor="\${GREEN}{disabled} "; if [ $SRS_NGINX = YES ]; then SrsNginxSummaryColor="\${GREEN}"; fi |
| 86 | SrsSslSummaryColor="\${YELLOW}{disabled} "; if [ $SRS_SSL = YES ]; then SrsSslSummaryColor="\${GREEN}"; fi | 86 | SrsSslSummaryColor="\${YELLOW}{disabled} "; if [ $SRS_SSL = YES ]; then SrsSslSummaryColor="\${GREEN}"; fi |
| 87 | SrsFfmpegSummaryColor="\${YELLOW}{disabled} "; if [ $SRS_FFMPEG = YES ]; then SrsFfmpegSummaryColor="\${GREEN}"; fi | 87 | SrsFfmpegSummaryColor="\${YELLOW}{disabled} "; if [ $SRS_FFMPEG = YES ]; then SrsFfmpegSummaryColor="\${GREEN}"; fi |
| 88 | +SrsTranscodeSummaryColor="\${YELLOW}{disabled} "; if [ $SRS_TRANSCODE = YES ]; then SrsTranscodeSummaryColor="\${GREEN}"; fi | ||
| 88 | SrsHttpCallbackSummaryColor="\${YELLOW}{disabled} "; if [ $SRS_HTTP_CALLBACK = YES ]; then SrsHttpCallbackSummaryColor="\${GREEN}"; fi | 89 | SrsHttpCallbackSummaryColor="\${YELLOW}{disabled} "; if [ $SRS_HTTP_CALLBACK = YES ]; then SrsHttpCallbackSummaryColor="\${GREEN}"; fi |
| 89 | SrsHttpServerSummaryColor="\${YELLOW}{disabled} "; if [ $SRS_HTTP_SERVER = YES ]; then SrsHttpServerSummaryColor="\${GREEN}"; fi | 90 | SrsHttpServerSummaryColor="\${YELLOW}{disabled} "; if [ $SRS_HTTP_SERVER = YES ]; then SrsHttpServerSummaryColor="\${GREEN}"; fi |
| 90 | SrsHttpApiSummaryColor="\${YELLOW}{disabled} "; if [ $SRS_HTTP_API = YES ]; then SrsHttpApiSummaryColor="\${GREEN}"; fi | 91 | SrsHttpApiSummaryColor="\${YELLOW}{disabled} "; if [ $SRS_HTTP_API = YES ]; then SrsHttpApiSummaryColor="\${GREEN}"; fi |
| @@ -152,7 +153,9 @@ echo -e " | ${SrsNginxSummaryColor}nginx: delivery HLS stream by nginx\$ | @@ -152,7 +153,9 @@ echo -e " | ${SrsNginxSummaryColor}nginx: delivery HLS stream by nginx\$ | ||
| 152 | echo -e " | ${SrsSslSummaryColor}ssl @see: https://github.com/winlinvip/simple-rtmp-server/wiki/RTMPHandshake\${BLACK}" | 153 | echo -e " | ${SrsSslSummaryColor}ssl @see: https://github.com/winlinvip/simple-rtmp-server/wiki/RTMPHandshake\${BLACK}" |
| 153 | echo -e " | ${SrsSslSummaryColor}ssl: support RTMP complex handshake for client required, for instance, flash\${BLACK}" | 154 | echo -e " | ${SrsSslSummaryColor}ssl: support RTMP complex handshake for client required, for instance, flash\${BLACK}" |
| 154 | echo -e " | ${SrsFfmpegSummaryColor}ffmpeg @see: https://github.com/winlinvip/simple-rtmp-server/wiki/FFMPEG\${BLACK}" | 155 | echo -e " | ${SrsFfmpegSummaryColor}ffmpeg @see: https://github.com/winlinvip/simple-rtmp-server/wiki/FFMPEG\${BLACK}" |
| 155 | -echo -e " | ${SrsFfmpegSummaryColor}ffmpeg: support transcoding RTMP stream with FFMPEG\${BLACK}" | 156 | +echo -e " | ${SrsFfmpegSummaryColor}ffmpeg: transcode, mux, ingest tool\${BLACK}" |
| 157 | +echo -e " | ${SrsTranscodeSummaryColor}transcode @see: https://github.com/winlinvip/simple-rtmp-server/wiki/FFMPEG\${BLACK}" | ||
| 158 | +echo -e " | ${SrsTranscodeSummaryColor}transcode: support transcoding RTMP stream\${BLACK}" | ||
| 156 | echo -e " | ${SrsHttpCallbackSummaryColor}http-callback @see: https://github.com/winlinvip/simple-rtmp-server/wiki/HTTPCallback\${BLACK}" | 159 | echo -e " | ${SrsHttpCallbackSummaryColor}http-callback @see: https://github.com/winlinvip/simple-rtmp-server/wiki/HTTPCallback\${BLACK}" |
| 157 | echo -e " | ${SrsHttpCallbackSummaryColor}http-callback: support http callback for authentication and event injection\${BLACK}" | 160 | echo -e " | ${SrsHttpCallbackSummaryColor}http-callback: support http callback for authentication and event injection\${BLACK}" |
| 158 | echo -e " | ${SrsHttpServerSummaryColor}http-server @see: https://github.com/winlinvip/simple-rtmp-server/wiki/HTTPServer\${BLACK}" | 161 | echo -e " | ${SrsHttpServerSummaryColor}http-server @see: https://github.com/winlinvip/simple-rtmp-server/wiki/HTTPServer\${BLACK}" |
| @@ -3,7 +3,7 @@ src_dir='src' | @@ -3,7 +3,7 @@ src_dir='src' | ||
| 3 | if [[ ! -d $src_dir ]]; then echo "错误:必须在src同目录执行脚本"; exit 1; fi | 3 | if [[ ! -d $src_dir ]]; then echo "错误:必须在src同目录执行脚本"; exit 1; fi |
| 4 | 4 | ||
| 5 | echo "编译SRS" | 5 | echo "编译SRS" |
| 6 | -./configure --with-ssl --with-hls --with-http-server --with-ffmpeg --with-http-callback && make | 6 | +./configure --with-ssl --with-hls --with-http-server --with-ffmpeg --with-transcode --with-http-callback && make |
| 7 | ret=$?; if [[ 0 -ne $ret ]]; then echo "错误:编译SRS失败"; exit $ret; fi | 7 | ret=$?; if [[ 0 -ne $ret ]]; then echo "错误:编译SRS失败"; exit $ret; fi |
| 8 | 8 | ||
| 9 | echo "编译SRS成功" | 9 | echo "编译SRS成功" |
| @@ -39,7 +39,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | @@ -39,7 +39,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
| 39 | #include <srs_app_pithy_print.hpp> | 39 | #include <srs_app_pithy_print.hpp> |
| 40 | #include <srs_protocol_rtmp_stack.hpp> | 40 | #include <srs_protocol_rtmp_stack.hpp> |
| 41 | 41 | ||
| 42 | -#ifdef SRS_FFMPEG | 42 | +#ifdef SRS_TRANSCODE |
| 43 | 43 | ||
| 44 | #define SRS_ENCODER_COPY "copy" | 44 | #define SRS_ENCODER_COPY "copy" |
| 45 | #define SRS_ENCODER_NO_VIDEO "vn" | 45 | #define SRS_ENCODER_NO_VIDEO "vn" |
| @@ -29,6 +29,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | @@ -29,6 +29,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
| 29 | */ | 29 | */ |
| 30 | #include <srs_core.hpp> | 30 | #include <srs_core.hpp> |
| 31 | 31 | ||
| 32 | +#ifdef SRS_TRANSCODE | ||
| 33 | + | ||
| 32 | #include <string> | 34 | #include <string> |
| 33 | #include <vector> | 35 | #include <vector> |
| 34 | 36 | ||
| @@ -38,8 +40,6 @@ class SrsConfDirective; | @@ -38,8 +40,6 @@ class SrsConfDirective; | ||
| 38 | class SrsRequest; | 40 | class SrsRequest; |
| 39 | class SrsPithyPrint; | 41 | class SrsPithyPrint; |
| 40 | 42 | ||
| 41 | -#ifdef SRS_FFMPEG | ||
| 42 | - | ||
| 43 | /** | 43 | /** |
| 44 | * a transcode engine: ffmepg, | 44 | * a transcode engine: ffmepg, |
| 45 | * used to transcode a stream to another. | 45 | * used to transcode a stream to another. |
| @@ -431,7 +431,7 @@ SrsSource::SrsSource(SrsRequest* _req) | @@ -431,7 +431,7 @@ SrsSource::SrsSource(SrsRequest* _req) | ||
| 431 | #ifdef SRS_HLS | 431 | #ifdef SRS_HLS |
| 432 | hls = new SrsHls(this); | 432 | hls = new SrsHls(this); |
| 433 | #endif | 433 | #endif |
| 434 | -#ifdef SRS_FFMPEG | 434 | +#ifdef SRS_TRANSCODE |
| 435 | encoder = new SrsEncoder(); | 435 | encoder = new SrsEncoder(); |
| 436 | #endif | 436 | #endif |
| 437 | 437 | ||
| @@ -477,7 +477,7 @@ SrsSource::~SrsSource() | @@ -477,7 +477,7 @@ SrsSource::~SrsSource() | ||
| 477 | #ifdef SRS_HLS | 477 | #ifdef SRS_HLS |
| 478 | srs_freep(hls); | 478 | srs_freep(hls); |
| 479 | #endif | 479 | #endif |
| 480 | -#ifdef SRS_FFMPEG | 480 | +#ifdef SRS_TRANSCODE |
| 481 | srs_freep(encoder); | 481 | srs_freep(encoder); |
| 482 | #endif | 482 | #endif |
| 483 | 483 | ||
| @@ -586,7 +586,7 @@ int SrsSource::on_reload_transcode(string vhost) | @@ -586,7 +586,7 @@ int SrsSource::on_reload_transcode(string vhost) | ||
| 586 | return ret; | 586 | return ret; |
| 587 | } | 587 | } |
| 588 | 588 | ||
| 589 | -#ifdef SRS_FFMPEG | 589 | +#ifdef SRS_TRANSCODE |
| 590 | encoder->on_unpublish(); | 590 | encoder->on_unpublish(); |
| 591 | if ((ret = encoder->on_publish(req)) != ERROR_SUCCESS) { | 591 | if ((ret = encoder->on_publish(req)) != ERROR_SUCCESS) { |
| 592 | srs_error("start encoder failed. ret=%d", ret); | 592 | srs_error("start encoder failed. ret=%d", ret); |
| @@ -900,7 +900,7 @@ int SrsSource::on_publish(SrsRequest* _req) | @@ -900,7 +900,7 @@ int SrsSource::on_publish(SrsRequest* _req) | ||
| 900 | return ret; | 900 | return ret; |
| 901 | } | 901 | } |
| 902 | 902 | ||
| 903 | -#ifdef SRS_FFMPEG | 903 | +#ifdef SRS_TRANSCODE |
| 904 | if ((ret = encoder->on_publish(req)) != ERROR_SUCCESS) { | 904 | if ((ret = encoder->on_publish(req)) != ERROR_SUCCESS) { |
| 905 | srs_error("start encoder failed. ret=%d", ret); | 905 | srs_error("start encoder failed. ret=%d", ret); |
| 906 | return ret; | 906 | return ret; |
| @@ -922,7 +922,7 @@ void SrsSource::on_unpublish() | @@ -922,7 +922,7 @@ void SrsSource::on_unpublish() | ||
| 922 | // destroy all forwarders | 922 | // destroy all forwarders |
| 923 | destroy_forwarders(); | 923 | destroy_forwarders(); |
| 924 | 924 | ||
| 925 | -#ifdef SRS_FFMPEG | 925 | +#ifdef SRS_TRANSCODE |
| 926 | encoder->on_unpublish(); | 926 | encoder->on_unpublish(); |
| 927 | #endif | 927 | #endif |
| 928 | 928 |
| @@ -46,7 +46,7 @@ class SrsRequest; | @@ -46,7 +46,7 @@ class SrsRequest; | ||
| 46 | #ifdef SRS_HLS | 46 | #ifdef SRS_HLS |
| 47 | class SrsHls; | 47 | class SrsHls; |
| 48 | #endif | 48 | #endif |
| 49 | -#ifdef SRS_FFMPEG | 49 | +#ifdef SRS_TRANSCODE |
| 50 | class SrsEncoder; | 50 | class SrsEncoder; |
| 51 | #endif | 51 | #endif |
| 52 | 52 | ||
| @@ -224,7 +224,7 @@ private: | @@ -224,7 +224,7 @@ private: | ||
| 224 | SrsHls* hls; | 224 | SrsHls* hls; |
| 225 | #endif | 225 | #endif |
| 226 | // transcoding handler. | 226 | // transcoding handler. |
| 227 | -#ifdef SRS_FFMPEG | 227 | +#ifdef SRS_TRANSCODE |
| 228 | SrsEncoder* encoder; | 228 | SrsEncoder* encoder; |
| 229 | #endif | 229 | #endif |
| 230 | // gop cache for client fast startup. | 230 | // gop cache for client fast startup. |
-
请 注册 或 登录 后发表评论