Changeset 186:7dbceed6df30 in verona


Ignore:
Timestamp:
May 12, 2011 4:58:07 PM (2 years ago)
Author:
laurent@…
Branch:
default
Message:

fix mediastreamer integration

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • .hgsubstate

    r185 r186  
    11a1bd05cf1becfa567d269e68ab312ed4154d4ab2 libs/hlibpp 
    223c961ba9aba9bb9031527dc9037e0132354698e8 libs/miniini 
    3 391f0d359a4586f08cf1af3c18ab3c84928d6f4c mediastreamer2 
     3929207d6eeaee115a3fc5a861f9c97a2787250d1 mediastreamer2 
  • phapi/phms_audiostream.c

    r177 r186  
    6161#include "phms_audiostream.h" 
    6262 
    63 void rtp_session_rtcp_parse(RtpSession *session, mblk_t *mp); 
    64  
    65  
    6663#ifndef USE_PHMS_AUDIOSTREAM 
    6764int audio_stream_start_full(AudioStream *stream, RtpProfile *profile, const char *remip,int remport, 
     
    8582const char* JITTER_BUFFER_ENV = "PH_JITTER_BUFFER_MS"; 
    8683 
    87 void audio_stream_change_decoder(AudioStream *stream, int payload); 
     84void rtp_session_rtcp_parse(RtpSession *session, mblk_t *mp); 
    8885 
    8986 
     
    107104 
    108105/* this code is not part of the library itself, it is part of the mediastream program */ 
    109 void audio_stream_free(AudioStream *stream); 
    110106void phms_audio_stream_free(AudioStream *stream) 
    111107{ 
     
    135131        if (stream->volrecv!=NULL) ms_filter_destroy(stream->volrecv); 
    136132        if (stream->soundread!=NULL) ms_filter_destroy(stream->soundread); 
    137         if (stream->dtmfgen2!=NULL) ms_filter_destroy(stream->dtmfgen2); 
     133        //if (stream->dtmfgen2!=NULL) ms_filter_destroy(stream->dtmfgen2); 
    138134        if (stream->soundwrite!=NULL) ms_filter_destroy(stream->soundwrite); 
    139135        if (stream->encoder!=NULL) ms_filter_destroy(stream->encoder); 
     
    334330                FILTER_LINK(stream->volrecv,0,stream->soundwrite,0); 
    335331#endif           
    336                 FILTER_LINK(stream->ec,1,stream->dtmfgen2,0); 
    337                 FILTER_LINK(stream->dtmfgen2, 0,stream->encoder,0); 
     332                //FILTER_LINK(stream->ec,1,stream->dtmfgen2,0); 
     333                //FILTER_LINK(stream->dtmfgen2, 0,stream->encoder,0); 
    338334                FILTER_LINK(stream->dtmfgen,0,stream->ec,0); 
    339335 
     
    348344#else 
    349345                FILTER_LINK(stream->soundread,0,stream->volsend,0); 
    350                 FILTER_LINK(stream->volsend,0,stream->dtmfgen2,0); 
     346//              FILTER_LINK(stream->volsend,0,stream->dtmfgen2,0); 
    351347                FILTER_LINK(stream->dtmfgen,0,stream->volrecv,0); 
    352348                FILTER_LINK(stream->volrecv,0,stream->soundwrite,0); 
    353349#endif           
    354                 FILTER_LINK(stream->dtmfgen2,0,stream->encoder,0); 
     350//              FILTER_LINK(stream->dtmfgen2,0,stream->encoder,0); 
    355351        } 
    356352        FILTER_LINK(stream->encoder,0,stream->rtpsend,0); 
     
    377373                FILTER_UNLINK(stream->volrecv,0,stream->soundwrite,0); 
    378374#endif                   
    379                 FILTER_UNLINK(stream->ec,1,stream->dtmfgen2,0); 
    380                 FILTER_UNLINK(stream->dtmfgen2, 0,stream->encoder,0); 
     375//              FILTER_UNLINK(stream->ec,1,stream->dtmfgen2,0); 
     376//              FILTER_UNLINK(stream->dtmfgen2, 0,stream->encoder,0); 
    381377                FILTER_UNLINK(stream->dtmfgen,0,stream->ec,0); 
    382378        }else{ 
     
    390386#else 
    391387                FILTER_UNLINK(stream->soundread,0,stream->volsend,0); 
    392                 FILTER_UNLINK(stream->volsend,0,stream->dtmfgen2,0); 
     388//              FILTER_UNLINK(stream->volsend,0,stream->dtmfgen2,0); 
    393389                FILTER_UNLINK(stream->dtmfgen,0,stream->volrecv,0); 
    394390                FILTER_UNLINK(stream->volrecv,0,stream->soundwrite,0); 
    395391#endif                   
    396                 FILTER_UNLINK(stream->dtmfgen2,0,stream->encoder,0); 
     392//              FILTER_UNLINK(stream->dtmfgen2,0,stream->encoder,0); 
    397393        } 
    398394 
     
    477473                if (outfile!=NULL) audio_stream_record(stream,outfile); 
    478474        } 
    479         stream->dtmfgen2=ms_filter_new(MS_DTMF_GEN_ID); 
     475//      stream->dtmfgen2=ms_filter_new(MS_DTMF_GEN_ID); 
    480476        //      ms_filter_call_method(stream->dtmfgen2, MS_FILTER_SET_DTMF_DURATION, &dtmf_dur); 
    481477 
     
    540536        ms_filter_call_method(stream->decoder,MS_FILTER_SET_SAMPLE_RATE,&pt->clock_rate); 
    541537        ms_filter_call_method(stream->dtmfgen,MS_FILTER_SET_SAMPLE_RATE,&pt->clock_rate); 
    542         ms_filter_call_method(stream->dtmfgen2,MS_FILTER_SET_SAMPLE_RATE,&pt->clock_rate); 
     538//      ms_filter_call_method(stream->dtmfgen2,MS_FILTER_SET_SAMPLE_RATE,&pt->clock_rate); 
    543539 
    544540        if (pt->send_fmtp!=NULL) ms_filter_call_method(stream->encoder,MS_FILTER_ADD_FMTP, (void*)pt->send_fmtp); 
     
    709705                FILTER_UNLINK(stream->volrecv,0,stream->soundwrite,0); 
    710706#endif 
    711                 FILTER_UNLINK(stream->ec,1,stream->dtmfgen2,0); 
    712                 FILTER_UNLINK(stream->dtmfgen2, 0,stream->encoder,0); 
     707//              FILTER_UNLINK(stream->ec,1,stream->dtmfgen2,0); 
     708//              FILTER_UNLINK(stream->dtmfgen2, 0,stream->encoder,0); 
    713709                FILTER_UNLINK(stream->dtmfgen,0,stream->ec,0); 
    714710        }else{ 
     
    722718#else 
    723719                FILTER_UNLINK(stream->soundread,0,stream->volsend,0); 
    724                 FILTER_UNLINK(stream->volsend,0,stream->dtmfgen2,0); 
     720//              FILTER_UNLINK(stream->volsend,0,stream->dtmfgen2,0); 
    725721                FILTER_UNLINK(stream->dtmfgen,0,stream->volrecv,0); 
    726722                FILTER_UNLINK(stream->volrecv,0,stream->soundwrite,0); 
    727723#endif 
    728                 FILTER_UNLINK(stream->dtmfgen2,0,stream->encoder,0); 
     724//              FILTER_UNLINK(stream->dtmfgen2,0,stream->encoder,0); 
    729725        } 
    730726 
     
    743739        if (stream->decoder!=NULL) ms_filter_destroy(stream->decoder); 
    744740        if (stream->dtmfgen!=NULL) ms_filter_destroy(stream->dtmfgen); 
    745         if (stream->dtmfgen2!=NULL) ms_filter_destroy(stream->dtmfgen2); 
     741//      if (stream->dtmfgen2!=NULL) ms_filter_destroy(stream->dtmfgen2); 
    746742        if (stream->ec!=NULL)   ms_filter_destroy(stream->ec); 
    747743        if (stream->ticker!=NULL) ms_ticker_destroy(stream->ticker); 
     
    760756        if (!stream) 
    761757                return -1; 
    762         if (!mode || mode > DTMF_BOTH) 
    763         { 
    764                 mode = DTMF_BOTH; 
    765         } 
    766         //      stream->sent_dtmfs=mode; 
     758 
    767759        return(audio_stream_send_dtmf(stream, dtmf)); 
    768760} 
     
    886878#endif           
    887879                FILTER_LINK(pas->dtmfgen,0, pas->ec,0); 
    888                 FILTER_LINK(pas->ec,1, pas->dtmfgen2,0); 
    889                 FILTER_LINK(pas->dtmfgen2, 0, pas->encoder, 0); 
     880//              FILTER_LINK(pas->ec,1, pas->dtmfgen2,0); 
     881//              FILTER_LINK(pas->dtmfgen2, 0, pas->encoder, 0); 
    890882        } 
    891883        else 
     
    897889                FILTER_LINK(pas->upsample,0, pas->soundwrite,0); 
    898890#else 
    899                 FILTER_LINK(pas->soundread, 0, pas->dtmfgen2, 0); 
     891//              FILTER_LINK(pas->soundread, 0, pas->dtmfgen2, 0); 
    900892                FILTER_LINK(pas->dtmfgen,0, pas->soundwrite,0); 
    901893#endif           
    902                 FILTER_LINK(pas->dtmfgen2, 0, pas->encoder,0); 
     894//              FILTER_LINK(pas->dtmfgen2, 0, pas->encoder,0); 
    903895        } 
    904896        if(flags & PH_MSTREAM_FLAG_SUSPENDED) 
     
    925917#endif           
    926918                FILTER_UNLINK(pas->dtmfgen,0, pas->ec,0); 
    927                 FILTER_UNLINK(pas->ec,1, pas->dtmfgen2,0); 
    928                 FILTER_UNLINK(pas->dtmfgen2, 0, pas->encoder, 0); 
     919//              FILTER_UNLINK(pas->ec,1, pas->dtmfgen2,0); 
     920//              FILTER_UNLINK(pas->dtmfgen2, 0, pas->encoder, 0); 
    929921        } 
    930922        else 
     
    936928                FILTER_UNLINK(pas->upsample,0, pas->soundwrite,0); 
    937929#else 
    938                 FILTER_UNLINK(pas->soundread, 0, pas->dtmfgen2, 0); 
     930//              FILTER_UNLINK(pas->soundread, 0, pas->dtmfgen2, 0); 
    939931                FILTER_UNLINK(pas->dtmfgen,0, pas->soundwrite,0); 
    940932#endif           
    941                 FILTER_UNLINK(pas->dtmfgen2, 0, pas->encoder,0); 
     933//              FILTER_UNLINK(pas->dtmfgen2, 0, pas->encoder,0); 
    942934        } 
    943935} 
     
    10151007#endif           
    10161008                FILTER_LINK(pcs->conf, 0, pcs->ec, 0); 
    1017                 FILTER_LINK(pcs->ec, 1, pas1->dtmfgen2, 0); 
    1018                 FILTER_LINK(pas1->dtmfgen2, 0, pcs->conf, 0); 
     1009//              FILTER_LINK(pcs->ec, 1, pas1->dtmfgen2, 0); 
     1010//              FILTER_LINK(pas1->dtmfgen2, 0, pcs->conf, 0); 
    10191011        } 
    10201012        else 
     
    10261018                FILTER_LINK(pas1->upsample, 0, pas1->soundwrite, 0); 
    10271019#else 
    1028                 FILTER_LINK(pas1->soundread, 0,   pas1->dtmfgen2, 0); 
     1020//              FILTER_LINK(pas1->soundread, 0,   pas1->dtmfgen2, 0); 
    10291021                FILTER_LINK(pcs->conf, 0, pas1->soundwrite, 0); 
    10301022#endif           
    1031                 FILTER_LINK(pas1->dtmfgen2, 0, pcs->conf, 0); 
     1023//              FILTER_LINK(pas1->dtmfgen2, 0, pcs->conf, 0); 
    10321024        } 
    10331025 
     
    11091101#endif                   
    11101102                        FILTER_UNLINK(pcs->conf, 0,  pcs->ec, 0); 
    1111                         FILTER_UNLINK(pcs->ec, 1, pas1->dtmfgen2, 0); 
    1112                         FILTER_UNLINK(pas1->dtmfgen2, 0,pcs->conf, 0); 
     1103//                      FILTER_UNLINK(pcs->ec, 1, pas1->dtmfgen2, 0); 
     1104//                      FILTER_UNLINK(pas1->dtmfgen2, 0,pcs->conf, 0); 
    11131105                } 
    11141106                else 
     
    11201112                        FILTER_UNLINK(pas1->upsample, 0,  pas1->soundwrite, 0); 
    11211113#else 
    1122                         FILTER_UNLINK(pas1->soundread, 0, pas1->dtmfgen2, 1); 
     1114//                      FILTER_UNLINK(pas1->soundread, 0, pas1->dtmfgen2, 1); 
    11231115                        FILTER_UNLINK(pcs->conf, 0, pas1->soundwrite, 0); 
    11241116#endif                   
    1125                         FILTER_UNLINK(pas1->dtmfgen2, 0,pcs->conf, 0); 
     1117//                      FILTER_UNLINK(pas1->dtmfgen2, 0,pcs->conf, 0); 
    11261118                } 
    11271119 
  • phapi/phms_videostream.c

    r179 r186  
    5151#define USE_NEW_CAPTURE 1 
    5252 
    53 void video_stream_change_decoder(VideoStream *stream, int payload); 
    54  
    5553static void get_default_display_vsize(MSVideoSize *vsize) 
    5654{ 
     
    326324        tmp=1; 
    327325        ms_filter_call_method(stream->output,MS_FILTER_SET_VIDEO_SIZE,&disp_size); 
    328         ms_filter_call_method(stream->output,MS_VIDEO_OUT_AUTO_FIT,&tmp); 
     326        //ms_filter_call_method(stream->output,MS_VIDEO_OUT_AUTO_FIT,&tmp); 
    329327        ms_filter_call_method(stream->output,MS_FILTER_SET_PIX_FMT,&format); 
    330328         
     
    610608        tmp=1; 
    611609        ms_filter_call_method(stream->output,MS_FILTER_SET_VIDEO_SIZE,&disp_size); 
    612         ms_filter_call_method(stream->output,MS_VIDEO_OUT_AUTO_FIT,&tmp); 
     610        //ms_filter_call_method(stream->output,MS_VIDEO_OUT_AUTO_FIT,&tmp); 
    613611        ms_filter_call_method(stream->output,MS_FILTER_SET_PIX_FMT,&format); 
    614612 
     
    10561054phStream * phms_video_start_preview(const char *deviceid, VideoStreamRenderCallback cb) 
    10571055{ 
    1058         MSVideoSize size; 
    10591056        phStream * phstream = (phStream *)osip_malloc(sizeof(phStream)); 
    10601057        MSWebCam *cam  = ms_web_cam_manager_get_cam(ms_web_cam_manager_get(),deviceid); 
     1058        VideoStream * videoStream; 
     1059 
    10611060        if(cam == NULL) 
    10621061                return NULL; 
    1063          
    1064         get_default_display_vsize(&size); 
    1065          
    1066         phstream->stream = video_preview_start(cam,size); 
    1067         video_stream_set_render_callback(phstream->stream,cb,NULL); 
    1068          
     1062 
     1063        videoStream = video_preview_new(); 
     1064        phstream->stream = videoStream; 
     1065        video_stream_use_preview_video_window(videoStream,0); 
     1066        video_stream_set_render_callback(videoStream,cb,NULL); 
     1067        video_preview_start(videoStream,cam); 
     1068 
    10691069        return phstream; 
    10701070} 
Note: See TracChangeset for help on using the changeset viewer.