Commit 8a55c6ea authored by Ghislain MARY's avatar Ghislain MARY
Browse files

Add event to notify that we have recovered from a video decoding error.

parent aa511d1b
......@@ -736,6 +736,12 @@ MS2_PUBLIC bool_t video_stream_is_decoding_error_to_be_reported(VideoStream *str
*/
MS2_PUBLIC void video_stream_decoding_error_reported(VideoStream *stream);
/**
* Tell the video stream that a decoding error has been recovered so that new decoding can be reported sooner.
* @param[in] stream The VideoStream object.
*/
MS2_PUBLIC void video_stream_decoding_error_recovered(VideoStream *stream);
/**
* Force a resolution for the preview.
......
......@@ -218,6 +218,8 @@ typedef enum _MSRecorderState MSRecorderState;
MS_FILTER_METHOD(MSFilterVideoDecoderInterface, 7, MSVideoDisplayDecodingSupport*)
#define MS_VIDEO_DECODER_FREEZE_ON_ERROR \
MS_FILTER_METHOD(MSFilterVideoDecoderInterface, 8, bool_t)
#define MS_VIDEO_DECODER_RECOVERED_FROM_ERRORS \
MS_FILTER_EVENT_NO_ARG(MSFilterVideoDecoderInterface, 9)
/** Interface definitions for video capture */
#define MS_VIDEO_CAPTURE_SET_DEVICE_ORIENTATION \
......
......@@ -1098,4 +1098,6 @@ void video_stream_decoding_error_reported(VideoStream *stream) {
stream->last_reported_decoding_error_time = stream->ms.sessions.ticker->time;
}
void video_stream_decoding_error_recovered(VideoStream *stream) {
stream->last_reported_decoding_error_time = 0;
}
......@@ -427,6 +427,7 @@ static void send_pli(Vp8RtpFmtUnpackerCtx *ctx) {
ms_filter_notify_no_arg(ctx->filter, MS_VIDEO_DECODER_SEND_PLI);
} else {
ms_filter_notify_no_arg(ctx->filter, MS_VIDEO_DECODER_DECODING_ERRORS);
ctx->error_notified = TRUE;
}
}
......@@ -443,6 +444,7 @@ static void send_sli(Vp8RtpFmtUnpackerCtx *ctx, Vp8RtpFmtFrame *frame) {
}
} else {
ms_filter_notify_no_arg(ctx->filter, MS_VIDEO_DECODER_DECODING_ERRORS);
ctx->error_notified = TRUE;
}
}
......@@ -728,6 +730,10 @@ static void output_valid_partitions(Vp8RtpFmtUnpackerCtx *ctx, MSQueue *out) {
ctx->valid_keyframe_received = TRUE;
ctx->video_size = get_size_from_key_frame(frame);
ctx->waiting_for_reference_frame = FALSE;
if (ctx->error_notified == TRUE) {
ms_filter_notify_no_arg(ctx->filter, MS_VIDEO_DECODER_RECOVERED_FROM_ERRORS);
ctx->error_notified = FALSE;
}
}
if ((ctx->avpf_enabled == TRUE) && (frame->reference == TRUE)) {
ctx->waiting_for_reference_frame = FALSE;
......@@ -894,6 +900,7 @@ void vp8rtpfmt_unpacker_init(Vp8RtpFmtUnpackerCtx *ctx, MSFilter *f, bool_t avpf
ctx->output_partitions = output_partitions;
ctx->valid_keyframe_received = FALSE;
ctx->waiting_for_reference_frame = TRUE;
ctx->error_notified = FALSE;
ctx->initialized_last_ts = FALSE;
ctx->initialized_ref_cseq = FALSE;
}
......
......@@ -106,6 +106,7 @@ extern "C"{
bool_t freeze_on_error;
bool_t output_partitions;
bool_t waiting_for_reference_frame;
bool_t error_notified;
bool_t valid_keyframe_received;
bool_t initialized_last_ts;
bool_t initialized_ref_cseq;
......
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