mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-29 14:45:55 +08:00
bug fixed
This commit is contained in:
parent
bd04b2e2ab
commit
71174f906b
@ -123,7 +123,6 @@ public:
|
|||||||
}, []() {
|
}, []() {
|
||||||
SDLDisplayerHelper::Destory();
|
SDLDisplayerHelper::Destory();
|
||||||
SDL_Quit();
|
SDL_Quit();
|
||||||
InfoL << "SDL_Quit";
|
|
||||||
});
|
});
|
||||||
|
|
||||||
_title = title;
|
_title = title;
|
||||||
|
@ -59,39 +59,38 @@ int main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MediaPlayer::Ptr player(new MediaPlayer());
|
{
|
||||||
player->setOnPlayResult([](const SockException &ex) {
|
MediaPlayer::Ptr player(new MediaPlayer());
|
||||||
InfoL << "OnPlayResult:" << ex.what();
|
player->setOnPlayResult([](const SockException &ex) {
|
||||||
});
|
InfoL << "OnPlayResult:" << ex.what();
|
||||||
player->setOnShutdown([](const SockException &ex) {
|
|
||||||
ErrorL << "OnShutdown:" << ex.what();
|
|
||||||
});
|
|
||||||
(*player)[RtspPlayer::kRtpType] = atoi(argv[2]);
|
|
||||||
player->play(argv[1]);
|
|
||||||
|
|
||||||
H264Decoder decoder;
|
|
||||||
YuvDisplayer displayer;
|
|
||||||
player->setOnVideoCB([&](const H264Frame &frame) {
|
|
||||||
SDLDisplayerHelper::Instance().doTask([&, frame]() {
|
|
||||||
AVFrame *pFrame = nullptr;
|
|
||||||
bool flag = decoder.inputVideo((unsigned char *) frame.data.data(), frame.data.size(), frame.timeStamp, &pFrame);
|
|
||||||
if (flag) {
|
|
||||||
//DebugL << pFrame->pkt_pts;
|
|
||||||
displayer.displayYUV(pFrame);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
});
|
});
|
||||||
});
|
player->setOnShutdown([](const SockException &ex) {
|
||||||
|
ErrorL << "OnShutdown:" << ex.what();
|
||||||
|
});
|
||||||
|
(*player)[RtspPlayer::kRtpType] = atoi(argv[2]);
|
||||||
|
player->play(argv[1]);
|
||||||
|
|
||||||
EventPoller::Instance().runLoop();
|
H264Decoder decoder;
|
||||||
|
YuvDisplayer displayer;
|
||||||
|
player->setOnVideoCB([&](const H264Frame &frame) {
|
||||||
|
SDLDisplayerHelper::Instance().doTask([&, frame]() {
|
||||||
|
AVFrame *pFrame = nullptr;
|
||||||
|
bool flag = decoder.inputVideo((unsigned char *) frame.data.data(), frame.data.size(), frame.timeStamp,
|
||||||
|
&pFrame);
|
||||||
|
if (flag) {
|
||||||
|
//DebugL << pFrame->pkt_pts;
|
||||||
|
displayer.displayYUV(pFrame);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
EventPoller::Instance().runLoop();
|
||||||
static onceToken token(nullptr, []() {
|
}
|
||||||
UDPServer::Destory();
|
UDPServer::Destory();
|
||||||
EventPoller::Destory();
|
EventPoller::Destory();
|
||||||
AsyncTaskThread::Destory();
|
AsyncTaskThread::Destory();
|
||||||
Logger::Destory();
|
Logger::Destory();
|
||||||
});
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user