Skip to content
Snippets Groups Projects
Commit 2d23b75e authored by Miguel Borges de Freitas's avatar Miguel Borges de Freitas Committed by enen92
Browse files

add dvdnav_toggle_spu_stream

Allows the client application to enable/disable the state of the current
spu stream.
parent 8d1e595a
No related branches found
No related tags found
1 merge request!36add dvdnav_toggle_spu_stream
Pipeline #218452 failed with stage
in 26 seconds
......@@ -1252,6 +1252,29 @@ int8_t dvdnav_get_active_spu_stream(dvdnav_t *this) {
return retval;
}
dvdnav_status_t dvdnav_toggle_spu_stream(dvdnav_t *this, uint8_t visibility) {
if(!this->started) {
printerr("Virtual DVD machine not started.");
return DVDNAV_STATUS_ERR;
}
pthread_mutex_lock(&this->vm_lock);
switch(visibility) {
case 0: /* disable */
this->vm->state.SPST_REG &= ~0x40;
break;
case 1: /* enable */
this->vm->state.SPST_REG |= 0x40;
break;
default:
printerr("Invalid provided enabled_flag value");
pthread_mutex_unlock(&this->vm_lock);
return DVDNAV_STATUS_ERR;
}
pthread_mutex_unlock(&this->vm_lock);
return DVDNAV_STATUS_OK;
}
static int8_t dvdnav_is_domain(dvdnav_t *this, DVDDomain_t domain) {
int8_t retval;
......
......@@ -679,6 +679,17 @@ user_ops_t dvdnav_get_restrictions(dvdnav_t *self);
int8_t dvdnav_get_number_of_streams(dvdnav_t *self, dvdnav_stream_type_t stream_type);
/*********************************************************************
* setting stream attributes *
*********************************************************************/
/*
* Set the visible (enable) status of the current spu stream
* (to enable/disable subtitles)
* visibility defines if the spu stream should be enabled/visible (1) or disabled (0)
*/
dvdnav_status_t dvdnav_toggle_spu_stream(dvdnav_t *self, uint8_t visibility);
/*********************************************************************
* multiple angles *
*********************************************************************/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment