X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=quicksync_encoder.cpp;h=068e2d416dc3fe3b2c1ccdebcfc6ab97244fe82e;hb=4a0187ffb4075b4d217b8d9e9c96cac548b199d8;hp=67e9668faaecbac253e6d37877664651ba47a927;hpb=27af21bd4b1d1638841a580d6a61608da08a8229;p=nageru diff --git a/quicksync_encoder.cpp b/quicksync_encoder.cpp index 67e9668..068e2d4 100644 --- a/quicksync_encoder.cpp +++ b/quicksync_encoder.cpp @@ -82,6 +82,7 @@ std::atomic metric_quick_sync_stalled_frames{0}; exit(1); \ } +#undef BUFFER_OFFSET #define BUFFER_OFFSET(i) ((char *)NULL + (i)) //#include "loadsurface.h" @@ -763,7 +764,7 @@ void QuickSyncEncoderImpl::va_close_display(VADisplay va_dpy) int QuickSyncEncoderImpl::init_va(const string &va_display) { - VAProfile profile_list[]={VAProfileH264High, VAProfileH264Main, VAProfileH264Baseline, VAProfileH264ConstrainedBaseline}; + VAProfile profile_list[]={VAProfileH264High, VAProfileH264Main, VAProfileH264ConstrainedBaseline}; VAEntrypoint *entrypoints; int num_entrypoints, slice_entrypoint; int support_encode = 0; @@ -806,11 +807,6 @@ int QuickSyncEncoderImpl::init_va(const string &va_display) exit(1); } else { switch (h264_profile) { - case VAProfileH264Baseline: - ip_period = 1; - constraint_set_flag |= (1 << 0); /* Annex A.2.1 */ - h264_entropy_mode = 0; - break; case VAProfileH264ConstrainedBaseline: constraint_set_flag |= (1 << 0 | 1 << 1); /* Annex A.2.2 */ ip_period = 1; @@ -824,7 +820,7 @@ int QuickSyncEncoderImpl::init_va(const string &va_display) constraint_set_flag |= (1 << 3); /* Annex A.2.4 */ break; default: - h264_profile = VAProfileH264Baseline; + h264_profile = VAProfileH264ConstrainedBaseline; ip_period = 1; constraint_set_flag |= (1 << 0); /* Annex A.2.1 */ break; @@ -1875,8 +1871,11 @@ void QuickSyncEncoderImpl::encode_thread_func() if (frame_type == FRAME_IDR) { // Release any reference frames from the previous GOP. - for (const ReferenceFrame &frame : reference_frames) { - release_gl_surface(frame.display_number); + { + unique_lock lock(storage_task_queue_mutex); + for (const ReferenceFrame &frame : reference_frames) { + release_gl_surface(frame.display_number); + } } reference_frames.clear(); current_ref_frame_num = 0;