1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-02-15 04:42:04 +00:00
srs/trunk/src/app/srs_app_encoder.hpp
Winlin c8a1e0f3da
Refine AUTHORS.txt to AUTHORS.md, etc. 5.0.8 (#2464)
* Refine AUTHORS.txt to AUTHORS.md, etc. 5.0.8

* Update README.md

* Update README.md

* Refine format for AUTHORS.md
2021-07-08 14:30:47 +08:00

53 lines
1.2 KiB
C++

//
// Copyright (c) 2013-2021 The SRS Authors
//
// SPDX-License-Identifier: MIT
//
#ifndef SRS_APP_ENCODER_HPP
#define SRS_APP_ENCODER_HPP
#include <srs_core.hpp>
#include <string>
#include <vector>
#include <srs_app_st.hpp>
class SrsConfDirective;
class SrsRequest;
class SrsPithyPrint;
class SrsFFMPEG;
// The encoder for a stream, may use multiple
// ffmpegs to transcode the specified stream.
class SrsEncoder : public ISrsCoroutineHandler
{
private:
std::string input_stream_name;
std::vector<SrsFFMPEG*> ffmpegs;
private:
SrsCoroutine* trd;
SrsPithyPrint* pprint;
public:
SrsEncoder();
virtual ~SrsEncoder();
public:
virtual srs_error_t on_publish(SrsRequest* req);
virtual void on_unpublish();
// Interface ISrsReusableThreadHandler.
public:
virtual srs_error_t cycle();
private:
virtual srs_error_t do_cycle();
private:
virtual void clear_engines();
virtual SrsFFMPEG* at(int index);
virtual srs_error_t parse_scope_engines(SrsRequest* req);
virtual srs_error_t parse_ffmpeg(SrsRequest* req, SrsConfDirective* conf);
virtual srs_error_t initialize_ffmpeg(SrsFFMPEG* ffmpeg, SrsRequest* req, SrsConfDirective* engine);
virtual void show_encode_log_message();
};
#endif