ZLMediaKit/src/Http/TsPlayer.h

44 lines
1.1 KiB
C++
Raw Normal View History

2022-01-20 22:49:47 +08:00
/*
2022-01-04 15:32:59 +08:00
* Copyright (c) 2020 The ZLMediaKit project authors. All Rights Reserved.
2022-01-09 15:01:23 +08:00
* Created by alex on 2021/4/6.
2022-01-04 15:32:59 +08:00
* This file is part of ZLMediaKit(https://github.com/xia-chu/ZLMediaKit).
*
* Use of this source code is governed by MIT license that can be found in the
* LICENSE file in the root of the source tree. All contributing project authors
* may be found in the AUTHORS file in the root of the source tree.
*/
#ifndef HTTP_TSPLAYER_H
#define HTTP_TSPLAYER_H
2022-01-20 14:48:45 +08:00
#include "HttpTSPlayer.h"
2022-01-20 15:39:40 +08:00
#include "Player/PlayerBase.h"
2022-01-04 15:32:59 +08:00
namespace mediakit {
2022-01-20 14:48:45 +08:00
class TsPlayer : public HttpTSPlayer , public PlayerBase {
2022-01-09 15:01:23 +08:00
public:
TsPlayer(const toolkit::EventPoller::Ptr &poller);
2022-01-09 15:01:23 +08:00
~TsPlayer() override = default;
/**
*
*/
void play(const std::string &url) override;
2022-01-09 15:01:23 +08:00
/**
*
*/
void teardown() override;
protected:
2022-01-20 14:48:45 +08:00
void onResponseBody(const char *buf, size_t size) override;
void onResponseCompleted(const toolkit::SockException &ex) override;
2022-01-09 15:01:23 +08:00
private:
2022-01-20 14:48:45 +08:00
bool _play_result = true;
2022-01-09 15:01:23 +08:00
};
2022-01-20 14:48:45 +08:00
} // namespace mediakit
#endif // HTTP_TSPLAYER_H