mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-02-07 14:18:25 +00:00
Add logging capabilities for ffmpeg (link with avutil)
git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@428 3f6dc0c8-ddfe-455d-9043-3cd528dc4637
This commit is contained in:
parent
4e6cfdd459
commit
aa40a7850c
1 changed files with 17 additions and 0 deletions
|
|
@ -26,6 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#else
|
||||
#include <ffmpeg/avcodec.h>
|
||||
#endif
|
||||
|
||||
#include "mediastreamer2/msfilter.h"
|
||||
#include "mediastreamer2/msvideo.h"
|
||||
#include "mediastreamer2/msticker.h"
|
||||
|
|
@ -40,11 +41,27 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
static bool_t avcodec_initialized=FALSE;
|
||||
|
||||
#ifdef ENABLE_LOG_FFMPEG
|
||||
|
||||
void ms_ffmpeg_log_callback(void* ptr, int level, const char* fmt, va_list vl)
|
||||
{
|
||||
static char message[8192];
|
||||
|
||||
vsnprintf(message, sizeof message, fmt, vl);
|
||||
ms_message(message);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void ms_ffmpeg_check_init(){
|
||||
if(!avcodec_initialized){
|
||||
avcodec_init();
|
||||
avcodec_register_all();
|
||||
avcodec_initialized=TRUE;
|
||||
#ifdef ENABLE_LOG_FFMPEG
|
||||
av_log_set_level(AV_LOG_WARNING);
|
||||
av_log_set_callback(&ms_ffmpeg_log_callback);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue