mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-07-06 11:38:11 +08:00
修复关闭HLS后,编译失败的问题
This commit is contained in:
@@ -15,11 +15,7 @@
|
||||
#include "TsMuxer.h"
|
||||
namespace mediakit {
|
||||
|
||||
class HlsRecorder : public MediaSourceEventInterceptor, public std::enable_shared_from_this<HlsRecorder>
|
||||
#if defined(ENABLE_HLS)
|
||||
, public TsMuxer
|
||||
#endif
|
||||
{
|
||||
class HlsRecorder : public MediaSourceEventInterceptor, public TsMuxer, public std::enable_shared_from_this<HlsRecorder> {
|
||||
public:
|
||||
typedef std::shared_ptr<HlsRecorder> Ptr;
|
||||
HlsRecorder(const string &m3u8_file, const string ¶ms){
|
||||
@@ -63,7 +59,6 @@ public:
|
||||
return _clear_cache ? true : _enabled;
|
||||
}
|
||||
|
||||
#if defined(ENABLE_HLS)
|
||||
void inputFrame(const Frame::Ptr &frame) override{
|
||||
if (_clear_cache) {
|
||||
_clear_cache = false;
|
||||
@@ -78,7 +73,6 @@ private:
|
||||
void onTs(const void *packet, int bytes, uint32_t timestamp, bool is_idr_fast_packet) override {
|
||||
_hls->inputData((char *) packet, bytes, timestamp, is_idr_fast_packet);
|
||||
}
|
||||
#endif
|
||||
|
||||
private:
|
||||
//默认不生成hls文件,有播放器时再生成
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
* may be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include "TsMuxer.h"
|
||||
#if defined(ENABLE_HLS)
|
||||
#include "TsMuxer.h"
|
||||
#include "mpeg-ts-proto.h"
|
||||
#include "mpeg-ts.h"
|
||||
#include "Extension/H264.h"
|
||||
@@ -183,5 +183,4 @@ void TsMuxer::uninit() {
|
||||
}
|
||||
|
||||
}//namespace mediakit
|
||||
|
||||
#endif// defined(ENABLE_HLS)
|
||||
@@ -11,6 +11,7 @@
|
||||
#ifndef TSMUXER_H
|
||||
#define TSMUXER_H
|
||||
|
||||
#if defined(ENABLE_HLS)
|
||||
#include <unordered_map>
|
||||
#include "Extension/Frame.h"
|
||||
#include "Extension/Track.h"
|
||||
@@ -72,4 +73,25 @@ private:
|
||||
};
|
||||
|
||||
}//namespace mediakit
|
||||
|
||||
#else
|
||||
|
||||
#include "Common/MediaSink.h"
|
||||
|
||||
namespace mediakit {
|
||||
class TsMuxer : public MediaSinkInterface {
|
||||
public:
|
||||
TsMuxer() {}
|
||||
~TsMuxer() override {}
|
||||
void addTrack(const Track::Ptr &track) override {}
|
||||
void resetTracks() override {}
|
||||
void inputFrame(const Frame::Ptr &frame) override {}
|
||||
|
||||
protected:
|
||||
virtual void onTs(const void *packet, int bytes,uint32_t timestamp,bool is_idr_fast_packet) = 0;
|
||||
};
|
||||
}//namespace mediakit
|
||||
|
||||
#endif// defined(ENABLE_HLS)
|
||||
|
||||
#endif //TSMUXER_H
|
||||
Reference in New Issue
Block a user