mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-18 06:02:21 +08:00
rtsp/http类型播放协议支持自定义header
This commit is contained in:
@@ -21,9 +21,22 @@
|
||||
#include "Common/MediaSink.h"
|
||||
#include "Extension/Frame.h"
|
||||
#include "Extension/Track.h"
|
||||
#include "Common/config.h"
|
||||
#include "Common/Parser.h"
|
||||
|
||||
namespace mediakit {
|
||||
|
||||
template <typename Type>
|
||||
void addCustomHeader(Type *c) {
|
||||
auto &custom_header = (*c)[Client::kCustomHeader];
|
||||
if (!custom_header.empty()) {
|
||||
auto args = mediakit::Parser::parseArgs(custom_header);
|
||||
for (auto &pr : args) {
|
||||
c->addHeader(pr.first, pr.second);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class PlayerBase : public TrackSource, public toolkit::mINI {
|
||||
public:
|
||||
using Ptr = std::shared_ptr<PlayerBase>;
|
||||
|
||||
Reference in New Issue
Block a user