124 #define THREAD_SAFE_CALLBACKS(avctx) \
125 ((avctx)->thread_safe_callbacks || (!(avctx)->get_buffer && (avctx)->get_buffer2 == avcodec_default_get_buffer2))
143 while (p->
state == STATE_INPUT_READY && !fctx->
die)
146 if (fctx->
die)
break;
158 "free the frame on failure. This is a bug, please report it.\n");
166 for (i = 0; i < MAX_BUFFERS; i++)
168 p->progress[i][0] = INT_MAX;
169 p->progress[i][1] = INT_MAX;
172 p->
state = STATE_INPUT_READY;
251 #define copy_fields(s, e) memcpy(&dst->s, &src->s, (char*)&dst->e - (char*)&dst->s);
256 #if FF_API_GET_BUFFER
330 if (prev_thread->
state == STATE_SETTING_UP) {
332 while (prev_thread->
state == STATE_SETTING_UP)
362 p->
state = STATE_SETTING_UP;
380 while (p->
state != STATE_SETUP_FINISHED && p->
state != STATE_INPUT_READY) {
383 while (p->
state == STATE_SETTING_UP)
387 case STATE_GET_BUFFER:
390 case STATE_GET_FORMAT:
398 p->
state = STATE_SETTING_UP;
412 AVFrame *picture,
int *got_picture_ptr,
451 p = &fctx->
threads[finished++];
453 if (p->
state != STATE_INPUT_READY) {
455 while (p->
state != STATE_INPUT_READY)
490 if (!progress || progress[field] >= n)
return;
508 if (!progress || progress[field] >= n)
return;
516 while (progress[field] < n)
526 if(p->
state == STATE_SETUP_FINISHED){
531 p->
state = STATE_SETUP_FINISHED;
541 for (i = 0; i < thread_count; i++) {
544 if (p->
state != STATE_INPUT_READY) {
546 while (p->
state != STATE_INPUT_READY)
571 for (i = 0; i < thread_count; i++) {
591 for (i = 0; i < thread_count; i++) {
641 if (thread_count <= 1) {
652 for (i = 0; i < thread_count; i++) {
692 err = codec->
init(copy);
775 if (p->
state != STATE_SETTING_UP &&
777 av_log(avctx,
AV_LOG_ERROR,
"get_buffer() cannot be called after ff_thread_finish_setup()\n");
789 progress[0] = progress[1] = -1;
805 p->
state = STATE_GET_BUFFER;
808 while (p->
state != STATE_SETTING_UP)
834 if (p->
state != STATE_SETTING_UP) {
835 av_log(avctx,
AV_LOG_ERROR,
"get_format() cannot be called after ff_thread_finish_setup()\n");
840 p->
state = STATE_GET_FORMAT;
843 while (p->
state != STATE_SETTING_UP)
885 if (can_direct_free) {