ZLMediaKit/src/Rtp/PSDecoder.h

46 lines
1.2 KiB
C++
Raw Normal View History

2019-12-05 19:20:12 +08:00
/*
2020-04-04 20:30:09 +08:00
* Copyright (c) 2016 The ZLMediaKit project authors. All Rights Reserved.
2019-12-06 11:54:10 +08:00
*
* This file is part of ZLMediaKit(https://github.com/xia-chu/ZLMediaKit).
2019-12-06 11:54:10 +08:00
*
2020-04-04 20:30:09 +08:00
* 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.
2019-12-06 11:54:10 +08:00
*/
2019-12-05 19:20:12 +08:00
2019-12-06 11:54:10 +08:00
#ifndef ZLMEDIAKIT_PSDECODER_H
#define ZLMEDIAKIT_PSDECODER_H
2019-12-05 19:20:12 +08:00
2019-12-06 11:54:10 +08:00
#if defined(ENABLE_RTPPROXY)
#include <stdint.h>
2020-03-06 13:00:06 +08:00
#include "Decoder.h"
2021-07-18 15:02:48 +08:00
#include "Http/HttpRequestSplitter.h"
2019-12-06 11:54:10 +08:00
namespace mediakit{
2019-12-05 19:20:12 +08:00
2020-03-06 13:00:06 +08:00
//ps解析器
2021-07-18 15:02:48 +08:00
class PSDecoder : public Decoder, private HttpRequestSplitter {
2019-12-05 19:20:12 +08:00
public:
PSDecoder();
2020-03-06 13:00:06 +08:00
~PSDecoder();
2021-07-18 15:02:48 +08:00
2021-02-09 14:01:10 +08:00
ssize_t input(const uint8_t* data, size_t bytes) override;
void setOnDecode(onDecode cb) override;
void setOnStream(onStream cb) override;
2021-07-18 15:02:48 +08:00
// HttpRequestSplitter interface
private:
using HttpRequestSplitter::input;
const char *onSearchPacketTail(const char *data, size_t len) override;
ssize_t onRecvHeader(const char *, size_t) override { return 0; };
2019-12-05 19:20:12 +08:00
private:
2019-12-06 11:54:10 +08:00
void *_ps_demuxer = nullptr;
2020-03-06 13:00:06 +08:00
onDecode _on_decode;
onStream _on_stream;
2019-12-05 19:20:12 +08:00
};
2019-12-06 11:54:10 +08:00
}//namespace mediakit
#endif//defined(ENABLE_RTPPROXY)
#endif //ZLMEDIAKIT_PSDECODER_H