LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Video in Linphone (sip-phone tool) (http://www.linuxquestions.org/questions/slackware-14/video-in-linphone-sip-phone-tool-4175442816/)

Chelyuk 12-24-2012 02:16 PM

Video in Linphone (sip-phone tool)
 
Hi to all.
I have found a new problem, so need an advice about compiling Linphone with video support. When I'm trying to build it I've got an error output:
Code:

videoenc.c: In function «ms_ffmpeg_check_init»:
videoenc.c:56:3: warning: неявная декларация функции «avcodec_init» [-Wimplicit-function-declaration]
videoenc.c: In function «prepare»:
videoenc.c:239:2: warning: «avcodec_get_context_defaults» is deprecated (declared at /usr/include/libavcodec/avcodec.h:3260) [-Wdeprecated-declarations]
videoenc.c: In function «prepare_h263»:
videoenc.c:303:13: error: «CODEC_FLAG_H263P_UMV» undeclared (first use in this function)
videoenc.c:303:13: notice: each undeclared identifier is reported only once for each function it appears in
videoenc.c:305:13: error: «CODEC_FLAG_H263P_SLICE_STRUCT» undeclared (first use in this function)
videoenc.c: In function «enc_preprocess»:
videoenc.c:345:2: warning: «avcodec_open» is deprecated (declared at /usr/include/libavcodec/avcodec.h:3380) [-Wdeprecated-declarations]
videoenc.c: In function «add_rfc2190_header»:
videoenc.c:375:41: error: «FF_I_TYPE» undeclared (first use in this function)
videoenc.c: In function «process_frame»:
videoenc.c:782:18: error: «FF_I_TYPE» undeclared (first use in this function)
videoenc.c:794:2: warning: «avcodec_encode_video» is deprecated (declared at /usr/include/libavcodec/avcodec.h:4077) [-Wdeprecated-declarations]
make[5]: *** [videoenc.lo] Error 1
make[5]: Leaving directory `/tmp/SBo/linphone-3.5.2/mediastreamer2/src'
make[4]: *** [all] Error 2
make[4]: Leaving directory `/tmp/SBo/linphone-3.5.2/mediastreamer2/src'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/tmp/SBo/linphone-3.5.2/mediastreamer2'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/tmp/SBo/linphone-3.5.2/mediastreamer2'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/tmp/SBo/linphone-3.5.2'
make: *** [all] Error 2

One wise man adviced me a solution:
Code:

$  cat mpeg-dirty.diff
diff -ru linphone-3.5.2/mediastreamer2/src/h264dec.c linphone-3.5.2/mediastreamer2/src/h264dec.c
--- linphone-3.5.2/mediastreamer2/src/h264dec.c    2012-02-22 15:54:58.000000000 +0400
+++ linphone-3.5.2/mediastreamer2/src/h264dec.c    2012-12-22 21:11:27.951128175 +0400
@@ -44,7 +44,7 @@
 static void ffmpeg_init(){
    static bool_t done=FALSE;
    if (!done){
-        avcodec_init();
+        //avcodec_init();
        avcodec_register_all();
        done=TRUE;
    }
diff -ru linphone-3.5.2/mediastreamer2/src/videoenc.c linphone-3.5.2/mediastreamer2/src/videoenc.c
--- linphone-3.5.2/mediastreamer2/src/videoenc.c    2012-02-22 15:54:58.000000000 +0400
+++ linphone-3.5.2/mediastreamer2/src/videoenc.c    2012-12-22 21:10:44.577670418 +0400
@@ -53,7 +53,7 @@
 
 void ms_ffmpeg_check_init(){
    if(!avcodec_initialized){
-        avcodec_init();
+        //avcodec_init();
        avcodec_register_all();
        avcodec_initialized=TRUE;
 #ifdef ENABLE_LOG_FFMPEG
@@ -300,10 +300,10 @@
    if (s->profile==0){
        s->codec=CODEC_ID_H263;
    }else{
-        c->flags|=CODEC_FLAG_H263P_UMV;
        c->flags|=CODEC_FLAG_AC_PRED;
-        c->flags|=CODEC_FLAG_H263P_SLICE_STRUCT;
        /*
+        c->flags|=CODEC_FLAG_H263P_UMV;
+        c->flags|=CODEC_FLAG_H263P_SLICE_STRUCT;
        c->flags|=CODEC_FLAG_OBMC;
        c->flags|=CODEC_FLAG_AC_PRED;
        */
@@ -372,7 +372,7 @@
    // assume video size is CIF or QCIF
    if (context->width == 352 && context->height == 288) header->b_wptr[1] = 0x60;
    else header->b_wptr[1] = 0x40;
-    if (context->coded_frame->pict_type != FF_I_TYPE) header->b_wptr[1] |= 0x10;
+    if (context->coded_frame->pict_type != AV_PICTURE_TYPE_I) header->b_wptr[1] |= 0x10;
    header->b_wptr += 4;
    header->b_cont = *packet;
    *packet = header;
@@ -779,7 +779,7 @@
        s->req_vfu=TRUE;
    }
    if (s->req_vfu){
-        pict.pict_type=FF_I_TYPE;
+        pict.pict_type=AV_PICTURE_TYPE_I;
        s->req_vfu=FALSE;
    }
    comp_buf->b_rptr=comp_buf->b_wptr=comp_buf->b_datap->db_base;
@@ -799,7 +799,7 @@
        if (s->framenum==1){
            video_starter_first_frame (&s->starter,f->ticker->time);
        }
-        if (c->coded_frame->pict_type==FF_I_TYPE){
+        if (c->coded_frame->pict_type==AV_PICTURE_TYPE_I){
            ms_message("Emitting I-frame");
        }
        comp_buf->b_wptr+=error;

In this case I can build a psckage, but video still not working. As I was told, the problem is that ffmpeg, and exactly libavcodec(libavcodec.so.54.23.100) is to new for linphone 3.5.2. I don't want to use old version of ffmpeg because it will make problem with vlc and xbmc. I looked in linuxmint (ubuntu) how it is work there, they are using libavcodec (libavcodec.so.53.45.0) with libav project instead of ffmpeg. So what is an appropriate decision for this issue?


All times are GMT -5. The time now is 04:51 AM.