From db81c59b5eebc1e49553f654ec3d41b4fe5b28a8 Mon Sep 17 00:00:00 2001 From: jp9000 Date: Thu, 23 Oct 2014 07:27:04 -0700 Subject: [PATCH] Revert "Add flag to obs_source_frame for unbuffered video" This reverts commit c3f4b0f01802692fee33c0504e16189def6063c4. The obs_source_frame should not need to take flags to do this. This shouldn't be a setting associated with the frame, but rather a setting associated with the source itself. This was the wrong approach to solving this particular problem. --- libobs/obs-source.c | 11 ----------- libobs/obs.h | 4 ---- plugins/linux-v4l2/v4l2-input.c | 1 - plugins/mac-avcapture/av-capture.m | 1 - plugins/mac-capture/mac-window-capture.m | 2 +- plugins/win-dshow/win-dshow.cpp | 2 -- 6 files changed, 1 insertion(+), 20 deletions(-) diff --git a/libobs/obs-source.c b/libobs/obs-source.c index a506a9c08..8b7a92c09 100644 --- a/libobs/obs-source.c +++ b/libobs/obs-source.c @@ -1606,17 +1606,6 @@ static bool ready_async_frame(obs_source_t *source, uint64_t sys_time) uint64_t frame_time = next_frame->timestamp; uint64_t frame_offset = 0; - while ((next_frame->flags & OBS_VIDEO_UNBUFFERED) != 0 && - source->video_frames.num > 1) { - - da_erase(source->video_frames, 0); - obs_source_frame_destroy(next_frame); - next_frame = source->video_frames.array[0]; - } - - if ((next_frame->flags & OBS_VIDEO_UNBUFFERED) != 0) - return true; - #if DEBUG_ASYNC_FRAMES blog(LOG_DEBUG, "source->last_frame_ts: %llu, frame_time: %llu, " "sys_offset: %llu, frame_offset: %llu, " diff --git a/libobs/obs.h b/libobs/obs.h index f8faa5f32..533482ace 100644 --- a/libobs/obs.h +++ b/libobs/obs.h @@ -174,9 +174,6 @@ struct obs_source_audio { uint64_t timestamp; }; -/** Specifies that the video frame should be played as soon as possible */ -#define OBS_VIDEO_UNBUFFERED (1<<0) - /** * Source asynchronous video output structure. Used with * obs_source_output_video to output asynchronous video. Video is buffered as @@ -192,7 +189,6 @@ struct obs_source_frame { uint32_t width; uint32_t height; uint64_t timestamp; - uint32_t flags; enum video_format format; float color_matrix[16]; diff --git a/plugins/linux-v4l2/v4l2-input.c b/plugins/linux-v4l2/v4l2-input.c index 88ee3ba5e..88155db9d 100644 --- a/plugins/linux-v4l2/v4l2-input.c +++ b/plugins/linux-v4l2/v4l2-input.c @@ -178,7 +178,6 @@ static void *v4l2_thread(void *vptr) } out.timestamp = timeval2ns(buf.timestamp); - out.flags = 0; start = (uint8_t *) data->buffers.info[buf.index].start; for (uint_fast32_t i = 0; i < MAX_AV_PLANES; ++i) out.data[i] = start + plane_offsets[i]; diff --git a/plugins/mac-avcapture/av-capture.m b/plugins/mac-avcapture/av-capture.m index 45bfb9623..1077809eb 100644 --- a/plugins/mac-avcapture/av-capture.m +++ b/plugins/mac-avcapture/av-capture.m @@ -232,7 +232,6 @@ static inline bool update_frame(struct av_capture *capture, CMTime target_pts_nano = CMTimeConvertScale(target_pts, NANO_TIMESCALE, kCMTimeRoundingMethod_Default); frame->timestamp = target_pts_nano.value; - frame->flags = 0; if (!update_frame(capture, frame, sampleBuffer)) return; diff --git a/plugins/mac-capture/mac-window-capture.m b/plugins/mac-capture/mac-window-capture.m index 2371f1e1b..d2d1a8beb 100644 --- a/plugins/mac-capture/mac-window-capture.m +++ b/plugins/mac-capture/mac-window-capture.m @@ -75,7 +75,7 @@ static inline void capture_frame(struct window_capture *wc) .height = height, .data[0] = data, .linesize[0] = width * 4, - .timestamp = ts + .timestamp = ts, }; obs_source_output_video(wc->source, &frame); diff --git a/plugins/win-dshow/win-dshow.cpp b/plugins/win-dshow/win-dshow.cpp index 904ecf680..9abc53bfe 100644 --- a/plugins/win-dshow/win-dshow.cpp +++ b/plugins/win-dshow/win-dshow.cpp @@ -377,7 +377,6 @@ void DShowInput::OnEncodedVideoData(enum AVCodecID id, if (got_output) { frame.timestamp = (uint64_t)ts * 100; - frame.flags = 0; #if LOG_ENCODED_VIDEO_TS blog(LOG_DEBUG, "video ts: %llu", frame.timestamp); #endif @@ -398,7 +397,6 @@ void DShowInput::OnVideoData(const VideoConfig &config, const int cy = config.cy; frame.timestamp = (uint64_t)startTime * 100; - frame.flags = 0; frame.width = config.cx; frame.height = config.cy; frame.format = ConvertVideoFormat(config.format); -- GitLab