uint8_t MpegMuxer::close ( void ) { ADM_assert(packStream); mux_close((PackStream *)packStream); packStream=NULL; return 1; }
int mux_exit( void ) { if (hMedia == AK_NULL) return 0; g_mux_exit = 1; printf("mux process close \n"); //wait capture thread return pthread_join(ThredMuxID, NULL); ThredMuxID = thread_zeroid(); mux_close(); CloseRecordManager(); CloseListenSD(); return 0; }
int mux_write_data(int type, void *pbuf, unsigned long size, unsigned long timestamp, int nIsIFrame) { int ret = 0; if (hMedia == AK_NULL || close_flag == 1 || stop_record_flag == 1) { return 0; } #if 0 MediaLib_Mux_GetInfo(hMedia, &mux_info); if(ReachLimit(mux_info.m_ulFileBytes, mux_info.m_ulTotalTime_ms)) { mux_close(); times--; if( times == 0 ) { printf("Record over \n"); CloseRecordManager(); Recordflag = 0; return -1; } else { mux_open( &mux_input ); } } #endif if (type == 0) ret = mux_addAudio(pbuf, size, timestamp); else ret = mux_addVideo(pbuf, size, timestamp, nIsIFrame); return ret; }
int stop_record() { mux_close(); CloseRecordManager(); return 0; }