Mercurial > libavcodec.hg
comparison mpegvideo.c @ 2492:57ba17bd3924 libavcodec
rtp_callback: send number of mb patch by (Johan Bilien {jobi via.ecp fr)
author | michael |
---|---|
date | Wed, 02 Feb 2005 18:14:59 +0000 |
parents | e248c6250232 |
children | 258120c61eea |
comparison
equal
deleted
inserted
replaced
2491:c559ea6e395c | 2492:57ba17bd3924 |
---|---|
4722 s->pb.buf_ptr= s->ptr_lastgob; | 4722 s->pb.buf_ptr= s->ptr_lastgob; |
4723 #endif | 4723 #endif |
4724 assert(pbBufPtr(&s->pb) == s->ptr_lastgob); | 4724 assert(pbBufPtr(&s->pb) == s->ptr_lastgob); |
4725 } | 4725 } |
4726 } | 4726 } |
4727 | 4727 |
4728 if (s->avctx->rtp_callback) | 4728 if (s->avctx->rtp_callback){ |
4729 s->avctx->rtp_callback(s->avctx, s->ptr_lastgob, current_packet_size, 0); | 4729 int number_mb = (mb_y - s->resync_mb_y)*s->mb_width + mb_x - s->resync_mb_x; |
4730 s->avctx->rtp_callback(s->avctx, s->ptr_lastgob, current_packet_size, number_mb); | |
4731 } | |
4730 | 4732 |
4731 switch(s->codec_id){ | 4733 switch(s->codec_id){ |
4732 case CODEC_ID_MPEG4: | 4734 case CODEC_ID_MPEG4: |
4733 ff_mpeg4_encode_video_packet_header(s); | 4735 ff_mpeg4_encode_video_packet_header(s); |
4734 ff_mpeg4_clean_buffers(s); | 4736 ff_mpeg4_clean_buffers(s); |
5164 | 5166 |
5165 write_slice_end(s); | 5167 write_slice_end(s); |
5166 | 5168 |
5167 /* Send the last GOB if RTP */ | 5169 /* Send the last GOB if RTP */ |
5168 if (s->avctx->rtp_callback) { | 5170 if (s->avctx->rtp_callback) { |
5171 int number_mb = (mb_y - s->resync_mb_y)*s->mb_width - s->resync_mb_x; | |
5169 pdif = pbBufPtr(&s->pb) - s->ptr_lastgob; | 5172 pdif = pbBufPtr(&s->pb) - s->ptr_lastgob; |
5170 /* Call the RTP callback to send the last GOB */ | 5173 /* Call the RTP callback to send the last GOB */ |
5171 emms_c(); | 5174 emms_c(); |
5172 s->avctx->rtp_callback(s->avctx, s->ptr_lastgob, pdif, 0); | 5175 s->avctx->rtp_callback(s->avctx, s->ptr_lastgob, pdif, number_mb); |
5173 } | 5176 } |
5174 | 5177 |
5175 return 0; | 5178 return 0; |
5176 } | 5179 } |
5177 | 5180 |