Commit 84d07db2 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

stream: add STREAM_GET_PRIVATE_BLOCK for block-based buffering

parent 561195e1
...@@ -106,6 +106,7 @@ enum stream_query_e ...@@ -106,6 +106,7 @@ enum stream_query_e
STREAM_SET_PRIVATE_ID_STATE = 0x1000, /* arg1= int i_private_data, bool b_selected res=can fail */ STREAM_SET_PRIVATE_ID_STATE = 0x1000, /* arg1= int i_private_data, bool b_selected res=can fail */
STREAM_SET_PRIVATE_ID_CA, /* arg1= int i_program_number, uint16_t i_vpid, uint16_t i_apid1, uint16_t i_apid2, uint16_t i_apid3, uint8_t i_length, uint8_t *p_data */ STREAM_SET_PRIVATE_ID_CA, /* arg1= int i_program_number, uint16_t i_vpid, uint16_t i_apid1, uint16_t i_apid2, uint16_t i_apid3, uint8_t i_length, uint8_t *p_data */
STREAM_GET_PRIVATE_ID_STATE, /* arg1=int i_private_data arg2=bool * res=can fail */ STREAM_GET_PRIVATE_ID_STATE, /* arg1=int i_private_data arg2=bool * res=can fail */
STREAM_GET_PRIVATE_BLOCK, /**< arg1= block_t **b, arg2=bool *eof */
}; };
VLC_API ssize_t stream_Read(stream_t *, void *, size_t); VLC_API ssize_t stream_Read(stream_t *, void *, size_t);
......
...@@ -498,6 +498,21 @@ int stream_vaControl(stream_t *s, int cmd, va_list args) ...@@ -498,6 +498,21 @@ int stream_vaControl(stream_t *s, int cmd, va_list args)
} }
return ret; return ret;
} }
case STREAM_GET_PRIVATE_BLOCK:
{
block_t **b = va_arg(args, block_t **);
bool *eof = va_arg(args, bool *);
if (priv->peek != NULL)
{
*b = priv->peek;
priv->peek = NULL;
*eof = false;
return VLC_SUCCESS;
}
return stream_ControlInternal(s, STREAM_GET_PRIVATE_BLOCK, b, eof);
}
} }
return s->pf_control(s, cmd, args); return s->pf_control(s, cmd, args);
} }
......
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