重写http客户端异常处理机制

This commit is contained in:
ziyue
2022-01-20 14:48:45 +08:00
parent 0f905b7333
commit 88dc8d0a73
20 changed files with 300 additions and 560 deletions

View File

@@ -11,19 +11,19 @@
#ifndef HTTP_TSPLAYER_H
#define HTTP_TSPLAYER_H
#include <unordered_set>
#include "Util/util.h"
#include "Poller/Timer.h"
#include "Http/HttpDownloader.h"
#include "HttpTSPlayer.h"
#include "Player/MediaPlayer.h"
#include "Poller/Timer.h"
#include "Rtp/Decoder.h"
#include "Rtp/TSDecoder.h"
#include "HttpTSPlayer.h"
#include "Util/util.h"
#include <unordered_set>
using namespace toolkit;
namespace mediakit {
class TsPlayer : public HttpTSPlayer, public PlayerBase {
class TsPlayer : public HttpTSPlayer , public PlayerBase {
public:
TsPlayer(const EventPoller::Ptr &poller);
~TsPlayer() override = default;
@@ -38,18 +38,13 @@ public:
*/
void teardown() override;
private:
void playTs();
protected:
virtual void onResponseCompleted() override;
virtual void onDisconnect(const SockException &ex) override;
virtual ssize_t onResponseHeader(const string &status, const HttpHeader &header) override;
void onResponseBody(const char *buf, size_t size) override;
void onResponseCompleted(const SockException &ex) override;
private:
bool _first = true;
string _ts_url;
bool _play_result = true;
};
}//namespace mediakit
#endif //HTTP_TSPLAYER_H
} // namespace mediakit
#endif // HTTP_TSPLAYER_H