1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

use --with-ffmpeg to compile FFMPEG tool only, use --with-transcode for transcoding

This commit is contained in:
winlin 2014-04-06 20:30:51 +08:00
parent 5ff1d589f7
commit 983fe46ce2
8 changed files with 37 additions and 15 deletions

View file

@ -39,7 +39,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <srs_app_pithy_print.hpp>
#include <srs_protocol_rtmp_stack.hpp>
#ifdef SRS_FFMPEG
#ifdef SRS_TRANSCODE
#define SRS_ENCODER_COPY "copy"
#define SRS_ENCODER_NO_VIDEO "vn"

View file

@ -29,6 +29,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <srs_core.hpp>
#ifdef SRS_TRANSCODE
#include <string>
#include <vector>
@ -38,8 +40,6 @@ class SrsConfDirective;
class SrsRequest;
class SrsPithyPrint;
#ifdef SRS_FFMPEG
/**
* a transcode engine: ffmepg,
* used to transcode a stream to another.

View file

@ -431,7 +431,7 @@ SrsSource::SrsSource(SrsRequest* _req)
#ifdef SRS_HLS
hls = new SrsHls(this);
#endif
#ifdef SRS_FFMPEG
#ifdef SRS_TRANSCODE
encoder = new SrsEncoder();
#endif
@ -477,7 +477,7 @@ SrsSource::~SrsSource()
#ifdef SRS_HLS
srs_freep(hls);
#endif
#ifdef SRS_FFMPEG
#ifdef SRS_TRANSCODE
srs_freep(encoder);
#endif
@ -586,7 +586,7 @@ int SrsSource::on_reload_transcode(string vhost)
return ret;
}
#ifdef SRS_FFMPEG
#ifdef SRS_TRANSCODE
encoder->on_unpublish();
if ((ret = encoder->on_publish(req)) != ERROR_SUCCESS) {
srs_error("start encoder failed. ret=%d", ret);
@ -900,7 +900,7 @@ int SrsSource::on_publish(SrsRequest* _req)
return ret;
}
#ifdef SRS_FFMPEG
#ifdef SRS_TRANSCODE
if ((ret = encoder->on_publish(req)) != ERROR_SUCCESS) {
srs_error("start encoder failed. ret=%d", ret);
return ret;
@ -922,7 +922,7 @@ void SrsSource::on_unpublish()
// destroy all forwarders
destroy_forwarders();
#ifdef SRS_FFMPEG
#ifdef SRS_TRANSCODE
encoder->on_unpublish();
#endif

View file

@ -46,7 +46,7 @@ class SrsRequest;
#ifdef SRS_HLS
class SrsHls;
#endif
#ifdef SRS_FFMPEG
#ifdef SRS_TRANSCODE
class SrsEncoder;
#endif
@ -224,7 +224,7 @@ private:
SrsHls* hls;
#endif
// transcoding handler.
#ifdef SRS_FFMPEG
#ifdef SRS_TRANSCODE
SrsEncoder* encoder;
#endif
// gop cache for client fast startup.