Changeset 275:d03b538c56ad in verona


Ignore:
Timestamp:
Aug 23, 2011 2:25:47 PM (21 months ago)
Author:
laurent <laurent@…>
Branch:
default
Message:

adaptive video allocation

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • .hgsubstate

    r273 r275  
    22cb83411a9e6657814a3f0e0b5d96bbb132540511 libs/miniini 
    33901c9952b3bf2cfc29d30111e104b4971b739187 libs/srtp 
    4 e5530a01b408145b1ad480d05351f7ab7db30501 mediastreamer2 
     4cb57f462231916f9358535dbf5e247765c1cf62b mediastreamer2 
  • phapi/phms_videostream.c

    r186 r275  
    9090                phms_video_stream_t *video = video1->streamerData; 
    9191 
    92                 if(local_view) 
    93                 { 
    94                         video->frame_event.frame_local->height = local_view->h; 
    95                         video->frame_event.frame_local->width = local_view->w; 
    96                         video->frame_event.frame_local->planes[0] = local_view->planes[0]; 
    97                 } 
    98                  
    99                 if(remote_view) 
    100                 { 
    101                         video->frame_event.frame_remote->height = remote_view->h; 
    102                         video->frame_event.frame_remote->width = remote_view->w; 
    103                         video->frame_event.frame_remote->planes[0] = remote_view->planes[0]; 
    104                 } 
    105                  
     92                if(local_view && local_view->w && local_view->h && local_view->planes[0]) 
     93                { 
     94                        if(video->frame_event.frame_local->height != local_view->h || video->frame_event.frame_local->width != local_view->w ) 
     95                        { 
     96                                video->frame_event.frame_local->height = local_view->h; 
     97                                video->frame_event.frame_local->width = local_view->w; 
     98                                video->frame_event.frame_local->planes[0] =  malloc((local_view->w*local_view->h*3)/2); 
     99                        } 
     100                        memcpy(video->frame_event.frame_local->planes[0], local_view->planes[0], (local_view->w*local_view->h*3)/2); 
     101                } 
     102 
     103                if(remote_view  && remote_view->w && remote_view->h && remote_view->planes[0]) 
     104                { 
     105                        if(video->frame_event.frame_remote->height != remote_view->h || video->frame_event.frame_remote->width != remote_view->w ) 
     106                        { 
     107                                video->frame_event.frame_remote->height = remote_view->h; 
     108                                video->frame_event.frame_remote->width = remote_view->w; 
     109                                video->frame_event.frame_remote->planes[0] =  malloc((remote_view->w*remote_view->h*3)/2); 
     110                        } 
     111 
     112                        memcpy(video->frame_event.frame_remote->planes[0], remote_view->planes[0], (remote_view->w*remote_view->h*3)/2); 
     113                } 
     114 
    106115                s->frameDisplayCbk((phcall_t*)s->cbkInfo, &video->frame_event); 
    107116        } 
     
    117126phms_video_stream_t *phms_video_stream_new(int locport, bool_t use_ipv6, int traffictype, int width, int height) 
    118127{ 
    119         MSVideoSize vsize; 
    120128        phms_video_stream_t *pvs=(phms_video_stream_t*)malloc(sizeof(phms_video_stream_t)); 
    121129        memset(pvs, 0, sizeof(phms_video_stream_t)); 
     
    131139                pvs->frame_event.frame_local = (phPicture_t *)malloc(sizeof(phPicture_t)); 
    132140                pvs->frame_event.frame_remote = (phPicture_t *)malloc(sizeof(phPicture_t)); 
     141                pvs->frame_event.frame_remote = (phPicture_t *)malloc(sizeof(phPicture_t)); 
     142                pvs->frame_event.frame_local->width = pvs->frame_event.frame_remote->width = width; 
     143                pvs->frame_event.frame_local->height = pvs->frame_event.frame_remote->height = height; 
    133144                pvs->frame_event.frame_local->planes[0] = NULL; 
    134145                pvs->frame_event.frame_remote->planes[0] = NULL; 
Note: See TracChangeset for help on using the changeset viewer.