Mercurial > libavcodec.hg
comparison dv.c @ 8129:a9734fe0811e libavcodec
Making it easier to send arbitrary structures as work orders to MT workers
author | romansh |
---|---|
date | Wed, 12 Nov 2008 17:47:23 +0000 |
parents | 890df98a7848 |
children | c30bdda1adb1 |
comparison
equal
deleted
inserted
replaced
8128:e2241dd85c65 | 8129:a9734fe0811e |
---|---|
1011 flush_put_bits(&pbs[j]); | 1011 flush_put_bits(&pbs[j]); |
1012 } | 1012 } |
1013 | 1013 |
1014 static int dv_decode_mt(AVCodecContext *avctx, void* sl) | 1014 static int dv_decode_mt(AVCodecContext *avctx, void* sl) |
1015 { | 1015 { |
1016 dv_decode_video_segment((DVVideoContext *)avctx->priv_data, (size_t)sl); | 1016 dv_decode_video_segment((DVVideoContext *)avctx->priv_data, *(size_t*)sl); |
1017 return 0; | 1017 return 0; |
1018 } | 1018 } |
1019 | 1019 |
1020 #ifdef CONFIG_DVVIDEO_ENCODER | 1020 #ifdef CONFIG_DVVIDEO_ENCODER |
1021 static int dv_encode_mt(AVCodecContext *avctx, void* sl) | 1021 static int dv_encode_mt(AVCodecContext *avctx, void* sl) |
1022 { | 1022 { |
1023 dv_encode_video_segment((DVVideoContext *)avctx->priv_data, (size_t)sl); | 1023 dv_encode_video_segment((DVVideoContext *)avctx->priv_data, *(size_t*)sl); |
1024 return 0; | 1024 return 0; |
1025 } | 1025 } |
1026 #endif | 1026 #endif |
1027 | 1027 |
1028 #ifdef CONFIG_DVVIDEO_DECODER | 1028 #ifdef CONFIG_DVVIDEO_DECODER |
1054 s->picture.interlaced_frame = 1; | 1054 s->picture.interlaced_frame = 1; |
1055 s->picture.top_field_first = 0; | 1055 s->picture.top_field_first = 0; |
1056 | 1056 |
1057 s->buf = buf; | 1057 s->buf = buf; |
1058 avctx->execute(avctx, dv_decode_mt, s->sys->work_chunks, NULL, | 1058 avctx->execute(avctx, dv_decode_mt, s->sys->work_chunks, NULL, |
1059 dv_work_pool_size(s->sys)); | 1059 dv_work_pool_size(s->sys), sizeof(void*)); |
1060 | 1060 |
1061 emms_c(); | 1061 emms_c(); |
1062 | 1062 |
1063 /* return image */ | 1063 /* return image */ |
1064 *data_size = sizeof(AVFrame); | 1064 *data_size = sizeof(AVFrame); |
1207 s->picture.key_frame = 1; | 1207 s->picture.key_frame = 1; |
1208 s->picture.pict_type = FF_I_TYPE; | 1208 s->picture.pict_type = FF_I_TYPE; |
1209 | 1209 |
1210 s->buf = buf; | 1210 s->buf = buf; |
1211 c->execute(c, dv_encode_mt, s->sys->work_chunks, NULL, | 1211 c->execute(c, dv_encode_mt, s->sys->work_chunks, NULL, |
1212 dv_work_pool_size(s->sys)); | 1212 dv_work_pool_size(s->sys), sizeof(void*)); |
1213 | 1213 |
1214 emms_c(); | 1214 emms_c(); |
1215 | 1215 |
1216 dv_format_frame(s, buf); | 1216 dv_format_frame(s, buf); |
1217 | 1217 |