2017-03-25 09:21:39 +00:00
|
|
|
/**
|
|
|
|
* The MIT License (MIT)
|
|
|
|
*
|
2017-03-25 13:29:29 +00:00
|
|
|
* Copyright (c) 2013-2017 OSSRS(winlin)
|
2017-03-25 09:21:39 +00:00
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
|
|
* this software and associated documentation files (the "Software"), to deal in
|
|
|
|
* the Software without restriction, including without limitation the rights to
|
|
|
|
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
|
|
* the Software, and to permit persons to whom the Software is furnished to do so,
|
|
|
|
* subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice shall be included in all
|
|
|
|
* copies or substantial portions of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
|
|
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
|
|
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
|
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
|
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
*/
|
2013-11-23 11:15:11 +00:00
|
|
|
|
2014-03-02 13:49:09 +00:00
|
|
|
#ifndef SRS_APP_HLS_HPP
|
|
|
|
#define SRS_APP_HLS_HPP
|
2013-11-23 11:15:11 +00:00
|
|
|
|
|
|
|
#include <srs_core.hpp>
|
|
|
|
|
2013-11-24 09:15:37 +00:00
|
|
|
#include <string>
|
2013-11-26 08:06:58 +00:00
|
|
|
#include <vector>
|
2013-11-24 09:15:37 +00:00
|
|
|
|
2015-01-25 08:42:22 +00:00
|
|
|
#include <srs_kernel_codec.hpp>
|
2015-02-03 08:01:07 +00:00
|
|
|
#include <srs_kernel_file.hpp>
|
2015-03-31 09:42:12 +00:00
|
|
|
#include <srs_app_async_call.hpp>
|
2017-03-18 13:29:08 +00:00
|
|
|
#include <srs_app_fragment.hpp>
|
2015-01-25 08:42:22 +00:00
|
|
|
|
2017-02-11 15:09:23 +00:00
|
|
|
class SrsFormat;
|
2014-04-29 06:44:07 +00:00
|
|
|
class SrsSharedPtrMessage;
|
2013-12-15 12:29:18 +00:00
|
|
|
class SrsAmf0Object;
|
2013-11-26 08:06:58 +00:00
|
|
|
class SrsRtmpJitter;
|
2017-02-12 13:50:02 +00:00
|
|
|
class SrsTsContextWriter;
|
2013-12-01 09:32:06 +00:00
|
|
|
class SrsRequest;
|
2013-12-05 15:34:26 +00:00
|
|
|
class SrsPithyPrint;
|
2013-12-15 12:29:18 +00:00
|
|
|
class SrsSource;
|
2017-01-19 04:38:55 +00:00
|
|
|
class SrsOriginHub;
|
2014-07-04 23:33:18 +00:00
|
|
|
class SrsFileWriter;
|
2015-09-22 00:59:52 +00:00
|
|
|
class SrsSimpleStream;
|
2015-01-22 10:13:33 +00:00
|
|
|
class SrsTsAacJitter;
|
2017-02-12 13:50:02 +00:00
|
|
|
class SrsTsMessageCache;
|
2015-02-03 08:01:07 +00:00
|
|
|
class SrsHlsSegment;
|
2015-04-08 08:52:43 +00:00
|
|
|
class SrsTsContext;
|
2015-02-03 08:01:07 +00:00
|
|
|
|
2013-12-02 06:24:09 +00:00
|
|
|
/**
|
2017-03-25 09:21:39 +00:00
|
|
|
* the wrapper of m3u8 segment from specification:
|
|
|
|
*
|
|
|
|
* 3.3.2. EXTINF
|
|
|
|
* The EXTINF tag specifies the duration of a media segment.
|
|
|
|
*/
|
2017-03-18 13:29:08 +00:00
|
|
|
class SrsHlsSegment : public SrsFragment
|
2013-12-02 06:24:09 +00:00
|
|
|
{
|
2014-03-20 10:19:08 +00:00
|
|
|
public:
|
2014-03-18 03:32:58 +00:00
|
|
|
// sequence number in m3u8.
|
|
|
|
int sequence_no;
|
|
|
|
// ts uri in m3u8.
|
|
|
|
std::string uri;
|
2017-02-12 13:50:02 +00:00
|
|
|
// the underlayer file writer.
|
2017-02-12 10:18:18 +00:00
|
|
|
SrsFileWriter* writer;
|
2017-02-12 13:50:02 +00:00
|
|
|
// The TS context writer to write TS to file.
|
|
|
|
SrsTsContextWriter* tscw;
|
2015-02-03 08:01:07 +00:00
|
|
|
public:
|
2017-02-12 12:38:39 +00:00
|
|
|
SrsHlsSegment(SrsTsContext* c, SrsAudioCodecId ac, SrsVideoCodecId vc);
|
2014-03-20 10:19:08 +00:00
|
|
|
virtual ~SrsHlsSegment();
|
2013-12-02 06:24:09 +00:00
|
|
|
};
|
|
|
|
|
2015-03-31 09:42:12 +00:00
|
|
|
/**
|
2015-04-10 04:01:45 +00:00
|
|
|
* the hls async call: on_hls
|
2015-03-31 09:42:12 +00:00
|
|
|
*/
|
2015-05-22 23:57:45 +00:00
|
|
|
class SrsDvrAsyncCallOnHls : public ISrsAsyncCallTask
|
2015-03-31 09:42:12 +00:00
|
|
|
{
|
|
|
|
private:
|
2015-09-14 05:47:25 +00:00
|
|
|
int cid;
|
2015-03-31 09:42:12 +00:00
|
|
|
std::string path;
|
2015-04-23 04:05:24 +00:00
|
|
|
std::string ts_url;
|
|
|
|
std::string m3u8;
|
|
|
|
std::string m3u8_url;
|
2015-03-31 09:42:12 +00:00
|
|
|
int seq_no;
|
|
|
|
SrsRequest* req;
|
2015-04-03 05:46:44 +00:00
|
|
|
double duration;
|
2015-03-31 09:42:12 +00:00
|
|
|
public:
|
2017-03-18 13:29:08 +00:00
|
|
|
// TODO: FIXME: Use TBN 1000.
|
2015-09-14 05:47:25 +00:00
|
|
|
SrsDvrAsyncCallOnHls(int c, SrsRequest* r, std::string p, std::string t, std::string m, std::string mu, int s, double d);
|
2015-03-31 09:42:12 +00:00
|
|
|
virtual ~SrsDvrAsyncCallOnHls();
|
|
|
|
public:
|
|
|
|
virtual int call();
|
|
|
|
virtual std::string to_string();
|
|
|
|
};
|
|
|
|
|
2015-04-10 04:01:45 +00:00
|
|
|
/**
|
|
|
|
* the hls async call: on_hls_notify
|
|
|
|
*/
|
2015-05-22 23:57:45 +00:00
|
|
|
class SrsDvrAsyncCallOnHlsNotify : public ISrsAsyncCallTask
|
2015-04-10 04:01:45 +00:00
|
|
|
{
|
|
|
|
private:
|
2015-09-14 05:47:25 +00:00
|
|
|
int cid;
|
2015-04-10 04:01:45 +00:00
|
|
|
std::string ts_url;
|
|
|
|
SrsRequest* req;
|
|
|
|
public:
|
2015-09-14 05:47:25 +00:00
|
|
|
SrsDvrAsyncCallOnHlsNotify(int c, SrsRequest* r, std::string u);
|
2015-04-10 04:01:45 +00:00
|
|
|
virtual ~SrsDvrAsyncCallOnHlsNotify();
|
|
|
|
public:
|
|
|
|
virtual int call();
|
|
|
|
virtual std::string to_string();
|
|
|
|
};
|
|
|
|
|
2013-11-26 08:06:58 +00:00
|
|
|
/**
|
2017-03-25 09:21:39 +00:00
|
|
|
* muxer the HLS stream(m3u8 and ts files).
|
|
|
|
* generally, the m3u8 muxer only provides methods to open/close segments,
|
|
|
|
* to flush video/audio, without any mechenisms.
|
|
|
|
*
|
|
|
|
* that is, user must use HlsCache, which will control the methods of muxer,
|
|
|
|
* and provides HLS mechenisms.
|
|
|
|
*/
|
2014-03-20 10:19:08 +00:00
|
|
|
class SrsHlsMuxer
|
2013-11-23 12:16:47 +00:00
|
|
|
{
|
2013-11-24 04:39:47 +00:00
|
|
|
private:
|
2015-02-03 08:01:07 +00:00
|
|
|
SrsRequest* req;
|
2013-12-02 07:55:10 +00:00
|
|
|
private:
|
2015-03-16 23:57:58 +00:00
|
|
|
std::string hls_entry_prefix;
|
2014-03-18 03:32:58 +00:00
|
|
|
std::string hls_path;
|
2015-03-30 04:44:04 +00:00
|
|
|
std::string hls_ts_file;
|
2015-04-02 03:52:03 +00:00
|
|
|
bool hls_cleanup;
|
2015-04-13 02:32:32 +00:00
|
|
|
bool hls_wait_keyframe;
|
2015-03-30 06:08:17 +00:00
|
|
|
std::string m3u8_dir;
|
2015-03-19 09:24:27 +00:00
|
|
|
double hls_aof_ratio;
|
2017-03-18 13:29:08 +00:00
|
|
|
// TODO: FIXME: Use TBN 1000.
|
2015-03-31 07:39:47 +00:00
|
|
|
double hls_fragment;
|
|
|
|
double hls_window;
|
2015-05-22 23:57:45 +00:00
|
|
|
SrsAsyncCallWorker* async;
|
2015-03-31 07:39:47 +00:00
|
|
|
private:
|
|
|
|
// whether use floor algorithm for timestamp.
|
|
|
|
bool hls_ts_floor;
|
2015-04-10 02:21:30 +00:00
|
|
|
// the deviation in piece to adjust the fragment to be more
|
2015-03-31 07:39:47 +00:00
|
|
|
// bigger or smaller.
|
2015-04-10 02:21:30 +00:00
|
|
|
int deviation_ts;
|
2015-03-31 07:54:05 +00:00
|
|
|
// the previous reap floor timestamp,
|
|
|
|
// used to detect the dup or jmp or ts.
|
2015-03-31 09:03:14 +00:00
|
|
|
int64_t accept_floor_ts;
|
2015-03-31 07:54:05 +00:00
|
|
|
int64_t previous_floor_ts;
|
2013-11-26 08:06:58 +00:00
|
|
|
private:
|
2014-05-04 02:45:13 +00:00
|
|
|
int _sequence_no;
|
2015-07-14 02:31:42 +00:00
|
|
|
int max_td;
|
2014-03-18 03:32:58 +00:00
|
|
|
std::string m3u8;
|
2015-04-23 04:05:24 +00:00
|
|
|
std::string m3u8_url;
|
2013-11-26 08:06:58 +00:00
|
|
|
private:
|
2017-03-18 13:29:08 +00:00
|
|
|
// The available cached segments in m3u8.
|
|
|
|
SrsFragmentWindow* segments;
|
|
|
|
// The current writing segment.
|
2014-03-20 10:19:08 +00:00
|
|
|
SrsHlsSegment* current;
|
2015-04-08 08:52:43 +00:00
|
|
|
/**
|
|
|
|
* the ts context, to keep cc continous between ts.
|
2015-11-11 02:37:50 +00:00
|
|
|
* @see https://github.com/ossrs/srs/issues/375
|
2015-04-08 08:52:43 +00:00
|
|
|
*/
|
|
|
|
SrsTsContext* context;
|
2013-12-02 07:55:10 +00:00
|
|
|
public:
|
2015-02-27 12:39:36 +00:00
|
|
|
SrsHlsMuxer();
|
2014-03-20 10:19:08 +00:00
|
|
|
virtual ~SrsHlsMuxer();
|
2015-05-30 05:48:29 +00:00
|
|
|
public:
|
|
|
|
virtual void dispose();
|
2014-05-04 02:45:13 +00:00
|
|
|
public:
|
|
|
|
virtual int sequence_no();
|
2015-03-31 07:39:47 +00:00
|
|
|
virtual std::string ts_url();
|
|
|
|
virtual double duration();
|
2015-04-10 02:21:30 +00:00
|
|
|
virtual int deviation();
|
2013-12-02 07:55:10 +00:00
|
|
|
public:
|
2015-02-27 12:39:36 +00:00
|
|
|
/**
|
2017-03-25 09:21:39 +00:00
|
|
|
* initialize the hls muxer.
|
|
|
|
*/
|
2017-06-11 01:40:07 +00:00
|
|
|
virtual srs_error_t initialize();
|
2015-02-03 08:01:07 +00:00
|
|
|
/**
|
2017-03-25 09:21:39 +00:00
|
|
|
* when publish, update the config for muxer.
|
|
|
|
*/
|
2015-03-30 04:44:04 +00:00
|
|
|
virtual int update_config(SrsRequest* r, std::string entry_prefix,
|
|
|
|
std::string path, std::string m3u8_file, std::string ts_file,
|
2015-04-02 03:52:03 +00:00
|
|
|
double fragment, double window, bool ts_floor, double aof_ratio,
|
2015-04-13 02:32:32 +00:00
|
|
|
bool cleanup, bool wait_keyframe);
|
2014-03-20 10:19:08 +00:00
|
|
|
/**
|
2017-03-18 13:29:08 +00:00
|
|
|
* open a new segment(a new ts file)
|
|
|
|
*/
|
|
|
|
virtual int segment_open();
|
2014-03-21 09:10:24 +00:00
|
|
|
virtual int on_sequence_header();
|
2014-03-20 10:19:08 +00:00
|
|
|
/**
|
2017-03-25 09:21:39 +00:00
|
|
|
* whether segment overflow,
|
|
|
|
* that is whether the current segment duration>=(the segment in config)
|
|
|
|
*/
|
2014-03-20 10:19:08 +00:00
|
|
|
virtual bool is_segment_overflow();
|
2015-04-13 02:32:32 +00:00
|
|
|
/**
|
|
|
|
* whether wait keyframe to reap the ts.
|
|
|
|
*/
|
|
|
|
virtual bool wait_keyframe();
|
2015-01-23 07:29:14 +00:00
|
|
|
/**
|
2017-03-25 09:21:39 +00:00
|
|
|
* whether segment absolutely overflow, for pure audio to reap segment,
|
|
|
|
* that is whether the current segment duration>=2*(the segment in config)
|
|
|
|
* @see https://github.com/ossrs/srs/issues/151#issuecomment-71155184
|
|
|
|
*/
|
2015-01-23 07:29:14 +00:00
|
|
|
virtual bool is_segment_absolutely_overflow();
|
2015-01-25 08:42:22 +00:00
|
|
|
public:
|
2015-10-27 08:20:02 +00:00
|
|
|
/**
|
|
|
|
* whether current hls muxer is pure audio mode.
|
|
|
|
*/
|
|
|
|
virtual bool pure_audio();
|
2017-02-12 13:50:02 +00:00
|
|
|
virtual int flush_audio(SrsTsMessageCache* cache);
|
|
|
|
virtual int flush_video(SrsTsMessageCache* cache);
|
2014-03-21 05:10:47 +00:00
|
|
|
/**
|
2017-03-18 13:29:08 +00:00
|
|
|
* Close segment(ts).
|
|
|
|
*/
|
|
|
|
virtual int segment_close();
|
2013-12-02 07:55:10 +00:00
|
|
|
private:
|
2014-03-18 03:32:58 +00:00
|
|
|
virtual int refresh_m3u8();
|
2015-02-03 08:01:07 +00:00
|
|
|
virtual int _refresh_m3u8(std::string m3u8_file);
|
2013-12-02 07:55:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2017-03-25 09:21:39 +00:00
|
|
|
* hls stream cache,
|
|
|
|
* use to cache hls stream and flush to hls muxer.
|
|
|
|
*
|
|
|
|
* when write stream to ts file:
|
|
|
|
* video frame will directly flush to M3u8Muxer,
|
|
|
|
* audio frame need to cache, because it's small and flv tbn problem.
|
|
|
|
*
|
|
|
|
* whatever, the Hls cache used to cache video/audio,
|
|
|
|
* and flush video/audio to m3u8 muxer if needed.
|
|
|
|
*
|
|
|
|
* about the flv tbn problem:
|
|
|
|
* flv tbn is 1/1000, ts tbn is 1/90000,
|
|
|
|
* when timestamp convert to flv tbn, it will loose precise,
|
|
|
|
* so we must gather audio frame together, and recalc the timestamp @see SrsTsAacJitter,
|
|
|
|
* we use a aac jitter to correct the audio pts.
|
|
|
|
*/
|
2017-02-12 10:18:18 +00:00
|
|
|
class SrsHlsController
|
2013-12-02 07:55:10 +00:00
|
|
|
{
|
2013-12-02 14:09:10 +00:00
|
|
|
private:
|
2017-02-12 10:18:18 +00:00
|
|
|
// The HLS muxer to reap ts and m3u8.
|
2017-02-12 13:50:02 +00:00
|
|
|
// The TS is cached to SrsTsMessageCache then flush to ts segment.
|
2017-02-12 10:18:18 +00:00
|
|
|
SrsHlsMuxer* muxer;
|
|
|
|
// The TS cache
|
2017-02-12 13:50:02 +00:00
|
|
|
SrsTsMessageCache* tsmc;
|
2013-12-02 14:09:10 +00:00
|
|
|
public:
|
2017-02-12 10:18:18 +00:00
|
|
|
SrsHlsController();
|
|
|
|
virtual ~SrsHlsController();
|
|
|
|
public:
|
2017-06-11 01:40:07 +00:00
|
|
|
virtual srs_error_t initialize();
|
2017-02-12 10:18:18 +00:00
|
|
|
virtual void dispose();
|
|
|
|
virtual int sequence_no();
|
|
|
|
virtual std::string ts_url();
|
|
|
|
virtual double duration();
|
|
|
|
virtual int deviation();
|
2013-12-02 14:09:10 +00:00
|
|
|
public:
|
2014-03-18 03:32:58 +00:00
|
|
|
/**
|
2017-03-25 09:21:39 +00:00
|
|
|
* when publish or unpublish stream.
|
|
|
|
*/
|
2017-03-18 13:29:08 +00:00
|
|
|
virtual int on_publish(SrsRequest* req);
|
2017-02-12 10:18:18 +00:00
|
|
|
virtual int on_unpublish();
|
2014-03-18 03:32:58 +00:00
|
|
|
/**
|
2017-03-25 09:21:39 +00:00
|
|
|
* when get sequence header,
|
|
|
|
* must write a #EXT-X-DISCONTINUITY to m3u8.
|
|
|
|
* @see: hls-m3u8-draft-pantos-http-live-streaming-12.txt
|
|
|
|
* @see: 3.4.11. EXT-X-DISCONTINUITY
|
|
|
|
*/
|
2017-02-12 10:18:18 +00:00
|
|
|
virtual int on_sequence_header();
|
2014-03-21 09:10:24 +00:00
|
|
|
/**
|
2017-03-25 09:21:39 +00:00
|
|
|
* write audio to cache, if need to flush, flush to muxer.
|
|
|
|
*/
|
2017-02-12 10:18:18 +00:00
|
|
|
virtual int write_audio(SrsAudioFrame* frame, int64_t pts);
|
2014-03-18 03:32:58 +00:00
|
|
|
/**
|
2017-03-25 09:21:39 +00:00
|
|
|
* write video to muxer.
|
|
|
|
*/
|
2017-02-12 10:18:18 +00:00
|
|
|
virtual int write_video(SrsVideoFrame* frame, int64_t dts);
|
2013-12-02 14:09:10 +00:00
|
|
|
private:
|
2014-03-20 10:55:45 +00:00
|
|
|
/**
|
2017-03-25 09:21:39 +00:00
|
|
|
* reopen the muxer for a new hls segment,
|
|
|
|
* close current segment, open a new segment,
|
|
|
|
* then write the key frame to the new segment.
|
|
|
|
* so, user must reap_segment then flush_video to hls muxer.
|
|
|
|
*/
|
2017-03-18 13:29:08 +00:00
|
|
|
virtual int reap_segment();
|
2013-12-02 14:09:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2017-03-25 09:21:39 +00:00
|
|
|
* Transmux RTMP stream to HLS(m3u8 and ts).
|
|
|
|
* TODO: FIXME: add utest for hls.
|
|
|
|
*/
|
2013-12-02 14:09:10 +00:00
|
|
|
class SrsHls
|
|
|
|
{
|
|
|
|
private:
|
2017-02-12 10:18:18 +00:00
|
|
|
SrsHlsController* controller;
|
2013-11-26 08:06:58 +00:00
|
|
|
private:
|
2015-09-15 07:58:57 +00:00
|
|
|
SrsRequest* req;
|
2017-02-11 13:14:28 +00:00
|
|
|
bool enabled;
|
|
|
|
bool disposable;
|
2015-05-30 06:41:09 +00:00
|
|
|
int64_t last_update_time;
|
2017-04-16 13:33:39 +00:00
|
|
|
private:
|
|
|
|
// If the diff=dts-previous_audio_dts is about 23,
|
|
|
|
// that's the AAC samples is 1024, and we use the samples to calc the dts.
|
|
|
|
int64_t previous_audio_dts;
|
|
|
|
// The total aac samples.
|
|
|
|
uint64_t aac_samples;
|
2015-05-30 06:41:09 +00:00
|
|
|
private:
|
2017-01-19 04:38:55 +00:00
|
|
|
SrsOriginHub* hub;
|
2014-03-18 03:32:58 +00:00
|
|
|
SrsRtmpJitter* jitter;
|
2015-02-19 10:56:21 +00:00
|
|
|
SrsPithyPrint* pprint;
|
2013-11-23 12:16:47 +00:00
|
|
|
public:
|
2015-02-27 12:39:36 +00:00
|
|
|
SrsHls();
|
2014-03-18 03:32:58 +00:00
|
|
|
virtual ~SrsHls();
|
2015-05-30 02:48:02 +00:00
|
|
|
public:
|
|
|
|
virtual void dispose();
|
2017-06-11 01:40:07 +00:00
|
|
|
virtual srs_error_t cycle();
|
2013-11-24 04:39:47 +00:00
|
|
|
public:
|
2015-02-27 12:39:36 +00:00
|
|
|
/**
|
2017-03-25 09:21:39 +00:00
|
|
|
* initialize the hls by handler and source.
|
|
|
|
*/
|
2017-06-11 01:40:07 +00:00
|
|
|
virtual srs_error_t initialize(SrsOriginHub* h, SrsRequest* r);
|
2014-03-18 03:32:58 +00:00
|
|
|
/**
|
2015-09-14 07:49:25 +00:00
|
|
|
* publish stream event, continue to write the m3u8,
|
|
|
|
* for the muxer object not destroyed.
|
|
|
|
* @param fetch_sequence_header whether fetch sequence from source.
|
|
|
|
*/
|
2017-02-11 13:14:28 +00:00
|
|
|
virtual int on_publish();
|
2014-03-18 03:32:58 +00:00
|
|
|
/**
|
2017-03-25 09:21:39 +00:00
|
|
|
* the unpublish event, only close the muxer, donot destroy the
|
|
|
|
* muxer, for when we continue to publish, the m3u8 will continue.
|
|
|
|
*/
|
2014-03-18 03:32:58 +00:00
|
|
|
virtual void on_unpublish();
|
|
|
|
/**
|
2017-03-25 09:21:39 +00:00
|
|
|
* mux the audio packets to ts.
|
|
|
|
* @param shared_audio, directly ptr, copy it if need to save it.
|
|
|
|
*/
|
2017-02-12 10:18:18 +00:00
|
|
|
virtual int on_audio(SrsSharedPtrMessage* shared_audio, SrsFormat* format);
|
2014-03-18 03:32:58 +00:00
|
|
|
/**
|
2015-09-14 10:36:44 +00:00
|
|
|
* mux the video packets to ts.
|
|
|
|
* @param shared_video, directly ptr, copy it if need to save it.
|
|
|
|
* @param is_sps_pps whether the video is h.264 sps/pps.
|
|
|
|
*/
|
2017-02-12 10:18:18 +00:00
|
|
|
// TODO: FIXME: Remove param is_sps_pps.
|
|
|
|
virtual int on_video(SrsSharedPtrMessage* shared_video, SrsFormat* format);
|
2013-12-05 15:34:26 +00:00
|
|
|
private:
|
2015-02-19 10:56:21 +00:00
|
|
|
virtual void hls_show_mux_log();
|
2013-11-23 12:16:47 +00:00
|
|
|
};
|
|
|
|
|
2013-11-27 14:41:58 +00:00
|
|
|
#endif
|