mirror of
https://gitee.com/xia-chu/ZLMediaKit.git
synced 2026-05-26 03:27:49 +08:00
Compare commits
No commits in common. "5c58f39046c10094c1d3b0586fa81462beadbf38" and "07f8f46e8ae734c4169caab0731e0497b6e00c04" have entirely different histories.
5c58f39046
...
07f8f46e8a
@ -25,19 +25,16 @@
|
|||||||
#include "Http/HttpSession.h"
|
#include "Http/HttpSession.h"
|
||||||
#include "Shell/ShellSession.h"
|
#include "Shell/ShellSession.h"
|
||||||
#include "Player/PlayerProxy.h"
|
#include "Player/PlayerProxy.h"
|
||||||
|
#include "webrtc/WebRtcProxyPlayer.h"
|
||||||
|
#include "webrtc/WebRtcProxyPlayerImp.h"
|
||||||
|
#include "../webrtc/WebRtcSignalingPeer.h"
|
||||||
|
#include "../webrtc/WebRtcSignalingSession.h"
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace toolkit;
|
using namespace toolkit;
|
||||||
using namespace mediakit;
|
using namespace mediakit;
|
||||||
|
|
||||||
#ifdef ENABLE_WEBRTC
|
#ifdef ENABLE_WEBRTC
|
||||||
|
#include "../webrtc/WebRtcSession.h"
|
||||||
#include "webrtc/WebRtcProxyPlayer.h"
|
|
||||||
#include "webrtc/WebRtcProxyPlayerImp.h"
|
|
||||||
#include "webrtc/WebRtcSignalingPeer.h"
|
|
||||||
#include "webrtc/WebRtcSignalingSession.h"
|
|
||||||
#include "webrtc/WebRtcSession.h"
|
|
||||||
|
|
||||||
static UdpServer::Ptr rtcServer_udp;
|
static UdpServer::Ptr rtcServer_udp;
|
||||||
static TcpServer::Ptr rtcServer_tcp;
|
static TcpServer::Ptr rtcServer_tcp;
|
||||||
class WebRtcArgsUrl : public mediakit::WebRtcArgs {
|
class WebRtcArgsUrl : public mediakit::WebRtcArgs {
|
||||||
@ -187,4 +184,4 @@ API_EXPORT void API_CALL mk_webrtc_list_rooms(on_mk_webrtc_room_keeper_data_cb c
|
|||||||
#else
|
#else
|
||||||
WarnL << "未启用webrtc功能, 编译时请开启ENABLE_WEBRTC";
|
WarnL << "未启用webrtc功能, 编译时请开启ENABLE_WEBRTC";
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -2612,18 +2612,6 @@
|
|||||||
"description": "是否循环点播mp4文件,如果配置文件已经开启循环点播,此参数无效",
|
"description": "是否循环点播mp4文件,如果配置文件已经开启循环点播,此参数无效",
|
||||||
"disabled": true
|
"disabled": true
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"key": "seek_ms",
|
|
||||||
"value": "0",
|
|
||||||
"description": "点播seek到特定位置,单位毫秒",
|
|
||||||
"disabled": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "speed",
|
|
||||||
"value": "1.0",
|
|
||||||
"description": "播放速度, float类型",
|
|
||||||
"disabled": true
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"key": "enable_hls",
|
"key": "enable_hls",
|
||||||
"value": "",
|
"value": "",
|
||||||
|
|||||||
@ -391,7 +391,6 @@ Value makeMediaSourceJson(MediaSource &media){
|
|||||||
item["schema"] = media.getSchema();
|
item["schema"] = media.getSchema();
|
||||||
dumpMediaTuple(media.getMediaTuple(), item);
|
dumpMediaTuple(media.getMediaTuple(), item);
|
||||||
item["createStamp"] = (Json::UInt64) media.getCreateStamp();
|
item["createStamp"] = (Json::UInt64) media.getCreateStamp();
|
||||||
item["currentStamp"] = (Json::UInt64) media.getTimeStamp(TrackInvalid);
|
|
||||||
item["aliveSecond"] = (Json::UInt64) media.getAliveSecond();
|
item["aliveSecond"] = (Json::UInt64) media.getAliveSecond();
|
||||||
item["bytesSpeed"] = (Json::UInt64) media.getBytesSpeed();
|
item["bytesSpeed"] = (Json::UInt64) media.getBytesSpeed();
|
||||||
item["totalBytes"] = (Json::UInt64) media.getTotalBytes();
|
item["totalBytes"] = (Json::UInt64) media.getTotalBytes();
|
||||||
@ -909,24 +908,12 @@ void installWebApi() {
|
|||||||
// Test url1 (get streams with virtual host "__defaultVost__") http://127.0.0.1/index/api/getMediaList?vhost=__defaultVost__
|
// Test url1 (get streams with virtual host "__defaultVost__") http://127.0.0.1/index/api/getMediaList?vhost=__defaultVost__
|
||||||
// 测试url2(获取rtsp类型的流) http://127.0.0.1/index/api/getMediaList?schema=rtsp [AUTO-TRANSLATED:21c2c15d]
|
// 测试url2(获取rtsp类型的流) http://127.0.0.1/index/api/getMediaList?schema=rtsp [AUTO-TRANSLATED:21c2c15d]
|
||||||
// Test url2 (get rtsp type streams) http://127.0.0.1/index/api/getMediaList?schema=rtsp
|
// Test url2 (get rtsp type streams) http://127.0.0.1/index/api/getMediaList?schema=rtsp
|
||||||
api_regist("/index/api/getMediaList",[](API_ARGS_MAP_ASYNC){
|
api_regist("/index/api/getMediaList",[](API_ARGS_MAP){
|
||||||
CHECK_SECRET();
|
CHECK_SECRET();
|
||||||
// 获取所有MediaSource列表 [AUTO-TRANSLATED:7bf16dc2]
|
// 获取所有MediaSource列表 [AUTO-TRANSLATED:7bf16dc2]
|
||||||
// Get all MediaSource lists
|
// Get all MediaSource lists
|
||||||
bool first = true;
|
|
||||||
std::shared_ptr<Json::Value> done(new Json::Value(val), [invoker, headerOut](Json::Value *val) {
|
|
||||||
invoker(200, headerOut, val->toStyledString());
|
|
||||||
delete val;
|
|
||||||
});
|
|
||||||
MediaSource::for_each_media([&](const MediaSource::Ptr &media) {
|
MediaSource::for_each_media([&](const MediaSource::Ptr &media) {
|
||||||
if (first) {
|
val["data"].append(makeMediaSourceJson(*media));
|
||||||
first = false;
|
|
||||||
media->getOwnerPoller()->async([media, done]() mutable {
|
|
||||||
(*done)["data"].append(makeMediaSourceJson(*media));
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
(*done)["data"].append(makeMediaSourceJson(*media));
|
|
||||||
}
|
|
||||||
}, allArgs["schema"], allArgs["vhost"], allArgs["app"], allArgs["stream"]);
|
}, allArgs["schema"], allArgs["vhost"], allArgs["app"], allArgs["stream"]);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -2264,19 +2251,6 @@ void installWebApi() {
|
|||||||
// sample_ms设置为0,从配置文件加载;file_repeat可以指定,如果配置文件也指定循环解复用,那么强制开启 [AUTO-TRANSLATED:23e826b4]
|
// sample_ms设置为0,从配置文件加载;file_repeat可以指定,如果配置文件也指定循环解复用,那么强制开启 [AUTO-TRANSLATED:23e826b4]
|
||||||
// sample_ms is set to 0, loaded from the configuration file; file_repeat can be specified, if the configuration file also specifies loop demultiplexing, then force it to be enabled
|
// sample_ms is set to 0, loaded from the configuration file; file_repeat can be specified, if the configuration file also specifies loop demultiplexing, then force it to be enabled
|
||||||
reader->startReadMP4(0, true, allArgs["file_repeat"]);
|
reader->startReadMP4(0, true, allArgs["file_repeat"]);
|
||||||
auto seek_ms = allArgs["seek_ms"].as<uint32_t>();
|
|
||||||
auto speed = allArgs["speed"].as<float>();
|
|
||||||
if (seek_ms || speed) {
|
|
||||||
auto p = static_pointer_cast<MediaSourceEvent>(reader);
|
|
||||||
p->getOwnerPoller(MediaSource::NullMediaSource())->async([seek_ms, speed, p]() {
|
|
||||||
if (seek_ms) {
|
|
||||||
p->seekTo(MediaSource::NullMediaSource(), seek_ms);
|
|
||||||
}
|
|
||||||
if (speed && speed != 1.0) {
|
|
||||||
p->speed(MediaSource::NullMediaSource(), speed);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
val["data"]["duration_ms"] = (Json::UInt64)reader->getDemuxer()->getDurationMS();
|
val["data"]["duration_ms"] = (Json::UInt64)reader->getDemuxer()->getDurationMS();
|
||||||
});
|
});
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -132,7 +132,7 @@ public:
|
|||||||
|
|
||||||
* [AUTO-TRANSLATED:24b0ee74]
|
* [AUTO-TRANSLATED:24b0ee74]
|
||||||
*/
|
*/
|
||||||
virtual uint16_t getSequence(TrackType trackType) {
|
virtual uint16_t getSeqence(TrackType trackType) {
|
||||||
assert(trackType >= 0 && trackType < TrackMax);
|
assert(trackType >= 0 && trackType < TrackMax);
|
||||||
auto &track = _tracks[trackType];
|
auto &track = _tracks[trackType];
|
||||||
if (!track) {
|
if (!track) {
|
||||||
|
|||||||
@ -437,7 +437,7 @@ void RtspSession::onAuthSuccess() {
|
|||||||
strong_self->_play_src = rtsp_src;
|
strong_self->_play_src = rtsp_src;
|
||||||
for(auto &track : strong_self->_sdp_track){
|
for(auto &track : strong_self->_sdp_track){
|
||||||
track->_ssrc = rtsp_src->getSsrc(track->_type);
|
track->_ssrc = rtsp_src->getSsrc(track->_type);
|
||||||
track->_seq = rtsp_src->getSequence(track->_type);
|
track->_seq = rtsp_src->getSeqence(track->_type);
|
||||||
track->_time_stamp = rtsp_src->getTimeStamp(track->_type);
|
track->_time_stamp = rtsp_src->getTimeStamp(track->_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -832,7 +832,7 @@ void RtspSession::handleReq_Play(const Parser &parser) {
|
|||||||
}
|
}
|
||||||
inited_tracks.emplace_back(track->_type);
|
inited_tracks.emplace_back(track->_type);
|
||||||
track->_ssrc = play_src->getSsrc(track->_type);
|
track->_ssrc = play_src->getSsrc(track->_type);
|
||||||
track->_seq = play_src->getSequence(track->_type);
|
track->_seq = play_src->getSeqence(track->_type);
|
||||||
track->_time_stamp = play_src->getTimeStamp(track->_type);
|
track->_time_stamp = play_src->getTimeStamp(track->_type);
|
||||||
|
|
||||||
rtp_info << "url=" << track->getControlUrl(_content_base) << ";"
|
rtp_info << "url=" << track->getControlUrl(_content_base) << ";"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user