| | |
| | | void rtsp_client_fmtp_callback(void* arg, const char* val);
|
| | | void rtsp_client_frame_callback(void* arg, uint8_t* buffer, size_t buffSize);
|
| | | void rtsp_client_continue_callback(void* arg);
|
| | | //struct RTSPConfig;
|
| | | #include "live555/testProgs/testRTSPClient.hpp"
|
| | |
|
| | | struct RTSPClient_Internal
|
| | | {
|
| | | PL_RTSPClient* client;
|
| | | RTSPConfig rtspConfig;
|
| | | pthread_t live_daemon_thid;
|
| | | char eventLoopWatchVariable;
|
| | |
| | | size_t lastBuffSize;
|
| | |
|
| | | RTSPClient_Internal() :
|
| | | client(nullptr), rtspConfig(), live_daemon_thid(0), |
| | | rtspConfig(), live_daemon_thid(0), |
| | | eventLoopWatchVariable(0), live_daemon_running(false),
|
| | | frame_mutex(new pthread_mutex_t), continue_mutex(new pthread_mutex_t),
|
| | | lastBuffer(nullptr), lastBuffSize(0)
|
| | |
| | |
|
| | | void reset()
|
| | | {
|
| | | client = nullptr;
|
| | | rtspConfig.progName = "";
|
| | | rtspConfig.rtspURL = "";
|
| | | RTSPConfig _rtspConfig;
|
| | | rtspConfig = _rtspConfig;
|
| | | live_daemon_thid = 0;
|
| | | eventLoopWatchVariable = 0;
|
| | | live_daemon_running = false;
|
| | |
| | | }
|
| | | };
|
| | |
|
| | | void* live_daemon_thd(void* arg)
|
| | | static void* live_daemon_thd(void* arg)
|
| | | {
|
| | | RTSPClient_Internal* in = (RTSPClient_Internal*)arg;
|
| | |
|
| | |
| | |
|
| | | usage(*env, in->rtspConfig.progName.c_str());
|
| | |
|
| | | openURL(*env, in->client, in->rtspConfig.progName.c_str(), in->rtspConfig.rtspURL.c_str());
|
| | | openURL(*env, in->rtspConfig);
|
| | |
|
| | | in->live_daemon_running = true;
|
| | | env->taskScheduler().doEventLoop(&(in->eventLoopWatchVariable));
|
| | |
| | | const RTSPConfig* config = reinterpret_cast<const RTSPConfig*>(args);
|
| | | RTSPClient_Internal* in = (RTSPClient_Internal*)internal;
|
| | | in->reset();
|
| | | in->client = this;
|
| | | in->rtspConfig = *config;
|
| | | in->rtspConfig.args = this;
|
| | |
|
| | | int ret = pthread_mutex_lock(in->frame_mutex);
|
| | | if(ret != 0)
|