restart
git-svn-id: http://192.168.1.226/svn/proxy@764 454eff88-639b-444f-9e54-f578c98de674
| | |
| | | void PL_AndroidMediaCodecDecoder::finit()
|
| | | {
|
| | | PL_AMCD_Internal* in = (PL_AMCD_Internal*)internal;
|
| | | //todo release codec
|
| | | // call AMediaCodec_stop
|
| | |
|
| | | AMediaCodec_stop(in->codec);
|
| | | AMediaCodec_delete(in->codec);
|
| | |
|
| | | in->reset();
|
| | | }
|
| | |
|
| | | bool PL_AndroidMediaCodecDecoder::pay(const PipeMaterial& pm)
|
| | |
| | |
|
| | | RtspClientParam lastParam;
|
| | |
|
| | | volatile bool killed;
|
| | |
|
| | | RTSPClient_Internal() :
|
| | | rtspConfig(), live_daemon_thid(0),
|
| | | eventLoopWatchVariable(0), live_daemon_running(false),
|
| | | frame_mutex(new pthread_mutex_t), continue_mutex(new pthread_mutex_t),
|
| | | lastFrame(), lastParam()
|
| | | lastFrame(), lastParam(), killed(false)
|
| | | {
|
| | | pthread_mutex_init(frame_mutex, NULL);
|
| | | pthread_mutex_init(continue_mutex, NULL);
|
| | |
| | | RTSPClient_Internal* in = (RTSPClient_Internal*)internal;
|
| | |
|
| | | in->eventLoopWatchVariable = 1;
|
| | |
|
| | | pthread_mutex_unlock(in->continue_mutex);
|
| | | pthread_mutex_unlock(in->frame_mutex);
|
| | |
|
| | | pthread_join(in->live_daemon_thid, NULL);
|
| | |
|
| | | in->reset();
|
| | | }
|
| | |
|
| | | bool PL_RTSPClient::pay(const PipeMaterial& pm)
|
| | |
| | | return false;
|
| | | }
|
| | |
|
| | | if (in->killed)
|
| | | {
|
| | | LOGP(WARN, "killed 1");
|
| | | return false;
|
| | | }
|
| | |
|
| | | ret = pthread_mutex_lock(in->frame_mutex);
|
| | | if(ret != 0)
|
| | | {
|
| | | LOGP(ERROR, "pthread_mutex_lock: %s/n", strerror(ret));
|
| | | return false;
|
| | | }
|
| | |
|
| | | if (in->killed)
|
| | | {
|
| | | LOGP(WARN, "killed 2");
|
| | | return false;
|
| | | }
|
| | |
|
| | |
| | | pm.former = this;
|
| | |
|
| | | return true;
|
| | | }
|
| | |
|
| | | void PL_RTSPClient::kill()
|
| | | {
|
| | | RTSPClient_Internal* in = (RTSPClient_Internal*)internal;
|
| | | in->killed = true;
|
| | | pthread_mutex_unlock(in->frame_mutex);
|
| | | }
|
| | |
|
| | | void rtsp_client_set_param_callback(void* arg, RtspClientParam& param)
|
| | |
| | | int ret = pthread_mutex_lock(in->continue_mutex);
|
| | | if(ret != 0)
|
| | | {
|
| | | LOG_ERROR << "pthread_mutex_unlock continue_mutex: " << strerror(ret) << std::endl;
|
| | | LOG_ERROR << "pthread_mutex_lock continue_mutex: " << strerror(ret) << std::endl;
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | virtual bool pay(const PipeMaterial& pm);
|
| | | virtual bool gain(PipeMaterial& pm);
|
| | |
|
| | | // kill locks internal
|
| | | void kill();
|
| | |
|
| | | private:
|
| | | void* internal;
|
| | |
| | | // destroy track handle
|
| | | cv_face_destroy_tracker(in->handle_track);
|
| | | in->handle_track = nullptr;
|
| | |
|
| | | in->reset();
|
| | | }
|
| | |
|
| | | static void test_dump_feature(cv_face_t* p_face, int face_count)
|
| | |
| | | int doFaceTrack(PL_SensetimeFaceTrack_Internal* in,
|
| | | uint8_t* buffer, size_t width, size_t height, size_t stride, cv_pixel_format cvPixFmt)
|
| | | {
|
| | | PipeLineElemTimingDebugger td(nullptr);
|
| | | //PipeLineElemTimingDebugger td(nullptr);
|
| | |
|
| | | if (in->config.doTrackPerFrame == 0)
|
| | | return 0;
|
| | |
| | | return true;
|
| | | }
|
| | |
|
| | |
|
| | | //static
|
| | | bool PipeLine::register_global_elem_creator(const std::string& type, elem_create_func_t func)
|
| | | {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | PipeLineElem* PipeLine::at(int idx)
|
| | | {
|
| | | return elems[idx];
|
| | | }
|
| | |
|
| | | bool PipeLine::remove_elem(PipeLineElem* elem)
|
| | | {
|
| | | if(elem != nullptr)
|
| | |
| | | return false;
|
| | | }
|
| | |
|
| | | void PipeLine::finit(elem_destory_func_t elem_destory_func)
|
| | | {
|
| | | while (!elems.empty())
|
| | | {
|
| | | PipeLineElem* elem = elems.back();
|
| | |
|
| | | if (elem->manager == this)
|
| | | {
|
| | | elem->finit();
|
| | | if (elem_destory_func != nullptr)
|
| | | elem_destory_func(elem);
|
| | | }
|
| | |
|
| | | elems.pop_back();
|
| | | }
|
| | |
|
| | | elem_create_func_map.clear();
|
| | | params_map.clear();
|
| | | }
|
| | |
|
| | | bool PipeLine::check_pipe_complete(PipeLineElem* lastRetElem) const
|
| | | {
|
| | | if (elems.empty())
|
| | |
| | | }; |
| | | |
| | | typedef PipeLineElem* (*elem_create_func_t)(); |
| | | typedef void (*elem_destory_func_t)(PipeLineElem* elem); |
| | | |
| | | // 0 (there is no elem). do nothing |
| | | // 1 (there is one elem). gain --> pm.deleter |
| | |
| | | PipeLineElem* push_elem(const std::string& type); |
| | | void push_front_elem(PipeLineElem* elem); |
| | | bool remove_elem(PipeLineElem* elem); |
| | | PipeLineElem* at(int idx); |
| | | |
| | | void finit(elem_destory_func_t elem_destory_func); |
| | | |
| | | bool check_pipe_complete(PipeLineElem* lastRetElem) const; |
| | | |
| | | // do pipe sync. returns the element who returns false, or the last one. |
| | | // if false return, the element should deal with pm, clean up. |
| | | PipeLineElem* pipe(PipeMaterial* pm = nullptr); |
| | | |
| | | // do pipe async |
| | | void pipe_start(); |
| | | void pipe_notify(PipeLineElem*); |
| | | void pipe_stop(); |
| | | |
| | | void set_param(const std::string& name, const std::string& value); |
| | | std::string get_param(const std::string& name) const; |