| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2004 Roman Shaposhnik | 2 * Copyright (c) 2004 Roman Shaposhnik |
| 3 * Copyright (c) 2008 Alexander Strange (astrange@ithinksw.com) | 3 * Copyright (c) 2008 Alexander Strange (astrange@ithinksw.com) |
| 4 * | 4 * |
| 5 * Many thanks to Steven M. Schultz for providing clever ideas and | 5 * Many thanks to Steven M. Schultz for providing clever ideas and |
| 6 * to Michael Niedermayer <michaelni@gmx.at> for writing initial | 6 * to Michael Niedermayer <michaelni@gmx.at> for writing initial |
| 7 * implementation. | 7 * implementation. |
| 8 * | 8 * |
| 9 * This file is part of FFmpeg. | 9 * This file is part of FFmpeg. |
| 10 * | 10 * |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 c->rets = &dummy_ret; | 195 c->rets = &dummy_ret; |
| 196 c->rets_count = 1; | 196 c->rets_count = 1; |
| 197 } | 197 } |
| 198 pthread_cond_broadcast(&c->current_job_cond); | 198 pthread_cond_broadcast(&c->current_job_cond); |
| 199 | 199 |
| 200 avcodec_thread_park_workers(c, avctx->thread_count); | 200 avcodec_thread_park_workers(c, avctx->thread_count); |
| 201 | 201 |
| 202 return 0; | 202 return 0; |
| 203 } | 203 } |
| 204 | 204 |
| 205 int avcodec_thread_execute2(AVCodecContext *avctx, action_func2* func2, void *ar
g, int *ret, int job_count) | 205 static int avcodec_thread_execute2(AVCodecContext *avctx, action_func2* func2, v
oid *arg, int *ret, int job_count) |
| 206 { | 206 { |
| 207 ThreadContext *c= avctx->thread_opaque; | 207 ThreadContext *c= avctx->thread_opaque; |
| 208 c->func2 = func2; | 208 c->func2 = func2; |
| 209 return avcodec_thread_execute(avctx, NULL, arg, ret, job_count, 0); | 209 return avcodec_thread_execute(avctx, NULL, arg, ret, job_count, 0); |
| 210 } | 210 } |
| 211 | 211 |
| 212 static int thread_init(AVCodecContext *avctx) | 212 static int thread_init(AVCodecContext *avctx) |
| 213 { | 213 { |
| 214 int i; | 214 int i; |
| 215 ThreadContext *c; | 215 ThreadContext *c; |
| (...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 791 return 0; | 791 return 0; |
| 792 } | 792 } |
| 793 | 793 |
| 794 void avcodec_thread_free(AVCodecContext *avctx) | 794 void avcodec_thread_free(AVCodecContext *avctx) |
| 795 { | 795 { |
| 796 if (avctx->active_thread_type&FF_THREAD_FRAME) | 796 if (avctx->active_thread_type&FF_THREAD_FRAME) |
| 797 frame_thread_free(avctx, avctx->thread_count); | 797 frame_thread_free(avctx, avctx->thread_count); |
| 798 else | 798 else |
| 799 thread_free(avctx); | 799 thread_free(avctx); |
| 800 } | 800 } |
| OLD | NEW |