rtsp/http类型播放协议支持自定义header

This commit is contained in:
xia-chu
2025-09-10 21:51:26 +08:00
parent 88b422db08
commit a8f5cedd84
8 changed files with 40 additions and 15 deletions

View File

@@ -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>;