| | |
| | | #include "PL_RTSPServer.h"
|
| | | #include "MaterialBuffer.h"
|
| | | #include "logger.h"
|
| | |
|
| | | #include <liveMedia.hh>
|
| | | #include <BasicUsageEnvironment.hh>
|
| | |
| | | *FrameBuffer = pBuffer;
|
| | | *FrameSize = newBufferSize;
|
| | |
|
| | | printf("send frame size=%u\n", in.buffSize);
|
| | | LOG(DEBUG) << "send frame size=" << in.buffSize;
|
| | | }
|
| | |
|
| | | virtual char ReleaseFrame()
|
| | |
| | | int ret = pthread_mutex_unlock(in.frame_mutex);
|
| | | if(ret != 0)
|
| | | {
|
| | | printf("pthread_mutex_unlock frame_mutex: %s/n", strerror(ret));
|
| | | LOG(WARN) << "pthread_mutex_unlock frame_mutex: " << strerror(ret);
|
| | | return 0;
|
| | | }
|
| | | }
|
| | |
| | | int ret = pthread_mutex_lock(in.frame_mutex);
|
| | | if(ret != 0)
|
| | | {
|
| | | printf("pthread_mutex_lock frame_mutex: %s/n", strerror(ret));
|
| | | LOG(WARN) << "pthread_mutex_lock frame_mutex: " << strerror(ret);
|
| | | return;
|
| | | }
|
| | | }
|
| | |
| | | int ret = pthread_create(&(in->live_daemon_thid), NULL, live_daemon_thd, in);
|
| | | if(ret != 0)
|
| | | {
|
| | | printf("pthread_create: %s/n", strerror(ret));
|
| | | LOG(ERROR) << "pthread_create: " << strerror(ret);
|
| | | return false;
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | RTSPServer_Internal* in = (RTSPServer_Internal*)internal;
|
| | |
|
| | | if (pm.buffer == nullptr || pm.buffSize <= 0)
|
| | | if (pm.buffer == nullptr)
|
| | | return false;
|
| | |
|
| | | if (pm.type != PipeMaterial::PMT_FRAME)
|
| | | {
|
| | | printf("PL_RTSPServer::pay only support PMT_FRAME\n");
|
| | | LOG(ERROR) << "PL_RTSPServer::pay only support PMT_FRAME";
|
| | | return false;
|
| | | }
|
| | |
|
| | | if (in->buffSize > 0)
|
| | | printf("PL_RTSPServer::pay may lost data size=%u\n", in->buffSize);
|
| | | LOG(WARN) << "PL_RTSPServer::pay may lost data size=" << in->buffSize;
|
| | |
|
| | | MB_Frame* frame = (MB_Frame*)pm.buffer;
|
| | | if (frame->buffer == nullptr)
|
| | | return false;
|
| | | memcpy(in->buffer, frame->buffer, frame->buffSize);
|
| | | in->buffSize = frame->buffSize;
|
| | |
|
| | |
| | | {
|
| | | RTSPServer_Internal* in = (RTSPServer_Internal*)internal;
|
| | |
|
| | | pm.type = PipeMaterial::PMT_NONE;
|
| | | pm.buffer = nullptr;
|
| | | pm.buffSize = 0;
|
| | | pm.former = this;
|