summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Santos <thiagoss@osg.samsung.com>2016-03-18 20:00:52 -0300
committerThiago Santos <thiagoss@osg.samsung.com>2016-04-01 09:53:24 -0300
commit506c9e2b5bbc50730b0083598b346b0fcc41ec78 (patch)
treed7452b29edc6cf7fade13c4d12a5db77d8833ceb
parent80c3bfe4485b98596489eb2f5eb3836fc5ec0bea (diff)
vaapidecode: add stop function
Clear any status on the current stream: stored frames, caps and decoder configuration https://bugzilla.gnome.org/show_bug.cgi?id=763460
-rw-r--r--gst/vaapi/gstvaapidecode.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/gst/vaapi/gstvaapidecode.c b/gst/vaapi/gstvaapidecode.c
index eb25ec8a..c3ac9b1e 100644
--- a/gst/vaapi/gstvaapidecode.c
+++ b/gst/vaapi/gstvaapidecode.c
@@ -937,8 +937,6 @@ gst_vaapidecode_finalize (GObject * object)
{
GstVaapiDecode *const decode = GST_VAAPIDECODE (object);
- gst_caps_replace (&decode->sinkpad_caps, NULL);
- gst_caps_replace (&decode->srcpad_caps, NULL);
gst_caps_replace (&decode->allowed_caps, NULL);
g_cond_clear (&decode->surface_ready);
@@ -976,13 +974,26 @@ gst_vaapidecode_close (GstVideoDecoder * vdec)
{
GstVaapiDecode *const decode = GST_VAAPIDECODE (vdec);
- gst_vaapi_decode_input_state_replace (decode, NULL);
gst_vaapidecode_destroy (decode);
gst_vaapi_plugin_base_close (GST_VAAPI_PLUGIN_BASE (decode));
return TRUE;
}
static gboolean
+gst_vaapidecode_stop (GstVideoDecoder * vdec)
+{
+ GstVaapiDecode *const decode = GST_VAAPIDECODE (vdec);
+
+ gst_vaapidecode_purge (decode);
+ gst_vaapi_decode_input_state_replace (decode, NULL);
+ gst_vaapi_decoder_replace (&decode->decoder, NULL);
+ gst_caps_replace (&decode->decoder_caps, NULL);
+ gst_caps_replace (&decode->sinkpad_caps, NULL);
+ gst_caps_replace (&decode->srcpad_caps, NULL);
+ return TRUE;
+}
+
+static gboolean
gst_vaapidecode_flush (GstVideoDecoder * vdec)
{
GstVaapiDecode *const decode = GST_VAAPIDECODE (vdec);
@@ -1235,6 +1246,7 @@ gst_vaapidecode_class_init (GstVaapiDecodeClass * klass)
vdec_class->open = GST_DEBUG_FUNCPTR (gst_vaapidecode_open);
vdec_class->close = GST_DEBUG_FUNCPTR (gst_vaapidecode_close);
+ vdec_class->stop = GST_DEBUG_FUNCPTR (gst_vaapidecode_stop);
vdec_class->set_format = GST_DEBUG_FUNCPTR (gst_vaapidecode_set_format);
vdec_class->flush = GST_DEBUG_FUNCPTR (gst_vaapidecode_flush);
vdec_class->parse = GST_DEBUG_FUNCPTR (gst_vaapidecode_parse);