Changeset 1014:587430e7483c in mediastreamer2
- Timestamp:
- Jun 23, 2010 4:32:53 PM (3 years ago)
- Branch:
- default
- Files:
-
- 3 edited
-
NEWS (modified) (1 diff)
-
src/alsa.c (modified) (2 diffs)
-
src/videodec.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
NEWS
r997 r1014 1 mediastreamer-2.5.1: ??? 1 mediastreamer-2.6.0: June 23, 2010 2 * fix crash when video window is closed on windows 3 * move H264 decoder from msx264 to mediastreamer2 4 * MSVolume improvements and cleanup, with native AGC support. 5 * Echo canceller reworked: use soundcard stream to synchronise far-end stream. 6 * fix segfault in ALSA support when capturing a stereo stream. 7 * H263 RFC2190 support improvements 2 8 3 9 mediastreamer-2.5.0: June 3, 2010 -
src/alsa.c
r992 r1014 873 873 while (alsa_can_read(ad->handle)>=samples){ 874 874 875 int size=samples*2 ;875 int size=samples*2*ad->nchannels; 876 876 om=allocb(size,0); 877 877 if ((err=alsa_read(ad->handle,om->b_wptr,samples))<=0) { … … 893 893 mblk_t *om=NULL; 894 894 int samples=(160*ad->rate)/8000; 895 895 int size=samples*2*ad->nchannels; 896 896 897 ms_mutex_lock(&ad->mutex); 897 while (ms_bufferizer_get_avail(ad->bufferizer)>=s amples*2){898 while (ms_bufferizer_get_avail(ad->bufferizer)>=size){ 898 899 899 om=allocb(s amples*2,0);900 ms_bufferizer_read(ad->bufferizer,om->b_wptr,s amples*2);901 om->b_wptr+=s amples*2;900 om=allocb(size,0); 901 ms_bufferizer_read(ad->bufferizer,om->b_wptr,size); 902 om->b_wptr+=size; 902 903 /*ms_message("alsa_read_process: Outputing %i bytes",size);*/ 903 904 ms_queue_put(obj->outputs[0],om); -
src/videodec.c
r890 r1014 142 142 143 143 static mblk_t * skip_rfc2190_header(mblk_t *inm){ 144 if (msgdsize(inm) >= 4) { 145 uint8_t *ph = inm->b_rptr; 146 int F = (ph[0]>>7) & 0x1; 147 int P = (ph[0]>>6) & 0x1; 148 if (F == 0) inm->b_rptr += 4; // mode A 149 else if (P == 0) inm->b_rptr += 8; // mode B 150 else inm->b_rptr += 12; // mode C 144 uint8_t *ph = inm->b_rptr; 145 uint8_t sbit = (ph[0] >> 3) & 0x07; 146 //unsigned int ebit = ph[0] & 0x7; 147 bool_t isIFrame=0; 148 unsigned hdrLen; 149 char mode; 150 if (msgdsize(inm) < 5 ) { 151 ms_warning("RFC2190 packet too small (size %d) to scan!", msgdsize(inm)); 152 freemsg(inm); 153 return NULL; 154 } 155 if ((ph[0] & 0x80) == 0) { 156 isIFrame = (ph[1] & 0x10) == 0; 157 hdrLen = 4; 158 mode = 'A'; 159 } else if ((ph[0] & 0x40) == 0) { 160 isIFrame = (ph[4] & 0x80) == 0; 161 hdrLen = 8; 162 mode = 'B'; 151 163 } else { 164 isIFrame = (ph[4] & 0x80) == 0; 165 hdrLen = 12; 166 mode = 'C'; 167 } 168 if (msgdsize(inm) > hdrLen) { 169 inm->reserved2 |= (sbit << 11); 170 inm->b_rptr += hdrLen; 171 } else { 172 ms_warning("RFC2190 packet mode:%c%s too small (size %d)", mode, isIFrame ? 173 " (I-Frame)":"", msgdsize(inm)); 152 174 freemsg(inm); 153 175 inm=NULL; … … 598 620 return dupmsg(s->yuv_msg); 599 621 } 622 /* Bitmasks to select bits of a byte from low side */ 623 static unsigned char smasks[7] = { 0x7f, 0x3f, 0x1f, 0x0f, 0x07, 0x03, 0x01 }; 600 624 601 625 static void dec_process_frame(MSFilter *f, mblk_t *inm){ … … 613 637 if (s->input==NULL){ 614 638 s->input=inm; 615 }else{ 639 }else{ 640 uint8_t sbit = (inm->reserved2 >> 11) & 0x7; 641 if (sbit!=0) { 642 mblk_t *mp = s->input; 643 while ( mp->b_cont != NULL ) mp = mp->b_cont; 644 mp->b_wptr--; 645 mp->b_wptr[0] |= ( inm->b_rptr[0] & smasks[sbit-1] ); 646 mp->b_wptr++; 647 inm->b_rptr++; 648 } 616 649 concatb(s->input,inm); 617 650 } … … 632 665 pkt.size = remain; 633 666 len=avcodec_decode_video2(&s->av_context,&orig,&got_picture,&pkt); 634 /*len=avcodec_decode_video(&s->av_context,&orig,&got_picture,(uint8_t*)frame->b_rptr,remain );*/635 667 if (len<=0) { 636 668 ms_warning("ms_AVdecoder_process: error %i.",len);
Note: See TracChangeset
for help on using the changeset viewer.
