|
|
|
@ -1236,7 +1236,7 @@ bool kernelModuleEmbedVideo::stopService( bool force ){ |
|
|
|
LOG( tB ); |
|
|
|
|
|
|
|
#endif
|
|
|
|
for( vectorHANDLERS::iterator index = m_vHandlersPool.begin(); index < m_vHandlersPool.end(); index++ ) { |
|
|
|
for( vectorHANDLERS::iterator index = m_vHandlersPool.begin(); index != m_vHandlersPool.end(); index++ ) { |
|
|
|
if( force ) { |
|
|
|
#ifdef DEBUG_EXTRA
|
|
|
|
LOG("Force Client Handler to Stop!"); |
|
|
|
@ -1258,9 +1258,8 @@ bool kernelModuleEmbedVideo::stopService( bool force ){ |
|
|
|
#ifdef DEBUG_EXTRA
|
|
|
|
LOG("Some Caps!"); |
|
|
|
#endif
|
|
|
|
for( mapSTREAMCAPS::iterator idx = m_mapCAPTURES.begin(); idx != m_mapCAPTURES.end(); idx++ ) idx->second.clear(); |
|
|
|
m_mapCAPTURES.clear(); |
|
|
|
//for( mapSTREAMCAPS::iterator idx = m_mapCAPTURES.begin(); idx < m_mapCAPTURES.end(); idx++ ) {
|
|
|
|
//};
|
|
|
|
#ifdef DEBUG_EXTRA
|
|
|
|
LOG("No More Caps!"); |
|
|
|
#endif
|
|
|
|
@ -3809,7 +3808,7 @@ void streamHandler::m_fThreadProc( void ){ |
|
|
|
}; |
|
|
|
|
|
|
|
if ( nQueueSize ) { |
|
|
|
#else
|
|
|
|
#else //!EVE_ENABLE_EASE_OUTPUT_FPS
|
|
|
|
if ( nQueueSize ) { |
|
|
|
#endif
|
|
|
|
m_mEncodingQueueProtector.lock(); |
|
|
|
@ -3851,31 +3850,23 @@ void streamHandler::m_fThreadProc( void ){ |
|
|
|
free( tData->data ); |
|
|
|
free( tData ); |
|
|
|
#ifdef EVE_ENABLE_EASE_OUTPUT_FPS
|
|
|
|
if( !bSkeepA ){ |
|
|
|
if( !bSkeepA ) |
|
|
|
#endif
|
|
|
|
if (m_bSegAActive) { |
|
|
|
if ( m_pEncoderA->isOpened() ) { |
|
|
|
m_pEncoderA->write( image ); |
|
|
|
m_mFrameCounterProtector.lock(); |
|
|
|
m_nSegAFrameCounter++; |
|
|
|
m_mFrameCounterProtector.unlock(); |
|
|
|
}; |
|
|
|
}; |
|
|
|
#ifdef EVE_ENABLE_EASE_OUTPUT_FPS
|
|
|
|
if (m_bSegAActive) if ( m_pEncoderA->isOpened() ) { |
|
|
|
m_pEncoderA->write( image ); |
|
|
|
m_mFrameCounterProtector.lock(); |
|
|
|
m_nSegAFrameCounter++; |
|
|
|
m_mFrameCounterProtector.unlock(); |
|
|
|
}; |
|
|
|
if( !bSkeepB ){ |
|
|
|
#endif
|
|
|
|
if ( m_bSegBActive ) { |
|
|
|
if ( m_pEncoderB->isOpened() ) { |
|
|
|
m_pEncoderB->write( image ); |
|
|
|
m_mFrameCounterProtector.lock(); |
|
|
|
m_nSegBFrameCounter++; |
|
|
|
m_mFrameCounterProtector.unlock(); |
|
|
|
}; |
|
|
|
}; |
|
|
|
#ifdef EVE_ENABLE_EASE_OUTPUT_FPS
|
|
|
|
}; |
|
|
|
if( !bSkeepB ) |
|
|
|
#endif
|
|
|
|
if ( m_bSegBActive ) if ( m_pEncoderB->isOpened() ) { |
|
|
|
m_pEncoderB->write( image ); |
|
|
|
m_mFrameCounterProtector.lock(); |
|
|
|
m_nSegBFrameCounter++; |
|
|
|
m_mFrameCounterProtector.unlock(); |
|
|
|
}; |
|
|
|
#else // !OPENCV_VIDEO_OUTPUT
|
|
|
|
//av_frame_make_writable( m_pAVFrame );
|
|
|
|
//m_qEncodingQueue.pop();
|
|
|
|
@ -3906,17 +3897,13 @@ void streamHandler::m_fThreadProc( void ){ |
|
|
|
}; |
|
|
|
m_pAVFrame->pts = m_nGlobalFrameCounter + 1; |
|
|
|
#ifdef SEPARATED_VIDEO_ENCODERS
|
|
|
|
//if( m_bSegAActive ) {
|
|
|
|
rVal = avcodec_send_frame(m_pCodecACtx, m_pAVFrame ); |
|
|
|
//};
|
|
|
|
//if( m_bSegBActive ) {
|
|
|
|
// rVal = avcodec_send_frame(m_pCodecBCtx, m_pAVFrame );
|
|
|
|
//};
|
|
|
|
#else // SEPARATED_VIDEO_ENCODERS
|
|
|
|
if( m_bSegAActive ) rVal = avcodec_send_frame( m_pCodecACtx, m_pAVFrame ); |
|
|
|
if( m_bSegBActive ) rVal = avcodec_send_frame( m_pCodecBCtx, m_pAVFrame ); |
|
|
|
#else //!SEPARATED_VIDEO_ENCODERS
|
|
|
|
rVal = avcodec_send_frame( m_pCodecCtx, m_pAVFrame ); |
|
|
|
#endif // SEPARATED_VIDEO_ENCODERS
|
|
|
|
#endif // !OPENCV_VIDEO_OUTPUT
|
|
|
|
#endif // !DIRECT_MJPEG_COMPOSING
|
|
|
|
#endif //!SEPARATED_VIDEO_ENCODERS
|
|
|
|
#endif //!OPENCV_VIDEO_OUTPUT
|
|
|
|
#endif //!DIRECT_MJPEG_COMPOSING
|
|
|
|
m_mFrameCounterProtector.lock(); |
|
|
|
m_nGlobalFrameCounter++; |
|
|
|
m_mFrameCounterProtector.unlock(); |
|
|
|
@ -3937,7 +3924,7 @@ void streamHandler::m_fThreadProc( void ){ |
|
|
|
fclose( m_pOutputFD[0] ); |
|
|
|
m_pOutputFD[0] = NULL; |
|
|
|
}; |
|
|
|
#else // !DIRECT_MJPEG_COMPOSING
|
|
|
|
#else //!DIRECT_MJPEG_COMPOSING
|
|
|
|
#ifdef OPENCV_VIDEO_OUTPUT
|
|
|
|
if ( m_pEncoderA->isOpened() ) { |
|
|
|
m_pEncoderA->release(); |
|
|
|
@ -3946,11 +3933,11 @@ void streamHandler::m_fThreadProc( void ){ |
|
|
|
LOG(" Encoder A is NOT Opened!"); |
|
|
|
#endif
|
|
|
|
}; |
|
|
|
#else
|
|
|
|
#else //!OPENCV_VIDEO_OUTPUT
|
|
|
|
av_write_trailer( m_pFormatCtxA ); |
|
|
|
avio_close( m_pFormatCtxA->pb ); |
|
|
|
#endif //OPENCV_VIDEO_OUTPUT
|
|
|
|
#endif // !DIRECT_MJPEG_COMPOSING
|
|
|
|
#endif //!OPENCV_VIDEO_OUTPUT
|
|
|
|
#endif //!DIRECT_MJPEG_COMPOSING
|
|
|
|
EVENT_CONTAINER *bEVT = createBasicEvent( m_sStreamData.source_id, EVT_CLASS_VIDEO, EVT_CAPTURE_DONE, NULL, NULL, &m_sStreamSegmentInfo[0] ); |
|
|
|
if ( bEVT ) { |
|
|
|
basicEventHeap::getInstance()->broadcast( bEVT ); |
|
|
|
|