mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-22 19:00:01 +08:00
Revert "Fix the issue of failing to push streams to FMS 3.0 server"
This reverts commit 3b7f16b755
.
This commit is contained in:
parent
f5ca61d235
commit
b05f515ccc
@ -165,14 +165,7 @@ void RtmpProtocol::sendResponse(int type, const string &str) {
|
|||||||
|
|
||||||
void RtmpProtocol::sendInvoke(const string &cmd, const AMFValue &val) {
|
void RtmpProtocol::sendInvoke(const string &cmd, const AMFValue &val) {
|
||||||
AMFEncoder enc;
|
AMFEncoder enc;
|
||||||
if (val.type() == AMFType::AMF_OBJECT || val.type() == AMFType::AMF_NULL)
|
|
||||||
{
|
|
||||||
enc << cmd << ++_send_req_id << val;
|
enc << cmd << ++_send_req_id << val;
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
enc << cmd << ++_send_req_id << AMFValue() << val;
|
|
||||||
}
|
|
||||||
sendRequest(MSG_CMD, enc.data());
|
sendRequest(MSG_CMD, enc.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -626,22 +619,12 @@ const char* RtmpProtocol::handle_rtmp(const char *data, size_t len) {
|
|||||||
case 12:
|
case 12:
|
||||||
chunk_data.is_abs_stamp = true;
|
chunk_data.is_abs_stamp = true;
|
||||||
chunk_data.stream_index = load_le32(header->stream_index);
|
chunk_data.stream_index = load_le32(header->stream_index);
|
||||||
_last_stream_index = chunk_data.stream_index;
|
|
||||||
case 8:
|
case 8:
|
||||||
chunk_data.body_size = load_be24(header->body_size);
|
chunk_data.body_size = load_be24(header->body_size);
|
||||||
chunk_data.type_id = header->type_id;
|
chunk_data.type_id = header->type_id;
|
||||||
_last_body_size = chunk_data.body_size;
|
|
||||||
_last_type_id = chunk_data.type_id;
|
|
||||||
case 4:
|
case 4:
|
||||||
chunk_data.ts_field = load_be24(header->time_stamp);
|
chunk_data.ts_field = load_be24(header->time_stamp);
|
||||||
}
|
}
|
||||||
switch (header->fmt) {
|
|
||||||
case 2:
|
|
||||||
chunk_data.type_id = _last_type_id;
|
|
||||||
chunk_data.body_size = _last_body_size;
|
|
||||||
case 1:
|
|
||||||
chunk_data.stream_index = _last_stream_index;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto time_stamp = chunk_data.ts_field;
|
auto time_stamp = chunk_data.ts_field;
|
||||||
if (chunk_data.ts_field == 0xFFFFFF) {
|
if (chunk_data.ts_field == 0xFFFFFF) {
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
#ifndef SRC_RTMP_RTMPPROTOCOL_H_
|
#ifndef SRC_RTMP_RTMPPROTOCOL_H_
|
||||||
#define SRC_RTMP_RTMPPROTOCOL_H_
|
#define SRC_RTMP_RTMPPROTOCOL_H_
|
||||||
|
|
||||||
#include <cstdint>
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
@ -88,9 +87,6 @@ protected:
|
|||||||
private:
|
private:
|
||||||
bool _data_started = false;
|
bool _data_started = false;
|
||||||
int _now_chunk_id = 0;
|
int _now_chunk_id = 0;
|
||||||
uint32_t _last_stream_index = 0;
|
|
||||||
size_t _last_body_size = 0;
|
|
||||||
uint8_t _last_type_id = 0;
|
|
||||||
////////////ChunkSize////////////
|
////////////ChunkSize////////////
|
||||||
size_t _chunk_size_in = DEFAULT_CHUNK_LEN;
|
size_t _chunk_size_in = DEFAULT_CHUNK_LEN;
|
||||||
size_t _chunk_size_out = DEFAULT_CHUNK_LEN;
|
size_t _chunk_size_out = DEFAULT_CHUNK_LEN;
|
||||||
|
@ -163,18 +163,6 @@ void RtmpPusher::send_connect() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void RtmpPusher::send_createStream() {
|
void RtmpPusher::send_createStream() {
|
||||||
// Workaround : 兼容较旧的 FMS3.0
|
|
||||||
{
|
|
||||||
{
|
|
||||||
AMFValue obj(_stream_id);
|
|
||||||
sendInvoke("releaseStream", obj);
|
|
||||||
}
|
|
||||||
{
|
|
||||||
AMFValue obj(_stream_id);
|
|
||||||
sendInvoke("FCPublish", obj);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
{
|
|
||||||
AMFValue obj(AMF_NULL);
|
AMFValue obj(AMF_NULL);
|
||||||
sendInvoke("createStream", obj);
|
sendInvoke("createStream", obj);
|
||||||
addOnResultCB([this](AMFDecoder &dec) {
|
addOnResultCB([this](AMFDecoder &dec) {
|
||||||
@ -183,8 +171,6 @@ void RtmpPusher::send_createStream() {
|
|||||||
_stream_index = dec.load<int>();
|
_stream_index = dec.load<int>();
|
||||||
send_publish();
|
send_publish();
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#define RTMP_STREAM_LIVE "live"
|
#define RTMP_STREAM_LIVE "live"
|
||||||
|
Loading…
Reference in New Issue
Block a user