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.
This commit is contained in:
Sebastian Dröge 2012-04-25 18:21:03 +02:00
parent ae42b25c07
commit f9facc6a4a
3 changed files with 5 additions and 57 deletions

View file

@ -1940,7 +1940,6 @@ gst_video_decoder_finish_frame (GstVideoDecoder * decoder,
GstVideoCodecFrame * frame)
{
GstVideoDecoderPrivate *priv = decoder->priv;
GstVideoCodecState *state = priv->output_state;
GstBuffer *output_buffer;
GstFlowReturn ret = GST_FLOW_OK;
guint64 start, stop;
@ -1967,26 +1966,6 @@ gst_video_decoder_finish_frame (GstVideoDecoder * decoder,
frame->output_buffer = NULL;
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) {
GST_BUFFER_FLAG_SET (output_buffer, GST_BUFFER_FLAG_DISCONT);
@ -2122,21 +2101,16 @@ gst_video_decoder_get_frame_duration (GstVideoDecoder * decoder,
GstVideoCodecFrame * frame)
{
GstVideoCodecState *state = decoder->priv->output_state;
gint fields;
if (state->info.fps_d == 0 || state->info.fps_n == 0) {
return GST_CLOCK_TIME_NONE;
}
if (GST_VIDEO_CODEC_FRAME_FLAG_IS_SET (frame, GST_VIDEO_CODEC_FRAME_FLAG_RFF))
fields = 3;
else if (GST_VIDEO_CODEC_FRAME_FLAG_IS_SET (frame,
GST_VIDEO_CODEC_FRAME_FLAG_ONEFIELD))
fields = 1;
else
fields = 2;
/* FIXME: For interlaced frames this needs to take into account
* the number of valid fields in the frame
*/
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);
}

View file

@ -1089,26 +1089,6 @@ gst_video_encoder_new_frame (GstVideoEncoder * encoder, GstBuffer * buf,
frame->pts = timestamp;
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;
}

View file

@ -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_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_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
*/
@ -85,10 +82,7 @@ typedef enum
GST_VIDEO_CODEC_FRAME_FLAG_DECODE_ONLY = (1<<0),
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_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)
GST_VIDEO_CODEC_FRAME_FLAG_FORCE_KEYFRAME_HEADERS = (1<<3)
} GstVideoCodecFrameFlags;
/**