Skip to content

Commit

Permalink
stream: add STREAM_GET_PRIVATE_BLOCK for block-based buffering
Browse files Browse the repository at this point in the history
  • Loading branch information
Rémi Denis-Courmont committed Aug 25, 2015
1 parent 561195e commit 84d07db
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/vlc_stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_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_BLOCK, /**< arg1= block_t **b, arg2=bool *eof */
};

VLC_API ssize_t stream_Read(stream_t *, void *, size_t);
Expand Down
15 changes: 15 additions & 0 deletions src/input/stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,21 @@ int stream_vaControl(stream_t *s, int cmd, va_list args)
}
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);
}
Expand Down

0 comments on commit 84d07db

Please sign in to comment.