Commit f9facc6a authored by Sebastian Dröge's avatar Sebastian Dröge
Browse files

video: Remove interlaced handling from the video base classes

This must be handled by the subclasses in 0.11 because interlacing
is much more complex now and can't be handled in a generic way.
parent ae42b25c
...@@ -1940,7 +1940,6 @@ gst_video_decoder_finish_frame (GstVideoDecoder * decoder, ...@@ -1940,7 +1940,6 @@ gst_video_decoder_finish_frame (GstVideoDecoder * decoder,
GstVideoCodecFrame * frame) GstVideoCodecFrame * frame)
{ {
GstVideoDecoderPrivate *priv = decoder->priv; GstVideoDecoderPrivate *priv = decoder->priv;
GstVideoCodecState *state = priv->output_state;
GstBuffer *output_buffer; GstBuffer *output_buffer;
GstFlowReturn ret = GST_FLOW_OK; GstFlowReturn ret = GST_FLOW_OK;
guint64 start, stop; guint64 start, stop;
...@@ -1967,26 +1966,6 @@ gst_video_decoder_finish_frame (GstVideoDecoder * decoder, ...@@ -1967,26 +1966,6 @@ gst_video_decoder_finish_frame (GstVideoDecoder * decoder,
frame->output_buffer = NULL; frame->output_buffer = NULL;
GST_BUFFER_FLAG_UNSET (output_buffer, GST_BUFFER_FLAG_DELTA_UNIT); GST_BUFFER_FLAG_UNSET (output_buffer, GST_BUFFER_FLAG_DELTA_UNIT);
if (GST_VIDEO_INFO_IS_INTERLACED (&state->info)) {
if (GST_VIDEO_CODEC_FRAME_FLAG_IS_SET (frame,
GST_VIDEO_CODEC_FRAME_FLAG_TFF)) {
GST_BUFFER_FLAG_SET (output_buffer, GST_VIDEO_BUFFER_FLAG_TFF);
} else {
GST_BUFFER_FLAG_UNSET (output_buffer, GST_VIDEO_BUFFER_FLAG_TFF);
}
if (GST_VIDEO_CODEC_FRAME_FLAG_IS_SET (frame,
GST_VIDEO_CODEC_FRAME_FLAG_RFF)) {
GST_BUFFER_FLAG_SET (output_buffer, GST_VIDEO_BUFFER_FLAG_RFF);
} else {
GST_BUFFER_FLAG_UNSET (output_buffer, GST_VIDEO_BUFFER_FLAG_RFF);
}
if (GST_VIDEO_CODEC_FRAME_FLAG_IS_SET (frame,
GST_VIDEO_CODEC_FRAME_FLAG_ONEFIELD)) {
GST_BUFFER_FLAG_SET (output_buffer, GST_VIDEO_BUFFER_FLAG_ONEFIELD);
} else {
GST_BUFFER_FLAG_UNSET (output_buffer, GST_VIDEO_BUFFER_FLAG_ONEFIELD);
}
}
if (priv->discont) { if (priv->discont) {
GST_BUFFER_FLAG_SET (output_buffer, GST_BUFFER_FLAG_DISCONT); GST_BUFFER_FLAG_SET (output_buffer, GST_BUFFER_FLAG_DISCONT);
...@@ -2122,21 +2101,16 @@ gst_video_decoder_get_frame_duration (GstVideoDecoder * decoder, ...@@ -2122,21 +2101,16 @@ gst_video_decoder_get_frame_duration (GstVideoDecoder * decoder,
GstVideoCodecFrame * frame) GstVideoCodecFrame * frame)
{ {
GstVideoCodecState *state = decoder->priv->output_state; GstVideoCodecState *state = decoder->priv->output_state;
gint fields;
if (state->info.fps_d == 0 || state->info.fps_n == 0) { if (state->info.fps_d == 0 || state->info.fps_n == 0) {
return GST_CLOCK_TIME_NONE; return GST_CLOCK_TIME_NONE;
} }
if (GST_VIDEO_CODEC_FRAME_FLAG_IS_SET (frame, GST_VIDEO_CODEC_FRAME_FLAG_RFF)) /* FIXME: For interlaced frames this needs to take into account
fields = 3; * the number of valid fields in the frame
else if (GST_VIDEO_CODEC_FRAME_FLAG_IS_SET (frame, */
GST_VIDEO_CODEC_FRAME_FLAG_ONEFIELD))
fields = 1;
else
fields = 2;
return gst_util_uint64_scale (fields * GST_SECOND, state->info.fps_d, return gst_util_uint64_scale (GST_SECOND, state->info.fps_d,
state->info.fps_n); state->info.fps_n);
} }
......
...@@ -1089,26 +1089,6 @@ gst_video_encoder_new_frame (GstVideoEncoder * encoder, GstBuffer * buf, ...@@ -1089,26 +1089,6 @@ gst_video_encoder_new_frame (GstVideoEncoder * encoder, GstBuffer * buf,
frame->pts = timestamp; frame->pts = timestamp;
frame->duration = duration; frame->duration = duration;
if (GST_VIDEO_INFO_IS_INTERLACED (&encoder->priv->input_state->info)) {
if (GST_BUFFER_FLAG_IS_SET (buf, GST_VIDEO_BUFFER_FLAG_TFF)) {
GST_VIDEO_CODEC_FRAME_FLAG_SET (frame, GST_VIDEO_CODEC_FRAME_FLAG_TFF);
} else {
GST_VIDEO_CODEC_FRAME_FLAG_UNSET (frame, GST_VIDEO_CODEC_FRAME_FLAG_TFF);
}
if (GST_BUFFER_FLAG_IS_SET (buf, GST_VIDEO_BUFFER_FLAG_RFF)) {
GST_VIDEO_CODEC_FRAME_FLAG_SET (frame, GST_VIDEO_CODEC_FRAME_FLAG_RFF);
} else {
GST_VIDEO_CODEC_FRAME_FLAG_UNSET (frame, GST_VIDEO_CODEC_FRAME_FLAG_RFF);
}
if (GST_BUFFER_FLAG_IS_SET (buf, GST_VIDEO_BUFFER_FLAG_ONEFIELD)) {
GST_VIDEO_CODEC_FRAME_FLAG_SET (frame,
GST_VIDEO_CODEC_FRAME_FLAG_ONEFIELD);
} else {
GST_VIDEO_CODEC_FRAME_FLAG_UNSET (frame,
GST_VIDEO_CODEC_FRAME_FLAG_ONEFIELD);
}
}
return frame; return frame;
} }
......
...@@ -74,9 +74,6 @@ struct _GstVideoCodecState ...@@ -74,9 +74,6 @@ struct _GstVideoCodecState
* @GST_VIDEO_CODEC_FRAME_FLAG_SYNC_POINT: is the frame a synchronization point (keyframe) * @GST_VIDEO_CODEC_FRAME_FLAG_SYNC_POINT: is the frame a synchronization point (keyframe)
* @GST_VIDEO_CODEC_FRAME_FLAG_FORCE_KEYFRAME: should the output frame be made a keyframe * @GST_VIDEO_CODEC_FRAME_FLAG_FORCE_KEYFRAME: should the output frame be made a keyframe
* @GST_VIDEO_CODEC_FRAME_FLAG_FORCE_KEYFRAME_HEADERS: should the encoder output stream headers * @GST_VIDEO_CODEC_FRAME_FLAG_FORCE_KEYFRAME_HEADERS: should the encoder output stream headers
* @GST_VIDEO_CODEC_FRAME_FLAG_TFF: top-field first
* @GST_VIDEO_CODEC_FRAME_FLAG_RFF: the field is repeated
* @GST_VIDEO_CODEC_FRAME_FLAG_ONEFIELD: only one field is present
* *
* Flags for #GstVideoCodecFrame * Flags for #GstVideoCodecFrame
*/ */
...@@ -85,10 +82,7 @@ typedef enum ...@@ -85,10 +82,7 @@ typedef enum
GST_VIDEO_CODEC_FRAME_FLAG_DECODE_ONLY = (1<<0), GST_VIDEO_CODEC_FRAME_FLAG_DECODE_ONLY = (1<<0),
GST_VIDEO_CODEC_FRAME_FLAG_SYNC_POINT = (1<<1), GST_VIDEO_CODEC_FRAME_FLAG_SYNC_POINT = (1<<1),
GST_VIDEO_CODEC_FRAME_FLAG_FORCE_KEYFRAME = (1<<2), GST_VIDEO_CODEC_FRAME_FLAG_FORCE_KEYFRAME = (1<<2),
GST_VIDEO_CODEC_FRAME_FLAG_FORCE_KEYFRAME_HEADERS = (1<<3), GST_VIDEO_CODEC_FRAME_FLAG_FORCE_KEYFRAME_HEADERS = (1<<3)
GST_VIDEO_CODEC_FRAME_FLAG_TFF = (1<<4),
GST_VIDEO_CODEC_FRAME_FLAG_RFF = (1<<5),
GST_VIDEO_CODEC_FRAME_FLAG_ONEFIELD = (1<<6)
} GstVideoCodecFrameFlags; } GstVideoCodecFrameFlags;
/** /**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment