Browse Source

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.
jp9000 11 years ago
parent
commit
db81c59b5e

+ 0 - 11
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, "

+ 0 - 4
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];

+ 0 - 1
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];

+ 0 - 1
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;

+ 1 - 1
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);

+ 0 - 2
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);