mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 07:58:51 +00:00
use new bytestream api
Original commit message from CVS: use new bytestream api
This commit is contained in:
parent
c622ee22a8
commit
163076dd9e
3 changed files with 11 additions and 8 deletions
|
@ -716,6 +716,7 @@ gst_ladspa_loop(GstElement *element)
|
||||||
guint num_processed, num_to_process;
|
guint num_processed, num_to_process;
|
||||||
GstEvent *event = NULL;
|
GstEvent *event = NULL;
|
||||||
guint32 waiting;
|
guint32 waiting;
|
||||||
|
guint32 got_bytes;
|
||||||
LADSPA_Data **data_in, **data_out;
|
LADSPA_Data **data_in, **data_out;
|
||||||
GstBuffer **buffers_in, **buffers_out;
|
GstBuffer **buffers_in, **buffers_out;
|
||||||
GstBufferPool *bufpool;
|
GstBufferPool *bufpool;
|
||||||
|
@ -750,9 +751,9 @@ gst_ladspa_loop(GstElement *element)
|
||||||
/* first get all the necessary data from the input ports */
|
/* first get all the necessary data from the input ports */
|
||||||
for (i=0 ; i<numsinkpads ; i++){
|
for (i=0 ; i<numsinkpads ; i++){
|
||||||
GST_DEBUG (0, "pulling %u bytes through channel %d'sbytestream", bufferbytesize, i);
|
GST_DEBUG (0, "pulling %u bytes through channel %d'sbytestream", bufferbytesize, i);
|
||||||
buffers_in[i] = gst_bytestream_read (bytestreams[i], bufferbytesize);
|
got_bytes = gst_bytestream_read (bytestreams[i], buffers_in + i, bufferbytesize);
|
||||||
|
|
||||||
if (buffers_in[i] == NULL) {
|
if (got_bytes != bufferbytesize) {
|
||||||
/* we need to check for an event. */
|
/* we need to check for an event. */
|
||||||
gst_bytestream_get_status (bytestreams[i], &waiting, &event);
|
gst_bytestream_get_status (bytestreams[i], &waiting, &event);
|
||||||
|
|
||||||
|
|
|
@ -435,11 +435,12 @@ static GstBuffer*
|
||||||
flx_get_data(GstFlxDec *flxdec, gulong size)
|
flx_get_data(GstFlxDec *flxdec, gulong size)
|
||||||
{
|
{
|
||||||
GstBuffer *retbuf;
|
GstBuffer *retbuf;
|
||||||
|
guint32 got_bytes;
|
||||||
|
|
||||||
g_return_val_if_fail (flxdec != NULL, NULL);
|
g_return_val_if_fail (flxdec != NULL, NULL);
|
||||||
|
|
||||||
retbuf = gst_bytestream_read (flxdec->bs, size);
|
got_bytes = gst_bytestream_read (flxdec->bs, &retbuf, size);
|
||||||
if (!retbuf) {
|
if (got_bytes < size) {
|
||||||
GstEvent *event;
|
GstEvent *event;
|
||||||
guint32 remaining;
|
guint32 remaining;
|
||||||
|
|
||||||
|
|
|
@ -362,7 +362,7 @@ gst_qtp_read_bytes_atom_head(GstQTDemux * qtdemux,GstQtpAtom * atom)
|
||||||
/* FIXME this can't be right, rewrite with _read */
|
/* FIXME this can't be right, rewrite with _read */
|
||||||
do { /* do ... while (event()) is necessary for bytestream events */
|
do { /* do ... while (event()) is necessary for bytestream events */
|
||||||
if (!amh) {
|
if (!amh) {
|
||||||
if ((amh = (GstQtpAtomMinHeader*) gst_bytestream_peek_bytes (bs, 8))) {
|
if (gst_bytestream_peek_bytes (bs, (guint8**)&amh, 8) == 8) {
|
||||||
atom->size = GUINT32_FROM_BE(amh->size);
|
atom->size = GUINT32_FROM_BE(amh->size);
|
||||||
atom->type = amh->type; /* don't need to turn this around magicly FIXME this can depend on endiannes */
|
atom->type = amh->type; /* don't need to turn this around magicly FIXME this can depend on endiannes */
|
||||||
atom->start = qtdemux->bs_pos;
|
atom->start = qtdemux->bs_pos;
|
||||||
|
@ -372,7 +372,7 @@ gst_qtp_read_bytes_atom_head(GstQTDemux * qtdemux,GstQtpAtom * atom)
|
||||||
}
|
}
|
||||||
if (amh) {
|
if (amh) {
|
||||||
if (atom->size == 1) { /* need to peek extended size field */
|
if (atom->size == 1) { /* need to peek extended size field */
|
||||||
if ((esize = (guint64*) gst_bytestream_peek_bytes (bs, 8))) {
|
if (gst_bytestream_peek_bytes (bs, (guint8**)&esize, 8) == 8) {
|
||||||
atom->size = GUINT64_FROM_BE(*esize);
|
atom->size = GUINT64_FROM_BE(*esize);
|
||||||
gst_bytestream_flush (bs, 8);
|
gst_bytestream_flush (bs, 8);
|
||||||
qtdemux->bs_pos += 8;
|
qtdemux->bs_pos += 8;
|
||||||
|
@ -391,8 +391,9 @@ gst_qtp_read_bytes(GstQTDemux * qtdemux, void * buffer, size_t size)
|
||||||
{
|
{
|
||||||
void * data;
|
void * data;
|
||||||
GstByteStream * bs = qtdemux->bs;
|
GstByteStream * bs = qtdemux->bs;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
if ((data = gst_bytestream_peek_bytes (bs,size))) {
|
if (gst_bytestream_peek_bytes (bs, (guint8**)&data, size) == size) {
|
||||||
memcpy(buffer,data,size);
|
memcpy(buffer,data,size);
|
||||||
gst_bytestream_flush(bs,size);
|
gst_bytestream_flush(bs,size);
|
||||||
qtdemux->bs_pos += size;
|
qtdemux->bs_pos += size;
|
||||||
|
@ -407,7 +408,7 @@ gst_qtp_read(GstQTDemux * qtdemux, size_t size)
|
||||||
GstBuffer * buf;
|
GstBuffer * buf;
|
||||||
GstByteStream * bs = qtdemux->bs;
|
GstByteStream * bs = qtdemux->bs;
|
||||||
do {
|
do {
|
||||||
if ((buf = gst_bytestream_read (bs,size))) {
|
if (gst_bytestream_read (bs, &buf, size) == size) {
|
||||||
qtdemux->bs_pos += size;
|
qtdemux->bs_pos += size;
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue