static int gst_schro_dec_scan_for_sync (GstBaseVideoDecoder *
base_video_decoder, gboolean at_eos, int offset, int n);
static GstFlowReturn gst_schro_dec_handle_frame (GstBaseVideoDecoder * decoder,
- GstVideoFrame * frame, GstClockTimeDiff deadline);
+ GstVideoFrame * frame);
static gboolean gst_schro_dec_finish (GstBaseVideoDecoder * base_video_decoder);
static void gst_schrodec_send_tags (GstSchroDec * schro_dec);
GstFlowReturn
gst_schro_dec_handle_frame (GstBaseVideoDecoder * base_video_decoder,
- GstVideoFrame * frame, GstClockTimeDiff deadline)
+ GstVideoFrame * frame)
{
GstSchroDec *schro_dec;
int schro_ret;
static GstFlowReturn gst_vp8_dec_parse_data (GstBaseVideoDecoder * decoder,
gboolean at_eos);
static GstFlowReturn gst_vp8_dec_handle_frame (GstBaseVideoDecoder * decoder,
- GstVideoFrame * frame, GstClockTimeDiff deadline);
+ GstVideoFrame * frame);
static GstStaticPadTemplate gst_vp8_dec_sink_template =
GST_STATIC_PAD_TEMPLATE ("sink",
}
static GstFlowReturn
-gst_vp8_dec_handle_frame (GstBaseVideoDecoder * decoder, GstVideoFrame * frame,
- GstClockTimeDiff deadline)
+gst_vp8_dec_handle_frame (GstBaseVideoDecoder * decoder, GstVideoFrame * frame)
{
GstVP8Dec *dec;
GstFlowReturn ret = GST_FLOW_OK;
vpx_codec_iter_t iter = NULL;
vpx_image_t *img;
long decoder_deadline = 0;
+ GstClockTimeDiff deadline;
GST_DEBUG_OBJECT (decoder, "handle_frame");
}
#endif
+ deadline = gst_base_video_decoder_get_max_decode_time (decoder, frame);
if (deadline < 0) {
decoder_deadline = 1;
} else if (deadline == G_MAXINT64) {
GstVideoFrame *frame = base_video_decoder->current_frame;
GstBaseVideoDecoderClass *base_video_decoder_class;
GstFlowReturn ret = GST_FLOW_OK;
- GstClockTime running_time;
- GstClockTimeDiff deadline;
base_video_decoder_class =
GST_BASE_VIDEO_DECODER_GET_CLASS (base_video_decoder);
base_video_decoder->frames = g_list_append (base_video_decoder->frames,
frame);
- running_time = gst_segment_to_running_time (&base_video_decoder->segment,
+ frame->deadline = gst_segment_to_running_time (&base_video_decoder->segment,
GST_FORMAT_TIME, frame->presentation_timestamp);
- if (GST_CLOCK_TIME_IS_VALID (base_video_decoder->earliest_time))
- deadline = GST_CLOCK_DIFF (base_video_decoder->earliest_time, running_time);
- else
- deadline = G_MAXINT64;
-
/* do something with frame */
- ret = base_video_decoder_class->handle_frame (base_video_decoder, frame,
- deadline);
+ ret = base_video_decoder_class->handle_frame (base_video_decoder, frame);
if (!GST_FLOW_IS_SUCCESS (ret)) {
GST_DEBUG ("flow error!");
}
return flow_ret;
}
+
+GstClockTimeDiff
+gst_base_video_decoder_get_max_decode_time (GstBaseVideoDecoder *
+ base_video_decoder, GstVideoFrame * frame)
+{
+ GstClockTimeDiff deadline;
+
+ if (GST_CLOCK_TIME_IS_VALID (base_video_decoder->earliest_time))
+ deadline = GST_CLOCK_DIFF (base_video_decoder->earliest_time,
+ frame->deadline);
+ else
+ deadline = G_MAXINT64;
+
+ return deadline;
+}
int offset, int n);
GstFlowReturn (*parse_data) (GstBaseVideoDecoder *decoder, gboolean at_eos);
GstFlowReturn (*finish) (GstBaseVideoDecoder *coder);
- GstFlowReturn (*handle_frame) (GstBaseVideoDecoder *coder, GstVideoFrame *frame,
- GstClockTimeDiff deadline);
+ GstFlowReturn (*handle_frame) (GstBaseVideoDecoder *coder, GstVideoFrame *frame);
GstFlowReturn (*shape_output) (GstBaseVideoDecoder *coder, GstVideoFrame *frame);
GstCaps *(*get_caps) (GstBaseVideoDecoder *coder);
GstFlowReturn gst_base_video_decoder_alloc_src_frame (GstBaseVideoDecoder *base_video_decoder,
GstVideoFrame *frame);
+GstClockTimeDiff gst_base_video_decoder_get_max_decode_time (
+ GstBaseVideoDecoder *base_video_decoder, GstVideoFrame *frame);
+
G_END_DECLS
#endif
int n_fields;
void *coder_hook;
+ GstClockTime deadline;
};
gboolean gst_base_video_rawvideo_convert (GstVideoState *state,