Commit 62417844 authored by Pierre-Eric Pelloux-Prayer's avatar Pierre-Eric Pelloux-Prayer
Browse files

Add a reset method for the IMAGE_DECODED callback from video decoders

parent 8e25f4c9
......@@ -129,6 +129,8 @@ typedef enum _MSPlayerState MSPlayerState;
MS_FILTER_EVENT_NO_ARG(MSFilterVideoDecoderInterface,0)
#define MS_VIDEO_DECODER_FIRST_IMAGE_DECODED \
MS_FILTER_EVENT_NO_ARG(MSFilterVideoDecoderInterface,1)
#define MS_VIDEO_DECODER_RESET_FIRST_IMAGE_NOTIFICATION \
MS_FILTER_METHOD_NO_ARG(MSFilterVideoDecoderInterface, 0)
/** Interface definitions for video capture */
#define MS_VIDEO_CAPTURE_SET_DEVICE_ORIENTATION \
......
......@@ -312,8 +312,14 @@ static int dec_add_fmtp(MSFilter *f, void *arg){
return 0;
}
static void reset_first_image(MSFilter* f) {
DecData *d=(DecData*)f->data;
d->first_image_decoded = FALSE;
}
static MSFilterMethod h264_dec_methods[]={
{ MS_FILTER_ADD_FMTP , dec_add_fmtp },
{ MS_VIDEO_DECODER_RESET_FIRST_IMAGE_NOTIFICATION, reset_first_image },
{ 0 , NULL }
};
......
......@@ -705,10 +705,16 @@ static void dec_process(MSFilter *f){
}
}
static void reset_first_image(MSFilter* f) {
DecState *s=(DecState*)f->data;
s->first_image_decoded = FALSE;
}
static MSFilterMethod methods[]={
{ MS_FILTER_ADD_FMTP , dec_add_fmtp },
{ MS_VIDEO_DECODER_RESET_FIRST_IMAGE_NOTIFICATION, reset_first_image },
{ 0 , NULL }
};
......
......@@ -602,7 +602,7 @@ static void dec_process(MSFilter *f) {
}
}
ms_queue_put(f->outputs[0], dupmsg(s->yuv_msg));
if (!s->first_image_decoded) {
ms_filter_notify_no_arg(f,MS_VIDEO_DECODER_FIRST_IMAGE_DECODED);
s->first_image_decoded = TRUE;
......@@ -613,6 +613,16 @@ static void dec_process(MSFilter *f) {
}
}
static void reset_first_image(MSFilter* f) {
DecState *s=(DecState*)f->data;
s->first_image_decoded = FALSE;
}
static MSFilterMethod dec_methods[]={
{ MS_VIDEO_DECODER_RESET_FIRST_IMAGE_NOTIFICATION, reset_first_image },
{ 0 , NULL }
};
#ifdef _MSC_VER
MSFilterDesc ms_vp8_dec_desc={
MS_VP8_DEC_ID,
......@@ -627,7 +637,7 @@ MSFilterDesc ms_vp8_dec_desc={
dec_process,
NULL,
dec_uninit,
NULL
dec_methods
};
#else
MSFilterDesc ms_vp8_dec_desc={
......@@ -643,7 +653,7 @@ MSFilterDesc ms_vp8_dec_desc={
.process=dec_process,
.postprocess=NULL,
.uninit=dec_uninit,
.methods=NULL
.methods=dec_methods
};
#endif
MS_FILTER_DESC_EXPORT(ms_vp8_dec_desc)
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