mirror of
https://github.com/ossrs/srs.git
synced 2025-02-13 03:41:55 +00:00
Always enable SRS_TRANSCODE
This commit is contained in:
parent
59d8bb532b
commit
330100769f
9 changed files with 4 additions and 54 deletions
|
@ -142,12 +142,6 @@ else
|
||||||
srs_undefine_macro "SRS_AUTO_FFMPEG_STUB" $SRS_AUTO_HEADERS_H
|
srs_undefine_macro "SRS_AUTO_FFMPEG_STUB" $SRS_AUTO_HEADERS_H
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $SRS_TRANSCODE = YES ]; then
|
|
||||||
srs_define_macro "SRS_AUTO_TRANSCODE" $SRS_AUTO_HEADERS_H
|
|
||||||
else
|
|
||||||
srs_undefine_macro "SRS_AUTO_TRANSCODE" $SRS_AUTO_HEADERS_H
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ $SRS_INGEST = YES ]; then
|
if [ $SRS_INGEST = YES ]; then
|
||||||
srs_define_macro "SRS_AUTO_INGEST" $SRS_AUTO_HEADERS_H
|
srs_define_macro "SRS_AUTO_INGEST" $SRS_AUTO_HEADERS_H
|
||||||
else
|
else
|
||||||
|
|
|
@ -19,7 +19,6 @@ SRS_HDS=RESERVED
|
||||||
SRS_NGINX=RESERVED
|
SRS_NGINX=RESERVED
|
||||||
SRS_SSL=RESERVED
|
SRS_SSL=RESERVED
|
||||||
SRS_FFMPEG_TOOL=RESERVED
|
SRS_FFMPEG_TOOL=RESERVED
|
||||||
SRS_TRANSCODE=RESERVED
|
|
||||||
SRS_INGEST=RESERVED
|
SRS_INGEST=RESERVED
|
||||||
SRS_STAT=RESERVED
|
SRS_STAT=RESERVED
|
||||||
SRS_STREAM_CASTER=RESERVED
|
SRS_STREAM_CASTER=RESERVED
|
||||||
|
@ -41,6 +40,7 @@ SRS_GPERF_CP=RESERVED
|
||||||
SRS_GPROF=RESERVED
|
SRS_GPROF=RESERVED
|
||||||
#
|
#
|
||||||
# Always enable the bellow features.
|
# Always enable the bellow features.
|
||||||
|
SRS_TRANSCODE=YES
|
||||||
SRS_HTTP_CALLBACK=YES
|
SRS_HTTP_CALLBACK=YES
|
||||||
SRS_HTTP_SERVER=YES
|
SRS_HTTP_SERVER=YES
|
||||||
SRS_HTTP_API=YES
|
SRS_HTTP_API=YES
|
||||||
|
@ -391,7 +391,6 @@ function apply_user_presets() {
|
||||||
SRS_NGINX=NO
|
SRS_NGINX=NO
|
||||||
SRS_SSL=NO
|
SRS_SSL=NO
|
||||||
SRS_FFMPEG_TOOL=NO
|
SRS_FFMPEG_TOOL=NO
|
||||||
SRS_TRANSCODE=NO
|
|
||||||
SRS_INGEST=NO
|
SRS_INGEST=NO
|
||||||
SRS_STAT=NO
|
SRS_STAT=NO
|
||||||
SRS_STREAM_CASTER=NO
|
SRS_STREAM_CASTER=NO
|
||||||
|
@ -414,7 +413,6 @@ function apply_user_presets() {
|
||||||
SRS_NGINX=YES
|
SRS_NGINX=YES
|
||||||
SRS_SSL=YES
|
SRS_SSL=YES
|
||||||
SRS_FFMPEG_TOOL=YES
|
SRS_FFMPEG_TOOL=YES
|
||||||
SRS_TRANSCODE=YES
|
|
||||||
SRS_INGEST=YES
|
SRS_INGEST=YES
|
||||||
SRS_STAT=YES
|
SRS_STAT=YES
|
||||||
SRS_STREAM_CASTER=YES
|
SRS_STREAM_CASTER=YES
|
||||||
|
@ -437,7 +435,6 @@ function apply_user_presets() {
|
||||||
SRS_NGINX=NO
|
SRS_NGINX=NO
|
||||||
SRS_SSL=NO
|
SRS_SSL=NO
|
||||||
SRS_FFMPEG_TOOL=NO
|
SRS_FFMPEG_TOOL=NO
|
||||||
SRS_TRANSCODE=NO
|
|
||||||
SRS_INGEST=NO
|
SRS_INGEST=NO
|
||||||
SRS_STAT=NO
|
SRS_STAT=NO
|
||||||
SRS_STREAM_CASTER=NO
|
SRS_STREAM_CASTER=NO
|
||||||
|
@ -460,7 +457,6 @@ function apply_user_presets() {
|
||||||
SRS_NGINX=NO
|
SRS_NGINX=NO
|
||||||
SRS_SSL=YES
|
SRS_SSL=YES
|
||||||
SRS_FFMPEG_TOOL=NO
|
SRS_FFMPEG_TOOL=NO
|
||||||
SRS_TRANSCODE=NO
|
|
||||||
SRS_INGEST=NO
|
SRS_INGEST=NO
|
||||||
SRS_STAT=NO
|
SRS_STAT=NO
|
||||||
SRS_STREAM_CASTER=NO
|
SRS_STREAM_CASTER=NO
|
||||||
|
@ -483,7 +479,6 @@ function apply_user_presets() {
|
||||||
SRS_NGINX=NO
|
SRS_NGINX=NO
|
||||||
SRS_SSL=YES
|
SRS_SSL=YES
|
||||||
SRS_FFMPEG_TOOL=NO
|
SRS_FFMPEG_TOOL=NO
|
||||||
SRS_TRANSCODE=YES
|
|
||||||
SRS_INGEST=YES
|
SRS_INGEST=YES
|
||||||
SRS_STAT=YES
|
SRS_STAT=YES
|
||||||
SRS_STREAM_CASTER=YES
|
SRS_STREAM_CASTER=YES
|
||||||
|
@ -507,7 +502,6 @@ function apply_user_presets() {
|
||||||
SRS_NGINX=NO
|
SRS_NGINX=NO
|
||||||
SRS_SSL=YES
|
SRS_SSL=YES
|
||||||
SRS_FFMPEG_TOOL=NO
|
SRS_FFMPEG_TOOL=NO
|
||||||
SRS_TRANSCODE=YES
|
|
||||||
SRS_INGEST=YES
|
SRS_INGEST=YES
|
||||||
SRS_STAT=YES
|
SRS_STAT=YES
|
||||||
SRS_STREAM_CASTER=YES
|
SRS_STREAM_CASTER=YES
|
||||||
|
@ -530,7 +524,6 @@ function apply_user_presets() {
|
||||||
SRS_NGINX=NO
|
SRS_NGINX=NO
|
||||||
SRS_SSL=YES
|
SRS_SSL=YES
|
||||||
SRS_FFMPEG_TOOL=NO
|
SRS_FFMPEG_TOOL=NO
|
||||||
SRS_TRANSCODE=YES
|
|
||||||
SRS_INGEST=YES
|
SRS_INGEST=YES
|
||||||
SRS_STAT=YES
|
SRS_STAT=YES
|
||||||
SRS_STREAM_CASTER=YES
|
SRS_STREAM_CASTER=YES
|
||||||
|
@ -553,7 +546,6 @@ function apply_user_presets() {
|
||||||
SRS_NGINX=NO
|
SRS_NGINX=NO
|
||||||
SRS_SSL=YES
|
SRS_SSL=YES
|
||||||
SRS_FFMPEG_TOOL=NO
|
SRS_FFMPEG_TOOL=NO
|
||||||
SRS_TRANSCODE=YES
|
|
||||||
SRS_INGEST=YES
|
SRS_INGEST=YES
|
||||||
SRS_STAT=YES
|
SRS_STAT=YES
|
||||||
SRS_STREAM_CASTER=YES
|
SRS_STREAM_CASTER=YES
|
||||||
|
@ -579,7 +571,6 @@ function apply_user_presets() {
|
||||||
SRS_NGINX=NO
|
SRS_NGINX=NO
|
||||||
SRS_SSL=YES
|
SRS_SSL=YES
|
||||||
SRS_FFMPEG_TOOL=YES
|
SRS_FFMPEG_TOOL=YES
|
||||||
SRS_TRANSCODE=YES
|
|
||||||
SRS_INGEST=YES
|
SRS_INGEST=YES
|
||||||
SRS_STAT=YES
|
SRS_STAT=YES
|
||||||
SRS_STREAM_CASTER=YES
|
SRS_STREAM_CASTER=YES
|
||||||
|
@ -602,7 +593,6 @@ function apply_user_presets() {
|
||||||
SRS_NGINX=NO
|
SRS_NGINX=NO
|
||||||
SRS_SSL=YES
|
SRS_SSL=YES
|
||||||
SRS_FFMPEG_TOOL=NO
|
SRS_FFMPEG_TOOL=NO
|
||||||
SRS_TRANSCODE=YES
|
|
||||||
SRS_INGEST=YES
|
SRS_INGEST=YES
|
||||||
SRS_STAT=YES
|
SRS_STAT=YES
|
||||||
SRS_STREAM_CASTER=YES
|
SRS_STREAM_CASTER=YES
|
||||||
|
@ -625,7 +615,6 @@ function apply_user_presets() {
|
||||||
SRS_NGINX=NO
|
SRS_NGINX=NO
|
||||||
SRS_SSL=YES
|
SRS_SSL=YES
|
||||||
SRS_FFMPEG_TOOL=YES
|
SRS_FFMPEG_TOOL=YES
|
||||||
SRS_TRANSCODE=YES
|
|
||||||
SRS_INGEST=YES
|
SRS_INGEST=YES
|
||||||
SRS_STAT=YES
|
SRS_STAT=YES
|
||||||
SRS_STREAM_CASTER=YES
|
SRS_STREAM_CASTER=YES
|
||||||
|
@ -648,7 +637,6 @@ function apply_user_presets() {
|
||||||
SRS_NGINX=NO
|
SRS_NGINX=NO
|
||||||
SRS_SSL=YES
|
SRS_SSL=YES
|
||||||
SRS_FFMPEG_TOOL=NO
|
SRS_FFMPEG_TOOL=NO
|
||||||
SRS_TRANSCODE=YES
|
|
||||||
SRS_INGEST=YES
|
SRS_INGEST=YES
|
||||||
SRS_STAT=YES
|
SRS_STAT=YES
|
||||||
SRS_STREAM_CASTER=YES
|
SRS_STREAM_CASTER=YES
|
||||||
|
@ -671,7 +659,6 @@ function apply_user_presets() {
|
||||||
SRS_NGINX=NO
|
SRS_NGINX=NO
|
||||||
SRS_SSL=YES
|
SRS_SSL=YES
|
||||||
SRS_FFMPEG_TOOL=YES
|
SRS_FFMPEG_TOOL=YES
|
||||||
SRS_TRANSCODE=YES
|
|
||||||
SRS_INGEST=YES
|
SRS_INGEST=YES
|
||||||
SRS_STAT=YES
|
SRS_STAT=YES
|
||||||
SRS_STREAM_CASTER=NO
|
SRS_STREAM_CASTER=NO
|
||||||
|
@ -707,6 +694,7 @@ function apply_user_detail_options() {
|
||||||
|
|
||||||
# Always enable HTTP utilies.
|
# Always enable HTTP utilies.
|
||||||
if [ $SRS_HTTP_CORE = NO ]; then SRS_HTTP_CORE=YES; echo -e "${YELLOW}[WARN] Always enable HTTP utilies.${BLACK}"; fi
|
if [ $SRS_HTTP_CORE = NO ]; then SRS_HTTP_CORE=YES; echo -e "${YELLOW}[WARN] Always enable HTTP utilies.${BLACK}"; fi
|
||||||
|
if [ $SRS_TRANSCODE = NO ]; then SRS_TRANSCODE=YES; echo -e "${YELLOW}[WARN] Always enable Transcode.${BLACK}"; fi
|
||||||
if [ $SRS_HTTP_CALLBACK = NO ]; then SRS_HTTP_CALLBACK=YES; echo -e "${YELLOW}[WARN] Always enable HTTP callback.${BLACK}"; fi
|
if [ $SRS_HTTP_CALLBACK = NO ]; then SRS_HTTP_CALLBACK=YES; echo -e "${YELLOW}[WARN] Always enable HTTP callback.${BLACK}"; fi
|
||||||
if [ $SRS_HTTP_SERVER = NO ]; then SRS_HTTP_SERVER=YES; echo -e "${YELLOW}[WARN] Always enable HTTP server.${BLACK}"; fi
|
if [ $SRS_HTTP_SERVER = NO ]; then SRS_HTTP_SERVER=YES; echo -e "${YELLOW}[WARN] Always enable HTTP server.${BLACK}"; fi
|
||||||
if [ $SRS_HTTP_API = NO ]; then SRS_HTTP_API=YES; echo -e "${YELLOW}[WARN] Always enable HTTP API.${BLACK}"; fi
|
if [ $SRS_HTTP_API = NO ]; then SRS_HTTP_API=YES; echo -e "${YELLOW}[WARN] Always enable HTTP API.${BLACK}"; fi
|
||||||
|
@ -732,6 +720,7 @@ function apply_user_detail_options() {
|
||||||
SRS_SSL=NO
|
SRS_SSL=NO
|
||||||
SRS_FFMPEG_TOOL=NO
|
SRS_FFMPEG_TOOL=NO
|
||||||
SRS_TRANSCODE=NO
|
SRS_TRANSCODE=NO
|
||||||
|
SRS_HTTP_CALLBACK=NO
|
||||||
SRS_INGEST=NO
|
SRS_INGEST=NO
|
||||||
SRS_STAT=NO
|
SRS_STAT=NO
|
||||||
SRS_STREAM_CASTER=NO
|
SRS_STREAM_CASTER=NO
|
||||||
|
|
|
@ -3895,11 +3895,6 @@ srs_error_t SrsConfig::check_normal_config()
|
||||||
if (get_hls_enabled(vhost->arg0())) {
|
if (get_hls_enabled(vhost->arg0())) {
|
||||||
srs_warn("can't enable vhost.hls of %s", vhost->arg0().c_str());
|
srs_warn("can't enable vhost.hls of %s", vhost->arg0().c_str());
|
||||||
}
|
}
|
||||||
#ifndef SRS_AUTO_TRANSCODE
|
|
||||||
if (get_transcode_enabled(get_transcode(vhost->arg0(), ""))) {
|
|
||||||
srs_warn("can't enable vhost.transcode of %s", vhost->arg0().c_str());
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifndef SRS_AUTO_INGEST
|
#ifndef SRS_AUTO_INGEST
|
||||||
vector<SrsConfDirective*> ingesters = get_ingesters(vhost->arg0());
|
vector<SrsConfDirective*> ingesters = get_ingesters(vhost->arg0());
|
||||||
for (int j = 0; j < (int)ingesters.size(); j++) {
|
for (int j = 0; j < (int)ingesters.size(); j++) {
|
||||||
|
|
|
@ -34,8 +34,6 @@ using namespace std;
|
||||||
#include <srs_app_ffmpeg.hpp>
|
#include <srs_app_ffmpeg.hpp>
|
||||||
#include <srs_kernel_utility.hpp>
|
#include <srs_kernel_utility.hpp>
|
||||||
|
|
||||||
#ifdef SRS_AUTO_TRANSCODE
|
|
||||||
|
|
||||||
// for encoder to detect the dead loop
|
// for encoder to detect the dead loop
|
||||||
static std::vector<std::string> _transcoded_url;
|
static std::vector<std::string> _transcoded_url;
|
||||||
|
|
||||||
|
@ -334,6 +332,3 @@ void SrsEncoder::show_encode_log_message()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -26,8 +26,6 @@
|
||||||
|
|
||||||
#include <srs_core.hpp>
|
#include <srs_core.hpp>
|
||||||
|
|
||||||
#ifdef SRS_AUTO_TRANSCODE
|
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
@ -72,5 +70,3 @@ private:
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
|
@ -603,11 +603,7 @@ srs_error_t SrsGoApiFeatures::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMess
|
||||||
features->set("api", SrsJsonAny::boolean(true));
|
features->set("api", SrsJsonAny::boolean(true));
|
||||||
features->set("httpd", SrsJsonAny::boolean(true));
|
features->set("httpd", SrsJsonAny::boolean(true));
|
||||||
features->set("dvr", SrsJsonAny::boolean(true));
|
features->set("dvr", SrsJsonAny::boolean(true));
|
||||||
#ifdef SRS_AUTO_TRANSCODE
|
|
||||||
features->set("transcode", SrsJsonAny::boolean(true));
|
features->set("transcode", SrsJsonAny::boolean(true));
|
||||||
#else
|
|
||||||
features->set("transcode", SrsJsonAny::boolean(false));
|
|
||||||
#endif
|
|
||||||
#ifdef SRS_AUTO_INGEST
|
#ifdef SRS_AUTO_INGEST
|
||||||
features->set("ingest", SrsJsonAny::boolean(true));
|
features->set("ingest", SrsJsonAny::boolean(true));
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -824,9 +824,7 @@ SrsOriginHub::SrsOriginHub()
|
||||||
hls = new SrsHls();
|
hls = new SrsHls();
|
||||||
dash = new SrsDash();
|
dash = new SrsDash();
|
||||||
dvr = new SrsDvr();
|
dvr = new SrsDvr();
|
||||||
#ifdef SRS_AUTO_TRANSCODE
|
|
||||||
encoder = new SrsEncoder();
|
encoder = new SrsEncoder();
|
||||||
#endif
|
|
||||||
#ifdef SRS_AUTO_HDS
|
#ifdef SRS_AUTO_HDS
|
||||||
hds = new SrsHds();
|
hds = new SrsHds();
|
||||||
#endif
|
#endif
|
||||||
|
@ -854,9 +852,7 @@ SrsOriginHub::~SrsOriginHub()
|
||||||
srs_freep(hls);
|
srs_freep(hls);
|
||||||
srs_freep(dash);
|
srs_freep(dash);
|
||||||
srs_freep(dvr);
|
srs_freep(dvr);
|
||||||
#ifdef SRS_AUTO_TRANSCODE
|
|
||||||
srs_freep(encoder);
|
srs_freep(encoder);
|
||||||
#endif
|
|
||||||
#ifdef SRS_AUTO_HDS
|
#ifdef SRS_AUTO_HDS
|
||||||
srs_freep(hds);
|
srs_freep(hds);
|
||||||
#endif
|
#endif
|
||||||
|
@ -1116,11 +1112,9 @@ srs_error_t SrsOriginHub::on_publish()
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: FIXME: use initialize to set req.
|
// TODO: FIXME: use initialize to set req.
|
||||||
#ifdef SRS_AUTO_TRANSCODE
|
|
||||||
if ((err = encoder->on_publish(req)) != srs_success) {
|
if ((err = encoder->on_publish(req)) != srs_success) {
|
||||||
return srs_error_wrap(err, "encoder publish");
|
return srs_error_wrap(err, "encoder publish");
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
if ((err = hls->on_publish()) != srs_success) {
|
if ((err = hls->on_publish()) != srs_success) {
|
||||||
return srs_error_wrap(err, "hls publish");
|
return srs_error_wrap(err, "hls publish");
|
||||||
|
@ -1158,10 +1152,7 @@ void SrsOriginHub::on_unpublish()
|
||||||
// destroy all forwarders
|
// destroy all forwarders
|
||||||
destroy_forwarders();
|
destroy_forwarders();
|
||||||
|
|
||||||
#ifdef SRS_AUTO_TRANSCODE
|
|
||||||
encoder->on_unpublish();
|
encoder->on_unpublish();
|
||||||
#endif
|
|
||||||
|
|
||||||
hls->on_unpublish();
|
hls->on_unpublish();
|
||||||
dash->on_unpublish();
|
dash->on_unpublish();
|
||||||
dvr->on_unpublish();
|
dvr->on_unpublish();
|
||||||
|
@ -1419,7 +1410,6 @@ srs_error_t SrsOriginHub::on_reload_vhost_transcode(string vhost)
|
||||||
|
|
||||||
// TODO: FIXME: maybe should ignore when publish already stopped?
|
// TODO: FIXME: maybe should ignore when publish already stopped?
|
||||||
|
|
||||||
#ifdef SRS_AUTO_TRANSCODE
|
|
||||||
encoder->on_unpublish();
|
encoder->on_unpublish();
|
||||||
|
|
||||||
// Don't start transcode when source is not active.
|
// Don't start transcode when source is not active.
|
||||||
|
@ -1431,7 +1421,6 @@ srs_error_t SrsOriginHub::on_reload_vhost_transcode(string vhost)
|
||||||
return srs_error_wrap(err, "start encoder failed");
|
return srs_error_wrap(err, "start encoder failed");
|
||||||
}
|
}
|
||||||
srs_trace("vhost %s transcode reload success", vhost.c_str());
|
srs_trace("vhost %s transcode reload success", vhost.c_str());
|
||||||
#endif
|
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,9 +55,7 @@ class SrsMessageHeader;
|
||||||
class SrsHls;
|
class SrsHls;
|
||||||
class SrsDvr;
|
class SrsDvr;
|
||||||
class SrsDash;
|
class SrsDash;
|
||||||
#ifdef SRS_AUTO_TRANSCODE
|
|
||||||
class SrsEncoder;
|
class SrsEncoder;
|
||||||
#endif
|
|
||||||
class SrsBuffer;
|
class SrsBuffer;
|
||||||
#ifdef SRS_AUTO_HDS
|
#ifdef SRS_AUTO_HDS
|
||||||
class SrsHds;
|
class SrsHds;
|
||||||
|
@ -428,9 +426,7 @@ private:
|
||||||
// dvr handler.
|
// dvr handler.
|
||||||
SrsDvr* dvr;
|
SrsDvr* dvr;
|
||||||
// transcoding handler.
|
// transcoding handler.
|
||||||
#ifdef SRS_AUTO_TRANSCODE
|
|
||||||
SrsEncoder* encoder;
|
SrsEncoder* encoder;
|
||||||
#endif
|
|
||||||
#ifdef SRS_AUTO_HDS
|
#ifdef SRS_AUTO_HDS
|
||||||
// adobe hds(http dynamic streaming).
|
// adobe hds(http dynamic streaming).
|
||||||
SrsHds *hds;
|
SrsHds *hds;
|
||||||
|
|
|
@ -226,7 +226,7 @@ void show_macro_features()
|
||||||
ss << ", hp:" << srs_bool2switch(true);
|
ss << ", hp:" << srs_bool2switch(true);
|
||||||
ss << ", dvr:" << srs_bool2switch(SRS_AUTO_DVR_BOOL);
|
ss << ", dvr:" << srs_bool2switch(SRS_AUTO_DVR_BOOL);
|
||||||
// trans(transcode)
|
// trans(transcode)
|
||||||
ss << ", trans:" << srs_bool2switch(SRS_AUTO_TRANSCODE_BOOL);
|
ss << ", trans:" << srs_bool2switch(true);
|
||||||
// inge(ingest)
|
// inge(ingest)
|
||||||
ss << ", inge:" << srs_bool2switch(SRS_AUTO_INGEST_BOOL);
|
ss << ", inge:" << srs_bool2switch(SRS_AUTO_INGEST_BOOL);
|
||||||
ss << ", kafka:" << srs_bool2switch(SRS_AUTO_KAFKA_BOOL);
|
ss << ", kafka:" << srs_bool2switch(SRS_AUTO_KAFKA_BOOL);
|
||||||
|
|
Loading…
Reference in a new issue