Commit 29f1784d authored by gb's avatar gb Committed by Gwenole Beauchesne

Add more error codes. Fix documentation.

parent eddf6b0d
......@@ -73,7 +73,10 @@ decoder_thread_cb(gpointer data)
g_mutex_unlock(priv->adapter_mutex);
if (!priv->decoder_thread_cancel) {
if (status == GST_VAAPI_DECODER_STATUS_SUCCESS) {
switch (status) {
case GST_VAAPI_DECODER_STATUS_SUCCESS:
case GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA:
GST_DEBUG("decode");
g_object_ref(decoder);
status = klass->decode(decoder);
g_object_unref(decoder);
......@@ -85,8 +88,8 @@ decoder_thread_cb(gpointer data)
status = GST_VAAPI_DECODER_STATUS_END_OF_STREAM;
GST_DEBUG("decode frame (status = %d)", status);
}
else {
break;
default:
/* XXX: something went wrong, simply destroy any
buffer until this decoder is destroyed */
g_mutex_lock(priv->adapter_mutex);
......@@ -96,6 +99,7 @@ decoder_thread_cb(gpointer data)
/* Signal the main thread we got an error */
if (status != GST_VAAPI_DECODER_STATUS_END_OF_STREAM)
gst_vaapi_decoder_push_surface(decoder, NULL);
break;
}
}
......
......@@ -60,8 +60,12 @@ typedef struct _GstVaapiDecoderClass GstVaapiDecoderClass;
* GstVaapiDecoderStatus:
* @GST_VAAPI_DECODER_STATUS_SUCCESS: Success.
* @GST_VAAPI_DECODER_STATUS_TIMEOUT: Timeout. Try again later.
* @GST_VAAPI_DECODER_STATUS_EOS: End-Of-Stream.
* @GST_VAAPI_DECODER_STATUS_ERROR: Unknown error.
* @GST_VAAPI_DECODER_STATUS_END_OF_STREAM: End-Of-Stream.
* @GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED: No memory left.
* @GST_VAAPI_DECODER_STATUS_ERROR_INIT_FAILED: Decoder initialization failure.
* @GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA: Not enough input data to decode.
* @GST_VAAPI_DECODER_STATUS_ERROR_INVALID_SURFACE: Invalid surface.
* @GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN: Unknown error.
*
* Decoder status for gst_vaapi_decoder_get_surface().
*/
......@@ -71,6 +75,8 @@ enum _GstVaapiDecoderStatus {
GST_VAAPI_DECODER_STATUS_END_OF_STREAM,
GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED,
GST_VAAPI_DECODER_STATUS_ERROR_INIT_FAILED,
GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA,
GST_VAAPI_DECODER_STATUS_ERROR_INVALID_SURFACE,
GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN
};
......
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