* syncVideoWork *********************************************************************** * **********************************************************************/
| 2931 | * |
| 2932 | **********************************************************************/ |
| 2933 | static int syncVideoWork( hb_work_object_t * w, hb_buffer_t ** buf_in, |
| 2934 | hb_buffer_t ** buf_out ) |
| 2935 | { |
| 2936 | hb_work_private_t * pv = w->private_data; |
| 2937 | hb_buffer_t * in = *buf_in; |
| 2938 | |
| 2939 | #if HB_PROJECT_FEATURE_QSV |
| 2940 | // Fix of LA case allowing use of LA up to 40 in full encode path, |
| 2941 | // as currently for such support we cannot allocate >64 slices per texture |
| 2942 | // due to MSFT limitation, not impacting other cases |
| 2943 | hb_job_t *job = pv->common->job; |
| 2944 | if (job->hw_pix_fmt == AV_PIX_FMT_QSV && |
| 2945 | job->qsv_ctx->la_is_enabled == 1) |
| 2946 | { |
| 2947 | pv->stream->max_len = SYNC_MIN_VIDEO_QUEUE_LEN; |
| 2948 | pv->common->job->qsv_ctx->la_is_enabled++; |
| 2949 | } |
| 2950 | #endif |
| 2951 | |
| 2952 | if (pv->stream->done) |
| 2953 | { |
| 2954 | flushStreamsLock(pv->common); |
| 2955 | return HB_WORK_DONE; |
| 2956 | } |
| 2957 | if (in->s.flags & HB_BUF_FLAG_EOF) |
| 2958 | { |
| 2959 | pv->stream->flush = 1; |
| 2960 | flushStreamsLock(pv->common); |
| 2961 | // Ideally, we would only do this subtitle scan check in |
| 2962 | // syncSubtitleWork, but someone might try to do a subtitle |
| 2963 | // scan on a source that has no subtitles :-( |
| 2964 | if (pv->common->job->indepth_scan) |
| 2965 | { |
| 2966 | // When doing subtitle indepth scan, the pipeline ends at sync. |
| 2967 | // Terminate job when EOF reached. |
| 2968 | *w->done = 1; |
| 2969 | } |
| 2970 | return HB_WORK_DONE; |
| 2971 | } |
| 2972 | |
| 2973 | *buf_in = NULL; |
| 2974 | QueueBuffer(pv->stream, in); |
| 2975 | Synchronize(pv->stream); |
| 2976 | |
| 2977 | if (pv->stream->done) |
| 2978 | { |
| 2979 | flushStreamsLock(pv->common); |
| 2980 | return HB_WORK_DONE; |
| 2981 | } |
| 2982 | return HB_WORK_OK; |
| 2983 | } |
| 2984 | |
| 2985 | hb_work_object_t hb_sync_video = |
| 2986 | { |
nothing calls this directly
no test coverage detected