[vlc-devel] [PATCH 02/17] Demux: Es Out use vlc_frame_t
Denis Charmet
typx at dinauz.org
Mon Apr 22 19:10:31 CEST 2019
* Adaptive Stream handling uses vlc_data_t to match generic accesses
---
modules/demux/adaptive/ChunksSource.hpp | 2 +-
modules/demux/adaptive/Streams.cpp | 4 +-
modules/demux/adaptive/Streams.hpp | 4 +-
modules/demux/adaptive/http/Chunk.cpp | 48 ++-
modules/demux/adaptive/http/Chunk.h | 28 +-
modules/demux/adaptive/mp4/AtomsReader.cpp | 2 +-
modules/demux/adaptive/mp4/AtomsReader.hpp | 2 +-
modules/demux/adaptive/playlist/Segment.cpp | 2 +-
modules/demux/adaptive/playlist/Segment.h | 2 +-
.../demux/adaptive/playlist/SegmentChunk.cpp | 4 +-
.../demux/adaptive/playlist/SegmentChunk.hpp | 2 +-
.../demux/adaptive/plumbing/CommandsQueue.cpp | 26 +-
.../demux/adaptive/plumbing/CommandsQueue.hpp | 6 +-
modules/demux/adaptive/plumbing/FakeESOut.cpp | 16 +-
modules/demux/adaptive/plumbing/FakeESOut.hpp | 2 +-
.../demux/adaptive/plumbing/SourceStream.cpp | 24 +-
.../demux/adaptive/plumbing/SourceStream.hpp | 8 +-
modules/demux/adaptive/tools/Retrieve.cpp | 4 +-
modules/demux/adaptive/tools/Retrieve.hpp | 2 +-
modules/demux/aiff.c | 12 +-
modules/demux/asf/asf.c | 18 +-
modules/demux/asf/asfpacket.c | 8 +-
modules/demux/asf/asfpacket.h | 4 +-
modules/demux/au.c | 12 +-
modules/demux/av1_unpack.h | 52 +--
modules/demux/avformat/demux.c | 16 +-
modules/demux/avformat/mux.c | 17 +-
modules/demux/avi/avi.c | 44 +--
modules/demux/caf.c | 14 +-
modules/demux/cdg.c | 16 +-
modules/demux/dash/DASHManager.cpp | 9 +-
modules/demux/dash/DASHStream.cpp | 2 +-
modules/demux/dash/DASHStream.hpp | 2 +-
modules/demux/dash/mp4/IndexReader.cpp | 2 +-
modules/demux/dash/mp4/IndexReader.hpp | 2 +-
modules/demux/dash/mpd/DASHSegment.cpp | 4 +-
modules/demux/dash/mpd/DASHSegment.h | 2 +-
modules/demux/demuxdump.c | 12 +-
modules/demux/flac.c | 128 +++----
modules/demux/gme.c | 30 +-
modules/demux/hls/HLSStreams.cpp | 2 +-
modules/demux/hls/HLSStreams.hpp | 2 +-
modules/demux/hls/playlist/HLSSegment.cpp | 8 +-
modules/demux/hls/playlist/HLSSegment.hpp | 2 +-
modules/demux/hls/playlist/M3U8.cpp | 5 +-
modules/demux/hls/playlist/Parser.cpp | 4 +-
modules/demux/image.c | 34 +-
modules/demux/mjpeg.c | 14 +-
modules/demux/mkv/mkv.cpp | 20 +-
modules/demux/mkv/util.cpp | 100 ++---
modules/demux/mkv/util.hpp | 12 +-
modules/demux/mock.c | 54 +--
modules/demux/mod.c | 6 +-
modules/demux/mp4/heif.c | 56 +--
modules/demux/mp4/libmp4.c | 6 +-
modules/demux/mp4/mp4.c | 190 +++++-----
modules/demux/mpc.c | 6 +-
modules/demux/mpeg/es.c | 98 ++---
modules/demux/mpeg/h26x.c | 36 +-
modules/demux/mpeg/mpgv.c | 26 +-
modules/demux/mpeg/ps.c | 30 +-
modules/demux/mpeg/ps.h | 14 +-
modules/demux/mpeg/ts.c | 354 +++++++++---------
modules/demux/mpeg/ts_hotfixes.c | 18 +-
modules/demux/mpeg/ts_metadata.c | 10 +-
modules/demux/mpeg/ts_scte.c | 12 +-
modules/demux/mpeg/ts_sl.c | 36 +-
modules/demux/mpeg/ts_streams.c | 4 +-
modules/demux/mpeg/ts_streams.h | 4 +-
modules/demux/mpeg/ts_streams_private.h | 8 +-
modules/demux/nsv.c | 14 +-
modules/demux/nuv.c | 34 +-
modules/demux/ogg.c | 134 +++----
modules/demux/ogg.h | 8 +-
modules/demux/pva.c | 40 +-
modules/demux/rawaud.c | 12 +-
modules/demux/rawdv.c | 18 +-
modules/demux/rawdv.h | 42 +--
modules/demux/rawvid.c | 12 +-
modules/demux/sid.cpp | 18 +-
modules/demux/smf.c | 36 +-
modules/demux/smooth/SmoothManager.cpp | 8 +-
modules/demux/smooth/SmoothStream.cpp | 2 +-
modules/demux/smooth/SmoothStream.hpp | 2 +-
modules/demux/smooth/mp4/IndexReader.cpp | 2 +-
modules/demux/smooth/mp4/IndexReader.hpp | 2 +-
.../smooth/playlist/ForgedInitSegment.cpp | 28 +-
.../smooth/playlist/ForgedInitSegment.hpp | 2 +-
modules/demux/smooth/playlist/MemoryChunk.cpp | 16 +-
modules/demux/smooth/playlist/MemoryChunk.hpp | 8 +-
.../demux/smooth/playlist/SmoothSegment.cpp | 4 +-
.../demux/smooth/playlist/SmoothSegment.hpp | 2 +-
modules/demux/stl.c | 4 +-
modules/demux/subtitle.c | 46 +--
modules/demux/timestamps_filter.h | 14 +-
modules/demux/tta.c | 4 +-
modules/demux/ttml.c | 12 +-
modules/demux/ty.c | 212 +++++------
modules/demux/vc1.c | 28 +-
modules/demux/vobsub.c | 32 +-
modules/demux/voc.c | 22 +-
modules/demux/wav.c | 14 +-
modules/demux/webvtt.c | 50 +--
modules/demux/xa.c | 14 +-
104 files changed, 1336 insertions(+), 1325 deletions(-)
diff --git a/modules/demux/adaptive/ChunksSource.hpp b/modules/demux/adaptive/ChunksSource.hpp
index afe84abeba..7f78d0e64c 100644
--- a/modules/demux/adaptive/ChunksSource.hpp
+++ b/modules/demux/adaptive/ChunksSource.hpp
@@ -28,7 +28,7 @@ namespace adaptive
{
public:
virtual ~ChunksSource() {}
- virtual block_t *readNextBlock() = 0;
+ virtual vlc_data_t *readNextBlock() = 0;
virtual std::string getContentType() = 0;
};
}
diff --git a/modules/demux/adaptive/Streams.cpp b/modules/demux/adaptive/Streams.cpp
index 7f6f02a6af..7cd14c8932 100644
--- a/modules/demux/adaptive/Streams.cpp
+++ b/modules/demux/adaptive/Streams.cpp
@@ -461,7 +461,7 @@ std::string AbstractStream::getContentType()
return std::string();
}
-block_t * AbstractStream::readNextBlock()
+vlc_data_t * AbstractStream::readNextBlock()
{
if (currentChunk == NULL && !eof)
currentChunk = segmentTracker->getNextChunk(!fakeesout->restarting(), connManager);
@@ -481,7 +481,7 @@ block_t * AbstractStream::readNextBlock()
const bool b_segment_head_chunk = (currentChunk->getBytesRead() == 0);
- block_t *block = currentChunk->readBlock();
+ vlc_data_t *block = currentChunk->readBlock();
if(block == NULL)
{
if(currentChunk->getRequestStatus() == RequestStatus::NotFound &&
diff --git a/modules/demux/adaptive/Streams.hpp b/modules/demux/adaptive/Streams.hpp
index 4e7bedbcd5..b4cda9353c 100644
--- a/modules/demux/adaptive/Streams.hpp
+++ b/modules/demux/adaptive/Streams.hpp
@@ -94,7 +94,7 @@ namespace adaptive
/* Used by demuxers fake streams */
virtual std::string getContentType(); /* impl */
- virtual block_t *readNextBlock(); /* impl */
+ virtual vlc_data_t *readNextBlock(); /* impl */
/**/
virtual void fillExtraFMTInfo( es_format_t * ) const; /* impl */
@@ -103,7 +103,7 @@ namespace adaptive
protected:
bool seekAble() const;
virtual void setTimeOffset(vlc_tick_t);
- virtual block_t *checkBlock(block_t *, bool) = 0;
+ virtual vlc_data_t *checkBlock(vlc_data_t *, bool) = 0;
AbstractDemuxer * createDemux(const StreamFormat &);
virtual AbstractDemuxer * newDemux(demux_t *, const StreamFormat &,
es_out_t *, AbstractSourceStream *) const; /* impl */
diff --git a/modules/demux/adaptive/http/Chunk.cpp b/modules/demux/adaptive/http/Chunk.cpp
index 3ec89fd4a1..ec5474b1c9 100644
--- a/modules/demux/adaptive/http/Chunk.cpp
+++ b/modules/demux/adaptive/http/Chunk.cpp
@@ -31,7 +31,7 @@
#include "Downloader.hpp"
#include <vlc_common.h>
-#include <vlc_block.h>
+#include <vlc_data.h>
#include <algorithm>
@@ -104,19 +104,17 @@ uint64_t AbstractChunk::getStartByteInFile() const
return source->getBytesRange().getStartByte();
}
-block_t * AbstractChunk::doRead(size_t size, bool b_block)
+vlc_data_t * AbstractChunk::doRead(size_t size, bool b_block)
{
if(!source)
return NULL;
- block_t *block = (b_block) ? source->readBlock() : source->read(size);
+ vlc_data_t *block = (b_block) ? source->readBlock() : source->read(size);
if(block)
{
- if(bytesRead == 0)
- block->i_flags |= BLOCK_FLAG_HEADER;
+ bool hdr = (bytesRead == 0);
bytesRead += block->i_buffer;
- onDownload(&block);
- block->i_flags &= ~BLOCK_FLAG_HEADER;
+ onDownload(&block, hdr);
}
return block;
@@ -127,12 +125,12 @@ bool AbstractChunk::isEmpty() const
return !source->hasMoreData();
}
-block_t * AbstractChunk::readBlock()
+vlc_data_t * AbstractChunk::readBlock()
{
return doRead(0, true);
}
-block_t * AbstractChunk::read(size_t size)
+vlc_data_t * AbstractChunk::read(size_t size)
{
return doRead(size, false);
}
@@ -185,7 +183,7 @@ bool HTTPChunkSource::hasMoreData() const
else return true;
}
-block_t * HTTPChunkSource::read(size_t readsize)
+vlc_data_t * HTTPChunkSource::read(size_t readsize)
{
vlc_mutex_locker locker(&lock);
if(!prepare())
@@ -203,7 +201,7 @@ block_t * HTTPChunkSource::read(size_t readsize)
if(contentLength && readsize > contentLength - consumed)
readsize = contentLength - consumed;
- block_t *p_block = block_Alloc(readsize);
+ vlc_data_t *p_block = vlc_data_Alloc(readsize);
if(!p_block)
{
eof = true;
@@ -215,7 +213,7 @@ block_t * HTTPChunkSource::read(size_t readsize)
time = vlc_tick_now() - time;
if(ret < 0)
{
- block_Release(p_block);
+ vlc_data_Release(p_block);
p_block = NULL;
eof = true;
}
@@ -287,7 +285,7 @@ bool HTTPChunkSource::prepare()
return false;
}
-block_t * HTTPChunkSource::readBlock()
+vlc_data_t * HTTPChunkSource::readBlock()
{
return read(HTTPChunkSource::CHUNK_SIZE);
}
@@ -318,7 +316,7 @@ HTTPChunkBufferedSource::~HTTPChunkBufferedSource()
if(p_head)
{
- block_ChainRelease(p_head);
+ vlc_data_ChainRelease(p_head);
p_head = NULL;
pp_tail = &p_head;
}
@@ -367,7 +365,7 @@ void HTTPChunkBufferedSource::bufferize(size_t readsize)
vlc_mutex_unlock(&lock);
- block_t *p_block = block_Alloc(readsize);
+ vlc_data_t *p_block = vlc_data_Alloc(readsize);
if(!p_block)
{
eof = true;
@@ -383,7 +381,7 @@ void HTTPChunkBufferedSource::bufferize(size_t readsize)
ssize_t ret = connection->read(p_block->p_buffer, readsize);
if(ret <= 0)
{
- block_Release(p_block);
+ vlc_data_Release(p_block);
p_block = NULL;
vlc_mutex_locker locker( &lock );
done = true;
@@ -396,7 +394,7 @@ void HTTPChunkBufferedSource::bufferize(size_t readsize)
p_block->i_buffer = (size_t) ret;
vlc_mutex_locker locker( &lock );
buffered += p_block->i_buffer;
- block_ChainLastAppend(&pp_tail, p_block);
+ vlc_data_ChainLastAppend(&pp_tail, p_block);
if((size_t) ret < readsize)
{
done = true;
@@ -430,9 +428,9 @@ bool HTTPChunkBufferedSource::hasMoreData() const
return !eof;
}
-block_t * HTTPChunkBufferedSource::readBlock()
+vlc_data_t * HTTPChunkBufferedSource::readBlock()
{
- block_t *p_block = NULL;
+ vlc_data_t *p_block = NULL;
vlc_mutex_locker locker(&lock);
@@ -442,7 +440,7 @@ block_t * HTTPChunkBufferedSource::readBlock()
if(!p_head && done)
{
if(!eof)
- p_block = block_Alloc(0);
+ p_block = vlc_data_Alloc(0);
eof = true;
return p_block;
}
@@ -464,15 +462,15 @@ block_t * HTTPChunkBufferedSource::readBlock()
return p_block;
}
-block_t * HTTPChunkBufferedSource::read(size_t readsize)
+vlc_data_t * HTTPChunkBufferedSource::read(size_t readsize)
{
vlc_mutex_locker locker(&lock);
while(readsize > buffered && !done)
vlc_cond_wait(&avail, &lock);
- block_t *p_block = NULL;
- if(!readsize || !buffered || !(p_block = block_Alloc(readsize)) )
+ vlc_data_t *p_block = NULL;
+ if(!readsize || !buffered || !(p_block = vlc_data_Alloc(readsize)) )
{
eof = true;
return NULL;
@@ -490,9 +488,9 @@ block_t * HTTPChunkBufferedSource::read(size_t readsize)
p_head->p_buffer += toconsume;
if(p_head->i_buffer == 0)
{
- block_t *next = p_head->p_next;
+ vlc_data_t *next = p_head->p_next;
p_head->p_next = NULL;
- block_Release(p_head);
+ vlc_data_Release(p_head);
p_head = next;
if(next == NULL)
pp_tail = &p_head;
diff --git a/modules/demux/adaptive/http/Chunk.h b/modules/demux/adaptive/http/Chunk.h
index c1eb3ba2e5..c2c978fe7e 100644
--- a/modules/demux/adaptive/http/Chunk.h
+++ b/modules/demux/adaptive/http/Chunk.h
@@ -32,7 +32,7 @@
#include <string>
#include <stdint.h>
-typedef struct block_t block_t;
+typedef struct vlc_data_t vlc_data_t;
namespace adaptive
{
@@ -47,8 +47,8 @@ namespace adaptive
public:
AbstractChunkSource();
virtual ~AbstractChunkSource();
- virtual block_t * readBlock () = 0;
- virtual block_t * read (size_t) = 0;
+ virtual vlc_data_t * readBlock () = 0;
+ virtual vlc_data_t * read (size_t) = 0;
virtual bool hasMoreData () const = 0;
void setBytesRange (const BytesRange &);
const BytesRange & getBytesRange () const;
@@ -72,9 +72,9 @@ namespace adaptive
uint64_t getStartByteInFile () const;
bool isEmpty () const;
- virtual block_t * readBlock ();
- virtual block_t * read (size_t);
- virtual void onDownload (block_t **) = 0;
+ virtual vlc_data_t * readBlock ();
+ virtual vlc_data_t * read (size_t);
+ virtual void onDownload (vlc_data_t **, bool) = 0;
protected:
AbstractChunk(AbstractChunkSource *);
@@ -82,7 +82,7 @@ namespace adaptive
private:
size_t bytesRead;
- block_t * doRead(size_t, bool);
+ vlc_data_t * doRead(size_t, bool);
};
class HTTPChunkSource : public AbstractChunkSource,
@@ -93,8 +93,8 @@ namespace adaptive
const ID &, bool = false);
virtual ~HTTPChunkSource();
- virtual block_t * readBlock (); /* impl */
- virtual block_t * read (size_t); /* impl */
+ virtual vlc_data_t * readBlock (); /* impl */
+ virtual vlc_data_t * read (size_t); /* impl */
virtual bool hasMoreData () const; /* impl */
virtual std::string getContentType () const; /* reimpl */
@@ -123,8 +123,8 @@ namespace adaptive
HTTPChunkBufferedSource(const std::string &url, AbstractConnectionManager *,
const ID &, bool = false);
virtual ~HTTPChunkBufferedSource();
- virtual block_t * readBlock (); /* reimpl */
- virtual block_t * read (size_t); /* reimpl */
+ virtual vlc_data_t * readBlock (); /* reimpl */
+ virtual vlc_data_t * read (size_t); /* reimpl */
virtual bool hasMoreData () const; /* impl */
void hold();
void release();
@@ -135,8 +135,8 @@ namespace adaptive
bool isDone() const;
private:
- block_t *p_head; /* read cache buffer */
- block_t **pp_tail;
+ vlc_data_t *p_head; /* read cache buffer */
+ vlc_data_t **pp_tail;
size_t buffered; /* read cache size */
bool done;
bool eof;
@@ -152,7 +152,7 @@ namespace adaptive
const ID &, bool = false);
virtual ~HTTPChunk();
- virtual void onDownload (block_t **) {} /* impl */
+ virtual void onDownload (vlc_data_t **, bool = false) {} /* impl */
};
}
}
diff --git a/modules/demux/adaptive/mp4/AtomsReader.cpp b/modules/demux/adaptive/mp4/AtomsReader.cpp
index 117af646cc..1e051c7787 100644
--- a/modules/demux/adaptive/mp4/AtomsReader.cpp
+++ b/modules/demux/adaptive/mp4/AtomsReader.cpp
@@ -43,7 +43,7 @@ void AtomsReader::clean()
rootbox = NULL;
}
-bool AtomsReader::parseBlock(block_t *p_block)
+bool AtomsReader::parseBlock(vlc_data_t *p_block)
{
if(rootbox)
clean();
diff --git a/modules/demux/adaptive/mp4/AtomsReader.hpp b/modules/demux/adaptive/mp4/AtomsReader.hpp
index 48fd86e995..25884eb181 100644
--- a/modules/demux/adaptive/mp4/AtomsReader.hpp
+++ b/modules/demux/adaptive/mp4/AtomsReader.hpp
@@ -36,7 +36,7 @@ namespace adaptive
AtomsReader(vlc_object_t *);
~AtomsReader();
void clean();
- bool parseBlock(block_t *);
+ bool parseBlock(vlc_data_t *);
protected:
vlc_object_t *object;
diff --git a/modules/demux/adaptive/playlist/Segment.cpp b/modules/demux/adaptive/playlist/Segment.cpp
index 7eb23aa236..fb18aaa38e 100644
--- a/modules/demux/adaptive/playlist/Segment.cpp
+++ b/modules/demux/adaptive/playlist/Segment.cpp
@@ -62,7 +62,7 @@ ISegment::~ISegment()
assert(chunksuse.Get() == 0);
}
-void ISegment::onChunkDownload(block_t **, SegmentChunk *, BaseRepresentation *)
+void ISegment::onChunkDownload(vlc_data_t **, SegmentChunk *, BaseRepresentation *, bool)
{
}
diff --git a/modules/demux/adaptive/playlist/Segment.h b/modules/demux/adaptive/playlist/Segment.h
index 8dca5e9538..40ffadabbf 100644
--- a/modules/demux/adaptive/playlist/Segment.h
+++ b/modules/demux/adaptive/playlist/Segment.h
@@ -77,7 +77,7 @@ namespace adaptive
static const int CLASSID_ISEGMENT = 0;
/* callbacks */
- virtual void onChunkDownload (block_t **, SegmentChunk *, BaseRepresentation *);
+ virtual void onChunkDownload (vlc_data_t **, SegmentChunk *, BaseRepresentation *, bool);
protected:
size_t startByte;
diff --git a/modules/demux/adaptive/playlist/SegmentChunk.cpp b/modules/demux/adaptive/playlist/SegmentChunk.cpp
index 4616e869ad..c1010c3871 100644
--- a/modules/demux/adaptive/playlist/SegmentChunk.cpp
+++ b/modules/demux/adaptive/playlist/SegmentChunk.cpp
@@ -45,9 +45,9 @@ SegmentChunk::~SegmentChunk()
segment->chunksuse.Set(segment->chunksuse.Get() - 1);
}
-void SegmentChunk::onDownload(block_t **pp_block)
+void SegmentChunk::onDownload(vlc_data_t **pp_block, bool b_header)
{
- segment->onChunkDownload(pp_block, this, rep);
+ segment->onChunkDownload(pp_block, this, rep, b_header);
}
StreamFormat SegmentChunk::getStreamFormat() const
diff --git a/modules/demux/adaptive/playlist/SegmentChunk.hpp b/modules/demux/adaptive/playlist/SegmentChunk.hpp
index 0d8906e59d..3370e654af 100644
--- a/modules/demux/adaptive/playlist/SegmentChunk.hpp
+++ b/modules/demux/adaptive/playlist/SegmentChunk.hpp
@@ -40,7 +40,7 @@ namespace adaptive
public:
SegmentChunk(ISegment *segment, AbstractChunkSource *, BaseRepresentation *);
virtual ~SegmentChunk();
- virtual void onDownload(block_t **); // reimpl
+ virtual void onDownload(vlc_data_t **, bool); // reimpl
StreamFormat getStreamFormat() const;
bool discontinuity;
diff --git a/modules/demux/adaptive/plumbing/CommandsQueue.cpp b/modules/demux/adaptive/plumbing/CommandsQueue.cpp
index 566f696b2b..36d20d7318 100644
--- a/modules/demux/adaptive/plumbing/CommandsQueue.cpp
+++ b/modules/demux/adaptive/plumbing/CommandsQueue.cpp
@@ -25,7 +25,7 @@
#include "FakeESOutID.hpp"
#include "FakeESOut.hpp"
#include <vlc_es_out.h>
-#include <vlc_block.h>
+#include <vlc_frame.h>
#include <vlc_meta.h>
#include <algorithm>
#include <set>
@@ -67,16 +67,16 @@ AbstractFakeEsCommand::AbstractFakeEsCommand( int type, FakeESOutID *p_es ) :
p_fakeid = p_es;
}
-EsOutSendCommand::EsOutSendCommand( FakeESOutID *p_es, block_t *p_block_ ) :
+EsOutSendCommand::EsOutSendCommand( FakeESOutID *p_es, vlc_frame_t *p_frame_ ) :
AbstractFakeEsCommand( ES_OUT_PRIVATE_COMMAND_SEND, p_es )
{
- p_block = p_block_;
+ p_frame = p_frame_;
}
EsOutSendCommand::~EsOutSendCommand()
{
- if( p_block )
- block_Release( p_block );
+ if( p_frame )
+ vlc_frame_Release( p_frame );
}
void EsOutSendCommand::Execute( es_out_t *out )
@@ -84,15 +84,15 @@ void EsOutSendCommand::Execute( es_out_t *out )
/* Be sure to notify Data before Sending, because UI would still not pick new ES */
p_fakeid->notifyData();
if( p_fakeid->realESID() &&
- es_out_Send( out, p_fakeid->realESID(), p_block ) == VLC_SUCCESS )
- p_block = NULL;
+ es_out_Send( out, p_fakeid->realESID(), p_frame ) == VLC_SUCCESS )
+ p_frame = NULL;
p_fakeid->notifyData();
}
vlc_tick_t EsOutSendCommand::getTime() const
{
- if( likely(p_block) )
- return p_block->i_dts;
+ if( likely(p_frame) )
+ return p_frame->i_dts;
else
return AbstractCommand::getTime();
}
@@ -185,9 +185,9 @@ void EsOutMetaCommand::Execute( es_out_t *out )
* Commands Default Factory
*/
-EsOutSendCommand * CommandsFactory::createEsOutSendCommand( FakeESOutID *id, block_t *p_block ) const
+EsOutSendCommand * CommandsFactory::createEsOutSendCommand( FakeESOutID *id, vlc_frame_t *p_frame ) const
{
- return new (std::nothrow) EsOutSendCommand( id, p_block );
+ return new (std::nothrow) EsOutSendCommand( id, p_frame );
}
EsOutDelCommand * CommandsFactory::createEsOutDelCommand( FakeESOutID *id ) const
@@ -263,7 +263,7 @@ static bool compareCommands( AbstractCommand *a, AbstractCommand *b )
if(a->getTime() == b->getTime())
{
/* Reorder the initial clock PCR setting PCR0 DTS0 PCR0 DTS1 PCR1
- so it appears after the block, avoiding it not being output */
+ so it appears after the frame, avoiding it not being output */
if(a->getType() == ES_OUT_SET_GROUP_PCR &&
b->getType() == ES_OUT_PRIVATE_COMMAND_SEND)
return false;
@@ -393,7 +393,7 @@ vlc_tick_t CommandsQueue::Process( es_out_t *out, vlc_tick_t barrier )
void CommandsQueue::LockedCommit()
{
- /* reorder all blocks by time between 2 PCR and merge with main list */
+ /* reorder all frames by time between 2 PCR and merge with main list */
incoming.sort( compareCommands );
commands.splice( commands.end(), incoming );
}
diff --git a/modules/demux/adaptive/plumbing/CommandsQueue.hpp b/modules/demux/adaptive/plumbing/CommandsQueue.hpp
index 50ff75bbd4..88cc2eb032 100644
--- a/modules/demux/adaptive/plumbing/CommandsQueue.hpp
+++ b/modules/demux/adaptive/plumbing/CommandsQueue.hpp
@@ -62,8 +62,8 @@ namespace adaptive
const void * esIdentifier() const;
protected:
- EsOutSendCommand( FakeESOutID *, block_t * );
- block_t *p_block;
+ EsOutSendCommand( FakeESOutID *, vlc_frame_t * );
+ vlc_frame_t *p_frame;
};
class EsOutDelCommand : public AbstractFakeEsCommand
@@ -138,7 +138,7 @@ namespace adaptive
{
public:
virtual ~CommandsFactory() {}
- virtual EsOutSendCommand * createEsOutSendCommand( FakeESOutID *, block_t * ) const;
+ virtual EsOutSendCommand * createEsOutSendCommand( FakeESOutID *, vlc_frame_t * ) const;
virtual EsOutDelCommand * createEsOutDelCommand( FakeESOutID * ) const;
virtual EsOutAddCommand * createEsOutAddCommand( FakeESOutID * ) const;
virtual EsOutControlPCRCommand * createEsOutControlPCRCommand( int, vlc_tick_t ) const;
diff --git a/modules/demux/adaptive/plumbing/FakeESOut.cpp b/modules/demux/adaptive/plumbing/FakeESOut.cpp
index e377759aa3..2e6b2fa87f 100644
--- a/modules/demux/adaptive/plumbing/FakeESOut.cpp
+++ b/modules/demux/adaptive/plumbing/FakeESOut.cpp
@@ -26,7 +26,7 @@
#include "FakeESOutID.hpp"
#include "CommandsQueue.hpp"
#include <vlc_es_out.h>
-#include <vlc_block.h>
+#include <vlc_frame.h>
#include <cassert>
using namespace adaptive;
@@ -335,22 +335,22 @@ void FakeESOut::checkTimestampsStart(vlc_tick_t i_start)
vlc_mutex_unlock(&lock);
}
-int FakeESOut::esOutSend_Callback(es_out_t *fakees, es_out_id_t *p_es, block_t *p_block)
+int FakeESOut::esOutSend_Callback(es_out_t *fakees, es_out_id_t *p_es, vlc_frame_t *p_frame)
{
FakeESOut *me = container_of(fakees, es_out_fake, es_out)->fake;
FakeESOutID *es_id = reinterpret_cast<FakeESOutID *>( p_es );
assert(!es_id->scheduledForDeletion());
- me->checkTimestampsStart( p_block->i_dts );
+ me->checkTimestampsStart( p_frame->i_dts );
vlc_tick_t offset = me->getTimestampOffset();
- if( p_block->i_dts != VLC_TICK_INVALID )
+ if( p_frame->i_dts != VLC_TICK_INVALID )
{
- p_block->i_dts += offset;
- if( p_block->i_pts != VLC_TICK_INVALID )
- p_block->i_pts += offset;
+ p_frame->i_dts += offset;
+ if( p_frame->i_pts != VLC_TICK_INVALID )
+ p_frame->i_pts += offset;
}
- AbstractCommand *command = me->commandsqueue->factory()->createEsOutSendCommand( es_id, p_block );
+ AbstractCommand *command = me->commandsqueue->factory()->createEsOutSendCommand( es_id, p_frame );
if( likely(command) )
{
me->commandsqueue->Schedule( command );
diff --git a/modules/demux/adaptive/plumbing/FakeESOut.hpp b/modules/demux/adaptive/plumbing/FakeESOut.hpp
index 3c434a7333..694e97360a 100644
--- a/modules/demux/adaptive/plumbing/FakeESOut.hpp
+++ b/modules/demux/adaptive/plumbing/FakeESOut.hpp
@@ -62,7 +62,7 @@ namespace adaptive
/* static callbacks for demuxer */
static es_out_id_t *esOutAdd_Callback( es_out_t *, const es_format_t * );
- static int esOutSend_Callback( es_out_t *, es_out_id_t *, block_t * );
+ static int esOutSend_Callback( es_out_t *, es_out_id_t *, vlc_frame_t * );
static void esOutDel_Callback( es_out_t *, es_out_id_t * );
static int esOutControl_Callback( es_out_t *, int, va_list );
static void esOutDestroy_Callback( es_out_t * );
diff --git a/modules/demux/adaptive/plumbing/SourceStream.cpp b/modules/demux/adaptive/plumbing/SourceStream.cpp
index 01119a471b..c259a4b7c6 100644
--- a/modules/demux/adaptive/plumbing/SourceStream.cpp
+++ b/modules/demux/adaptive/plumbing/SourceStream.cpp
@@ -46,7 +46,7 @@ ChunksSourceStream::~ChunksSourceStream()
void ChunksSourceStream::Reset()
{
if(p_block)
- block_Release(p_block);
+ vlc_data_Release(p_block);
p_block = NULL;
b_eof = false;
}
@@ -103,7 +103,7 @@ ssize_t ChunksSourceStream::Read(uint8_t *buf, size_t size)
memcpy(buf + i_copied, p_block->p_buffer, p_block->i_buffer);
i_copied += p_block->i_buffer;
i_toread -= p_block->i_buffer;
- block_Release(p_block);
+ vlc_data_Release(p_block);
p_block = NULL;
}
}
@@ -174,17 +174,17 @@ BufferedChunksSourceStream::BufferedChunksSourceStream(vlc_object_t *p_obj_, Chu
{
i_global_offset = 0;
i_bytestream_offset = 0;
- block_BytestreamInit( &bs );
+ vlc_data_BytestreamInit( &bs );
}
BufferedChunksSourceStream::~BufferedChunksSourceStream()
{
- block_BytestreamEmpty( &bs );
+ vlc_data_BytestreamEmpty( &bs );
}
void BufferedChunksSourceStream::Reset()
{
- block_BytestreamEmpty( &bs );
+ vlc_data_BytestreamEmpty( &bs );
i_bytestream_offset = 0;
i_global_offset = 0;
b_eof = false;
@@ -197,18 +197,18 @@ ssize_t BufferedChunksSourceStream::Read(uint8_t *buf, size_t size)
while(i_toread && !b_eof)
{
- size_t i_remain = block_BytestreamRemaining(&bs) - i_bytestream_offset;
+ size_t i_remain = vlc_data_BytestreamRemaining(&bs) - i_bytestream_offset;
if(i_remain < i_toread)
{
- block_t *p_add = source->readNextBlock();
+ vlc_data_t *p_add = source->readNextBlock();
if(!p_add)
{
b_eof = true;
break;
}
i_remain += p_add->i_buffer;
- block_BytestreamPush(&bs, p_add);
+ vlc_data_BytestreamPush(&bs, p_add);
}
size_t i_read;
@@ -218,7 +218,7 @@ ssize_t BufferedChunksSourceStream::Read(uint8_t *buf, size_t size)
i_read = i_remain;
if(buf)
- block_PeekOffsetBytes(&bs, i_bytestream_offset, &buf[i_copied], i_read);
+ vlc_data_PeekOffsetBytes(&bs, i_bytestream_offset, &buf[i_copied], i_read);
i_bytestream_offset += i_read;
i_copied += i_read;
i_toread -= i_read;
@@ -229,8 +229,8 @@ ssize_t BufferedChunksSourceStream::Read(uint8_t *buf, size_t size)
const size_t i_drop = i_bytestream_offset - MAX_BACKEND;
if(i_drop >= MIN_BACKEND_CLEANUP) /* Dont flush for few bytes */
{
- block_GetBytes(&bs, NULL, i_drop);
- block_BytestreamFlush(&bs);
+ vlc_data_GetBytes(&bs, NULL, i_drop);
+ vlc_data_BytestreamFlush(&bs);
i_bytestream_offset -= i_drop;
i_global_offset += i_drop;
}
@@ -242,7 +242,7 @@ ssize_t BufferedChunksSourceStream::Read(uint8_t *buf, size_t size)
int BufferedChunksSourceStream::Seek(uint64_t i_seek)
{
if(i_seek < i_global_offset ||
- i_seek - i_global_offset > block_BytestreamRemaining(&bs))
+ i_seek - i_global_offset > vlc_data_BytestreamRemaining(&bs))
return VLC_EGENERIC;
i_bytestream_offset = i_seek - i_global_offset;
return VLC_SUCCESS;
diff --git a/modules/demux/adaptive/plumbing/SourceStream.hpp b/modules/demux/adaptive/plumbing/SourceStream.hpp
index 434a1ac447..cd94d7b6ab 100644
--- a/modules/demux/adaptive/plumbing/SourceStream.hpp
+++ b/modules/demux/adaptive/plumbing/SourceStream.hpp
@@ -21,8 +21,8 @@
#define SOURCESTREAM_HPP
#include <vlc_common.h>
-#include <vlc_block.h>
-#include <vlc_block_helper.h>
+#include <vlc_data.h>
+#include <vlc_data_helper.h>
#include <string>
namespace adaptive
@@ -54,7 +54,7 @@ namespace adaptive
ChunksSource *source;
private:
- block_t *p_block;
+ vlc_data_t *p_block;
static ssize_t read_Callback(stream_t *, void *, size_t);
static int seek_Callback(stream_t *, uint64_t);
static int control_Callback( stream_t *, int i_query, va_list );
@@ -77,7 +77,7 @@ namespace adaptive
static const int MIN_BACKEND_CLEANUP = 50 * 1024;
uint64_t i_global_offset;
size_t i_bytestream_offset;
- block_bytestream_t bs;
+ vlc_data_bytestream_t bs;
};
}
#endif // SOURCESTREAM_HPP
diff --git a/modules/demux/adaptive/tools/Retrieve.cpp b/modules/demux/adaptive/tools/Retrieve.cpp
index a6171e5507..561a910289 100644
--- a/modules/demux/adaptive/tools/Retrieve.cpp
+++ b/modules/demux/adaptive/tools/Retrieve.cpp
@@ -31,7 +31,7 @@
using namespace adaptive;
using namespace adaptive::http;
-block_t * Retrieve::HTTP(vlc_object_t *obj, AuthStorage *auth, const std::string &uri)
+vlc_data_t * Retrieve::HTTP(vlc_object_t *obj, AuthStorage *auth, const std::string &uri)
{
HTTPConnectionManager connManager(obj, auth);
HTTPChunk *datachunk;
@@ -42,7 +42,7 @@ block_t * Retrieve::HTTP(vlc_object_t *obj, AuthStorage *auth, const std::string
return NULL;
}
- block_t *block = datachunk->read(1<<25);
+ vlc_data_t *block = datachunk->read(1<<25);
delete datachunk;
return block;
}
diff --git a/modules/demux/adaptive/tools/Retrieve.hpp b/modules/demux/adaptive/tools/Retrieve.hpp
index 55128c8f60..6045b11eca 100644
--- a/modules/demux/adaptive/tools/Retrieve.hpp
+++ b/modules/demux/adaptive/tools/Retrieve.hpp
@@ -33,7 +33,7 @@ namespace adaptive
class Retrieve
{
public:
- static block_t * HTTP(vlc_object_t *, http::AuthStorage *, const std::string &uri);
+ static vlc_data_t * HTTP(vlc_object_t *, http::AuthStorage *, const std::string &uri);
};
}
diff --git a/modules/demux/aiff.c b/modules/demux/aiff.c
index 857ccd0482..078339211b 100644
--- a/modules/demux/aiff.c
+++ b/modules/demux/aiff.c
@@ -224,7 +224,7 @@ static int Demux( demux_t *p_demux )
demux_sys_t *p_sys = p_demux->p_sys;
int64_t i_tell = vlc_stream_Tell( p_demux->s );
- block_t *p_block;
+ vlc_frame_t *p_frame;
int i_read;
if( p_sys->i_ssnd_end > 0 && i_tell >= p_sys->i_ssnd_end )
@@ -242,20 +242,20 @@ static int Demux( demux_t *p_demux )
{
i_read = p_sys->i_ssnd_end - i_tell;
}
- if( ( p_block = vlc_stream_Block( p_demux->s, i_read ) ) == NULL )
+ if( ( p_frame = vlc_stream_Frame( p_demux->s, i_read ) ) == NULL )
{
return VLC_DEMUXER_EOF;
}
- p_block->i_dts =
- p_block->i_pts = VLC_TICK_0 + p_sys->i_time;
+ p_frame->i_dts =
+ p_frame->i_pts = VLC_TICK_0 + p_sys->i_time;
- p_sys->i_time += vlc_tick_from_samples(p_block->i_buffer,
+ p_sys->i_time += vlc_tick_from_samples(p_frame->i_buffer,
p_sys->i_ssnd_fsize) /
p_sys->fmt.audio.i_rate;
/* */
- es_out_Send( p_demux->out, p_sys->es, p_block );
+ es_out_Send( p_demux->out, p_sys->es, p_frame );
return VLC_DEMUXER_SUCCESS;
}
diff --git a/modules/demux/asf/asf.c b/modules/demux/asf/asf.c
index 8a72c706f9..f4106e89fb 100644
--- a/modules/demux/asf/asf.c
+++ b/modules/demux/asf/asf.c
@@ -83,7 +83,7 @@ static bool Block_Dequeue( demux_t *p_demux, vlc_tick_t i_nexttime );
static asf_track_info_t * Packet_GetTrackInfo( asf_packet_sys_t *p_packetsys,
uint8_t i_stream_number );
static bool Packet_DoSkip( asf_packet_sys_t *p_packetsys, uint8_t i_stream_number, bool b_packet_keyframe );
-static void Packet_Enqueue( asf_packet_sys_t *p_packetsys, uint8_t i_stream_number, block_t **pp_frame );
+static void Packet_Enqueue( asf_packet_sys_t *p_packetsys, uint8_t i_stream_number, vlc_frame_t **pp_frame );
static void Packet_SetAR( asf_packet_sys_t *p_packetsys, uint8_t i_stream_number,
uint8_t i_ratio_x, uint8_t i_ratio_y );
@@ -101,8 +101,8 @@ typedef struct
struct
{
- block_t *p_first;
- block_t **pp_last;
+ vlc_frame_t *p_first;
+ vlc_frame_t **pp_last;
} queue;
} asf_track_t;
@@ -634,7 +634,7 @@ static bool Packet_DoSkip( asf_packet_sys_t *p_packetsys, uint8_t i_stream_numbe
return false;
}
-static void Packet_Enqueue( asf_packet_sys_t *p_packetsys, uint8_t i_stream_number, block_t **pp_frame )
+static void Packet_Enqueue( asf_packet_sys_t *p_packetsys, uint8_t i_stream_number, vlc_frame_t **pp_frame )
{
demux_t *p_demux = p_packetsys->p_demux;
demux_sys_t *p_sys = p_demux->p_sys;
@@ -642,10 +642,10 @@ static void Packet_Enqueue( asf_packet_sys_t *p_packetsys, uint8_t i_stream_numb
if ( !tk )
return;
- block_t *p_gather = block_ChainGather( *pp_frame );
+ vlc_frame_t *p_gather = vlc_frame_ChainGather( *pp_frame );
if( p_gather )
{
- block_ChainLastAppend( & tk->queue.pp_last, p_gather );
+ vlc_frame_ChainLastAppend( & tk->queue.pp_last, p_gather );
#ifdef ASF_DEBUG
msg_Dbg( p_demux, " enqueue packet dts %"PRId64" pts %"PRId64" pcr %"PRId64, p_gather->i_dts, p_gather->i_pts, p_sys->i_time );
#endif
@@ -666,7 +666,7 @@ static bool Block_Dequeue( demux_t *p_demux, vlc_tick_t i_nexttime )
b_tracks_have_data |= (tk->queue.p_first != NULL);
while( tk->queue.p_first && tk->queue.p_first->i_dts <= i_nexttime )
{
- block_t *p_block = tk->queue.p_first;
+ vlc_frame_t *p_block = tk->queue.p_first;
tk->queue.p_first = p_block->p_next;
if( tk->queue.p_first == NULL )
tk->queue.pp_last = &tk->queue.p_first;
@@ -1351,12 +1351,12 @@ static void FlushQueue( asf_track_t *tk )
{
if( tk->info.p_frame )
{
- block_ChainRelease( tk->info.p_frame );
+ vlc_frame_ChainRelease( tk->info.p_frame );
tk->info.p_frame = NULL;
}
if( tk->queue.p_first )
{
- block_ChainRelease( tk->queue.p_first );
+ vlc_frame_ChainRelease( tk->queue.p_first );
tk->queue.p_first = NULL;
tk->queue.pp_last = &tk->queue.p_first;
}
diff --git a/modules/demux/asf/asfpacket.c b/modules/demux/asf/asfpacket.c
index 296cc39f3c..4c84838ca3 100644
--- a/modules/demux/asf/asfpacket.c
+++ b/modules/demux/asf/asfpacket.c
@@ -77,7 +77,7 @@ static uint32_t SkipBytes( stream_t *s, uint32_t i_bytes )
}
static int DemuxSubPayload( asf_packet_sys_t *p_packetsys,
- uint8_t i_stream_number, block_t **pp_frame,
+ uint8_t i_stream_number, vlc_frame_t **pp_frame,
uint32_t i_sub_payload_data_length, vlc_tick_t i_pts, vlc_tick_t i_dts,
uint32_t i_media_object_offset, bool b_keyframe, bool b_ignore_pts )
{
@@ -87,7 +87,7 @@ static int DemuxSubPayload( asf_packet_sys_t *p_packetsys,
p_packetsys->pf_send( p_packetsys, i_stream_number, pp_frame );
}
- block_t *p_frag = vlc_stream_Block( p_packetsys->p_demux->s, i_sub_payload_data_length );
+ vlc_frame_t *p_frag = vlc_stream_Frame( p_packetsys->p_demux->s, i_sub_payload_data_length );
if( p_frag == NULL ) {
msg_Warn( p_packetsys->p_demux, "cannot read data" );
return -1;
@@ -96,9 +96,9 @@ static int DemuxSubPayload( asf_packet_sys_t *p_packetsys,
p_frag->i_pts = (b_ignore_pts) ? VLC_TICK_INVALID : VLC_TICK_0 + i_pts;
p_frag->i_dts = VLC_TICK_0 + i_dts;
if ( b_keyframe )
- p_frag->i_flags |= BLOCK_FLAG_TYPE_I;
+ p_frag->i_flags |= FRAME_FLAG_TYPE_I;
- block_ChainAppend( pp_frame, p_frag );
+ vlc_frame_ChainAppend( pp_frame, p_frag );
return 0;
}
diff --git a/modules/demux/asf/asfpacket.h b/modules/demux/asf/asfpacket.h
index 9a5af1aa66..587add5e20 100644
--- a/modules/demux/asf/asfpacket.h
+++ b/modules/demux/asf/asfpacket.h
@@ -30,7 +30,7 @@
typedef struct
{
- block_t *p_frame; /* used to gather complete frame */
+ vlc_frame_t *p_frame; /* used to gather complete frame */
asf_object_stream_properties_t *p_sp;
asf_object_extended_stream_properties_t *p_esp;
int i_cat;
@@ -47,7 +47,7 @@ struct asf_packet_sys_s
vlc_tick_t *pi_preroll_start;
/* callbacks */
- void (*pf_send)(asf_packet_sys_t *, uint8_t, block_t **);
+ void (*pf_send)(asf_packet_sys_t *, uint8_t, vlc_frame_t **);
asf_track_info_t * (*pf_gettrackinfo)(asf_packet_sys_t *, uint8_t);
/* optional callbacks */
diff --git a/modules/demux/au.c b/modules/demux/au.c
index 0a09f31d35..a18e301207 100644
--- a/modules/demux/au.c
+++ b/modules/demux/au.c
@@ -304,21 +304,21 @@ static int Open( vlc_object_t *p_this )
static int Demux( demux_t *p_demux )
{
demux_sys_t *p_sys = p_demux->p_sys;
- block_t *p_block;
+ vlc_frame_t *p_frame;
/* set PCR */
es_out_SetPCR( p_demux->out, VLC_TICK_0 + p_sys->i_time );
- p_block = vlc_stream_Block( p_demux->s, p_sys->i_frame_size );
- if( p_block == NULL )
+ p_frame = vlc_stream_Frame( p_demux->s, p_sys->i_frame_size );
+ if( p_frame == NULL )
{
msg_Warn( p_demux, "cannot read data" );
return VLC_DEMUXER_EOF;
}
- p_block->i_dts =
- p_block->i_pts = VLC_TICK_0 + p_sys->i_time;
- es_out_Send( p_demux->out, p_sys->es, p_block );
+ p_frame->i_dts =
+ p_frame->i_pts = VLC_TICK_0 + p_sys->i_time;
+ es_out_Send( p_demux->out, p_sys->es, p_frame );
p_sys->i_time += p_sys->i_frame_length;
diff --git a/modules/demux/av1_unpack.h b/modules/demux/av1_unpack.h
index af7f056abf..70fde74a8b 100644
--- a/modules/demux/av1_unpack.h
+++ b/modules/demux/av1_unpack.h
@@ -22,7 +22,7 @@
#include "../packetizer/av1_obu.h"
#include <vlc_common.h>
-#include <vlc_block.h>
+#include <vlc_frame.h>
static inline uint8_t leb128_expected(uint32_t v)
{
@@ -45,10 +45,10 @@ static inline void leb128_write(uint32_t v, uint8_t *p)
}
}
-static inline block_t * AV1_Unpack_Sample_ExpandSize(block_t *p_block)
+static inline vlc_frame_t * AV1_Unpack_Sample_ExpandSize(vlc_frame_t *p_frame)
{
AV1_OBU_iterator_ctx_t ctx;
- AV1_OBU_iterator_init(&ctx, p_block->p_buffer, p_block->i_buffer);
+ AV1_OBU_iterator_init(&ctx, p_frame->p_buffer, p_frame->i_buffer);
const uint8_t *p_obu = NULL; size_t i_obu;
while(AV1_OBU_iterate_next(&ctx, &p_obu, &i_obu))
{
@@ -56,38 +56,38 @@ static inline block_t * AV1_Unpack_Sample_ExpandSize(block_t *p_block)
continue;
const uint8_t i_header = 1 + AV1_OBUHasExtensionField(p_obu);
const uint8_t i_sizelen = leb128_expected(i_obu - i_header);
- const size_t i_obu_offset = p_obu - p_block->p_buffer;
+ const size_t i_obu_offset = p_obu - p_frame->p_buffer;
/* Make room for i_sizelen after header */
- if(2 * (i_obu_offset + i_header) + i_sizelen < p_block->i_buffer)
+ if(2 * (i_obu_offset + i_header) + i_sizelen < p_frame->i_buffer)
{
/* move data to the left */
- p_block = block_Realloc(p_block, i_sizelen, p_block->i_buffer);
- if(p_block)
- memmove(p_block->p_buffer, &p_block->p_buffer[i_sizelen],
+ p_frame = vlc_frame_Realloc(p_frame, i_sizelen, p_frame->i_buffer);
+ if(p_frame)
+ memmove(p_frame->p_buffer, &p_frame->p_buffer[i_sizelen],
i_obu_offset + i_header);
}
else
{
/* move data to the right */
- p_block = block_Realloc(p_block, 0, p_block->i_buffer + i_sizelen);
- if(p_block)
+ p_frame = vlc_frame_Realloc(p_frame, 0, p_frame->i_buffer + i_sizelen);
+ if(p_frame)
{
const size_t i_off = i_obu_offset + i_header;
- memmove(&p_block->p_buffer[i_off + i_sizelen], &p_block->p_buffer[i_off],
- p_block->i_buffer - i_off - i_sizelen);
+ memmove(&p_frame->p_buffer[i_off + i_sizelen], &p_frame->p_buffer[i_off],
+ p_frame->i_buffer - i_off - i_sizelen);
}
}
- if(likely(p_block))
+ if(likely(p_frame))
{
- leb128_write(i_obu - i_header, &p_block->p_buffer[i_obu_offset + i_header]);
- p_block->p_buffer[i_obu_offset] |= 0x02;
+ leb128_write(i_obu - i_header, &p_frame->p_buffer[i_obu_offset + i_header]);
+ p_frame->p_buffer[i_obu_offset] |= 0x02;
}
break;
}
- return p_block;
+ return p_frame;
}
/*
@@ -99,23 +99,23 @@ static inline block_t * AV1_Unpack_Sample_ExpandSize(block_t *p_block)
Matroska/WebM
https://github.com/Matroska-Org/matroska-specification/blob/master/codec/av1.md
*/
-static inline block_t * AV1_Unpack_Sample(block_t *p_block)
+static inline vlc_frame_t * AV1_Unpack_Sample(vlc_frame_t *p_frame)
{
/* Restore last size field if missing */
- p_block = AV1_Unpack_Sample_ExpandSize(p_block);
+ p_frame = AV1_Unpack_Sample_ExpandSize(p_frame);
/* Reinsert removed TU: See av1-isobmff 2.4 */
- if(p_block &&
- (p_block->p_buffer[0] & 0x81) == 0 && /* reserved flags */
- (p_block->p_buffer[0] & 0x7A) != 0x12) /* no TEMPORAL_DELIMITER */
+ if(p_frame &&
+ (p_frame->p_buffer[0] & 0x81) == 0 && /* reserved flags */
+ (p_frame->p_buffer[0] & 0x7A) != 0x12) /* no TEMPORAL_DELIMITER */
{
- p_block = block_Realloc(p_block, 2, p_block->i_buffer);
- if(p_block)
+ p_frame = vlc_frame_Realloc(p_frame, 2, p_frame->i_buffer);
+ if(p_frame)
{
- p_block->p_buffer[0] = 0x12;
- p_block->p_buffer[1] = 0x00;
+ p_frame->p_buffer[0] = 0x12;
+ p_frame->p_buffer[1] = 0x00;
}
}
- return p_block;
+ return p_frame;
}
#endif
diff --git a/modules/demux/avformat/demux.c b/modules/demux/avformat/demux.c
index f7e2531254..330978a793 100644
--- a/modules/demux/avformat/demux.c
+++ b/modules/demux/avformat/demux.c
@@ -92,7 +92,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args );
static int IORead( void *opaque, uint8_t *buf, int buf_size );
static int64_t IOSeek( void *opaque, int64_t offset, int whence );
-static block_t *BuildSsaFrame( const AVPacket *p_pkt, unsigned i_order );
+static vlc_frame_t *BuildSsaFrame( const AVPacket *p_pkt, unsigned i_order );
static void UpdateSeekPoint( demux_t *p_demux, vlc_tick_t i_time );
static void ResetTime( demux_t *p_demux, int64_t i_time );
@@ -766,7 +766,7 @@ static int Demux( demux_t *p_demux )
{
demux_sys_t *p_sys = p_demux->p_sys;
AVPacket pkt;
- block_t *p_frame;
+ vlc_frame_t *p_frame;
vlc_tick_t i_start_time;
/* Read a frame */
@@ -803,7 +803,7 @@ static int Demux( demux_t *p_demux )
}
else if( p_stream->codecpar->codec_id == AV_CODEC_ID_DVB_SUBTITLE )
{
- if( ( p_frame = block_Alloc( pkt.size + 3 ) ) == NULL )
+ if( ( p_frame = vlc_frame_Alloc( pkt.size + 3 ) ) == NULL )
{
av_packet_unref( &pkt );
return 0;
@@ -815,7 +815,7 @@ static int Demux( demux_t *p_demux )
}
else
{
- if( ( p_frame = block_Alloc( pkt.size ) ) == NULL )
+ if( ( p_frame = vlc_frame_Alloc( pkt.size ) ) == NULL )
{
av_packet_unref( &pkt );
return 0;
@@ -824,7 +824,7 @@ static int Demux( demux_t *p_demux )
}
if( pkt.flags & AV_PKT_FLAG_KEY )
- p_frame->i_flags |= BLOCK_FLAG_TYPE_I;
+ p_frame->i_flags |= FRAME_FLAG_TYPE_I;
/* Used to avoid timestamps overlow */
if( p_sys->ic->start_time != (int64_t)AV_NOPTS_VALUE )
@@ -906,7 +906,7 @@ static int Demux( demux_t *p_demux )
if( p_track->p_es != NULL )
es_out_Send( p_demux->out, p_track->p_es, p_frame );
else
- block_Release( p_frame );
+ vlc_frame_Release( p_frame );
av_packet_unref( &pkt );
return 1;
@@ -967,7 +967,7 @@ static void ResetTime( demux_t *p_demux, int64_t i_time )
}
}
-static block_t *BuildSsaFrame( const AVPacket *p_pkt, unsigned i_order )
+static vlc_frame_t *BuildSsaFrame( const AVPacket *p_pkt, unsigned i_order )
{
if( p_pkt->size <= 0 )
return NULL;
@@ -992,7 +992,7 @@ static block_t *BuildSsaFrame( const AVPacket *p_pkt, unsigned i_order )
if( asprintf( &p, "%u,%d,%.*s", i_order, i_layer, p_pkt->size - i_position, p_pkt->data + i_position ) < 0 )
return NULL;
- block_t *p_frame = block_heap_Alloc( p, strlen(p) + 1 );
+ vlc_frame_t *p_frame = vlc_frame_heap_Alloc( p, strlen(p) + 1 );
if( p_frame )
p_frame->i_length = vlc_tick_from_sec((h1-h0) * 3600 +
(m1-m0) * 60 +
diff --git a/modules/demux/avformat/mux.c b/modules/demux/avformat/mux.c
index 7244f51ffc..5db6c84364 100644
--- a/modules/demux/avformat/mux.c
+++ b/modules/demux/avformat/mux.c
@@ -29,7 +29,6 @@
#endif
#include <vlc_common.h>
-#include <vlc_block.h>
#include <vlc_sout.h>
#include <vlc_es.h>
@@ -348,7 +347,7 @@ static void DelStream( sout_mux_t *p_mux, sout_input_t *p_input )
static int MuxBlock( sout_mux_t *p_mux, sout_input_t *p_input )
{
sout_mux_sys_t *p_sys = p_mux->p_sys;
- block_t *p_data = block_FifoGet( p_input->p_fifo );
+ vlc_frame_t *p_data = vlc_frame_FifoGet( p_input->p_fifo );
int i_stream = *((int *)p_input->p_sys);
AVStream *p_stream = p_sys->oc->streams[i_stream];
AVPacket pkt;
@@ -360,7 +359,7 @@ static int MuxBlock( sout_mux_t *p_mux, sout_input_t *p_input )
pkt.size = p_data->i_buffer;
pkt.stream_index = i_stream;
- if( p_data->i_flags & BLOCK_FLAG_TYPE_I )
+ if( p_data->i_flags & FRAME_FLAG_TYPE_I )
{
#ifdef AVFMT_ALLOW_FLUSH
/* Make sure we don't inadvertedly mark buffered data as keyframes. */
@@ -388,11 +387,11 @@ static int MuxBlock( sout_mux_t *p_mux, sout_input_t *p_input )
msg_Err( p_mux, "could not write frame (pts: %"PRId64", dts: %"PRId64") "
"(pkt pts: %"PRId64", dts: %"PRId64")",
p_data->i_pts, p_data->i_dts, pkt.pts, pkt.dts );
- block_Release( p_data );
+ vlc_frame_Release( p_data );
return VLC_EGENERIC;
}
- block_Release( p_data );
+ vlc_frame_Release( p_data );
return VLC_SUCCESS;
}
@@ -509,19 +508,19 @@ static int IOWrite( void *opaque, uint8_t *buf, int buf_size )
msg_Dbg( p_mux, "IOWrite %i bytes", buf_size );
#endif
- block_t *p_buf = block_Alloc( buf_size );
+ vlc_frame_t *p_buf = vlc_frame_Alloc( buf_size );
if( buf_size > 0 ) memcpy( p_buf->p_buffer, buf, buf_size );
if( p_sys->b_write_header )
- p_buf->i_flags |= BLOCK_FLAG_HEADER;
+ p_buf->i_flags |= FRAME_FLAG_HEADER;
#if LIBAVFORMAT_VERSION_CHECK( 57, 7, 0, 40, 100 )
if( !p_sys->b_header_done )
- p_buf->i_flags |= BLOCK_FLAG_HEADER;
+ p_buf->i_flags |= FRAME_FLAG_HEADER;
#endif
if( p_sys->b_write_keyframe )
{
- p_buf->i_flags |= BLOCK_FLAG_TYPE_I;
+ p_buf->i_flags |= FRAME_FLAG_TYPE_I;
p_sys->b_write_keyframe = false;
}
diff --git a/modules/demux/avi/avi.c b/modules/demux/avi/avi.c
index 62b5e89d0d..084a4f5004 100644
--- a/modules/demux/avi/avi.c
+++ b/modules/demux/avi/avi.c
@@ -222,7 +222,7 @@ static void AVI_IndexCreate ( demux_t * );
static void AVI_ExtractSubtitle( demux_t *, unsigned int i_stream, avi_chunk_list_t *, avi_chunk_STRING_t * );
-static void AVI_DvHandleAudio( demux_t *, avi_track_t *, block_t * );
+static void AVI_DvHandleAudio( demux_t *, avi_track_t *, vlc_frame_t * );
static vlc_tick_t AVI_MovieGetLength( demux_t * );
@@ -804,10 +804,10 @@ error:
* ReadFrame: Reads frame, using stride if necessary
*****************************************************************************/
-static block_t * ReadFrame( demux_t *p_demux, const avi_track_t *tk,
+static vlc_frame_t * ReadFrame( demux_t *p_demux, const avi_track_t *tk,
const unsigned int i_header, const int i_size )
{
- block_t *p_frame = vlc_stream_Block( p_demux->s, __EVEN( i_size ) );
+ vlc_frame_t *p_frame = vlc_stream_Frame( p_demux->s, __EVEN( i_size ) );
if ( !p_frame ) return p_frame;
if( i_size % 2 ) /* read was padded on word boundary */
@@ -854,10 +854,10 @@ static block_t * ReadFrame( demux_t *p_demux, const avi_track_t *tk,
}
else
{
- block_t *p_flippedframe = block_Alloc( p_frame->i_buffer );
+ vlc_frame_t *p_flippedframe = vlc_frame_Alloc( p_frame->i_buffer );
if ( !p_flippedframe )
{
- block_Release( p_frame );
+ vlc_frame_Release( p_frame );
return NULL;
}
@@ -875,7 +875,7 @@ static block_t * ReadFrame( demux_t *p_demux, const avi_track_t *tk,
p_flippedframe->i_buffer += tk->bihprops.i_stride;
}
- block_Release( p_frame );
+ vlc_frame_Release( p_frame );
p_frame = p_flippedframe;
}
@@ -1002,7 +1002,7 @@ static int Demux_Seekable( demux_t *p_demux )
{
avi_track_t *tk;
bool b_done;
- block_t *p_frame;
+ vlc_frame_t *p_frame;
int64_t i_pos;
unsigned int i;
size_t i_size;
@@ -1173,11 +1173,11 @@ static int Demux_Seekable( demux_t *p_demux )
p_frame->i_pts = VLC_TICK_0 + AVI_GetPTS( tk );
if( tk->idx.p_entry[tk->i_idxposc].i_flags&AVIIF_KEYFRAME )
{
- p_frame->i_flags = BLOCK_FLAG_TYPE_I;
+ p_frame->i_flags = FRAME_FLAG_TYPE_I;
}
else
{
- p_frame->i_flags = BLOCK_FLAG_TYPE_PB;
+ p_frame->i_flags = FRAME_FLAG_TYPE_PB;
}
/* read data */
@@ -1243,7 +1243,7 @@ static int Demux_Seekable( demux_t *p_demux )
if( tk->p_es )
es_out_Send( p_demux->out, tk->p_es, p_frame );
else
- block_Release( p_frame );
+ vlc_frame_Release( p_frame );
}
}
@@ -1354,7 +1354,7 @@ static int Demux_UnSeekable( demux_t *p_demux )
AVI_GetPTS( p_stream_master ) )< VLC_TICK_FROM_SEC(2) )
{
/* load it and send to decoder */
- block_t *p_frame = ReadFrame( p_demux, p_stream, 8, avi_pk.i_size + 8 ) ;
+ vlc_frame_t *p_frame = ReadFrame( p_demux, p_stream, 8, avi_pk.i_size + 8 ) ;
if( p_frame == NULL )
{
return VLC_DEMUXER_EGENERIC;
@@ -1375,7 +1375,7 @@ static int Demux_UnSeekable( demux_t *p_demux )
if( p_stream->p_es )
es_out_Send( p_demux->out, p_stream->p_es, p_frame );
else
- block_Release( p_frame );
+ vlc_frame_Release( p_frame );
}
else
{
@@ -1528,7 +1528,7 @@ static int Seek( demux_t *p_demux, vlc_tick_t i_date, double f_ratio, bool b_acc
p_stream->b_eof = AVI_TrackSeek( p_demux, i_stream, i_wanted ) != 0;
if( !p_stream->b_eof )
{
- p_stream->i_next_block_flags |= BLOCK_FLAG_DISCONTINUITY;
+ p_stream->i_next_block_flags |= FRAME_FLAG_DISCONTINUITY;
if( p_stream->fmt.i_cat == AUDIO_ES || p_stream->fmt.i_cat == VIDEO_ES )
i_start = __MIN(i_start, AVI_GetPTS( p_stream ));
@@ -2759,7 +2759,7 @@ static void AVI_MetaLoad( demux_t *p_demux,
}
}
-static void AVI_DvHandleAudio( demux_t *p_demux, avi_track_t *tk, block_t *p_frame )
+static void AVI_DvHandleAudio( demux_t *p_demux, avi_track_t *tk, vlc_frame_t *p_frame )
{
size_t i_offset = 80 * 6 + 80 * 16 * 3 + 3;
if( p_frame->i_buffer < i_offset + 5 )
@@ -2785,13 +2785,13 @@ static void AVI_DvHandleAudio( demux_t *p_demux, avi_track_t *tk, block_t *p_fra
es_format_Clean( &fmt );
- block_t *p_frame_audio = dv_extract_audio( p_frame );
+ vlc_frame_t *p_frame_audio = dv_extract_audio( p_frame );
if( p_frame_audio )
{
if( tk->p_es_dv_audio )
es_out_Send( p_demux->out, tk->p_es_dv_audio, p_frame_audio );
else
- block_Release( p_frame_audio );
+ vlc_frame_Release( p_frame_audio );
}
}
@@ -2804,7 +2804,7 @@ static void AVI_ExtractSubtitle( demux_t *p_demux,
avi_chunk_STRING_t *p_strn )
{
demux_sys_t *p_sys = p_demux->p_sys;
- block_t *p_block = NULL;
+ vlc_frame_t *p_frame = NULL;
input_attachment_t *p_attachment = NULL;
char *psz_description = NULL;
avi_chunk_indx_t *p_indx = NULL;
@@ -2872,12 +2872,12 @@ static void AVI_ExtractSubtitle( demux_t *p_demux,
if( vlc_stream_Seek( p_demux->s, i_position ) )
goto exit;
- p_block = vlc_stream_Block( p_demux->s, i_size );
- if( !p_block )
+ p_frame = vlc_stream_Frame( p_demux->s, i_size );
+ if( !p_frame )
goto exit;
/* Parse packet header */
- const uint8_t *p = p_block->p_buffer;
+ const uint8_t *p = p_frame->p_buffer;
if( i_size < 8 || p[2] != 't' || p[3] != 'x' )
goto exit;
p += 8;
@@ -2918,8 +2918,8 @@ static void AVI_ExtractSubtitle( demux_t *p_demux,
exit:
free( psz_description );
- if( p_block )
- block_Release( p_block );
+ if( p_frame )
+ vlc_frame_Release( p_frame );
if( p_attachment )
msg_Dbg( p_demux, "Loaded an embedded subtitle" );
diff --git a/modules/demux/caf.c b/modules/demux/caf.c
index 875a1e1ba8..711ff79293 100644
--- a/modules/demux/caf.c
+++ b/modules/demux/caf.c
@@ -917,7 +917,7 @@ caf_open_end:
static int Demux( demux_t *p_demux )
{
demux_sys_t *p_sys = p_demux->p_sys;
- block_t *p_block;
+ vlc_frame_t *p_frame;
if( p_sys->i_data_size != kCHUNK_SIZE_EOF && p_sys->position.i_bytes >= p_sys->i_data_size )
{
@@ -977,20 +977,20 @@ static int Demux( demux_t *p_demux )
return VLC_DEMUXER_EGENERIC;
}
- p_block = vlc_stream_Block( p_demux->s, (int)advance.i_bytes );
- if( p_block == NULL )
+ p_frame = vlc_stream_Frame( p_demux->s, (int)advance.i_bytes );
+ if( p_frame == NULL )
{
msg_Err( p_demux, "cannot read data" );
return VLC_DEMUXER_EGENERIC;
}
- p_block->i_dts =
- p_block->i_pts = FrameSpanGetTime( &p_sys->position, p_sys->fmt.audio.i_rate );
+ p_frame->i_dts =
+ p_frame->i_pts = FrameSpanGetTime( &p_sys->position, p_sys->fmt.audio.i_rate );
FrameSpanAddSpan( &p_sys->position, &advance );
- es_out_SetPCR( p_demux->out, p_block->i_pts );
- es_out_Send( p_demux->out, p_sys->es, p_block );
+ es_out_SetPCR( p_demux->out, p_frame->i_pts );
+ es_out_Send( p_demux->out, p_sys->es, p_frame );
return VLC_DEMUXER_SUCCESS;
}
diff --git a/modules/demux/cdg.c b/modules/demux/cdg.c
index 21005d95b2..38a82cdd3d 100644
--- a/modules/demux/cdg.c
+++ b/modules/demux/cdg.c
@@ -121,11 +121,11 @@ static vlc_tick_t PosToDate( demux_t *p_demux )
static int Demux( demux_t *p_demux )
{
demux_sys_t *p_sys = p_demux->p_sys;
- block_t *p_block;
+ vlc_frame_t *p_frame;
vlc_tick_t i_date;
- p_block = vlc_stream_Block( p_demux->s, CDG_FRAME_SIZE );
- if( p_block == NULL )
+ p_frame = vlc_stream_Frame( p_demux->s, CDG_FRAME_SIZE );
+ if( p_frame == NULL )
{
msg_Dbg( p_demux, "cannot read data, eof" );
return VLC_DEMUXER_EOF;
@@ -134,17 +134,17 @@ static int Demux( demux_t *p_demux )
i_date = PosToDate( p_demux );
if( i_date >= date_Get( &p_sys->pts ) + CDG_FRAME_DELTA )
{
- p_block->i_dts = p_block->i_pts = VLC_TICK_0 + i_date;
+ p_frame->i_dts = p_frame->i_pts = VLC_TICK_0 + i_date;
date_Set( &p_sys->pts, VLC_TICK_0 + i_date );
}
else
{
- p_block->i_dts = VLC_TICK_0 + i_date;
- p_block->i_pts = date_Get( &p_sys->pts );
+ p_frame->i_dts = VLC_TICK_0 + i_date;
+ p_frame->i_pts = date_Get( &p_sys->pts );
}
- es_out_SetPCR( p_demux->out, p_block->i_pts );
- es_out_Send( p_demux->out, p_sys->p_es, p_block );
+ es_out_SetPCR( p_demux->out, p_frame->i_pts );
+ es_out_Send( p_demux->out, p_sys->p_es, p_frame );
return VLC_DEMUXER_SUCCESS;
}
diff --git a/modules/demux/dash/DASHManager.cpp b/modules/demux/dash/DASHManager.cpp
index 3dcf786af8..35afda16a3 100644
--- a/modules/demux/dash/DASHManager.cpp
+++ b/modules/demux/dash/DASHManager.cpp
@@ -39,7 +39,6 @@
#include <vlc_stream.h>
#include <vlc_demux.h>
#include <vlc_meta.h>
-#include <vlc_block.h>
#include "../adaptive/tools/Retrieve.hpp"
#include <algorithm>
@@ -102,14 +101,14 @@ bool DASHManager::updatePlaylist()
{
std::string url(p_demux->psz_url);
- block_t *p_block = Retrieve::HTTP(VLC_OBJECT(p_demux), authStorage, url);
+ vlc_data_t *p_block = Retrieve::HTTP(VLC_OBJECT(p_demux), authStorage, url);
if(!p_block)
return false;
stream_t *mpdstream = vlc_stream_MemoryNew(p_demux, p_block->p_buffer, p_block->i_buffer, true);
if(!mpdstream)
{
- block_Release(p_block);
+ vlc_data_Release(p_block);
return false;
}
@@ -117,7 +116,7 @@ bool DASHManager::updatePlaylist()
if(!parser.parse(true))
{
vlc_stream_Delete(mpdstream);
- block_Release(p_block);
+ vlc_data_Release(p_block);
return false;
}
@@ -139,7 +138,7 @@ bool DASHManager::updatePlaylist()
delete newmpd;
}
vlc_stream_Delete(mpdstream);
- block_Release(p_block);
+ vlc_data_Release(p_block);
}
return true;
diff --git a/modules/demux/dash/DASHStream.cpp b/modules/demux/dash/DASHStream.cpp
index f472ecc761..7b5f1ee762 100644
--- a/modules/demux/dash/DASHStream.cpp
+++ b/modules/demux/dash/DASHStream.cpp
@@ -30,7 +30,7 @@ DASHStream::DASHStream(demux_t *demux)
{
}
-block_t * DASHStream::checkBlock(block_t *p_block, bool)
+vlc_data_t * DASHStream::checkBlock(vlc_data_t *p_block, bool)
{
return p_block;
}
diff --git a/modules/demux/dash/DASHStream.hpp b/modules/demux/dash/DASHStream.hpp
index 946615f51b..57e5b92ad7 100644
--- a/modules/demux/dash/DASHStream.hpp
+++ b/modules/demux/dash/DASHStream.hpp
@@ -32,7 +32,7 @@ namespace dash
DASHStream(demux_t *);
protected:
- virtual block_t *checkBlock(block_t *, bool); /* impl */
+ virtual vlc_data_t *checkBlock(vlc_data_t *, bool); /* impl */
virtual AbstractDemuxer * newDemux(demux_t *, const StreamFormat &,
es_out_t *, AbstractSourceStream *) const; /* reimpl */
};
diff --git a/modules/demux/dash/mp4/IndexReader.cpp b/modules/demux/dash/mp4/IndexReader.cpp
index 83ef5cab66..cb762cebd6 100644
--- a/modules/demux/dash/mp4/IndexReader.cpp
+++ b/modules/demux/dash/mp4/IndexReader.cpp
@@ -34,7 +34,7 @@ IndexReader::IndexReader(vlc_object_t *obj)
{
}
-bool IndexReader::parseIndex(block_t *p_block, BaseRepresentation *rep, uint64_t i_fileoffset)
+bool IndexReader::parseIndex(vlc_data_t *p_block, BaseRepresentation *rep, uint64_t i_fileoffset)
{
if(!rep || !parseBlock(p_block))
return false;
diff --git a/modules/demux/dash/mp4/IndexReader.hpp b/modules/demux/dash/mp4/IndexReader.hpp
index 7c19e87df7..8f8cb04274 100644
--- a/modules/demux/dash/mp4/IndexReader.hpp
+++ b/modules/demux/dash/mp4/IndexReader.hpp
@@ -41,7 +41,7 @@ namespace dash
{
public:
IndexReader(vlc_object_t *);
- bool parseIndex(block_t *, BaseRepresentation *, uint64_t);
+ bool parseIndex(vlc_data_t *, BaseRepresentation *, uint64_t);
};
}
}
diff --git a/modules/demux/dash/mpd/DASHSegment.cpp b/modules/demux/dash/mpd/DASHSegment.cpp
index c21b201e0d..f22fe58725 100644
--- a/modules/demux/dash/mpd/DASHSegment.cpp
+++ b/modules/demux/dash/mpd/DASHSegment.cpp
@@ -41,9 +41,9 @@ DashIndexSegment::DashIndexSegment(ICanonicalUrl *parent) :
{
}
-void DashIndexSegment::onChunkDownload(block_t **pp_block, SegmentChunk *p_chunk, BaseRepresentation *rep)
+void DashIndexSegment::onChunkDownload(vlc_data_t **pp_block, SegmentChunk *p_chunk, BaseRepresentation *rep, bool header)
{
- if(!rep || ((*pp_block)->i_flags & BLOCK_FLAG_HEADER) == 0 )
+ if(!rep || !header )
return;
IndexReader br(rep->getPlaylist()->getVLCObject());
diff --git a/modules/demux/dash/mpd/DASHSegment.h b/modules/demux/dash/mpd/DASHSegment.h
index 70a2d21aed..98aca5a8c7 100644
--- a/modules/demux/dash/mpd/DASHSegment.h
+++ b/modules/demux/dash/mpd/DASHSegment.h
@@ -40,7 +40,7 @@ namespace dash
DashIndexSegment( ICanonicalUrl *parent );
protected:
- virtual void onChunkDownload(block_t **, SegmentChunk *, BaseRepresentation *); //reimpl
+ virtual void onChunkDownload(vlc_data_t **, SegmentChunk *, BaseRepresentation *, bool); //reimpl
};
}
diff --git a/modules/demux/demuxdump.c b/modules/demux/demuxdump.c
index ab47bc69b5..825b535656 100644
--- a/modules/demux/demuxdump.c
+++ b/modules/demux/demuxdump.c
@@ -124,19 +124,19 @@ static int Demux( demux_t *p_demux )
{
sout_access_out_t *out = (void *)p_demux->p_sys;
- block_t *block = block_Alloc( DUMP_BLOCKSIZE );
- if( unlikely(block == NULL) )
+ vlc_frame_t *frame = vlc_frame_Alloc( DUMP_BLOCKSIZE );
+ if( unlikely(frame == NULL) )
return -1;
- int rd = vlc_stream_Read( p_demux->s, block->p_buffer, DUMP_BLOCKSIZE );
+ int rd = vlc_stream_Read( p_demux->s, frame->p_buffer, DUMP_BLOCKSIZE );
if ( rd <= 0 )
{
- block_Release( block );
+ vlc_frame_Release( frame );
return rd;
}
- block->i_buffer = rd;
+ frame->i_buffer = rd;
- size_t wr = sout_AccessOutWrite( out, block );
+ size_t wr = sout_AccessOutWrite( out, frame );
if( wr != (size_t)rd )
{
msg_Err( p_demux, "cannot write data" );
diff --git a/modules/demux/flac.c b/modules/demux/flac.c
index d82eab7adf..345bdeec68 100644
--- a/modules/demux/flac.c
+++ b/modules/demux/flac.c
@@ -72,9 +72,9 @@ typedef struct
typedef struct
{
bool b_start;
- int i_next_block_flags;
+ int i_next_frame_flags;
es_out_id_t *p_es;
- block_t *p_current_block;
+ vlc_frame_t *p_current_frame;
/* Packetizer */
decoder_t *p_packetizer;
@@ -139,14 +139,14 @@ static int Open( vlc_object_t * p_this )
p_demux->pf_control = Control;
p_demux->p_sys = p_sys;
p_sys->b_start = true;
- p_sys->i_next_block_flags = 0;
+ p_sys->i_next_frame_flags = 0;
p_sys->p_packetizer = NULL;
p_sys->p_meta = NULL;
p_sys->i_length = 0;
p_sys->i_pts = VLC_TICK_INVALID;
p_sys->b_stream_info = false;
p_sys->p_es = NULL;
- p_sys->p_current_block = NULL;
+ p_sys->p_current_frame = NULL;
TAB_INIT( p_sys->i_seekpoint, p_sys->seekpoint );
TAB_INIT( p_sys->i_attachments, p_sys->attachments);
TAB_INIT( p_sys->i_title_seekpoints, p_sys->pp_title_seekpoints );
@@ -192,8 +192,8 @@ static void Close( vlc_object_t * p_this )
demux_t *p_demux = (demux_t*)p_this;
demux_sys_t *p_sys = p_demux->p_sys;
- if( p_sys->p_current_block )
- block_Release( p_sys->p_current_block );
+ if( p_sys->p_current_frame )
+ vlc_frame_Release( p_sys->p_current_frame );
for( int i = 0; i < p_sys->i_seekpoint; i++ )
free(p_sys->seekpoint[i]);
@@ -216,23 +216,23 @@ static void Close( vlc_object_t * p_this )
free( p_sys );
}
-static block_t *GetPacketizedBlock( decoder_t *p_packetizer,
+static vlc_frame_t *GetPacketizedBlock( decoder_t *p_packetizer,
const struct flac_stream_info *streaminfo,
- block_t **pp_current_block )
+ vlc_frame_t **pp_current_frame )
{
- block_t *p_block = p_packetizer->pf_packetize( p_packetizer, pp_current_block );
- if( p_block )
+ vlc_frame_t *p_frame = p_packetizer->pf_packetize( p_packetizer, pp_current_frame );
+ if( p_frame )
{
- if( p_block->i_buffer >= FLAC_HEADER_SIZE_MAX )
+ if( p_frame->i_buffer >= FLAC_HEADER_SIZE_MAX )
{
struct flac_header_info headerinfo;
- int i_ret = FLAC_ParseSyncInfo( p_block->p_buffer, streaminfo, NULL, &headerinfo );
+ int i_ret = FLAC_ParseSyncInfo( p_frame->p_buffer, streaminfo, NULL, &headerinfo );
assert( i_ret != 0 ); /* Same as packetizer */
/* Use Frame PTS, not the interpolated one */
- p_block->i_dts = p_block->i_pts = headerinfo.i_pts;
+ p_frame->i_dts = p_frame->i_pts = headerinfo.i_pts;
}
}
- return p_block;
+ return p_frame;
}
static void FlushPacketizer( decoder_t *p_packetizer )
@@ -241,9 +241,9 @@ static void FlushPacketizer( decoder_t *p_packetizer )
p_packetizer->pf_flush( p_packetizer );
else
{
- block_t *p_block_out;
- while( (p_block_out = p_packetizer->pf_packetize( p_packetizer, NULL )) )
- block_Release( p_block_out );
+ vlc_frame_t *p_frame_out;
+ while( (p_frame_out = p_packetizer->pf_packetize( p_packetizer, NULL )) )
+ vlc_frame_Release( p_frame_out );
}
}
@@ -252,10 +252,10 @@ static void Reset( demux_sys_t *p_sys )
p_sys->i_pts = VLC_TICK_INVALID;
FlushPacketizer( p_sys->p_packetizer );
- if( p_sys->p_current_block )
+ if( p_sys->p_current_frame )
{
- block_Release( p_sys->p_current_block );
- p_sys->p_current_block = NULL;
+ vlc_frame_Release( p_sys->p_current_frame );
+ p_sys->p_current_frame = NULL;
}
}
@@ -264,8 +264,8 @@ static int RefineSeek( demux_t *p_demux, vlc_tick_t i_time, double i_bytemicrora
{
demux_sys_t *p_sys = p_demux->p_sys;
bool b_found = false;
- block_t *p_block_out;
- block_t *p_block_in;
+ vlc_frame_t *p_frame_out;
+ vlc_frame_t *p_frame_in;
unsigned i_frame_size = FLAC_FRAME_SIZE_MIN;
@@ -278,36 +278,36 @@ static int RefineSeek( demux_t *p_demux, vlc_tick_t i_time, double i_bytemicrora
{
FlushPacketizer( p_sys->p_packetizer );
- p_block_out = NULL;
- p_block_in = NULL;
+ p_frame_out = NULL;
+ p_frame_in = NULL;
- while( !p_block_out )
+ while( !p_frame_out )
{
- if( !p_block_in )
+ if( !p_frame_in )
{
- if( !(p_block_in = vlc_stream_Block( p_demux->s, i_frame_size )) )
+ if( !(p_frame_in = vlc_stream_Frame( p_demux->s, i_frame_size )) )
break;
}
- p_block_out = GetPacketizedBlock( p_sys->p_packetizer,
+ p_frame_out = GetPacketizedBlock( p_sys->p_packetizer,
p_sys->b_stream_info ? &p_sys->stream_info : NULL,
- &p_block_in );
+ &p_frame_in );
}
- if( !p_block_out )
+ if( !p_frame_out )
{
- if( p_block_in )
- block_Release( p_block_in );
+ if( p_frame_in )
+ vlc_frame_Release( p_frame_in );
break;
}
- if( p_block_out->i_buffer > i_frame_size )
- i_frame_size = p_block_out->i_buffer;
+ if( p_frame_out->i_buffer > i_frame_size )
+ i_frame_size = p_frame_out->i_buffer;
- /* If we are further than wanted block */
- if( p_block_out->i_dts >= i_time )
+ /* If we are further than wanted frame */
+ if( p_frame_out->i_dts >= i_time )
{
- vlc_tick_t i_diff = p_block_out->i_dts - i_time;
+ vlc_tick_t i_diff = p_frame_out->i_dts - i_time;
/* Not in acceptable approximation range */
if( i_diff > VLC_TICK_FROM_MS(100) && i_diff / i_bytemicrorate > i_frame_size )
{
@@ -319,7 +319,7 @@ static int RefineSeek( demux_t *p_demux, vlc_tick_t i_time, double i_bytemicrora
}
else
{
- vlc_tick_t i_diff = i_time - p_block_out->i_dts;
+ vlc_tick_t i_diff = i_time - p_frame_out->i_dts;
/* Not in acceptable NEXT_TIME demux range */
if( i_diff >= ((b_canfastseek) ? FLAC_MAX_PREROLL : FLAC_MAX_SLOW_PREROLL) &&
i_diff / i_bytemicrorate > i_frame_size )
@@ -331,10 +331,10 @@ static int RefineSeek( demux_t *p_demux, vlc_tick_t i_time, double i_bytemicrora
else b_found = true;
}
- if( p_block_out )
- block_Release( p_block_out );
- if( p_block_in )
- block_Release( p_block_in );
+ if( p_frame_out )
+ vlc_frame_Release( p_frame_out );
+ if( p_frame_in )
+ vlc_frame_Release( p_frame_in );
if( !b_found )
{
@@ -357,46 +357,46 @@ static int RefineSeek( demux_t *p_demux, vlc_tick_t i_time, double i_bytemicrora
static int Demux( demux_t *p_demux )
{
demux_sys_t *p_sys = p_demux->p_sys;
- block_t *p_block_out;
+ vlc_frame_t *p_frame_out;
bool b_eof = false;
- if( p_sys->p_current_block == NULL )
+ if( p_sys->p_current_frame == NULL )
{
- p_sys->p_current_block = vlc_stream_Block( p_demux->s, FLAC_PACKET_SIZE );
- b_eof = (p_sys->p_current_block == NULL);
+ p_sys->p_current_frame = vlc_stream_Frame( p_demux->s, FLAC_PACKET_SIZE );
+ b_eof = (p_sys->p_current_frame == NULL);
}
- if ( p_sys->p_current_block )
+ if ( p_sys->p_current_frame )
{
- p_sys->p_current_block->i_flags = p_sys->i_next_block_flags;
- p_sys->i_next_block_flags = 0;
- p_sys->p_current_block->i_pts =
- p_sys->p_current_block->i_dts = p_sys->b_start ? VLC_TICK_0 : VLC_TICK_INVALID;
+ p_sys->p_current_frame->i_flags = p_sys->i_next_frame_flags;
+ p_sys->i_next_frame_flags = 0;
+ p_sys->p_current_frame->i_pts =
+ p_sys->p_current_frame->i_dts = p_sys->b_start ? VLC_TICK_0 : VLC_TICK_INVALID;
}
- while( (p_block_out = GetPacketizedBlock( p_sys->p_packetizer,
+ while( (p_frame_out = GetPacketizedBlock( p_sys->p_packetizer,
p_sys->b_stream_info ? &p_sys->stream_info : NULL,
- p_sys->p_current_block ? &p_sys->p_current_block : NULL ) ) )
+ p_sys->p_current_frame ? &p_sys->p_current_frame : NULL ) ) )
{
/* Only clear on output when packet is accepted as sync #17111 */
p_sys->b_start = false;
- while( p_block_out )
+ while( p_frame_out )
{
- block_t *p_next = p_block_out->p_next;
+ vlc_frame_t *p_next = p_frame_out->p_next;
- p_block_out->p_next = NULL;
+ p_frame_out->p_next = NULL;
/* set PCR */
if( unlikely(p_sys->i_pts == VLC_TICK_INVALID) )
- es_out_SetPCR( p_demux->out, __MAX(p_block_out->i_dts - 1, VLC_TICK_0) );
+ es_out_SetPCR( p_demux->out, __MAX(p_frame_out->i_dts - 1, VLC_TICK_0) );
- p_sys->i_pts = p_block_out->i_dts;
+ p_sys->i_pts = p_frame_out->i_dts;
- es_out_Send( p_demux->out, p_sys->p_es, p_block_out );
+ es_out_Send( p_demux->out, p_sys->p_es, p_frame_out );
es_out_SetPCR( p_demux->out, p_sys->i_pts );
- p_block_out = p_next;
+ p_frame_out = p_next;
}
break;
}
@@ -493,7 +493,7 @@ static int ControlSetTime( demux_t *p_demux, vlc_tick_t i_time )
int i_ret = RefineSeek( p_demux, i_time, i_bytemicrorate, i_lower, i_upper );
if( i_ret == VLC_SUCCESS )
{
- p_sys->i_next_block_flags |= BLOCK_FLAG_DISCONTINUITY;
+ p_sys->i_next_frame_flags |= FRAME_FLAG_DISCONTINUITY;
Reset( p_sys );
es_out_Control( p_demux->out, ES_OUT_SET_NEXT_DISPLAY_TIME, i_time );
}
@@ -542,7 +542,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
i_ret = vlc_stream_Seek( p_demux->s, (int64_t) (f * stream_Size( p_demux->s )) );
if( i_ret == VLC_SUCCESS )
{
- p_sys->i_next_block_flags |= BLOCK_FLAG_DISCONTINUITY;
+ p_sys->i_next_frame_flags |= FRAME_FLAG_DISCONTINUITY;
Reset( p_sys );
}
return i_ret;
@@ -695,7 +695,7 @@ static int ParseHeaders( demux_t *p_demux, es_format_t *p_fmt )
if( i_type == META_STREAMINFO && p_fmt->p_extra == NULL )
{
if( i_len != FLAC_STREAMINFO_SIZE ) {
- msg_Err( p_demux, "invalid size %d for a STREAMINFO metadata block", i_len );
+ msg_Err( p_demux, "invalid size %d for a STREAMINFO metadata frame", i_len );
return VLC_EGENERIC;
}
@@ -711,7 +711,7 @@ static int ParseHeaders( demux_t *p_demux, es_format_t *p_fmt )
if( vlc_stream_Read( p_demux->s, p_fmt->p_extra,
FLAC_STREAMINFO_SIZE ) != FLAC_STREAMINFO_SIZE )
{
- msg_Err( p_demux, "failed to read STREAMINFO metadata block" );
+ msg_Err( p_demux, "failed to read STREAMINFO metadata frame" );
FREENULL( p_fmt->p_extra );
return VLC_EGENERIC;
}
diff --git a/modules/demux/gme.c b/modules/demux/gme.c
index 5bf2244b8b..9c3543a141 100644
--- a/modules/demux/gme.c
+++ b/modules/demux/gme.c
@@ -88,10 +88,10 @@ static int Open (vlc_object_t *obj)
return VLC_EGENERIC;
msg_Dbg (obj, "detected file type %s", type);
- block_t *data = NULL;
+ vlc_frame_t *data = NULL;
if (size <= 0)
{
- data = vlc_stream_Block (demux->s, 1 << 24);
+ data = vlc_stream_Frame (demux->s, 1 << 24);
if (data == NULL)
return VLC_EGENERIC;
}
@@ -110,7 +110,7 @@ static int Open (vlc_object_t *obj)
if (data)
{
gme_load_custom (sys->emu, ReaderBlock, data->i_buffer, data);
- block_Release(data);
+ vlc_frame_Release(data);
}
else
{
@@ -188,12 +188,12 @@ static gme_err_t ReaderStream (void *data, void *buf, int length)
}
static gme_err_t ReaderBlock (void *data, void *buf, int length)
{
- block_t *block = data;
+ vlc_frame_t *frame = data;
- int max = __MIN (length, (int)block->i_buffer);
- memcpy (buf, block->p_buffer, max);
- block->i_buffer -= max;
- block->p_buffer += max;
+ int max = __MIN (length, (int)frame->i_buffer);
+ memcpy (buf, frame->p_buffer, max);
+ frame->i_buffer -= max;
+ frame->p_buffer += max;
if (max != length)
return "short read";
return NULL;
@@ -217,21 +217,21 @@ static int Demux (demux_t *demux)
}
- block_t *block = block_Alloc (2 * 2 * SAMPLES);
- if (unlikely(block == NULL))
+ vlc_frame_t *frame = vlc_frame_Alloc (2 * 2 * SAMPLES);
+ if (unlikely(frame == NULL))
return VLC_DEMUXER_EOF;
- gme_err_t ret = gme_play (sys->emu, 2 * SAMPLES, (void *)block->p_buffer);
+ gme_err_t ret = gme_play (sys->emu, 2 * SAMPLES, (void *)frame->p_buffer);
if (ret != NULL)
{
- block_Release (block);
+ vlc_frame_Release (frame);
msg_Err (demux, "%s", ret);
return VLC_DEMUXER_EOF;
}
- block->i_pts = block->i_dts = date_Get (&sys->pts);
- es_out_SetPCR (demux->out, block->i_pts);
- es_out_Send (demux->out, sys->es, block);
+ frame->i_pts = frame->i_dts = date_Get (&sys->pts);
+ es_out_SetPCR (demux->out, frame->i_pts);
+ es_out_Send (demux->out, sys->es, frame);
date_Increment (&sys->pts, SAMPLES);
return VLC_DEMUXER_SUCCESS;
}
diff --git a/modules/demux/hls/HLSStreams.cpp b/modules/demux/hls/HLSStreams.cpp
index cdd04a7645..c3a955ac6d 100644
--- a/modules/demux/hls/HLSStreams.cpp
+++ b/modules/demux/hls/HLSStreams.cpp
@@ -96,7 +96,7 @@ int HLSStream::ID3TAG_Parse_Handler(uint32_t i_tag, const uint8_t *p_payload, si
return hlsstream->ParseID3Tag(i_tag, p_payload, i_payload);
}
-block_t * HLSStream::checkBlock(block_t *p_block, bool b_first)
+vlc_data_t * HLSStream::checkBlock(vlc_data_t *p_block, bool b_first)
{
if(b_first && p_block &&
p_block->i_buffer >= 10 && ID3TAG_IsTag(p_block->p_buffer, false))
diff --git a/modules/demux/hls/HLSStreams.hpp b/modules/demux/hls/HLSStreams.hpp
index 77dff6a434..dc691f5f3f 100644
--- a/modules/demux/hls/HLSStreams.hpp
+++ b/modules/demux/hls/HLSStreams.hpp
@@ -34,7 +34,7 @@ namespace hls
protected:
virtual void setTimeOffset(vlc_tick_t); /* reimpl */
- virtual block_t *checkBlock(block_t *, bool); /* reimpl */
+ virtual vlc_data_t *checkBlock(vlc_data_t *, bool); /* reimpl */
virtual AbstractDemuxer * newDemux(demux_t *, const StreamFormat &,
es_out_t *, AbstractSourceStream *) const; /* reimpl */
diff --git a/modules/demux/hls/playlist/HLSSegment.cpp b/modules/demux/hls/playlist/HLSSegment.cpp
index c43f6a58ad..57f82850db 100644
--- a/modules/demux/hls/playlist/HLSSegment.cpp
+++ b/modules/demux/hls/playlist/HLSSegment.cpp
@@ -26,7 +26,7 @@
#include "../adaptive/playlist/BaseRepresentation.h"
#include <vlc_common.h>
-#include <vlc_block.h>
+#include <vlc_data.h>
#ifdef HAVE_GCRYPT
#include <vlc_gcrypt.h>
#endif
@@ -56,16 +56,16 @@ HLSSegment::~HLSSegment()
#endif
}
-void HLSSegment::onChunkDownload(block_t **pp_block, SegmentChunk *chunk, BaseRepresentation *)
+void HLSSegment::onChunkDownload(vlc_data_t **pp_block, SegmentChunk *chunk, BaseRepresentation *, bool)
{
- block_t *p_block = *pp_block;
+ vlc_data_t *p_block = *pp_block;
#ifndef HAVE_GCRYPT
(void)chunk;
#else
if(encryption.method == SegmentEncryption::AES_128)
{
- block_t *p_block = *pp_block;
+ vlc_data_t *p_block = *pp_block;
/* first bytes */
if(!ctx && chunk->getBytesRead() == p_block->i_buffer)
{
diff --git a/modules/demux/hls/playlist/HLSSegment.hpp b/modules/demux/hls/playlist/HLSSegment.hpp
index b96a558aef..88babc2cd0 100644
--- a/modules/demux/hls/playlist/HLSSegment.hpp
+++ b/modules/demux/hls/playlist/HLSSegment.hpp
@@ -59,7 +59,7 @@ namespace hls
protected:
vlc_tick_t utcTime;
- virtual void onChunkDownload(block_t **, SegmentChunk *, BaseRepresentation *); /* reimpl */
+ virtual void onChunkDownload(vlc_data_t **, SegmentChunk *, BaseRepresentation *, bool); /* reimpl */
SegmentEncryption encryption;
#ifdef HAVE_GCRYPT
diff --git a/modules/demux/hls/playlist/M3U8.cpp b/modules/demux/hls/playlist/M3U8.cpp
index 622783bfee..14ca92e5ad 100644
--- a/modules/demux/hls/playlist/M3U8.cpp
+++ b/modules/demux/hls/playlist/M3U8.cpp
@@ -29,7 +29,6 @@
#include <vlc_common.h>
#include <vlc_stream.h>
-#include <vlc_block.h>
using namespace hls::playlist;
@@ -55,7 +54,7 @@ std::vector<uint8_t> M3U8::getEncryptionKey(const std::string &uri)
if(it == keystore.end())
{
/* Pretty bad inside the lock */
- block_t *p_block = Retrieve::HTTP(p_object, auth, uri);
+ vlc_data_t *p_block = Retrieve::HTTP(p_object, auth, uri);
if(p_block)
{
if(p_block->i_buffer == 16)
@@ -64,7 +63,7 @@ std::vector<uint8_t> M3U8::getEncryptionKey(const std::string &uri)
memcpy(&key[0], p_block->p_buffer, 16);
keystore.insert(std::pair<std::string, std::vector<uint8_t> >(uri, key));
}
- block_Release(p_block);
+ vlc_data_Release(p_block);
}
}
else
diff --git a/modules/demux/hls/playlist/Parser.cpp b/modules/demux/hls/playlist/Parser.cpp
index 5d67e160a2..217e6a7c2b 100644
--- a/modules/demux/hls/playlist/Parser.cpp
+++ b/modules/demux/hls/playlist/Parser.cpp
@@ -171,7 +171,7 @@ void M3U8Parser::createAndFillRepresentation(vlc_object_t *p_obj, BaseAdaptation
bool M3U8Parser::appendSegmentsFromPlaylistURI(vlc_object_t *p_obj, Representation *rep)
{
- block_t *p_block = Retrieve::HTTP(p_obj, auth, rep->getPlaylistUrl().toString());
+ vlc_data_t *p_block = Retrieve::HTTP(p_obj, auth, rep->getPlaylistUrl().toString());
if(p_block)
{
stream_t *substream = vlc_stream_MemoryNew(p_obj, p_block->p_buffer, p_block->i_buffer, true);
@@ -184,7 +184,7 @@ bool M3U8Parser::appendSegmentsFromPlaylistURI(vlc_object_t *p_obj, Representati
releaseTagsList(tagslist);
}
- block_Release(p_block);
+ vlc_data_Release(p_block);
return true;
}
return false;
diff --git a/modules/demux/image.c b/modules/demux/image.c
index f438bcdc56..7fc4b43f36 100644
--- a/modules/demux/image.c
+++ b/modules/demux/image.c
@@ -101,7 +101,7 @@ vlc_module_end()
*****************************************************************************/
typedef struct
{
- block_t *data;
+ vlc_frame_t *data;
es_out_id_t *es;
vlc_tick_t duration;
bool is_realtime;
@@ -110,7 +110,7 @@ typedef struct
date_t pts;
} demux_sys_t;
-static block_t *Load(demux_t *demux)
+static vlc_frame_t *Load(demux_t *demux)
{
const unsigned max_size = 4096 * 4096 * 8;
uint64_t size;
@@ -124,26 +124,26 @@ static block_t *Load(demux_t *demux)
} else
size = max_size;
- block_t *block = block_Alloc(size);
- if (block == NULL)
+ vlc_frame_t *frame = vlc_frame_Alloc(size);
+ if (frame == NULL)
return NULL;
- ssize_t val = vlc_stream_Read(demux->s, block->p_buffer, size);
+ ssize_t val = vlc_stream_Read(demux->s, frame->p_buffer, size);
if (val < 0) {
- block_Release(block);
+ vlc_frame_Release(frame);
return NULL;
}
- block->i_buffer = val;
- return block;
+ frame->i_buffer = val;
+ return frame;
}
-static block_t *Decode(demux_t *demux,
- es_format_t *fmt, vlc_fourcc_t chroma, block_t *data)
+static vlc_frame_t *Decode(demux_t *demux,
+ es_format_t *fmt, vlc_fourcc_t chroma, vlc_frame_t *data)
{
image_handler_t *handler = image_HandlerCreate(demux);
if (!handler) {
- block_Release(data);
+ vlc_frame_Release(data);
return NULL;
}
@@ -164,7 +164,7 @@ static block_t *Decode(demux_t *demux,
for (int i = 0; i < image->i_planes; i++)
size += image->p[i].i_pitch * image->p[i].i_lines;
- data = block_Alloc(size);
+ data = vlc_frame_Alloc(size);
if (!data) {
picture_Release(image);
return NULL;
@@ -217,7 +217,7 @@ static int Demux(demux_t *demux)
if (pts >= deadline)
return VLC_DEMUXER_SUCCESS;
- block_t *data = block_Duplicate(sys->data);
+ vlc_frame_t *data = vlc_frame_Duplicate(sys->data);
if (!data)
return VLC_DEMUXER_EGENERIC;
@@ -227,7 +227,7 @@ static int Demux(demux_t *demux)
if(sys->es)
es_out_Send(demux->out, sys->es, data);
else
- block_Release(data);
+ vlc_frame_Release(data);
date_Increment(&sys->pts, 1);
}
@@ -704,7 +704,7 @@ static int Open(vlc_object_t *object)
es_format_Init(&fmt, VIDEO_ES, codec);
fmt.video.i_chroma = fmt.i_codec;
- block_t *data = Load(demux);
+ vlc_frame_t *data = Load(demux);
if (data && var_InheritBool(demux, "image-decode")) {
char *string = var_InheritString(demux, "image-chroma");
vlc_fourcc_t chroma = vlc_fourcc_GetCodecFromString(VIDEO_ES, string);
@@ -733,7 +733,7 @@ static int Open(vlc_object_t *object)
demux_sys_t *sys = malloc(sizeof(*sys));
if (!sys) {
if (data)
- block_Release(data);
+ vlc_frame_Release(data);
es_format_Clean(&fmt);
return VLC_ENOMEM;
}
@@ -761,7 +761,7 @@ static void Close(vlc_object_t *object)
demux_sys_t *sys = demux->p_sys;
if (sys->data)
- block_Release(sys->data);
+ vlc_frame_Release(sys->data);
free(sys);
}
diff --git a/modules/demux/mjpeg.c b/modules/demux/mjpeg.c
index bdbaea2e93..2994928512 100644
--- a/modules/demux/mjpeg.c
+++ b/modules/demux/mjpeg.c
@@ -258,9 +258,9 @@ static bool CheckMimeHeader( demux_t *p_demux, int *p_header_size )
static int SendBlock( demux_t *p_demux, int i )
{
demux_sys_t *p_sys = p_demux->p_sys;
- block_t *p_block;
+ vlc_frame_t *p_frame;
- if( ( p_block = vlc_stream_Block( p_demux->s, i ) ) == NULL )
+ if( ( p_frame = vlc_stream_Frame( p_demux->s, i ) ) == NULL )
{
msg_Warn( p_demux, "cannot read data" );
return VLC_DEMUXER_EOF;
@@ -268,17 +268,17 @@ static int SendBlock( demux_t *p_demux, int i )
if( p_sys->i_frame_length != VLC_TICK_INVALID )
{
- p_block->i_pts = p_sys->i_time;
+ p_frame->i_pts = p_sys->i_time;
p_sys->i_time += p_sys->i_frame_length;
}
else
{
- p_block->i_pts = vlc_tick_now();
+ p_frame->i_pts = vlc_tick_now();
}
- p_block->i_dts = p_block->i_pts;
+ p_frame->i_dts = p_frame->i_pts;
- es_out_SetPCR( p_demux->out, p_block->i_pts );
- es_out_Send( p_demux->out, p_sys->p_es, p_block );
+ es_out_SetPCR( p_demux->out, p_frame->i_pts );
+ es_out_Send( p_demux->out, p_sys->p_es, p_frame );
if( p_sys->b_still )
p_sys->i_still_end = vlc_tick_now() + p_sys->i_frame_length;
diff --git a/modules/demux/mkv/mkv.cpp b/modules/demux/mkv/mkv.cpp
index c452d07668..812ee73feb 100644
--- a/modules/demux/mkv/mkv.cpp
+++ b/modules/demux/mkv/mkv.cpp
@@ -559,7 +559,7 @@ void BlockDecode( demux_t *p_demux, KaxBlock *block, KaxSimpleBlock *simpleblock
for( unsigned int i_frame = 0; i_frame < i_number_frames; i_frame++ )
{
- block_t *p_block;
+ vlc_frame_t *p_block;
DataBuffer *data = &internal_block.GetBuffer(i_frame);
frame_size += data->Size();
@@ -573,11 +573,11 @@ void BlockDecode( demux_t *p_demux, KaxBlock *block, KaxSimpleBlock *simpleblock
if( track.i_compression_type == MATROSKA_COMPRESSION_HEADER &&
track.p_compression_data != NULL &&
track.i_encoding_scope & MATROSKA_ENCODING_SCOPE_ALL_FRAMES )
- p_block = MemToBlock( data->Buffer(), data->Size(), track.p_compression_data->GetSize() + extra_data );
+ p_block = MemToFrame( data->Buffer(), data->Size(), track.p_compression_data->GetSize() + extra_data );
else if( unlikely( track.fmt.i_codec == VLC_CODEC_WAVPACK ) )
p_block = packetize_wavpack( track, data->Buffer(), data->Size() );
else
- p_block = MemToBlock( data->Buffer(), data->Size(), extra_data );
+ p_block = MemToFrame( data->Buffer(), data->Size(), extra_data );
if( p_block == NULL )
{
@@ -588,7 +588,7 @@ void BlockDecode( demux_t *p_demux, KaxBlock *block, KaxSimpleBlock *simpleblock
if( track.i_compression_type == MATROSKA_COMPRESSION_ZLIB &&
track.i_encoding_scope & MATROSKA_ENCODING_SCOPE_ALL_FRAMES )
{
- p_block = block_zlib_decompress( VLC_OBJECT(p_demux), p_block );
+ p_block = frame_zlib_decompress( VLC_OBJECT(p_demux), p_block );
if( p_block == NULL )
break;
}
@@ -603,7 +603,7 @@ void BlockDecode( demux_t *p_demux, KaxBlock *block, KaxSimpleBlock *simpleblock
memcpy( p_block->p_buffer + 4, "icpf", 4 );
if ( b_key_picture )
- p_block->i_flags |= BLOCK_FLAG_TYPE_I;
+ p_block->i_flags |= FRAME_FLAG_TYPE_I;
switch( track.fmt.i_codec )
{
@@ -611,7 +611,7 @@ void BlockDecode( demux_t *p_demux, KaxBlock *block, KaxSimpleBlock *simpleblock
case VLC_CODEC_ATRAC3:
{
handle_real_audio(p_demux, &track, p_block, i_pts);
- block_Release(p_block);
+ vlc_frame_Release(p_block);
i_pts = ( track.i_default_duration )?
i_pts + track.i_default_duration:
VLC_TICK_INVALID;
@@ -620,7 +620,7 @@ void BlockDecode( demux_t *p_demux, KaxBlock *block, KaxSimpleBlock *simpleblock
case VLC_CODEC_WEBVTT:
{
- p_block = block_Realloc( p_block, 16, p_block->i_buffer );
+ p_block = vlc_frame_Realloc( p_block, 16, p_block->i_buffer );
if( !p_block )
continue;
SetDWBE( p_block->p_buffer, p_block->i_buffer );
@@ -641,7 +641,7 @@ void BlockDecode( demux_t *p_demux, KaxBlock *block, KaxSimpleBlock *simpleblock
case VLC_CODEC_DVBS:
{
- p_block = block_Realloc( p_block, 2, p_block->i_buffer + 1);
+ p_block = vlc_frame_Realloc( p_block, 2, p_block->i_buffer + 1);
if( unlikely( !p_block ) )
continue;
@@ -665,7 +665,7 @@ void BlockDecode( demux_t *p_demux, KaxBlock *block, KaxSimpleBlock *simpleblock
{
// TODO handle the start/stop times of this packet
p_sys->ev.SetPci( (const pci_t *)&p_block->p_buffer[1]);
- block_Release( p_block );
+ vlc_frame_Release( p_block );
return;
}
p_block->i_dts = p_block->i_pts = i_pts;
@@ -696,7 +696,7 @@ void BlockDecode( demux_t *p_demux, KaxBlock *block, KaxSimpleBlock *simpleblock
}
}
- send_Block( p_demux, &track, p_block, i_number_frames, i_duration );
+ send_Frame( p_demux, &track, p_block, i_number_frames, i_duration );
/* use time stamp only for first block */
i_pts = ( track.i_default_duration )?
diff --git a/modules/demux/mkv/util.cpp b/modules/demux/mkv/util.cpp
index f3dbf8c10b..e9b405d1d4 100644
--- a/modules/demux/mkv/util.cpp
+++ b/modules/demux/mkv/util.cpp
@@ -97,10 +97,10 @@ int32_t zlib_decompress_extra( demux_t * p_demux, mkv_track_t & tk )
return 0;
}
-block_t *block_zlib_decompress( vlc_object_t *p_this, block_t *p_in_block ) {
+vlc_frame_t *frame_zlib_decompress( vlc_object_t *p_this, vlc_frame_t *p_in_frame ) {
int result, dstsize, n;
unsigned char *dst;
- block_t *p_block;
+ vlc_frame_t *p_frame;
z_stream d_stream;
d_stream.zalloc = NULL;
@@ -113,16 +113,16 @@ block_t *block_zlib_decompress( vlc_object_t *p_this, block_t *p_in_block ) {
return NULL;
}
- d_stream.next_in = (Bytef *)p_in_block->p_buffer;
- d_stream.avail_in = p_in_block->i_buffer;
+ d_stream.next_in = (Bytef *)p_in_frame->p_buffer;
+ d_stream.avail_in = p_in_frame->i_buffer;
n = 0;
- p_block = block_Alloc( 0 );
+ p_frame = vlc_frame_Alloc( 0 );
dst = NULL;
do
{
n++;
- p_block = block_Realloc( p_block, 0, n * 1000 );
- dst = static_cast<unsigned char *>( p_block->p_buffer );
+ p_frame = vlc_frame_Realloc( p_frame, 0, n * 1000 );
+ dst = static_cast<unsigned char *>( p_frame->p_buffer );
d_stream.next_out = (Bytef *)&dst[(n - 1) * 1000];
d_stream.avail_out = 1000;
result = inflate(&d_stream, Z_NO_FLUSH);
@@ -130,8 +130,8 @@ block_t *block_zlib_decompress( vlc_object_t *p_this, block_t *p_in_block ) {
{
msg_Err( p_this, "Zlib decompression failed. Result: %d", result );
inflateEnd( &d_stream );
- block_Release( p_block );
- return p_in_block;
+ vlc_frame_Release( p_frame );
+ return p_in_frame;
}
}
while( ( d_stream.avail_out == 0 ) && ( d_stream.avail_in != 0 ) &&
@@ -140,30 +140,30 @@ block_t *block_zlib_decompress( vlc_object_t *p_this, block_t *p_in_block ) {
dstsize = d_stream.total_out;
inflateEnd( &d_stream );
- p_block = block_Realloc( p_block, 0, dstsize );
- p_block->i_buffer = dstsize;
- block_Release( p_in_block );
+ p_frame = vlc_frame_Realloc( p_frame, 0, dstsize );
+ p_frame->i_buffer = dstsize;
+ vlc_frame_Release( p_in_frame );
- return p_block;
+ return p_frame;
}
#endif
/* Utility function for BlockDecode */
-block_t *MemToBlock( uint8_t *p_mem, size_t i_mem, size_t offset)
+vlc_frame_t *MemToFrame( uint8_t *p_mem, size_t i_mem, size_t offset)
{
if( unlikely( i_mem > SIZE_MAX - offset ) )
return NULL;
- block_t *p_block = block_Alloc( i_mem + offset );
- if( likely(p_block != NULL) )
+ vlc_frame_t *p_frame = vlc_frame_Alloc( i_mem + offset );
+ if( likely(p_frame != NULL) )
{
- memcpy( p_block->p_buffer + offset, p_mem, i_mem );
+ memcpy( p_frame->p_buffer + offset, p_mem, i_mem );
}
- return p_block;
+ return p_frame;
}
-void handle_real_audio(demux_t * p_demux, mkv_track_t * p_tk, block_t * p_blk, vlc_tick_t i_pts)
+void handle_real_audio(demux_t * p_demux, mkv_track_t * p_tk, vlc_frame_t * p_blk, vlc_tick_t i_pts)
{
uint8_t * p_frame = p_blk->p_buffer;
Cook_PrivateTrackData * p_sys = (Cook_PrivateTrackData *) p_tk->p_sys;
@@ -174,12 +174,12 @@ void handle_real_audio(demux_t * p_demux, mkv_track_t * p_tk, block_t * p_blk, v
for( size_t i = 0; i < p_sys->i_subpackets; i++)
if( p_sys->p_subpackets[i] )
{
- block_Release(p_sys->p_subpackets[i]);
+ vlc_frame_Release(p_sys->p_subpackets[i]);
p_sys->p_subpackets[i] = NULL;
}
p_sys->i_subpacket = 0;
- if ( !( p_blk->i_flags & BLOCK_FLAG_TYPE_I) )
+ if ( !( p_blk->i_flags & FRAME_FLAG_TYPE_I) )
{
msg_Dbg( p_demux, "discard non-key preroll block in track %u at %" PRId64,
p_tk->i_number, i_pts );
@@ -200,27 +200,27 @@ void handle_real_audio(demux_t * p_demux, mkv_track_t * p_tk, block_t * p_blk, v
if( i_index >= p_sys->i_subpackets )
return;
- block_t *p_block = block_Alloc( p_sys->i_subpacket_size );
- if( !p_block )
+ vlc_frame_t *p_frame = vlc_frame_Alloc( p_sys->i_subpacket_size );
+ if( !p_frame )
return;
if( size < p_sys->i_subpacket_size )
return;
- memcpy( p_block->p_buffer, p_frame, p_sys->i_subpacket_size );
- p_block->i_dts = VLC_TICK_INVALID;
- p_block->i_pts = VLC_TICK_INVALID;
+ memcpy( p_frame->p_buffer, p_frame, p_sys->i_subpacket_size );
+ p_frame->i_dts = VLC_TICK_INVALID;
+ p_frame->i_pts = VLC_TICK_INVALID;
if( !p_sys->i_subpacket )
{
p_tk->i_last_dts =
- p_block->i_pts = i_pts;
+ p_frame->i_pts = i_pts;
}
p_frame += p_sys->i_subpacket_size;
size -= p_sys->i_subpacket_size;
p_sys->i_subpacket++;
- p_sys->p_subpackets[i_index] = p_block;
+ p_sys->p_subpackets[i_index] = p_frame;
}
}
else
@@ -231,50 +231,50 @@ void handle_real_audio(demux_t * p_demux, mkv_track_t * p_tk, block_t * p_blk, v
{
for( size_t i = 0; i < p_sys->i_subpackets; i++)
{
- send_Block( p_demux, p_tk, p_sys->p_subpackets[i], 1, 0 );
+ send_Frame( p_demux, p_tk, p_sys->p_subpackets[i], 1, 0 );
p_sys->p_subpackets[i] = NULL;
}
p_sys->i_subpacket = 0;
}
}
-void send_Block( demux_t * p_demux, mkv_track_t * p_tk, block_t * p_block, unsigned int i_number_frames, int64_t i_duration )
+void send_Frame( demux_t * p_demux, mkv_track_t * p_tk, vlc_frame_t * p_frame, unsigned int i_number_frames, int64_t i_duration )
{
demux_sys_t *p_sys = (demux_sys_t *)p_demux->p_sys;
matroska_segment_c *p_segment = p_sys->p_current_vsegment->CurrentSegment();
if( p_tk->fmt.i_cat == AUDIO_ES && p_tk->i_chans_to_reorder )
{
- aout_ChannelReorder( p_block->p_buffer, p_block->i_buffer,
+ aout_ChannelReorder( p_frame->p_buffer, p_frame->i_buffer,
p_tk->fmt.audio.i_channels,
p_tk->pi_chan_table, p_tk->fmt.i_codec );
}
- if( p_block->i_dts != VLC_TICK_INVALID &&
+ if( p_frame->i_dts != VLC_TICK_INVALID &&
( p_tk->fmt.i_cat == VIDEO_ES || p_tk->fmt.i_cat == AUDIO_ES ) )
{
- p_tk->i_last_dts = p_block->i_dts;
+ p_tk->i_last_dts = p_frame->i_dts;
}
if( !p_tk->b_no_duration )
{
- p_block->i_length = VLC_TICK_FROM_NS(i_duration * p_tk->f_timecodescale *
+ p_frame->i_length = VLC_TICK_FROM_NS(i_duration * p_tk->f_timecodescale *
p_segment->i_timescale) / i_number_frames;
}
if( p_tk->b_discontinuity )
{
- p_block->i_flags |= BLOCK_FLAG_DISCONTINUITY;
+ p_frame->i_flags |= FRAME_FLAG_DISCONTINUITY;
p_tk->b_discontinuity = false;
}
- es_out_Send( p_demux->out, p_tk->p_es, p_block);
+ es_out_Send( p_demux->out, p_tk->p_es, p_frame);
}
int32_t Cook_PrivateTrackData::Init()
{
i_subpackets = (size_t) i_sub_packet_h * (size_t) i_frame_size / (size_t) i_subpacket_size;
- p_subpackets = static_cast<block_t**> ( calloc(i_subpackets, sizeof(block_t*)) );
+ p_subpackets = static_cast<vlc_frame_t**> ( calloc(i_subpackets, sizeof(vlc_frame_t*)) );
if( unlikely( !p_subpackets ) )
{
@@ -289,7 +289,7 @@ Cook_PrivateTrackData::~Cook_PrivateTrackData()
{
for( size_t i = 0; i < i_subpackets; i++ )
if( p_subpackets[i] )
- block_Release( p_subpackets[i] );
+ vlc_frame_Release( p_subpackets[i] );
free( p_subpackets );
}
@@ -313,13 +313,13 @@ static inline void fill_wvpk_block(uint16_t version, uint32_t block_samples, uin
memcpy( dst + 32, src, srclen );
}
-block_t * packetize_wavpack( const mkv_track_t & tk, uint8_t * buffer, size_t size)
+vlc_frame_t * packetize_wavpack( const mkv_track_t & tk, uint8_t * buffer, size_t size)
{
uint16_t version = 0x403;
uint32_t block_samples;
uint32_t flags;
uint32_t crc;
- block_t * p_block = NULL;
+ vlc_frame_t * p_frame = NULL;
if( tk.i_extra_data >= 2 )
version = GetWLE( tk.p_extra_data );
@@ -339,19 +339,19 @@ block_t * packetize_wavpack( const mkv_track_t & tk, uint8_t * buffer, size_t s
buffer += 8;
size -= 8;
- p_block = block_Alloc( size + 32 );
- if( !p_block )
+ p_frame = vlc_frame_Alloc( size + 32 );
+ if( !p_frame )
return NULL;
- fill_wvpk_block(version, block_samples, flags, crc, buffer, size, p_block->p_buffer);
+ fill_wvpk_block(version, block_samples, flags, crc, buffer, size, p_frame->p_buffer);
}
else
{
/* Multiblock */
size_t total_size = 0;
- p_block = block_Alloc( 0 );
- if( !p_block )
+ p_frame = vlc_frame_Alloc( 0 );
+ if( !p_frame )
return NULL;
while(size >= 12)
@@ -368,21 +368,21 @@ block_t * packetize_wavpack( const mkv_track_t & tk, uint8_t * buffer, size_t s
total_size += bsz + 32;
- assert(total_size >= p_block->i_buffer);
+ assert(total_size >= p_frame->i_buffer);
- p_block = block_Realloc( p_block, 0, total_size );
+ p_frame = vlc_frame_Realloc( p_frame, 0, total_size );
- if( !p_block )
+ if( !p_frame )
return NULL;
fill_wvpk_block(version, block_samples, flags, crc, buffer, bsz,
- p_block->p_buffer + total_size - bsz - 32 );
+ p_frame->p_buffer + total_size - bsz - 32 );
buffer += bsz;
size -= bsz;
}
}
- return p_block;
+ return p_frame;
}
void MkvTree_va( demux_t& demuxer, int i_level, const char* fmt, va_list args)
diff --git a/modules/demux/mkv/util.hpp b/modules/demux/mkv/util.hpp
index b53ff3b657..d614fe1f6b 100644
--- a/modules/demux/mkv/util.hpp
+++ b/modules/demux/mkv/util.hpp
@@ -28,12 +28,12 @@ namespace mkv {
#ifdef HAVE_ZLIB_H
int32_t zlib_decompress_extra( demux_t * p_demux, mkv_track_t & tk );
-block_t *block_zlib_decompress( vlc_object_t *p_this, block_t *p_in_block );
+vlc_frame_t *frame_zlib_decompress( vlc_object_t *p_this, vlc_frame_t *p_in_frame );
#endif
-block_t *MemToBlock( uint8_t *p_mem, size_t i_mem, size_t offset);
-void handle_real_audio(demux_t * p_demux, mkv_track_t * p_tk, block_t * p_blk, vlc_tick_t i_pts);
-void send_Block( demux_t * p_demux, mkv_track_t * p_tk, block_t * p_block, unsigned int i_number_frames, int64_t i_duration );
+vlc_frame_t *MemToFrame( uint8_t *p_mem, size_t i_mem, size_t offset);
+void handle_real_audio(demux_t * p_demux, mkv_track_t * p_tk, vlc_frame_t * p_blk, vlc_tick_t i_pts);
+void send_Frame( demux_t * p_demux, mkv_track_t * p_tk, vlc_frame_t * p_frame, unsigned int i_number_frames, int64_t i_duration );
struct real_audio_private
@@ -85,12 +85,12 @@ public:
uint16_t i_sub_packet_h;
uint16_t i_frame_size;
uint16_t i_subpacket_size;
- block_t **p_subpackets;
+ vlc_frame_t **p_subpackets;
size_t i_subpackets;
size_t i_subpacket;
};
-block_t * packetize_wavpack( const mkv_track_t &, uint8_t *, size_t);
+vlc_frame_t * packetize_wavpack( const mkv_track_t &, uint8_t *, size_t);
/* helper functions to print the mkv parse tree */
void MkvTree_va( demux_t& demuxer, int i_level, const char* fmt, va_list args);
diff --git a/modules/demux/mock.c b/modules/demux/mock.c
index 03d282606b..e942e65660 100644
--- a/modules/demux/mock.c
+++ b/modules/demux/mock.c
@@ -326,44 +326,44 @@ Control(demux_t *demux, int query, va_list args)
}
}
-static block_t *
-CreateAudioBlock(demux_t *demux, struct mock_track *track)
+static vlc_frame_t *
+CreateAudioFrame(demux_t *demux, struct mock_track *track)
{
struct demux_sys *sys = demux->p_sys;
const int64_t samples =
samples_from_vlc_tick(sys->step_length, track->fmt.audio.i_rate);
const int64_t bytes = samples / track->fmt.audio.i_frame_length
* track->fmt.audio.i_bytes_per_frame;
- block_t *b = block_Alloc(bytes);
+ vlc_frame_t *b = vlc_frame_Alloc(bytes);
if (!b)
return NULL;
memset(b->p_buffer, 0, b->i_buffer);
return b;
}
-struct video_block
+struct video_frame
{
- block_t b;
+ vlc_frame_t b;
picture_t *pic;
};
static void
-video_block_free_cb(block_t *b)
+video_frame_free_cb(vlc_frame_t *b)
{
- struct video_block *video = container_of(b, struct video_block, b);
+ struct video_frame *video = container_of(b, struct video_frame, b);
picture_Release(video->pic);
free(video);
}
-static block_t *
-CreateVideoBlock(demux_t *demux, struct mock_track *track)
+static vlc_frame_t *
+CreateVideoFrame(demux_t *demux, struct mock_track *track)
{
struct demux_sys *sys = demux->p_sys;
picture_t *pic = picture_NewFromFormat(&track->fmt.video);
if (!pic)
return NULL;
- struct video_block *video = malloc(sizeof(*video));
+ struct video_frame *video = malloc(sizeof(*video));
if (!video)
{
picture_Release(pic);
@@ -371,22 +371,22 @@ CreateVideoBlock(demux_t *demux, struct mock_track *track)
}
video->pic = pic;
- static const struct vlc_block_callbacks cbs =
+ static const struct vlc_frame_callbacks cbs =
{
- .free = video_block_free_cb
+ .free = video_frame_free_cb
};
- size_t block_len = 0;
+ size_t frame_len = 0;
for (int i = 0; i < pic->i_planes; ++i)
- block_len += pic->p[i].i_lines * pic->p[i].i_pitch;
+ frame_len += pic->p[i].i_lines * pic->p[i].i_pitch;
memset(pic->p[0].p_pixels, (sys->pts / VLC_TICK_FROM_MS(10)) % 255,
- block_len);
- return block_Init(&video->b, &cbs, pic->p[0].p_pixels, block_len);
+ frame_len);
+ return vlc_frame_Init(&video->b, &cbs, pic->p[0].p_pixels, frame_len);
(void) demux;
}
-static block_t *
-CreateSubBlock(demux_t *demux, struct mock_track *track)
+static vlc_frame_t *
+CreateSubFrame(demux_t *demux, struct mock_track *track)
{
struct demux_sys *sys = demux->p_sys;
char *text;
@@ -394,7 +394,7 @@ CreateSubBlock(demux_t *demux, struct mock_track *track)
return NULL;
size_t len = strlen(text) + 1;
- block_t *b = block_Alloc(len);
+ vlc_frame_t *b = vlc_frame_Alloc(len);
if (!b)
{
free(text);
@@ -566,26 +566,26 @@ Demux(demux_t *demux)
struct mock_track *track;
vlc_vector_foreach(track, &sys->tracks)
{
- block_t *block;
+ vlc_frame_t *frame;
switch (track->fmt.i_cat)
{
case AUDIO_ES:
- block = CreateAudioBlock(demux, track);
+ frame = CreateAudioFrame(demux, track);
break;
case VIDEO_ES:
- block = CreateVideoBlock(demux, track);
+ frame = CreateVideoFrame(demux, track);
break;
case SPU_ES:
- block = CreateSubBlock(demux, track);
+ frame = CreateSubFrame(demux, track);
break;
default:
vlc_assert_unreachable();
}
- if (!block)
+ if (!frame)
return VLC_DEMUXER_EGENERIC;
- block->i_length = sys->step_length;
- block->i_pts = block->i_dts = sys->pts;
- int ret = es_out_Send(demux->out, track->id, block);
+ frame->i_length = sys->step_length;
+ frame->i_pts = frame->i_dts = sys->pts;
+ int ret = es_out_Send(demux->out, track->id, frame);
if (ret != VLC_SUCCESS)
return VLC_DEMUXER_EGENERIC;
}
diff --git a/modules/demux/mod.c b/modules/demux/mod.c
index 589b2822f3..8d543b1104 100644
--- a/modules/demux/mod.c
+++ b/modules/demux/mod.c
@@ -259,11 +259,11 @@ static void Close( vlc_object_t *p_this )
static int Demux( demux_t *p_demux )
{
demux_sys_t *p_sys = p_demux->p_sys;
- block_t *p_frame;
+ vlc_frame_t *p_frame;
const int i_bk = ( p_sys->fmt.audio.i_bitspersample / 8 ) *
p_sys->fmt.audio.i_channels;
- p_frame = block_Alloc( p_sys->fmt.audio.i_rate / 10 * i_bk );
+ p_frame = vlc_frame_Alloc( p_sys->fmt.audio.i_rate / 10 * i_bk );
if( !p_frame )
return VLC_DEMUXER_EGENERIC;
@@ -271,7 +271,7 @@ static int Demux( demux_t *p_demux )
if( i_read <= 0 )
{
/* EOF */
- block_Release( p_frame );
+ vlc_frame_Release( p_frame );
return VLC_DEMUXER_EOF;
}
p_frame->i_buffer = i_read;
diff --git a/modules/demux/mp4/heif.c b/modules/demux/mp4/heif.c
index 18ad595e72..d6f6c65f7a 100644
--- a/modules/demux/mp4/heif.c
+++ b/modules/demux/mp4/heif.c
@@ -218,27 +218,27 @@ static int ControlHEIF( demux_t *p_demux, int i_query, va_list args )
//}
-static block_t *ReadItemExtents( demux_t *p_demux, uint32_t i_item_id,
+static vlc_frame_t *ReadItemExtents( demux_t *p_demux, uint32_t i_item_id,
const MP4_Box_t *p_shared_header )
{
struct heif_private_t *p_sys = (void *) p_demux->p_sys;
- block_t *p_block = NULL;
+ vlc_frame_t *p_frame = NULL;
MP4_Box_t *p_iloc = MP4_BoxGet( p_sys->p_root, "meta/iloc" );
if( !p_iloc )
- return p_block;
+ return p_frame;
for( uint32_t i=0; i<BOXDATA(p_iloc)->i_item_count; i++ )
{
if( BOXDATA(p_iloc)->p_items[i].i_item_id != i_item_id )
continue;
- block_t **pp_append = &p_block;
+ vlc_frame_t **pp_append = &p_frame;
/* Shared prefix data, ex: JPEG */
if( p_shared_header )
{
- *pp_append = block_Alloc( p_shared_header->data.p_binary->i_blob );
+ *pp_append = vlc_frame_Alloc( p_shared_header->data.p_binary->i_blob );
if( *pp_append )
{
memcpy( (*pp_append)->p_buffer,
@@ -267,7 +267,7 @@ static block_t *ReadItemExtents( demux_t *p_demux, uint32_t i_item_id,
if( vlc_stream_Seek( p_demux->s, i_offset ) != VLC_SUCCESS )
break;
- *pp_append = vlc_stream_Block( p_demux->s, i_length );
+ *pp_append = vlc_stream_Frame( p_demux->s, i_length );
}
/* Extents are 3:iloc reference */
else if( BOXDATA(p_iloc)->p_items[i].i_construction_method == 2 )
@@ -308,10 +308,10 @@ static block_t *ReadItemExtents( demux_t *p_demux, uint32_t i_item_id,
break;
}
- if( p_block )
- p_block = block_ChainGather( p_block );
+ if( p_frame )
+ p_frame = vlc_frame_ChainGather( p_frame );
- return p_block;
+ return p_frame;
}
static int SetPictureProperties( demux_t *p_demux, uint32_t i_item_id,
@@ -505,7 +505,7 @@ static int ReadDerivationData( demux_t *p_demux, vlc_fourcc_t type,
union heif_derivation_data *d )
{
int i_ret = VLC_EGENERIC;
- block_t *p_data = ReadItemExtents( p_demux, i_item_id, NULL );
+ vlc_frame_t *p_data = ReadItemExtents( p_demux, i_item_id, NULL );
if( p_data )
{
switch( type )
@@ -517,7 +517,7 @@ static int ReadDerivationData( demux_t *p_demux, vlc_fourcc_t type,
default:
break;
}
- block_Release( p_data );
+ vlc_frame_Release( p_data );
}
return i_ret;
}
@@ -545,7 +545,7 @@ static int LoadGridImage( demux_t *p_demux, uint32_t i_pic_item_id,
return VLC_EGENERIC; /* Unsupported picture, goto next */
}
- block_t *p_sample = ReadItemExtents( p_demux, i_pic_item_id,
+ vlc_frame_t *p_sample = ReadItemExtents( p_demux, i_pic_item_id,
p_shared_header );
if(!p_sample)
{
@@ -556,7 +556,7 @@ static int LoadGridImage( demux_t *p_demux, uint32_t i_pic_item_id,
image_handler_t *handler = image_HandlerCreate( p_demux );
if (!handler)
{
- block_Release( p_sample );
+ vlc_frame_Release( p_sample );
es_format_Clean( &fmt );
return VLC_EGENERIC;
}
@@ -607,7 +607,7 @@ static int LoadGridImage( demux_t *p_demux, uint32_t i_pic_item_id,
}
static int DerivedImageAssembleGrid( demux_t *p_demux, uint32_t i_grid_item_id,
- es_format_t *fmt, block_t **pp_block )
+ es_format_t *fmt, vlc_frame_t **pp_frame )
{
struct heif_private_t *p_sys = (void *) p_demux->p_sys;
@@ -638,11 +638,11 @@ static int DerivedImageAssembleGrid( demux_t *p_demux, uint32_t i_grid_item_id,
derivation_data.ImageGrid.columns_minus_one + 1,
derivation_data.ImageGrid.columns_minus_one + 1);
- block_t *p_block = block_Alloc( derivation_data.ImageGrid.output_width *
+ vlc_frame_t *p_frame = vlc_frame_Alloc( derivation_data.ImageGrid.output_width *
derivation_data.ImageGrid.output_height * 4 );
- if( !p_block )
+ if( !p_frame )
return VLC_EGENERIC;
- *pp_block = p_block;
+ *pp_frame = p_frame;
es_format_Init( fmt, VIDEO_ES, VLC_CODEC_RGBA );
fmt->video.i_sar_num =
@@ -659,7 +659,7 @@ static int DerivedImageAssembleGrid( demux_t *p_demux, uint32_t i_grid_item_id,
(derivation_data.ImageGrid.columns_minus_one + 1) );
LoadGridImage( p_demux,
BOXDATA(p_refbox)->p_references[i].i_to_item_id,
- p_block->p_buffer, i,
+ p_frame->p_buffer, i,
derivation_data.ImageGrid.columns_minus_one + 1,
derivation_data.ImageGrid.output_width,
derivation_data.ImageGrid.output_height );
@@ -719,11 +719,11 @@ static int DemuxHEIF( demux_t *p_demux )
es_format_t fmt;
es_format_Init(&fmt, UNKNOWN_ES, 0);
- block_t *p_block = NULL;
+ vlc_frame_t *p_frame = NULL;
if( p_sys->current.BOXDATA(p_infe)->item_type == VLC_FOURCC('g','r','i','d') )
{
if( DerivedImageAssembleGrid( p_demux, i_current_item_id,
- &fmt, &p_block ) != VLC_SUCCESS )
+ &fmt, &p_frame ) != VLC_SUCCESS )
{
es_format_Clean( &fmt );
return VLC_DEMUXER_SUCCESS;
@@ -738,9 +738,9 @@ static int DemuxHEIF( demux_t *p_demux )
return VLC_DEMUXER_SUCCESS;
}
- p_block = ReadItemExtents( p_demux, i_current_item_id,
+ p_frame = ReadItemExtents( p_demux, i_current_item_id,
p_sys->current.p_shared_header );
- if( !p_block )
+ if( !p_frame )
{
es_format_Clean( &fmt );
return VLC_DEMUXER_SUCCESS; /* Goto next picture */
@@ -766,16 +766,16 @@ static int DemuxHEIF( demux_t *p_demux )
es_out_SetPCR( p_demux->out, p_sys->i_pcr );
}
- p_block->i_dts = p_block->i_pts = p_sys->i_pcr;
- p_block->i_length = p_sys->i_image_duration;
+ p_frame->i_dts = p_frame->i_pts = p_sys->i_pcr;
+ p_frame->i_length = p_sys->i_image_duration;
- p_block->i_flags |= BLOCK_FLAG_END_OF_SEQUENCE;
+ p_frame->i_flags |= FRAME_FLAG_END_OF_SEQUENCE;
- p_sys->i_end_display_time = vlc_tick_now() + p_block->i_length;
+ p_sys->i_end_display_time = vlc_tick_now() + p_frame->i_length;
p_sys->b_seekpoint_changed = true;
- p_sys->i_pcr = p_block->i_dts + p_block->i_length;
- es_out_Send( p_demux->out, p_sys->id, p_block );
+ p_sys->i_pcr = p_frame->i_dts + p_frame->i_length;
+ es_out_Send( p_demux->out, p_sys->id, p_frame );
es_out_SetPCR( p_demux->out, p_sys->i_pcr );
return VLC_DEMUXER_SUCCESS;
diff --git a/modules/demux/mp4/libmp4.c b/modules/demux/mp4/libmp4.c
index 3b6f64a136..7ee58447cb 100644
--- a/modules/demux/mp4/libmp4.c
+++ b/modules/demux/mp4/libmp4.c
@@ -2448,7 +2448,7 @@ static int MP4_ReadBox_fiel( stream_t *p_stream, MP4_Box_t *p_box )
MP4_READBOX_EXIT( 0 );
if(p_peek[0] == 1)
{
- p_fiel->i_flags = BLOCK_FLAG_SINGLE_FIELD;
+ p_fiel->i_flags = FRAME_FLAG_SINGLE_FIELD;
}
else if(p_peek[0] == 2) /* Interlaced */
{
@@ -2460,9 +2460,9 @@ static int MP4_ReadBox_fiel( stream_t *p_stream, MP4_Box_t *p_box )
* 14 – T is displayed earliest, B is stored first in the file.
*/
if(p_peek[1] == 1 || p_peek[1] == 9)
- p_fiel->i_flags = BLOCK_FLAG_TOP_FIELD_FIRST;
+ p_fiel->i_flags = FRAME_FLAG_TOP_FIELD_FIRST;
else if(p_peek[1] == 6 || p_peek[1] == 14)
- p_fiel->i_flags = BLOCK_FLAG_BOTTOM_FIELD_FIRST;
+ p_fiel->i_flags = FRAME_FLAG_BOTTOM_FIELD_FIRST;
}
MP4_READBOX_EXIT( 1 );
}
diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
index 6fa1502051..f0cad57e49 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -168,7 +168,7 @@ static void MP4_TrackSetup( demux_t *, mp4_track_t *, MP4_Box_t *, bool, bool )
static void MP4_TrackInit( mp4_track_t * );
static void MP4_TrackClean( es_out_t *, mp4_track_t * );
-static void MP4_Block_Send( demux_t *, mp4_track_t *, block_t * );
+static void MP4_Block_Send( demux_t *, mp4_track_t *, vlc_frame_t * );
static void MP4_TrackSelect ( demux_t *, mp4_track_t *, bool );
static int MP4_TrackSeek ( demux_t *, mp4_track_t *, vlc_tick_t );
@@ -201,12 +201,12 @@ static void FragResetContext( demux_sys_t * );
/* ASF Handlers */
static asf_track_info_t * MP4ASF_GetTrackInfo( asf_packet_sys_t *p_packetsys, uint8_t i_stream_number );
-static void MP4ASF_Send(asf_packet_sys_t *p_packetsys, uint8_t i_stream_number, block_t **pp_frame);
+static void MP4ASF_Send(asf_packet_sys_t *p_packetsys, uint8_t i_stream_number, vlc_frame_t **pp_frame);
static void MP4ASF_ResetFrames( demux_sys_t *p_sys );
/* RTP Hint track */
-static block_t * MP4_RTPHint_Convert( demux_t *p_demux, block_t *p_block, vlc_fourcc_t i_codec );
-static block_t * MP4_RTPHintToFrame( demux_t *p_demux, block_t *p_block, uint32_t packetcount );
+static vlc_frame_t * MP4_RTPHint_Convert( demux_t *p_demux, vlc_frame_t *p_frame, vlc_fourcc_t i_codec );
+static vlc_frame_t * MP4_RTPHintToFrame( demux_t *p_demux, vlc_frame_t *p_frame, uint32_t packetcount );
static int MP4_LoadMeta( demux_sys_t *p_sys, vlc_meta_t *p_meta );
@@ -495,27 +495,27 @@ static int CreateTracks( demux_t *p_demux, unsigned i_tracks )
return VLC_SUCCESS;
}
-static block_t * MP4_EIA608_Convert( block_t * p_block )
+static vlc_frame_t * MP4_EIA608_Convert( vlc_frame_t * p_frame )
{
/* Rebuild codec data from encap */
size_t i_copied = 0;
- size_t i_remaining = __MIN(p_block->i_buffer, INT64_MAX / 3);
+ size_t i_remaining = __MIN(p_frame->i_buffer, INT64_MAX / 3);
uint32_t i_bytes = 0;
- block_t *p_newblock;
+ vlc_frame_t *p_newframe;
/* always need at least 10 bytes (atom size+header+1pair)*/
if ( i_remaining < 10 ||
- !(i_bytes = GetDWBE(p_block->p_buffer)) ||
+ !(i_bytes = GetDWBE(p_frame->p_buffer)) ||
(i_bytes > i_remaining) ||
- memcmp("cdat", &p_block->p_buffer[4], 4) ||
- !(p_newblock = block_Alloc( i_remaining * 3 - 8 )) )
+ memcmp("cdat", &p_frame->p_buffer[4], 4) ||
+ !(p_newframe = vlc_frame_Alloc( i_remaining * 3 - 8 )) )
{
- p_block->i_buffer = 0;
- return p_block;
+ p_frame->i_buffer = 0;
+ return p_frame;
}
- uint8_t *p_write = p_newblock->p_buffer;
- uint8_t *p_read = &p_block->p_buffer[8];
+ uint8_t *p_write = p_newframe->p_buffer;
+ uint8_t *p_read = &p_frame->p_buffer[8];
i_bytes -= 8;
i_remaining -= 8;
@@ -548,12 +548,12 @@ static block_t * MP4_EIA608_Convert( block_t * p_block )
} while( i_bytes >= 2 );
}
- p_newblock->i_pts = p_block->i_dts;
- p_newblock->i_buffer = i_copied;
- p_newblock->i_flags = BLOCK_FLAG_TYPE_P;
- block_Release( p_block );
+ p_newframe->i_pts = p_frame->i_dts;
+ p_newframe->i_buffer = i_copied;
+ p_newframe->i_flags = FRAME_FLAG_TYPE_P;
+ vlc_frame_Release( p_frame );
- return p_newblock;
+ return p_newframe;
}
static uint32_t MP4_TrackGetRunSeq( mp4_track_t *p_track )
@@ -629,7 +629,7 @@ static void MP4_GetInterleaving( demux_t *p_demux, vlc_tick_t *pi_max_contiguous
p_sys->track[i].i_chunk = 0;
}
-static block_t * MP4_Block_Convert( demux_t *p_demux, const mp4_track_t *p_track, block_t *p_block )
+static vlc_frame_t * MP4_Block_Convert( demux_t *p_demux, const mp4_track_t *p_track, vlc_frame_t *p_frame )
{
/* might have some encap */
if( p_track->fmt.i_cat == SPU_ES )
@@ -644,45 +644,45 @@ static block_t * MP4_Block_Convert( demux_t *p_demux, const mp4_track_t *p_track
/* accept as-is */
break;
case VLC_CODEC_CEA608:
- p_block = MP4_EIA608_Convert( p_block );
+ p_frame = MP4_EIA608_Convert( p_frame );
break;
default:
- p_block->i_buffer = 0;
+ p_frame->i_buffer = 0;
break;
}
}
else if( p_track->fmt.i_codec == VLC_CODEC_AV1 )
{
- p_block = AV1_Unpack_Sample( p_block );
+ p_frame = AV1_Unpack_Sample( p_frame );
}
else if( p_track->fmt.i_original_fourcc == ATOM_rrtp )
{
- p_block = MP4_RTPHint_Convert( p_demux, p_block, p_track->fmt.i_codec );
+ p_frame = MP4_RTPHint_Convert( p_demux, p_frame, p_track->fmt.i_codec );
}
- return p_block;
+ return p_frame;
}
-static void MP4_Block_Send( demux_t *p_demux, mp4_track_t *p_track, block_t *p_block )
+static void MP4_Block_Send( demux_t *p_demux, mp4_track_t *p_track, vlc_frame_t *p_frame )
{
demux_sys_t *p_sys = p_demux->p_sys;
- p_block = MP4_Block_Convert( p_demux, p_track, p_block );
- if( p_block == NULL )
+ p_frame = MP4_Block_Convert( p_demux, p_track, p_frame );
+ if( p_frame == NULL )
return;
if ( p_track->b_chans_reorder )
{
- aout_ChannelReorder( p_block->p_buffer, p_block->i_buffer,
+ aout_ChannelReorder( p_frame->p_buffer, p_frame->i_buffer,
p_track->fmt.audio.i_channels,
p_track->rgi_chans_reordering,
p_track->fmt.i_codec );
}
- p_block->i_flags |= p_track->i_block_flags;
+ p_frame->i_flags |= p_track->i_block_flags;
if( p_track->i_next_block_flags )
{
- p_block->i_flags |= p_track->i_next_block_flags;
+ p_frame->i_flags |= p_track->i_next_block_flags;
p_track->i_next_block_flags = 0;
}
@@ -691,20 +691,20 @@ static void MP4_Block_Send( demux_t *p_demux, mp4_track_t *p_track, block_t *p_b
{
/* Fake a new stream from MP4 block */
stream_t *p_stream = p_demux->s;
- p_demux->s = vlc_stream_MemoryNew( p_demux, p_block->p_buffer, p_block->i_buffer, true );
+ p_demux->s = vlc_stream_MemoryNew( p_demux, p_frame->p_buffer, p_frame->i_buffer, true );
if ( p_demux->s )
{
- p_track->i_dts_backup = p_block->i_dts;
- p_track->i_pts_backup = p_block->i_pts;
+ p_track->i_dts_backup = p_frame->i_dts;
+ p_track->i_pts_backup = p_frame->i_pts;
/* And demux it as ASF packet */
- DemuxASFPacket( &p_sys->asfpacketsys, p_block->i_buffer, p_block->i_buffer );
+ DemuxASFPacket( &p_sys->asfpacketsys, p_frame->i_buffer, p_frame->i_buffer );
vlc_stream_Delete(p_demux->s);
}
- block_Release(p_block);
+ vlc_frame_Release(p_frame);
p_demux->s = p_stream;
}
else
- es_out_Send( p_demux->out, p_track->p_es, p_block );
+ es_out_Send( p_demux->out, p_track->p_es, p_frame );
}
int OpenHEIF ( vlc_object_t * );
@@ -1137,22 +1137,22 @@ const unsigned int CONSTRUCTORSIZE = 16;
/*******************************************************************************
* MP4_RTPHintToFrame: converts RTP Reception Hint Track sample to H.264 frame
*******************************************************************************/
-static block_t * MP4_RTPHintToFrame( demux_t *p_demux, block_t *p_block, uint32_t packetcount )
+static vlc_frame_t * MP4_RTPHintToFrame( demux_t *p_demux, vlc_frame_t *p_frame, uint32_t packetcount )
{
- uint8_t *p_slice = p_block->p_buffer + SAMPLEHEADERSIZE;
- block_t *p_newblock = NULL;
+ uint8_t *p_slice = p_frame->p_buffer + SAMPLEHEADERSIZE;
+ vlc_frame_t *p_newframe = NULL;
size_t i_payload = 0;
- if( p_block->i_buffer < SAMPLEHEADERSIZE + RTPPACKETSIZE + CONSTRUCTORSIZE )
+ if( p_frame->i_buffer < SAMPLEHEADERSIZE + RTPPACKETSIZE + CONSTRUCTORSIZE )
{
msg_Err( p_demux, "Sample not large enough for necessary structs");
- block_Release( p_block );
+ vlc_frame_Release( p_frame );
return NULL;
}
for( uint32_t i = 0; i < packetcount; ++i )
{
- if( (size_t)(p_slice - p_block->p_buffer) + RTPPACKETSIZE + CONSTRUCTORSIZE > p_block->i_buffer )
+ if( (size_t)(p_slice - p_frame->p_buffer) + RTPPACKETSIZE + CONSTRUCTORSIZE > p_frame->i_buffer )
goto error;
/* skip RTP header in sample. Could be used to detect packet losses */
@@ -1180,22 +1180,22 @@ static block_t * MP4_RTPHintToFrame( demux_t *p_demux, block_t *p_block, uint32_
}
/* slice doesn't fit in buffer */
- if( sample_cons.sampleoffset + sample_cons.length > p_block->i_buffer)
+ if( sample_cons.sampleoffset + sample_cons.length > p_frame->i_buffer)
{
msg_Err(p_demux, "Sample buffer is smaller than sample" );
goto error;
}
- block_t *p_realloc = ( p_newblock ) ?
- block_Realloc( p_newblock, 0, i_payload + sample_cons.length + 4 ):
- block_Alloc( i_payload + sample_cons.length + 4 );
+ vlc_frame_t *p_realloc = ( p_newframe ) ?
+ vlc_frame_Realloc( p_newframe, 0, i_payload + sample_cons.length + 4 ):
+ vlc_frame_Alloc( i_payload + sample_cons.length + 4 );
if( !p_realloc )
goto error;
- p_newblock = p_realloc;
- uint8_t *p_dst = &p_newblock->p_buffer[i_payload];
+ p_newframe = p_realloc;
+ uint8_t *p_dst = &p_newframe->p_buffer[i_payload];
- const uint8_t* p_src = p_block->p_buffer + sample_cons.sampleoffset;
+ const uint8_t* p_src = p_frame->p_buffer + sample_cons.sampleoffset;
uint8_t i_type = (*p_src) & ((1<<5)-1);
const uint8_t synccode[4] = { 0, 0, 0, 1 };
@@ -1213,49 +1213,49 @@ static block_t * MP4_RTPHintToFrame( demux_t *p_demux, block_t *p_block, uint32_
memcpy( p_dst, p_src, sample_cons.length );
p_dst += sample_cons.length;
- i_payload = p_dst - p_newblock->p_buffer;
+ i_payload = p_dst - p_newframe->p_buffer;
}
- block_Release( p_block );
- if( p_newblock )
- p_newblock->i_buffer = i_payload;
- return p_newblock;
+ vlc_frame_Release( p_frame );
+ if( p_newframe )
+ p_newframe->i_buffer = i_payload;
+ return p_newframe;
error:
- block_Release( p_block );
- if( p_newblock )
- block_Release( p_newblock );
+ vlc_frame_Release( p_frame );
+ if( p_newframe )
+ vlc_frame_Release( p_newframe );
return NULL;
}
/* RTP Reception Hint Track */
-static block_t * MP4_RTPHint_Convert( demux_t *p_demux, block_t *p_block, vlc_fourcc_t i_codec )
+static vlc_frame_t * MP4_RTPHint_Convert( demux_t *p_demux, vlc_frame_t *p_frame, vlc_fourcc_t i_codec )
{
- block_t *p_converted = NULL;
- if( p_block->i_buffer < 2 )
+ vlc_frame_t *p_converted = NULL;
+ if( p_frame->i_buffer < 2 )
{
- block_Release( p_block );
+ vlc_frame_Release( p_frame );
return NULL;
}
/* number of RTP packets contained in this sample */
- const uint16_t i_packets = GetWBE( p_block->p_buffer );
+ const uint16_t i_packets = GetWBE( p_frame->p_buffer );
if( i_packets <= 1 || i_codec != VLC_CODEC_H264 )
{
const size_t i_skip = SAMPLEHEADERSIZE + i_packets * ( RTPPACKETSIZE + CONSTRUCTORSIZE );
- if( i_packets == 1 && i_skip < p_block->i_buffer )
+ if( i_packets == 1 && i_skip < p_frame->i_buffer )
{
- p_block->p_buffer += i_skip;
- p_converted = p_block;
+ p_frame->p_buffer += i_skip;
+ p_converted = p_frame;
}
else
{
- block_Release( p_block );
+ vlc_frame_Release( p_frame );
}
}
else
{
- p_converted = MP4_RTPHintToFrame( p_demux, p_block, i_packets );
+ p_converted = MP4_RTPHintToFrame( p_demux, p_frame, i_packets );
}
return p_converted;
@@ -1299,7 +1299,7 @@ static int DemuxTrack( demux_t *p_demux, mp4_track_t *tk, uint64_t i_readpos,
i_samplessize = MP4_TrackGetReadSize( tk, &i_nb_samples );
if( i_samplessize > 0 )
{
- block_t *p_block;
+ vlc_frame_t *p_frame;
vlc_tick_t i_delta;
if( vlc_stream_Tell( p_demux->s ) != i_readpos )
@@ -1315,7 +1315,7 @@ static int DemuxTrack( demux_t *p_demux, mp4_track_t *tk, uint64_t i_readpos,
}
/* now read pes */
- if( !(p_block = vlc_stream_Block( p_demux->s, i_samplessize )) )
+ if( !(p_frame = vlc_stream_Frame( p_demux->s, i_samplessize )) )
{
msg_Warn( p_demux, "track[0x%x] will be disabled (eof?)"
": Failed to read %d bytes sample at %"PRIu64,
@@ -1332,18 +1332,18 @@ static int DemuxTrack( demux_t *p_demux, mp4_track_t *tk, uint64_t i_readpos,
}
/* dts */
- p_block->i_dts = VLC_TICK_0 + i_current_nzdts;
+ p_frame->i_dts = VLC_TICK_0 + i_current_nzdts;
/* pts */
if( MP4_TrackGetPTSDelta( p_demux, tk, &i_delta ) )
- p_block->i_pts = p_block->i_dts + i_delta;
+ p_frame->i_pts = p_frame->i_dts + i_delta;
else if( tk->fmt.i_cat != VIDEO_ES )
- p_block->i_pts = p_block->i_dts;
+ p_frame->i_pts = p_frame->i_dts;
else
- p_block->i_pts = VLC_TICK_INVALID;
+ p_frame->i_pts = VLC_TICK_INVALID;
- p_block->i_length = MP4_GetSamplesDuration( p_demux, tk, i_nb_samples );
+ p_frame->i_length = MP4_GetSamplesDuration( p_demux, tk, i_nb_samples );
- MP4_Block_Send( p_demux, tk, p_block );
+ MP4_Block_Send( p_demux, tk, p_frame );
}
/* Next sample */
@@ -1552,7 +1552,7 @@ static int Seek( demux_t *p_demux, vlc_tick_t i_date, bool b_accurate )
for( i_track = 0; i_track < p_sys->i_tracks; i_track++ )
{
mp4_track_t *tk = &p_sys->track[i_track];
- tk->i_next_block_flags |= BLOCK_FLAG_DISCONTINUITY;
+ tk->i_next_block_flags |= FRAME_FLAG_DISCONTINUITY;
if( tk->fmt.i_cat == VIDEO_ES )
continue;
MP4_TrackSeek( p_demux, tk, i_start );
@@ -1862,7 +1862,7 @@ static int FragSeekToTime( demux_t *p_demux, vlc_tick_t i_nztime, bool b_accurat
{
stime_t i_tst = MP4_rescale_qtime( i_sync_time, p_sys->track[i].i_timescale );
FragTrunSeekToTime( &p_sys->track[i], i_tst );
- p_sys->track[i].i_next_block_flags |= BLOCK_FLAG_DISCONTINUITY;
+ p_sys->track[i].i_next_block_flags |= FRAME_FLAG_DISCONTINUITY;
}
}
@@ -3644,7 +3644,7 @@ static void MP4_TrackClean( es_out_t *out, mp4_track_t *p_track )
free( p_track->p_sample_size );
if ( p_track->asfinfo.p_frame )
- block_ChainRelease( p_track->asfinfo.p_frame );
+ vlc_frame_ChainRelease( p_track->asfinfo.p_frame );
free( p_track->context.runs.p_array );
}
@@ -4054,7 +4054,7 @@ static void MP4_TrackSetELST( demux_t *p_demux, mp4_track_t *tk,
if( i_elst_last != tk->i_elst )
{
msg_Warn( p_demux, "elst old=%d new=%d", i_elst_last, tk->i_elst );
- tk->i_next_block_flags |= BLOCK_FLAG_DISCONTINUITY;
+ tk->i_next_block_flags |= FRAME_FLAG_DISCONTINUITY;
}
}
@@ -4438,13 +4438,13 @@ static int FragDemuxTrack( demux_t *p_demux, mp4_track_t *p_track,
if( !len )
msg_Warn(p_demux, "Zero length sample in trun.");
- block_t *p_block = vlc_stream_Block( p_demux->s, len );
- uint32_t i_read = ( p_block ) ? p_block->i_buffer : 0;
+ vlc_frame_t *p_frame = vlc_stream_Frame( p_demux->s, len );
+ uint32_t i_read = ( p_frame ) ? p_frame->i_buffer : 0;
p_track->context.i_trun_sample_pos += i_read;
- if( i_read < len || p_block == NULL )
+ if( i_read < len || p_frame == NULL )
{
- if( p_block )
- block_Release( p_block );
+ if( p_frame )
+ vlc_frame_Release( p_frame );
return VLC_DEMUXER_FATAL;
}
@@ -4456,15 +4456,15 @@ static int FragDemuxTrack( demux_t *p_demux, mp4_track_t *p_track,
#endif
if ( p_track->p_es )
{
- p_block->i_dts = VLC_TICK_0 + MP4_rescale_mtime( i_dts, p_track->i_timescale );
+ p_frame->i_dts = VLC_TICK_0 + MP4_rescale_mtime( i_dts, p_track->i_timescale );
if( p_track->fmt.i_cat == VIDEO_ES && !( p_trun->i_flags & MP4_TRUN_SAMPLE_TIME_OFFSET ) )
- p_block->i_pts = VLC_TICK_INVALID;
+ p_frame->i_pts = VLC_TICK_INVALID;
else
- p_block->i_pts = VLC_TICK_0 + MP4_rescale_mtime( i_pts, p_track->i_timescale );
- p_block->i_length = MP4_rescale_mtime( dur, p_track->i_timescale );
- MP4_Block_Send( p_demux, p_track, p_block );
+ p_frame->i_pts = VLC_TICK_0 + MP4_rescale_mtime( i_pts, p_track->i_timescale );
+ p_frame->i_length = MP4_rescale_mtime( dur, p_track->i_timescale );
+ MP4_Block_Send( p_demux, p_track, p_frame );
}
- else block_Release( p_block );
+ else vlc_frame_Release( p_frame );
}
if( p_track->context.i_trun_sample == p_trun->i_sample_count )
@@ -5156,16 +5156,16 @@ static asf_track_info_t * MP4ASF_GetTrackInfo( asf_packet_sys_t *p_packetsys,
}
static void MP4ASF_Send( asf_packet_sys_t *p_packetsys, uint8_t i_stream_number,
- block_t **pp_frame )
+ vlc_frame_t **pp_frame )
{
mp4_track_t *p_track = MP4ASF_GetTrack( p_packetsys, i_stream_number );
if ( !p_track )
{
- block_Release( *pp_frame );
+ vlc_frame_Release( *pp_frame );
}
else
{
- block_t *p_gather = block_ChainGather( *pp_frame );
+ vlc_frame_t *p_gather = vlc_frame_ChainGather( *pp_frame );
p_gather->i_dts = p_track->i_dts_backup;
p_gather->i_pts = p_track->i_pts_backup;
es_out_Send( p_packetsys->p_demux->out, p_track->p_es, p_gather );
@@ -5181,7 +5181,7 @@ static void MP4ASF_ResetFrames( demux_sys_t *p_sys )
mp4_track_t *p_track = &p_sys->track[i];
if( p_track->asfinfo.p_frame )
{
- block_ChainRelease( p_track->asfinfo.p_frame );
+ vlc_frame_ChainRelease( p_track->asfinfo.p_frame );
p_track->asfinfo.p_frame = NULL;
}
}
diff --git a/modules/demux/mpc.c b/modules/demux/mpc.c
index 61c0a59038..0f047455a2 100644
--- a/modules/demux/mpc.c
+++ b/modules/demux/mpc.c
@@ -220,10 +220,10 @@ static void Close( vlc_object_t * p_this )
static int Demux( demux_t *p_demux )
{
demux_sys_t *p_sys = p_demux->p_sys;
- block_t *p_data;
+ vlc_frame_t *p_data;
int i_ret;
- p_data = block_New( p_demux,
+ p_data = vlc_frame_New( p_demux,
MPC_DECODER_BUFFER_LENGTH*sizeof(MPC_SAMPLE_FORMAT) );
if( !p_data )
return VLC_DEMUXER_EGENERIC;
@@ -233,7 +233,7 @@ static int Demux( demux_t *p_demux )
NULL, NULL );
if( i_ret <= 0 )
{
- block_Release( p_data );
+ vlc_frame_Release( p_data );
return i_ret < 0 ? VLC_DEMUXER_EGENERIC : VLC_DEMUXER_EOF;
}
diff --git a/modules/demux/mpeg/es.c b/modules/demux/mpeg/es.c
index a4d62db46a..52b484159e 100644
--- a/modules/demux/mpeg/es.c
+++ b/modules/demux/mpeg/es.c
@@ -137,7 +137,7 @@ typedef struct
bool b_start;
decoder_t *p_packetizer;
- block_t *p_packetized_data;
+ vlc_frame_t *p_packetized_data;
vlc_tick_t i_pts;
vlc_tick_t i_time_offset;
@@ -196,7 +196,7 @@ static int MlpProbe( demux_t *p_demux, uint64_t *pi_offset );
static int ThdProbe( demux_t *p_demux, uint64_t *pi_offset );
static int MlpInit( demux_t *p_demux );
-static bool Parse( demux_t *p_demux, block_t **pp_output );
+static bool Parse( demux_t *p_demux, vlc_frame_t **pp_output );
static uint64_t SeekByMlltTable( demux_t *p_demux, vlc_tick_t *pi_time );
static const codec_t p_codecs[] = {
@@ -352,55 +352,55 @@ static int Demux( demux_t *p_demux )
int ret = 1;
demux_sys_t *p_sys = p_demux->p_sys;
- block_t *p_block_out = p_sys->p_packetized_data;
- if( p_block_out )
+ vlc_frame_t *p_frame_out = p_sys->p_packetized_data;
+ if( p_frame_out )
p_sys->p_packetized_data = NULL;
else
- ret = Parse( p_demux, &p_block_out ) ? 0 : 1;
+ ret = Parse( p_demux, &p_frame_out ) ? 0 : 1;
/* Update chapter if any */
IncreaseChapter( p_demux,
- p_block_out ? p_sys->i_time_offset + p_block_out->i_dts
+ p_frame_out ? p_sys->i_time_offset + p_frame_out->i_dts
: VLC_TICK_INVALID );
- while( p_block_out )
+ while( p_frame_out )
{
- block_t *p_next = p_block_out->p_next;
+ vlc_frame_t *p_next = p_frame_out->p_next;
/* Correct timestamp */
if( p_sys->p_packetizer->fmt_out.i_cat == VIDEO_ES )
{
- if( p_block_out->i_pts == VLC_TICK_INVALID &&
- p_block_out->i_dts == VLC_TICK_INVALID )
- p_block_out->i_dts = VLC_TICK_0 + p_sys->i_pts + VLC_TICK_FROM_SEC(1) / p_sys->f_fps;
- if( p_block_out->i_dts != VLC_TICK_INVALID )
- p_sys->i_pts = p_block_out->i_dts - VLC_TICK_0;
+ if( p_frame_out->i_pts == VLC_TICK_INVALID &&
+ p_frame_out->i_dts == VLC_TICK_INVALID )
+ p_frame_out->i_dts = VLC_TICK_0 + p_sys->i_pts + VLC_TICK_FROM_SEC(1) / p_sys->f_fps;
+ if( p_frame_out->i_dts != VLC_TICK_INVALID )
+ p_sys->i_pts = p_frame_out->i_dts - VLC_TICK_0;
}
else
{
- p_sys->i_pts = p_block_out->i_pts - VLC_TICK_0;
+ p_sys->i_pts = p_frame_out->i_pts - VLC_TICK_0;
}
- if( p_block_out->i_pts != VLC_TICK_INVALID )
+ if( p_frame_out->i_pts != VLC_TICK_INVALID )
{
- p_block_out->i_pts += p_sys->i_time_offset;
+ p_frame_out->i_pts += p_sys->i_time_offset;
}
- if( p_block_out->i_dts != VLC_TICK_INVALID )
+ if( p_frame_out->i_dts != VLC_TICK_INVALID )
{
- p_block_out->i_dts += p_sys->i_time_offset;
- es_out_SetPCR( p_demux->out, p_block_out->i_dts );
+ p_frame_out->i_dts += p_sys->i_time_offset;
+ es_out_SetPCR( p_demux->out, p_frame_out->i_dts );
}
/* Re-estimate bitrate */
if( p_sys->b_estimate_bitrate && p_sys->i_pts > VLC_TICK_FROM_MS(500) )
p_sys->i_bitrate_avg = 8 * CLOCK_FREQ * p_sys->i_bytes
/ (p_sys->i_pts - 1);
- p_sys->i_bytes += p_block_out->i_buffer;
+ p_sys->i_bytes += p_frame_out->i_buffer;
- p_block_out->p_next = NULL;
- es_out_Send( p_demux->out, p_sys->p_es, p_block_out );
+ p_frame_out->p_next = NULL;
+ es_out_Send( p_demux->out, p_sys->p_es, p_frame_out );
- p_block_out = p_next;
+ p_frame_out = p_next;
}
return ret;
}
@@ -414,7 +414,7 @@ static void Close( vlc_object_t * p_this )
demux_sys_t *p_sys = p_demux->p_sys;
if( p_sys->p_packetized_data )
- block_ChainRelease( p_sys->p_packetized_data );
+ vlc_frame_ChainRelease( p_sys->p_packetized_data );
for( size_t i=0; i< p_sys->chapters.i_count; i++ )
vlc_seekpoint_Delete( p_sys->chapters.p_entry[i].p_seekpoint );
TAB_CLEAN( p_sys->chapters.i_count, p_sys->chapters.p_entry );
@@ -436,7 +436,7 @@ static int MovetoTimePos( demux_t *p_demux, vlc_tick_t i_time, uint64_t i_pos )
p_sys->i_time_offset = i_time - p_sys->i_pts;
/* And reset buffered data */
if( p_sys->p_packetized_data )
- block_ChainRelease( p_sys->p_packetized_data );
+ vlc_frame_ChainRelease( p_sys->p_packetized_data );
p_sys->p_packetized_data = NULL;
p_sys->chapters.i_current = 0;
p_sys->i_demux_flags |= INPUT_UPDATE_SEEKPOINT;
@@ -594,7 +594,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
p_sys->i_time_offset = i_time - p_sys->i_pts;
/* And reset buffered data */
if( p_sys->p_packetized_data )
- block_ChainRelease( p_sys->p_packetized_data );
+ vlc_frame_ChainRelease( p_sys->p_packetized_data );
p_sys->p_packetized_data = NULL;
}
@@ -610,10 +610,10 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
* Makes a link list of buffer of parsed data
* Returns true if EOF
*****************************************************************************/
-static bool Parse( demux_t *p_demux, block_t **pp_output )
+static bool Parse( demux_t *p_demux, vlc_frame_t **pp_output )
{
demux_sys_t *p_sys = p_demux->p_sys;
- block_t *p_block_in, *p_block_out;
+ vlc_frame_t *p_frame_in, *p_frame_out;
*pp_output = NULL;
@@ -625,37 +625,37 @@ static bool Parse( demux_t *p_demux, block_t **pp_output )
return true;
}
- p_block_in = vlc_stream_Block( p_demux->s, p_sys->i_packet_size );
- bool b_eof = p_block_in == NULL;
+ p_frame_in = vlc_stream_Frame( p_demux->s, p_sys->i_packet_size );
+ bool b_eof = p_frame_in == NULL;
- if( p_block_in )
+ if( p_frame_in )
{
- if( p_sys->codec.b_use_word && !p_sys->b_big_endian && p_block_in->i_buffer > 0 )
+ if( p_sys->codec.b_use_word && !p_sys->b_big_endian && p_frame_in->i_buffer > 0 )
{
/* Convert to big endian */
- block_t *old = p_block_in;
- p_block_in = block_Alloc( p_block_in->i_buffer );
- if( p_block_in )
+ vlc_frame_t *old = p_frame_in;
+ p_frame_in = vlc_frame_Alloc( p_frame_in->i_buffer );
+ if( p_frame_in )
{
- block_CopyProperties( p_block_in, old );
- swab( old->p_buffer, p_block_in->p_buffer, old->i_buffer );
+ vlc_frame_CopyProperties( p_frame_in, old );
+ swab( old->p_buffer, p_frame_in->p_buffer, old->i_buffer );
}
- block_Release( old );
+ vlc_frame_Release( old );
}
- if( p_block_in )
+ if( p_frame_in )
{
- p_block_in->i_pts =
- p_block_in->i_dts = (p_sys->b_start || p_sys->b_initial_sync_failed) ?
+ p_frame_in->i_pts =
+ p_frame_in->i_dts = (p_sys->b_start || p_sys->b_initial_sync_failed) ?
VLC_TICK_0 : VLC_TICK_INVALID;
}
}
p_sys->b_initial_sync_failed = p_sys->b_start; /* Only try to resync once */
- while( ( p_block_out = p_sys->p_packetizer->pf_packetize( p_sys->p_packetizer, p_block_in ? &p_block_in : NULL ) ) )
+ while( ( p_frame_out = p_sys->p_packetizer->pf_packetize( p_sys->p_packetizer, p_frame_in ? &p_frame_in : NULL ) ) )
{
p_sys->b_initial_sync_failed = false;
- while( p_block_out )
+ while( p_frame_out )
{
if( !p_sys->p_es )
{
@@ -680,17 +680,17 @@ static bool Parse( demux_t *p_demux, block_t **pp_output )
p_sys->i_bitrate_avg = p_sys->p_packetizer->fmt_out.i_bitrate;
}
- block_t *p_next = p_block_out->p_next;
- p_block_out->p_next = NULL;
+ vlc_frame_t *p_next = p_frame_out->p_next;
+ p_frame_out->p_next = NULL;
- block_ChainLastAppend( &pp_output, p_block_out );
+ vlc_frame_ChainLastAppend( &pp_output, p_frame_out );
- p_block_out = p_next;
+ p_frame_out = p_next;
}
}
if( p_sys->b_initial_sync_failed )
- msg_Dbg( p_demux, "did not sync on first block" );
+ msg_Dbg( p_demux, "did not sync on first frame" );
p_sys->b_start = false;
return b_eof;
@@ -1141,7 +1141,7 @@ static int ID3TAG_Parse_Handler( uint32_t i_tag, const uint8_t *p_payload, size_
static int ID3Parse( demux_t *p_demux,
int (*pf_callback)(uint32_t, const uint8_t *, size_t, void *) )
{
- const block_t *p_tags = NULL;
+ const vlc_frame_t *p_tags = NULL;
if( vlc_stream_Control( p_demux->s, STREAM_GET_TAGS, &p_tags ) != VLC_SUCCESS )
return VLC_EGENERIC;
diff --git a/modules/demux/mpeg/h26x.c b/modules/demux/mpeg/h26x.c
index bc1022bc59..503f7f8fd7 100644
--- a/modules/demux/mpeg/h26x.c
+++ b/modules/demux/mpeg/h26x.c
@@ -412,32 +412,32 @@ static void Close( vlc_object_t * p_this )
static int Demux( demux_t *p_demux)
{
demux_sys_t *p_sys = p_demux->p_sys;
- block_t *p_block_in, *p_block_out;
+ vlc_frame_t *p_frame_in, *p_frame_out;
bool b_eof = false;
- p_block_in = vlc_stream_Block( p_demux->s, H26X_PACKET_SIZE );
- if( p_block_in == NULL )
+ p_frame_in = vlc_stream_Frame( p_demux->s, H26X_PACKET_SIZE );
+ if( p_frame_in == NULL )
{
b_eof = true;
}
else
{
- p_block_in->i_dts = date_Get( &p_sys->dts );
+ p_frame_in->i_dts = date_Get( &p_sys->dts );
}
- while( (p_block_out = p_sys->p_packetizer->pf_packetize( p_sys->p_packetizer,
- p_block_in ? &p_block_in : NULL )) )
+ while( (p_frame_out = p_sys->p_packetizer->pf_packetize( p_sys->p_packetizer,
+ p_frame_in ? &p_frame_in : NULL )) )
{
- while( p_block_out )
+ while( p_frame_out )
{
- block_t *p_next = p_block_out->p_next;
+ vlc_frame_t *p_next = p_frame_out->p_next;
- p_block_out->p_next = NULL;
+ p_frame_out->p_next = NULL;
- if( p_block_in )
+ if( p_frame_in )
{
- p_block_in->i_dts = date_Get( &p_sys->dts );
- p_block_in->i_pts = VLC_TICK_INVALID;
+ p_frame_in->i_dts = date_Get( &p_sys->dts );
+ p_frame_in->i_pts = VLC_TICK_INVALID;
}
if( p_sys->p_es == NULL )
@@ -446,16 +446,16 @@ static int Demux( demux_t *p_demux)
p_sys->p_es = es_out_Add( p_demux->out, &p_sys->p_packetizer->fmt_out );
if( !p_sys->p_es )
{
- block_ChainRelease( p_block_out );
+ vlc_frame_ChainRelease( p_frame_out );
return VLC_DEMUXER_EOF;
}
}
/* h264 packetizer does merge multiple NAL into AU, but slice flag persists */
- bool frame = p_block_out->i_flags & BLOCK_FLAG_TYPE_MASK;
- const vlc_tick_t i_frame_dts = p_block_out->i_dts;
- const vlc_tick_t i_frame_length = p_block_out->i_length;
- es_out_Send( p_demux->out, p_sys->p_es, p_block_out );
+ bool frame = p_frame_out->i_flags & FRAME_FLAG_TYPE_MASK;
+ const vlc_tick_t i_frame_dts = p_frame_out->i_dts;
+ const vlc_tick_t i_frame_length = p_frame_out->i_length;
+ es_out_Send( p_demux->out, p_sys->p_es, p_frame_out );
if( frame )
{
if( !p_sys->frame_rate_den )
@@ -491,7 +491,7 @@ static int Demux( demux_t *p_demux)
date_Set( &p_sys->dts, i_frame_dts );
}
- p_block_out = p_next;
+ p_frame_out = p_next;
}
}
return (b_eof) ? VLC_DEMUXER_EOF : VLC_DEMUXER_SUCCESS;
diff --git a/modules/demux/mpeg/mpgv.c b/modules/demux/mpeg/mpgv.c
index 234235e143..bb00287696 100644
--- a/modules/demux/mpeg/mpgv.c
+++ b/modules/demux/mpeg/mpgv.c
@@ -165,35 +165,35 @@ static int Open( vlc_object_t * p_this )
static int Demux( demux_t *p_demux )
{
demux_sys_t *p_sys = p_demux->p_sys;
- block_t *p_block_in, *p_block_out;
+ vlc_frame_t *p_frame_in, *p_frame_out;
bool b_eof = false;
- if( ( p_block_in = vlc_stream_Block( p_demux->s, MPGV_PACKET_SIZE ) ) == NULL )
+ if( ( p_frame_in = vlc_stream_Frame( p_demux->s, MPGV_PACKET_SIZE ) ) == NULL )
{
b_eof = true;
}
- if( p_block_in )
+ if( p_frame_in )
{
- p_block_in->i_pts =
- p_block_in->i_dts = ( p_sys->b_start ) ? VLC_TICK_0 : VLC_TICK_INVALID;
+ p_frame_in->i_pts =
+ p_frame_in->i_dts = ( p_sys->b_start ) ? VLC_TICK_0 : VLC_TICK_INVALID;
}
- while( (p_block_out = p_sys->p_packetizer->pf_packetize( p_sys->p_packetizer,
- p_block_in ? &p_block_in : NULL )) )
+ while( (p_frame_out = p_sys->p_packetizer->pf_packetize( p_sys->p_packetizer,
+ p_frame_in ? &p_frame_in : NULL )) )
{
p_sys->b_start = false;
- while( p_block_out )
+ while( p_frame_out )
{
- block_t *p_next = p_block_out->p_next;
+ vlc_frame_t *p_next = p_frame_out->p_next;
- es_out_SetPCR( p_demux->out, p_block_out->i_dts );
+ es_out_SetPCR( p_demux->out, p_frame_out->i_dts );
- p_block_out->p_next = NULL;
- es_out_Send( p_demux->out, p_sys->p_es, p_block_out );
+ p_frame_out->p_next = NULL;
+ es_out_Send( p_demux->out, p_sys->p_es, p_frame_out );
- p_block_out = p_next;
+ p_frame_out = p_next;
}
}
return (b_eof) ? VLC_DEMUXER_EOF : VLC_DEMUXER_SUCCESS;
diff --git a/modules/demux/mpeg/ps.c b/modules/demux/mpeg/ps.c
index 859c23b313..eb34bc51c1 100644
--- a/modules/demux/mpeg/ps.c
+++ b/modules/demux/mpeg/ps.c
@@ -119,7 +119,7 @@ static int Demux ( demux_t *p_demux );
static int Control( demux_t *p_demux, int i_query, va_list args );
static int ps_pkt_resynch( stream_t *, int, bool );
-static block_t *ps_pkt_read ( stream_t * );
+static vlc_frame_t *ps_pkt_read ( stream_t * );
/*****************************************************************************
* Open
@@ -278,7 +278,7 @@ static int Probe( demux_t *p_demux, bool b_end )
{
demux_sys_t *p_sys = p_demux->p_sys;
int i_ret, i_id;
- block_t *p_pkt;
+ vlc_frame_t *p_pkt;
i_ret = ps_pkt_resynch( p_demux->s, p_sys->format, p_sys->b_have_pack );
if( i_ret < 0 )
@@ -330,7 +330,7 @@ static int Probe( demux_t *p_demux, bool b_end )
p_sys->b_have_pack = true;
}
- block_Release( p_pkt );
+ vlc_frame_Release( p_pkt );
return VLC_DEMUXER_SUCCESS;
}
@@ -393,7 +393,7 @@ static void NotifyDiscontinuity( ps_track_t *p_tk, es_out_t *out )
es_out_Control( out, ES_OUT_GET_ES_STATE, tk->es, &b_selected ) == VLC_SUCCESS
&& b_selected )
{
- tk->i_next_block_flags |= BLOCK_FLAG_DISCONTINUITY;
+ tk->i_next_block_flags |= FRAME_FLAG_DISCONTINUITY;
}
}
}
@@ -412,7 +412,7 @@ static int Demux( demux_t *p_demux )
{
demux_sys_t *p_sys = p_demux->p_sys;
int i_ret, i_mux_rate;
- block_t *p_pkt;
+ vlc_frame_t *p_pkt;
i_ret = ps_pkt_resynch( p_demux->s, p_sys->format, p_sys->b_have_pack );
if( i_ret < 0 )
@@ -448,7 +448,7 @@ static int Demux( demux_t *p_demux )
if( p_pkt->i_buffer < 4 )
{
- block_Release( p_pkt );
+ vlc_frame_Release( p_pkt );
return VLC_DEMUXER_EGENERIC;
}
@@ -456,7 +456,7 @@ static int Demux( demux_t *p_demux )
switch( i_stream_id )
{
case PS_STREAM_ID_END_STREAM:
- block_Release( p_pkt );
+ vlc_frame_Release( p_pkt );
break;
case PS_STREAM_ID_PACK_HEADER:
@@ -472,7 +472,7 @@ static int Demux( demux_t *p_demux )
/* es_out_SetPCR( p_demux->out, p_sys->i_scr ); */
if( i_mux_rate > 0 ) p_sys->i_mux_rate = i_mux_rate;
}
- block_Release( p_pkt );
+ vlc_frame_Release( p_pkt );
break;
case PS_STREAM_ID_SYSTEM_HEADER:
@@ -492,7 +492,7 @@ static int Demux( demux_t *p_demux )
}
}
}
- block_Release( p_pkt );
+ vlc_frame_Release( p_pkt );
break;
case PS_STREAM_ID_MAP:
@@ -500,14 +500,14 @@ static int Demux( demux_t *p_demux )
msg_Dbg( p_demux, "contains a PSM");
ps_psm_fill( &p_sys->psm, p_pkt, p_sys->tk, p_demux->out );
- block_Release( p_pkt );
+ vlc_frame_Release( p_pkt );
break;
default:
/* Reject non video/audio nor PES */
if( i_stream_id < 0xC0 || i_stream_id > 0xEF )
{
- block_Release( p_pkt );
+ vlc_frame_Release( p_pkt );
break;
}
/* fallthrough */
@@ -653,7 +653,7 @@ static int Demux( demux_t *p_demux )
}
else
{
- block_Release( p_pkt );
+ vlc_frame_Release( p_pkt );
}
p_sys->i_pack_scr = VLC_TICK_INVALID;
@@ -885,7 +885,7 @@ static int ps_pkt_resynch( stream_t *s, int format, bool b_pack )
return vlc_stream_Read( s, NULL, i_skip ) == i_skip ? 0 : -1;
}
-static block_t *ps_pkt_read( stream_t *s )
+static vlc_frame_t *ps_pkt_read( stream_t *s )
{
const uint8_t *p_peek;
int i_peek = vlc_stream_Peek( s, &p_peek, 14 );
@@ -909,7 +909,7 @@ static block_t *ps_pkt_read( stream_t *s )
if( p_peek[i_size] == 0x00 && p_peek[i_size+1] == 0x00 &&
p_peek[i_size+2] == 0x01 && p_peek[i_size+3] >= PS_STREAM_ID_END_STREAM )
{
- return vlc_stream_Block( s, i_size );
+ return vlc_stream_Frame( s, i_size );
}
i_size++;
}
@@ -918,7 +918,7 @@ static block_t *ps_pkt_read( stream_t *s )
else
{
/* Normal case */
- return vlc_stream_Block( s, i_size );
+ return vlc_stream_Frame( s, i_size );
}
return NULL;
diff --git a/modules/demux/mpeg/ps.h b/modules/demux/mpeg/ps.h
index 845111e09a..15c17131c5 100644
--- a/modules/demux/mpeg/ps.h
+++ b/modules/demux/mpeg/ps.h
@@ -118,7 +118,7 @@ static inline bool ps_is_H264( const uint8_t *p_data, size_t i_data )
/* From id fill i_skip and es_format_t */
static inline int ps_track_fill( ps_track_t *tk, ps_psm_t *p_psm,
- int i_id, block_t *p_pkt, bool b_mpeg2only )
+ int i_id, vlc_frame_t *p_pkt, bool b_mpeg2only )
{
tk->i_skip = 0;
tk->i_id = i_id;
@@ -314,7 +314,7 @@ static inline int ps_track_fill( ps_track_t *tk, ps_psm_t *p_psm,
}
/* return the id of a PES (should be valid) */
-static inline int ps_pkt_id( block_t *p_pkt )
+static inline int ps_pkt_id( vlc_frame_t *p_pkt )
{
if( p_pkt->p_buffer[3] == 0xbd )
{
@@ -429,7 +429,7 @@ static inline int ps_pkt_size( const uint8_t *p, int i_peek )
}
/* parse a PACK PES */
-static inline int ps_pkt_parse_pack( block_t *p_pkt, vlc_tick_t *pi_scr,
+static inline int ps_pkt_parse_pack( vlc_frame_t *p_pkt, vlc_tick_t *pi_scr,
int *pi_mux_rate )
{
uint8_t *p = p_pkt->p_buffer;
@@ -454,7 +454,7 @@ static inline int ps_pkt_parse_pack( block_t *p_pkt, vlc_tick_t *pi_scr,
}
/* Parse a SYSTEM PES */
-static inline int ps_pkt_parse_system( block_t *p_pkt, ps_psm_t *p_psm,
+static inline int ps_pkt_parse_system( vlc_frame_t *p_pkt, ps_psm_t *p_psm,
ps_track_t tk[PS_TK_COUNT] )
{
uint8_t *p = &p_pkt->p_buffer[6 + 3 + 1 + 1 + 1];
@@ -490,7 +490,7 @@ static inline int ps_pkt_parse_system( block_t *p_pkt, ps_psm_t *p_psm,
}
/* Parse a PES (and skip i_skip_extra in the payload) */
-static inline int ps_pkt_parse_pes( vlc_object_t *p_object, block_t *p_pes, int i_skip_extra )
+static inline int ps_pkt_parse_pes( vlc_object_t *p_object, vlc_frame_t *p_pes, int i_skip_extra )
{
unsigned int i_skip = 0;
stime_t i_pts = -1;
@@ -503,7 +503,7 @@ static inline int ps_pkt_parse_pes( vlc_object_t *p_object, block_t *p_pes, int
return VLC_EGENERIC;
if( b_pes_scrambling )
- p_pes->i_flags |= BLOCK_FLAG_SCRAMBLED;
+ p_pes->i_flags |= FRAME_FLAG_SCRAMBLED;
if( i_skip_extra >= 0 )
i_skip += i_skip_extra;
@@ -614,7 +614,7 @@ static inline void ps_parse_descriptors( const uint8_t *p_data, size_t i_data,
}
}
-static inline int ps_psm_fill( ps_psm_t *p_psm, block_t *p_pkt,
+static inline int ps_psm_fill( ps_psm_t *p_psm, vlc_frame_t *p_pkt,
ps_track_t tk[PS_TK_COUNT], es_out_t *out )
{
size_t i_buffer = p_pkt->i_buffer;
diff --git a/modules/demux/mpeg/ts.c b/modules/demux/mpeg/ts.c
index ff753aa9b2..b1309fe9c1 100644
--- a/modules/demux/mpeg/ts.c
+++ b/modules/demux/mpeg/ts.c
@@ -180,22 +180,22 @@ static bool PIDReferencedByProgram( const ts_pmt_t *, uint16_t );
void UpdatePESFilters( demux_t *p_demux, bool b_all );
static inline void FlushESBuffer( ts_stream_t *p_pes );
static void UpdatePIDScrambledState( demux_t *p_demux, ts_pid_t *p_pid, bool );
-static inline int PIDGet( block_t *p )
+static inline int PIDGet( vlc_frame_t *p )
{
return ( (p->p_buffer[1]&0x1f)<<8 )|p->p_buffer[2];
}
-static stime_t GetPCR( const block_t * );
+static stime_t GetPCR( const vlc_frame_t * );
-static block_t * ProcessTSPacket( demux_t *p_demux, ts_pid_t *pid, block_t *p_pkt, int * );
-static bool GatherPESData( demux_t *p_demux, ts_pid_t *pid, block_t *p_bk, size_t );
-static bool GatherSectionsData( demux_t *p_demux, ts_pid_t *, block_t *, size_t );
+static vlc_frame_t * ProcessTSPacket( demux_t *p_demux, ts_pid_t *pid, vlc_frame_t *p_pkt, int * );
+static bool GatherPESData( demux_t *p_demux, ts_pid_t *pid, vlc_frame_t *p_bk, size_t );
+static bool GatherSectionsData( demux_t *p_demux, ts_pid_t *, vlc_frame_t *, size_t );
static void ProgramSetPCR( demux_t *p_demux, ts_pmt_t *p_prg, stime_t i_pcr );
-static block_t* ReadTSPacket( demux_t *p_demux );
+static vlc_frame_t* ReadTSPacket( demux_t *p_demux );
static int SeekToTime( demux_t *p_demux, const ts_pmt_t *, stime_t time );
static void ReadyQueuesPostSeek( demux_t *p_demux );
static void PCRHandle( demux_t *p_demux, ts_pid_t *, stime_t );
-static void PCRFixHandle( demux_t *, ts_pmt_t *, block_t * );
+static void PCRFixHandle( demux_t *, ts_pmt_t *, vlc_frame_t * );
#define TS_PACKET_SIZE_188 188
#define TS_PACKET_SIZE_192 192
@@ -634,7 +634,7 @@ static int Demux( demux_t *p_demux )
{
bool b_frame = false;
int i_header = 0;
- block_t *p_pkt;
+ vlc_frame_t *p_pkt;
if( !(p_pkt = ReadTSPacket( p_demux )) )
{
return VLC_DEMUXER_EOF;
@@ -651,7 +651,7 @@ static int Demux( demux_t *p_demux )
/* Early reject truncated packets from hw devices */
if( unlikely(p_pkt->i_buffer < TS_PACKET_SIZE_188) )
{
- block_Release( p_pkt );
+ vlc_frame_Release( p_pkt );
continue;
}
@@ -660,7 +660,7 @@ static int Demux( demux_t *p_demux )
{
msg_Dbg( p_demux, "transport_error_indicator set (pid=%d)",
PIDGet( p_pkt ) );
- block_Release( p_pkt );
+ vlc_frame_Release( p_pkt );
continue;
}
@@ -680,9 +680,9 @@ static int Demux( demux_t *p_demux )
if( !p_pkt )
continue;
- if( !SCRAMBLED(*p_pid) != !(p_pkt->i_flags & BLOCK_FLAG_SCRAMBLED) )
+ if( !SCRAMBLED(*p_pid) != !(p_pkt->i_flags & FRAME_FLAG_SCRAMBLED) )
{
- UpdatePIDScrambledState( p_demux, p_pid, p_pkt->i_flags & BLOCK_FLAG_SCRAMBLED );
+ UpdatePIDScrambledState( p_demux, p_pid, p_pkt->i_flags & FRAME_FLAG_SCRAMBLED );
}
/* Adaptation field cannot be scrambled */
@@ -706,7 +706,7 @@ static int Demux( demux_t *p_demux )
case TYPE_PMT:
/* PAT and PMT are not allowed to be scrambled */
ts_psi_Packet_Push( p_pid, p_pkt->p_buffer );
- block_Release( p_pkt );
+ vlc_frame_Release( p_pkt );
break;
case TYPE_STREAM:
@@ -723,7 +723,7 @@ static int Demux( demux_t *p_demux )
if( !p_sys->b_access_control && !(p_pid->i_flags & FLAG_FILTERED) )
{
/* That packet is for an unselected ES, don't waste time/memory gathering its data */
- block_Release( p_pkt );
+ vlc_frame_Release( p_pkt );
continue;
}
@@ -737,27 +737,27 @@ static int Demux( demux_t *p_demux )
}
else // pid->u.p_pes->transport == TS_TRANSPORT_IGNORE
{
- block_Release( p_pkt );
+ vlc_frame_Release( p_pkt );
}
break;
case TYPE_SI:
- if( (p_pkt->i_flags & (BLOCK_FLAG_SCRAMBLED|BLOCK_FLAG_CORRUPTED)) == 0 )
+ if( (p_pkt->i_flags & (FRAME_FLAG_SCRAMBLED|FRAME_FLAG_CORRUPTED)) == 0 )
ts_si_Packet_Push( p_pid, p_pkt->p_buffer );
- block_Release( p_pkt );
+ vlc_frame_Release( p_pkt );
break;
case TYPE_PSIP:
- if( (p_pkt->i_flags & (BLOCK_FLAG_SCRAMBLED|BLOCK_FLAG_CORRUPTED)) == 0 )
+ if( (p_pkt->i_flags & (FRAME_FLAG_SCRAMBLED|FRAME_FLAG_CORRUPTED)) == 0 )
ts_psip_Packet_Push( p_pid, p_pkt->p_buffer );
- block_Release( p_pkt );
+ vlc_frame_Release( p_pkt );
break;
case TYPE_CAT:
default:
/* We have to handle PCR if present */
- block_Release( p_pkt );
+ vlc_frame_Release( p_pkt );
break;
}
@@ -1225,13 +1225,13 @@ static int16_t read_opus_flag(uint8_t **buf, size_t *len)
return ret;
}
-static block_t *Opus_Parse(demux_t *demux, block_t *block)
+static vlc_frame_t *Opus_Parse(demux_t *demux, vlc_frame_t *frame)
{
- block_t *p_chain = NULL;
- block_t **pp_chain_last = &p_chain;
+ vlc_frame_t *p_chain = NULL;
+ vlc_frame_t **pp_chain_last = &p_chain;
- uint8_t *buf = block->p_buffer;
- size_t len = block->i_buffer;
+ uint8_t *buf = frame->p_buffer;
+ size_t len = frame->i_buffer;
while (len > 3 && ((buf[0] << 3) | (buf[1] >> 5)) == 0x3ff) {
int16_t start_trim = 0, end_trim = 0;
@@ -1277,12 +1277,12 @@ static block_t *Opus_Parse(demux_t *demux, block_t *block)
break;
}
- block_t *au = block_Alloc(au_size);
+ vlc_frame_t *au = vlc_frame_Alloc(au_size);
if (!au)
break;
memcpy(au->p_buffer, buf, au_size);
- block_CopyProperties(au, block);
- block_ChainLastAppend( &pp_chain_last, au );
+ vlc_frame_CopyProperties(au, frame);
+ vlc_frame_ChainLastAppend( &pp_chain_last, au );
au->i_nb_samples = opus_frame_duration(buf, au_size);
if (end_trim && (uint16_t) end_trim <= au->i_nb_samples)
@@ -1293,22 +1293,22 @@ static block_t *Opus_Parse(demux_t *demux, block_t *block)
if (start_trim && start_trim < (au->i_nb_samples - au->i_length)) {
au->i_nb_samples -= start_trim;
if (au->i_nb_samples == 0)
- au->i_flags |= BLOCK_FLAG_PREROLL;
+ au->i_flags |= FRAME_FLAG_PREROLL;
}
buf += au_size;
len -= au_size;
}
- block_Release(block);
+ vlc_frame_Release(frame);
return p_chain;
}
-static block_t *J2K_Parse( demux_t *p_demux, block_t *p_block, bool b_interlaced )
+static vlc_frame_t *J2K_Parse( demux_t *p_demux, vlc_frame_t *p_frame, bool b_interlaced )
{
- const uint8_t *p_buf = p_block->p_buffer;
+ const uint8_t *p_buf = p_frame->p_buffer;
- if( p_block->i_buffer < ((b_interlaced) ? 48 : 38) )
+ if( p_frame->i_buffer < ((b_interlaced) ? 48 : 38) )
goto invalid;
if( memcmp( p_buf, "elsmfrat", 8 ) )
@@ -1318,102 +1318,102 @@ static block_t *J2K_Parse( demux_t *p_demux, block_t *p_block, bool b_interlaced
uint16_t i_num = GetWBE( &p_buf[10] );
if( i_den == 0 )
goto invalid;
- p_block->i_length = vlc_tick_from_samples( i_den, i_num );
+ p_frame->i_length = vlc_tick_from_samples( i_den, i_num );
- p_block->p_buffer += (b_interlaced) ? 48 : 38;
- p_block->i_buffer -= (b_interlaced) ? 48 : 38;
+ p_frame->p_buffer += (b_interlaced) ? 48 : 38;
+ p_frame->i_buffer -= (b_interlaced) ? 48 : 38;
- return p_block;
+ return p_frame;
invalid:
msg_Warn( p_demux, "invalid J2K header, dropping codestream" );
- block_Release( p_block );
+ vlc_frame_Release( p_frame );
return NULL;
}
-static block_t * ConvertPESBlock( demux_t *p_demux, ts_es_t *p_es,
+static vlc_frame_t * ConvertPESBlock( demux_t *p_demux, ts_es_t *p_es,
size_t i_pes_size, uint8_t i_stream_id,
- block_t *p_block )
+ vlc_frame_t *p_frame )
{
- if(!p_block)
+ if(!p_frame)
return NULL;
if( p_es->fmt.i_codec == VLC_CODEC_SUBT )
{
- if( i_pes_size > 0 && p_block->i_buffer > i_pes_size )
+ if( i_pes_size > 0 && p_frame->i_buffer > i_pes_size )
{
- p_block->i_buffer = i_pes_size;
+ p_frame->i_buffer = i_pes_size;
}
/* Append a \0 */
- p_block = block_Realloc( p_block, 0, p_block->i_buffer + 1 );
- if( p_block )
- p_block->p_buffer[p_block->i_buffer -1] = '\0';
+ p_frame = vlc_frame_Realloc( p_frame, 0, p_frame->i_buffer + 1 );
+ if( p_frame )
+ p_frame->p_buffer[p_frame->i_buffer -1] = '\0';
}
else if( p_es->fmt.i_codec == VLC_CODEC_TELETEXT )
{
- if( p_block->i_pts == VLC_TICK_INVALID )
+ if( p_frame->i_pts == VLC_TICK_INVALID )
{
/* Teletext may have missing PTS (ETSI EN 300 472 Annexe A)
* In this case use the last PCR + 40ms */
stime_t i_pcr = p_es->p_program->pcr.i_current;
if( SETANDVALID(i_pcr) )
- p_block->i_pts = FROM_SCALE(i_pcr) + VLC_TICK_FROM_MS(40);
+ p_frame->i_pts = FROM_SCALE(i_pcr) + VLC_TICK_FROM_MS(40);
}
}
else if( p_es->fmt.i_codec == VLC_CODEC_ARIB_A ||
p_es->fmt.i_codec == VLC_CODEC_ARIB_C )
{
- if( p_block->i_pts == VLC_TICK_INVALID )
+ if( p_frame->i_pts == VLC_TICK_INVALID )
{
- if( i_pes_size > 0 && p_block->i_buffer > i_pes_size )
+ if( i_pes_size > 0 && p_frame->i_buffer > i_pes_size )
{
- p_block->i_buffer = i_pes_size;
+ p_frame->i_buffer = i_pes_size;
}
/* Append a \0 */
- p_block = block_Realloc( p_block, 0, p_block->i_buffer + 1 );
- if( p_block )
- p_block->p_buffer[p_block->i_buffer -1] = '\0';
+ p_frame = vlc_frame_Realloc( p_frame, 0, p_frame->i_buffer + 1 );
+ if( p_frame )
+ p_frame->p_buffer[p_frame->i_buffer -1] = '\0';
}
}
else if( p_es->fmt.i_codec == VLC_CODEC_OPUS)
{
- p_block = Opus_Parse(p_demux, p_block);
+ p_frame = Opus_Parse(p_demux, p_frame);
}
else if( p_es->fmt.i_codec == VLC_CODEC_JPEG2000 )
{
if( unlikely(i_stream_id != 0xBD) )
{
- block_Release( p_block );
- p_block = NULL;
+ vlc_frame_Release( p_frame );
+ p_frame = NULL;
}
else
{
- p_block = J2K_Parse( p_demux, p_block, p_es->b_interlaced );
+ p_frame = J2K_Parse( p_demux, p_frame, p_es->b_interlaced );
}
}
- return p_block;
+ return p_frame;
}
/****************************************************************************
- * fanouts current block to all subdecoders / shared pid es
+ * fanouts current frame to all subdecoders / shared pid es
****************************************************************************/
-static void SendDataChain( demux_t *p_demux, ts_es_t *p_es, block_t *p_chain )
+static void SendDataChain( demux_t *p_demux, ts_es_t *p_es, vlc_frame_t *p_chain )
{
bool b_lowdelay = var_InheritBool(p_demux, "low-delay");
while( p_chain )
{
- block_t *p_block = p_chain;
- p_chain = p_block->p_next;
- p_block->p_next = NULL;
+ vlc_frame_t *p_frame = p_chain;
+ p_chain = p_frame->p_next;
+ p_frame->p_next = NULL;
if( b_lowdelay )
- p_block->i_flags |= BLOCK_FLAG_AU_END;
+ p_frame->i_flags |= FRAME_FLAG_AU_END;
ts_es_t *p_es_send = p_es;
if( p_es_send->i_next_block_flags )
{
- p_block->i_flags |= p_es_send->i_next_block_flags;
+ p_frame->i_flags |= p_es_send->i_next_block_flags;
p_es_send->i_next_block_flags = 0;
}
@@ -1427,7 +1427,7 @@ static void SendDataChain( demux_t *p_demux, ts_es_t *p_es, block_t *p_chain )
{
if( p_extra_es->id )
{
- block_t *p_dup = block_Duplicate( p_block );
+ vlc_frame_t *p_dup = vlc_frame_Duplicate( p_frame );
if( p_dup )
es_out_Send( p_demux->out, p_extra_es->id, p_dup );
}
@@ -1438,7 +1438,7 @@ static void SendDataChain( demux_t *p_demux, ts_es_t *p_es, block_t *p_chain )
{
if( p_es_send->id )
{
- block_t *p_dup = block_Duplicate( p_block );
+ vlc_frame_t *p_dup = vlc_frame_Duplicate( p_frame );
if( p_dup )
es_out_Send( p_demux->out, p_es_send->id, p_dup );
}
@@ -1447,23 +1447,23 @@ static void SendDataChain( demux_t *p_demux, ts_es_t *p_es, block_t *p_chain )
{
if( p_es_send->id )
{
- es_out_Send( p_demux->out, p_es_send->id, p_block );
- p_block = NULL;
+ es_out_Send( p_demux->out, p_es_send->id, p_frame );
+ p_frame = NULL;
}
}
}
p_es_send = p_es_send->p_next;
}
- if( p_block )
- block_Release( p_block );
+ if( p_frame )
+ vlc_frame_Release( p_frame );
}
}
/****************************************************************************
* gathering stuff
****************************************************************************/
-static void ParsePESDataChain( demux_t *p_demux, ts_pid_t *pid, block_t *p_pes )
+static void ParsePESDataChain( demux_t *p_demux, ts_pid_t *pid, vlc_frame_t *p_pes )
{
uint8_t header[34];
unsigned i_pes_size = 0;
@@ -1477,25 +1477,25 @@ static void ParsePESDataChain( demux_t *p_demux, ts_pid_t *pid, block_t *p_pes )
assert(pid->type == TYPE_STREAM);
- const int i_max = block_ChainExtract( p_pes, header, 34 );
+ const int i_max = vlc_frame_ChainExtract( p_pes, header, 34 );
if ( i_max < 4 )
{
- block_ChainRelease( p_pes );
+ vlc_frame_ChainRelease( p_pes );
return;
}
if( header[0] != 0 || header[1] != 0 || header[2] != 1 )
{
- if ( !(p_pes->i_flags & BLOCK_FLAG_SCRAMBLED) )
+ if ( !(p_pes->i_flags & FRAME_FLAG_SCRAMBLED) )
msg_Warn( p_demux, "invalid header [0x%02x:%02x:%02x:%02x] (pid: %d)",
header[0], header[1],header[2],header[3], pid->i_pid );
- block_ChainRelease( p_pes );
+ vlc_frame_ChainRelease( p_pes );
return;
}
else
{
/* Incorrect transport scrambling flag set by german boxes */
- p_pes->i_flags &= ~BLOCK_FLAG_SCRAMBLED;
+ p_pes->i_flags &= ~FRAME_FLAG_SCRAMBLED;
}
ts_es_t *p_es = pid->u.p_stream->p_es;
@@ -1503,7 +1503,7 @@ static void ParsePESDataChain( demux_t *p_demux, ts_pid_t *pid, block_t *p_pes )
if( ParsePESHeader( VLC_OBJECT(p_demux), (uint8_t*)&header, i_max, &i_skip,
&i_dts, &i_pts, &i_stream_id, &b_pes_scrambling ) == VLC_EGENERIC )
{
- block_ChainRelease( p_pes );
+ vlc_frame_ChainRelease( p_pes );
return;
}
else
@@ -1513,7 +1513,7 @@ static void ParsePESDataChain( demux_t *p_demux, ts_pid_t *pid, block_t *p_pes )
if( i_dts != -1 && p_es->p_program )
i_dts = TimeStampWrapAround( p_es->p_program->pcr.i_first, i_dts );
if( b_pes_scrambling )
- p_pes->i_flags |= BLOCK_FLAG_SCRAMBLED;
+ p_pes->i_flags |= FRAME_FLAG_SCRAMBLED;
}
if( p_es->i_sl_es_id )
@@ -1555,10 +1555,10 @@ static void ParsePESDataChain( demux_t *p_demux, ts_pid_t *pid, block_t *p_pes )
{
if( p_pes->i_buffer <= i_skip )
{
- block_t *p_next = p_pes->p_next;
+ vlc_frame_t *p_next = p_pes->p_next;
i_skip -= p_pes->i_buffer;
- block_Release( p_pes );
+ vlc_frame_Release( p_pes );
p_pes = p_next;
}
else
@@ -1578,7 +1578,7 @@ static void ParsePESDataChain( demux_t *p_demux, ts_pid_t *pid, block_t *p_pes )
ts_pmt_t *p_pmt = p_es->p_program;
if( unlikely(!p_pmt) )
{
- block_ChainRelease( p_pes );
+ vlc_frame_ChainRelease( p_pes );
return;
}
@@ -1591,23 +1591,23 @@ static void ParsePESDataChain( demux_t *p_demux, ts_pid_t *pid, block_t *p_pes )
p_pes->i_length = FROM_SCALE_NZ(i_length);
/* Can become a chain on next call due to prepcr */
- block_t *p_chain = block_ChainGather( p_pes );
+ vlc_frame_t *p_chain = vlc_frame_ChainGather( p_pes );
while ( p_chain ) {
- block_t *p_block = p_chain;
+ vlc_frame_t *p_frame = p_chain;
p_chain = p_chain->p_next;
- p_block->p_next = NULL;
+ p_frame->p_next = NULL;
if( !p_pmt->pcr.b_fix_done ) /* Not seen yet */
- PCRFixHandle( p_demux, p_pmt, p_block );
+ PCRFixHandle( p_demux, p_pmt, p_frame );
if( p_es->id && (p_pmt->pcr.i_current > -1 || p_pmt->pcr.b_disable) )
{
if( pid->u.p_stream->prepcr.p_head )
{
/* Rebuild current output chain, appending any prepcr outqueue */
- block_ChainLastAppend( &pid->u.p_stream->prepcr.pp_last, p_block );
+ vlc_frame_ChainLastAppend( &pid->u.p_stream->prepcr.pp_last, p_frame );
if( p_chain )
- block_ChainLastAppend( &pid->u.p_stream->prepcr.pp_last, p_chain );
+ vlc_frame_ChainLastAppend( &pid->u.p_stream->prepcr.pp_last, p_chain );
p_chain = pid->u.p_stream->prepcr.p_head;
pid->u.p_stream->prepcr.p_head = NULL;
pid->u.p_stream->prepcr.pp_last = &pid->u.p_stream->prepcr.p_head;
@@ -1615,21 +1615,21 @@ static void ParsePESDataChain( demux_t *p_demux, ts_pid_t *pid, block_t *p_pes )
continue;
}
- if ( p_pmt->pcr.b_disable && p_block->i_dts != VLC_TICK_INVALID &&
+ if ( p_pmt->pcr.b_disable && p_frame->i_dts != VLC_TICK_INVALID &&
( p_pmt->i_pid_pcr == pid->i_pid || p_pmt->i_pid_pcr == 0x1FFF ) )
{
- stime_t i_pcr = ( p_block->i_dts > VLC_TICK_FROM_MS(120) )
- ? TO_SCALE(p_block->i_dts - VLC_TICK_FROM_MS(120))
- : TO_SCALE(p_block->i_dts);
+ stime_t i_pcr = ( p_frame->i_dts > VLC_TICK_FROM_MS(120) )
+ ? TO_SCALE(p_frame->i_dts - VLC_TICK_FROM_MS(120))
+ : TO_SCALE(p_frame->i_dts);
ProgramSetPCR( p_demux, p_pmt, i_pcr );
}
/* Compute PCR/DTS offset if any */
- if( p_pmt->pcr.i_pcroffset == -1 && p_block->i_dts != VLC_TICK_INVALID &&
+ if( p_pmt->pcr.i_pcroffset == -1 && p_frame->i_dts != VLC_TICK_INVALID &&
SETANDVALID(p_pmt->pcr.i_current) &&
(p_es->fmt.i_cat == VIDEO_ES || p_es->fmt.i_cat == AUDIO_ES) )
{
- stime_t i_dts27 = TO_SCALE(p_block->i_dts);
+ stime_t i_dts27 = TO_SCALE(p_frame->i_dts);
i_dts27 = TimeStampWrapAround( p_pmt->pcr.i_first, i_dts27 );
stime_t i_pcr = TimeStampWrapAround( p_pmt->pcr.i_first, p_pmt->pcr.i_current );
if( i_dts27 < i_pcr )
@@ -1644,39 +1644,39 @@ static void ParsePESDataChain( demux_t *p_demux, ts_pid_t *pid, block_t *p_pes )
if( p_pmt->pcr.i_pcroffset != -1 )
{
- if( p_block->i_dts != VLC_TICK_INVALID )
- p_block->i_dts += FROM_SCALE_NZ(p_pmt->pcr.i_pcroffset);
- if( p_block->i_pts != VLC_TICK_INVALID )
- p_block->i_pts += FROM_SCALE_NZ(p_pmt->pcr.i_pcroffset);
+ if( p_frame->i_dts != VLC_TICK_INVALID )
+ p_frame->i_dts += FROM_SCALE_NZ(p_pmt->pcr.i_pcroffset);
+ if( p_frame->i_pts != VLC_TICK_INVALID )
+ p_frame->i_pts += FROM_SCALE_NZ(p_pmt->pcr.i_pcroffset);
}
- /*** From here, block can become a chain again though conversion below ***/
+ /*** From here, frame can become a chain again though conversion below ***/
if( pid->u.p_stream->p_proc )
{
- if( p_block->i_flags & BLOCK_FLAG_DISCONTINUITY )
+ if( p_frame->i_flags & FRAME_FLAG_DISCONTINUITY )
ts_stream_processor_Reset( pid->u.p_stream->p_proc );
- p_block = ts_stream_processor_Push( pid->u.p_stream->p_proc, i_stream_id, p_block );
+ p_frame = ts_stream_processor_Push( pid->u.p_stream->p_proc, i_stream_id, p_frame );
}
else
/* Some codecs might need xform or AU splitting */
{
- p_block = ConvertPESBlock( p_demux, p_es, i_pes_size, i_stream_id, p_block );
+ p_frame = ConvertPESBlock( p_demux, p_es, i_pes_size, i_stream_id, p_frame );
}
- SendDataChain( p_demux, p_es, p_block );
+ SendDataChain( p_demux, p_es, p_frame );
}
else
{
if( !p_pmt->pcr.b_fix_done ) /* Not seen yet */
- PCRFixHandle( p_demux, p_pmt, p_block );
+ PCRFixHandle( p_demux, p_pmt, p_frame );
- block_ChainLastAppend( &pid->u.p_stream->prepcr.pp_last, p_block );
+ vlc_frame_ChainLastAppend( &pid->u.p_stream->prepcr.pp_last, p_frame );
- /* PCR Seen and no es->id, cleanup current and prepcr blocks */
+ /* PCR Seen and no es->id, cleanup current and prepcr frames */
if( p_pmt->pcr.i_current > -1)
{
- block_ChainRelease( pid->u.p_stream->prepcr.p_head );
+ vlc_frame_ChainRelease( pid->u.p_stream->prepcr.p_head );
pid->u.p_stream->prepcr.p_head = NULL;
pid->u.p_stream->prepcr.pp_last = &pid->u.p_stream->prepcr.p_head;
}
@@ -1689,14 +1689,14 @@ static void ParsePESDataChain( demux_t *p_demux, ts_pid_t *pid, block_t *p_pes )
}
}
-static bool PushPESBlock( demux_t *p_demux, ts_pid_t *pid, block_t *p_pkt, bool b_unit_start )
+static bool PushPESBlock( demux_t *p_demux, ts_pid_t *pid, vlc_frame_t *p_pkt, bool b_unit_start )
{
bool b_ret = false;
ts_stream_t *p_pes = pid->u.p_stream;
if ( b_unit_start && p_pes->gather.p_data )
{
- block_t *p_datachain = p_pes->gather.p_data;
+ vlc_frame_t *p_datachain = p_pes->gather.p_data;
/* Flush the pes from pid */
p_pes->gather.p_data = NULL;
p_pes->gather.i_data_size = 0;
@@ -1712,11 +1712,11 @@ static bool PushPESBlock( demux_t *p_demux, ts_pid_t *pid, block_t *p_pkt, bool
if( !b_unit_start && p_pes->gather.p_data == NULL )
{
/* msg_Dbg( p_demux, "broken packet" ); */
- block_Release( p_pkt );
+ vlc_frame_Release( p_pkt );
return b_ret;
}
- block_ChainLastAppend( &p_pes->gather.pp_last, p_pkt );
+ vlc_frame_ChainLastAppend( &p_pes->gather.pp_last, p_pkt );
p_pes->gather.i_gathered += p_pkt->i_buffer;
if( p_pes->gather.i_data_size > 0 &&
@@ -1730,14 +1730,14 @@ static bool PushPESBlock( demux_t *p_demux, ts_pid_t *pid, block_t *p_pkt, bool
return b_ret;
}
-static block_t* ReadTSPacket( demux_t *p_demux )
+static vlc_frame_t* ReadTSPacket( demux_t *p_demux )
{
demux_sys_t *p_sys = p_demux->p_sys;
- block_t *p_pkt;
+ vlc_frame_t *p_pkt;
/* Get a new TS packet */
- if( !( p_pkt = vlc_stream_Block( p_sys->stream, p_sys->i_packet_size ) ) )
+ if( !( p_pkt = vlc_stream_Frame( p_sys->stream, p_sys->i_packet_size ) ) )
{
int64_t size = stream_Size( p_sys->stream );
if( size >= 0 && (uint64_t)size == vlc_stream_Tell( p_sys->stream ) )
@@ -1749,7 +1749,7 @@ static block_t* ReadTSPacket( demux_t *p_demux )
if( p_pkt->i_buffer < TS_HEADER_SIZE + p_sys->i_packet_header_size )
{
- block_Release( p_pkt );
+ vlc_frame_Release( p_pkt );
return NULL;
}
@@ -1764,7 +1764,7 @@ static block_t* ReadTSPacket( demux_t *p_demux )
if( p_pkt->p_buffer[0] != 0x47 )
{
msg_Warn( p_demux, "lost synchro" );
- block_Release( p_pkt );
+ vlc_frame_Release( p_pkt );
for( ;; )
{
const uint8_t *p_peek;
@@ -1797,7 +1797,7 @@ static block_t* ReadTSPacket( demux_t *p_demux )
break;
}
}
- if( !( p_pkt = vlc_stream_Block( p_sys->stream, p_sys->i_packet_size ) ) )
+ if( !( p_pkt = vlc_stream_Frame( p_sys->stream, p_sys->i_packet_size ) ) )
{
msg_Dbg( p_demux, "eof ?" );
return NULL;
@@ -1806,7 +1806,7 @@ static block_t* ReadTSPacket( demux_t *p_demux )
return p_pkt;
}
-static stime_t GetPCR( const block_t *p_pkt )
+static stime_t GetPCR( const vlc_frame_t *p_pkt )
{
const uint8_t *p = p_pkt->p_buffer;
@@ -1860,7 +1860,7 @@ static inline void FlushESBuffer( ts_stream_t *p_pes )
if( p_pes->gather.p_data )
{
p_pes->gather.i_gathered = p_pes->gather.i_data_size = 0;
- block_ChainRelease( p_pes->gather.p_data );
+ vlc_frame_ChainRelease( p_pes->gather.p_data );
p_pes->gather.p_data = NULL;
p_pes->gather.pp_last = &p_pes->gather.p_data;
p_pes->gather.i_saved = 0;
@@ -1886,14 +1886,14 @@ static void ReadyQueuesPostSeek( demux_t *p_demux )
continue;
for( ts_es_t *p_es = p_pes->p_es; p_es; p_es = p_es->p_next )
- p_es->i_next_block_flags |= BLOCK_FLAG_DISCONTINUITY;
+ p_es->i_next_block_flags |= FRAME_FLAG_DISCONTINUITY;
pid->i_cc = 0xff;
pid->i_dup = 0;
if( pid->u.p_stream->prepcr.p_head )
{
- block_ChainRelease( pid->u.p_stream->prepcr.p_head );
+ vlc_frame_ChainRelease( pid->u.p_stream->prepcr.p_head );
pid->u.p_stream->prepcr.p_head = NULL;
pid->u.p_stream->prepcr.pp_last = &pid->u.p_stream->prepcr.p_head;
}
@@ -1942,7 +1942,7 @@ static int SeekToTime( demux_t *p_demux, const ts_pmt_t *p_pmt, stime_t i_scaled
while( i_pos < i_tail_pos )
{
stime_t i_pcr = -1;
- block_t *p_pkt = ReadTSPacket( p_demux );
+ vlc_frame_t *p_pkt = ReadTSPacket( p_demux );
if( !p_pkt )
{
i_head_pos = i_tail_pos;
@@ -1984,7 +1984,7 @@ static int SeekToTime( demux_t *p_demux, const ts_pmt_t *p_pmt, stime_t i_scaled
}
}
}
- block_Release( p_pkt );
+ vlc_frame_Release( p_pkt );
if( i_pcr != -1 )
{
@@ -2016,7 +2016,7 @@ static int ProbeChunk( demux_t *p_demux, int i_program, bool b_end, stime_t *pi_
{
demux_sys_t *p_sys = p_demux->p_sys;
int i_count = 0;
- block_t *p_pkt = NULL;
+ vlc_frame_t *p_pkt = NULL;
for( ;; )
{
@@ -2030,7 +2030,7 @@ static int ProbeChunk( demux_t *p_demux, int i_program, bool b_end, stime_t *pi_
if( p_pkt->i_size < TS_PACKET_SIZE_188 &&
( p_pkt->p_buffer[1]&0x80 ) /* transport error */ )
{
- block_Release( p_pkt );
+ vlc_frame_Release( p_pkt );
continue;
}
@@ -2106,7 +2106,7 @@ static int ProbeChunk( demux_t *p_demux, int i_program, bool b_end, stime_t *pi_
}
}
- block_Release( p_pkt );
+ vlc_frame_Release( p_pkt );
}
return i_count;
@@ -2193,12 +2193,12 @@ static void ProgramSetPCR( demux_t *p_demux, ts_pmt_t *p_pmt, stime_t i_pcr )
for( int j=0; j<p_opmt->e_streams.i_size; j++ )
{
ts_pid_t *p_pid = p_opmt->e_streams.p_elems[j];
- block_t *p_block = p_pid->u.p_stream->prepcr.p_head;
- while( p_block && p_block->i_dts == VLC_TICK_INVALID )
- p_block = p_block->p_next;
+ vlc_frame_t *p_frame = p_pid->u.p_stream->prepcr.p_head;
+ while( p_frame && p_frame->i_dts == VLC_TICK_INVALID )
+ p_frame = p_frame->p_next;
- if( p_block && ( i_mindts == VLC_TICK_INVALID || p_block->i_dts < i_mindts ) )
- i_mindts = p_block->i_dts;
+ if( p_frame && ( i_mindts == VLC_TICK_INVALID || p_frame->i_dts < i_mindts ) )
+ i_mindts = p_frame->i_dts;
}
}
@@ -2237,7 +2237,7 @@ static void ProgramSetPCR( demux_t *p_demux, ts_pmt_t *p_pmt, stime_t i_pcr )
static int IsVideoEnd( ts_pid_t *p_pid )
{
/* jump to near end of PES packet */
- block_t *p = p_pid->u.p_stream->gather.p_data;
+ vlc_frame_t *p = p_pid->u.p_stream->gather.p_data;
if( !p || !p->p_next )
return 0;
while( p->p_next->p_next )
@@ -2247,7 +2247,7 @@ static int IsVideoEnd( ts_pid_t *p_pid )
/* extract last bytes */
uint8_t tail[ 188 ];
- const int i_tail = block_ChainExtract( p, tail, sizeof( tail ) );
+ const int i_tail = vlc_frame_ChainExtract( p, tail, sizeof( tail ) );
if( i_tail < 4 )
return 0;
@@ -2280,7 +2280,7 @@ static void PCRCheckDTS( demux_t *p_demux, ts_pmt_t *p_pmt, stime_t i_pcr)
continue;
uint8_t header[34];
- const int i_max = block_ChainExtract( p_pes->gather.p_data, header, 34 );
+ const int i_max = vlc_frame_ChainExtract( p_pes->gather.p_data, header, 34 );
if( i_max < 6 || header[0] != 0 || header[1] != 0 || header[2] != 1 )
continue;
@@ -2401,7 +2401,7 @@ int FindPCRCandidate( ts_pmt_t *p_pmt )
}
/* Tries to reselect a new PCR when none has been received */
-static void PCRFixHandle( demux_t *p_demux, ts_pmt_t *p_pmt, block_t *p_block )
+static void PCRFixHandle( demux_t *p_demux, ts_pmt_t *p_pmt, vlc_frame_t *p_frame )
{
demux_sys_t *p_sys = p_demux->p_sys;
@@ -2416,9 +2416,9 @@ static void PCRFixHandle( demux_t *p_demux, ts_pmt_t *p_pmt, block_t *p_block )
/* Record the first data packet timestamp in case there wont be any PCR */
else if( p_pmt->pcr.i_first_dts == TS_TICK_UNKNOWN )
{
- p_pmt->pcr.i_first_dts = TO_SCALE(p_block->i_dts);
+ p_pmt->pcr.i_first_dts = TO_SCALE(p_frame->i_dts);
}
- else if( p_block->i_dts - FROM_SCALE(p_pmt->pcr.i_first_dts) > VLC_TICK_FROM_MS(500) ) /* "PCR repeat rate shall not exceed 100ms" */
+ else if( p_frame->i_dts - FROM_SCALE(p_pmt->pcr.i_first_dts) > VLC_TICK_FROM_MS(500) ) /* "PCR repeat rate shall not exceed 100ms" */
{
if( p_pmt->pcr.i_current < 0 &&
GetPID( p_sys, p_pmt->i_pid_pcr )->probed.i_pcr_count == 0 )
@@ -2435,7 +2435,7 @@ static void PCRFixHandle( demux_t *p_demux, ts_pmt_t *p_pmt, block_t *p_block )
}
}
-static block_t * ProcessTSPacket( demux_t *p_demux, ts_pid_t *pid, block_t *p_pkt, int *pi_skip )
+static vlc_frame_t * ProcessTSPacket( demux_t *p_demux, ts_pid_t *pid, vlc_frame_t *p_pkt, int *pi_skip )
{
demux_sys_t *p_sys = p_demux->p_sys;
const uint8_t *p = p_pkt->p_buffer;
@@ -2457,7 +2457,7 @@ static block_t * ProcessTSPacket( demux_t *p_demux, ts_pid_t *pid, block_t *p_pk
/* Drop null packets */
if( unlikely(pid->i_pid == 0x1FFF) )
{
- block_Release( p_pkt );
+ vlc_frame_Release( p_pkt );
return NULL;
}
@@ -2474,7 +2474,7 @@ static block_t * ProcessTSPacket( demux_t *p_demux, ts_pid_t *pid, block_t *p_pk
vlc_mutex_unlock( &p_sys->csa_lock );
}
else
- p_pkt->i_flags |= BLOCK_FLAG_SCRAMBLED;
+ p_pkt->i_flags |= FRAME_FLAG_SCRAMBLED;
}
/* We don't have any adaptation_field, so payload starts
@@ -2486,7 +2486,7 @@ static block_t * ProcessTSPacket( demux_t *p_demux, ts_pid_t *pid, block_t *p_pk
if( p[4] + 5 > 188 /* adaptation field only == 188 */ )
{
/* Broken is broken */
- block_Release( p_pkt );
+ vlc_frame_Release( p_pkt );
return NULL;
}
else if( p[4] > 0 )
@@ -2498,11 +2498,11 @@ static block_t * ProcessTSPacket( demux_t *p_demux, ts_pid_t *pid, block_t *p_pk
msg_Warn( p_demux, "discontinuity indicator (pid=%d) ",
pid->i_pid );
/* ignore, that's not that simple 2.4.3.5 */
- //p_pkt->i_flags |= BLOCK_FLAG_DISCONTINUITY;
+ //p_pkt->i_flags |= FRAME_FLAG_DISCONTINUITY;
/* ... or don't ignore for our Bluray still frames and seek hacks */
if(p[5] == 0x82 && !strncmp((const char *)&p[7], "VLC_DISCONTINU", 14))
- p_pkt->i_flags |= BLOCK_FLAG_DISCONTINUITY;
+ p_pkt->i_flags |= FRAME_FLAG_DISCONTINUITY;
}
#if 0
if( p[5]&0x40 )
@@ -2545,7 +2545,7 @@ static block_t * ProcessTSPacket( demux_t *p_demux, ts_pid_t *pid, block_t *p_pk
* That should not need CRC or full payload as it should be
* restarting with PSI packets */
pid->i_dup++;
- block_Release( p_pkt );
+ vlc_frame_Release( p_pkt );
return NULL;
}
else if( i_diff != 0 && !b_discontinuity )
@@ -2555,7 +2555,7 @@ static block_t * ProcessTSPacket( demux_t *p_demux, ts_pid_t *pid, block_t *p_pk
pid->i_cc = i_cc;
pid->i_dup = 0;
- p_pkt->i_flags |= BLOCK_FLAG_DISCONTINUITY;
+ p_pkt->i_flags |= FRAME_FLAG_DISCONTINUITY;
}
else pid->i_cc = i_cc;
}
@@ -2572,7 +2572,7 @@ static block_t * ProcessTSPacket( demux_t *p_demux, ts_pid_t *pid, block_t *p_pk
if( unlikely(!(b_payload || b_adaptation)) ) /* Invalid, ignore */
{
- block_Release( p_pkt );
+ vlc_frame_Release( p_pkt );
return NULL;
}
@@ -2580,36 +2580,36 @@ static block_t * ProcessTSPacket( demux_t *p_demux, ts_pid_t *pid, block_t *p_pk
}
/* Avoids largest memcpy */
-static bool block_Split( block_t **pp_block, block_t **pp_remain, size_t i_offset )
+static bool vlc_frame_Split( vlc_frame_t **pp_frame, vlc_frame_t **pp_remain, size_t i_offset )
{
- block_t *p_block = *pp_block;
- block_t *p_split = NULL;
+ vlc_frame_t *p_frame = *pp_frame;
+ vlc_frame_t *p_split = NULL;
*pp_remain = NULL;
- size_t i_tocopy = p_block->i_buffer - i_offset;
- if( i_tocopy > i_offset ) /* make new block for head */
+ size_t i_tocopy = p_frame->i_buffer - i_offset;
+ if( i_tocopy > i_offset ) /* make new frame for head */
{
if( i_offset > 0 )
{
- p_split = block_Alloc( i_offset );
+ p_split = vlc_frame_Alloc( i_offset );
if( p_split == NULL )
return false;
- memcpy( p_split->p_buffer, p_block->p_buffer, i_offset );
- p_block->p_buffer += i_offset;
- p_block->i_buffer -= i_offset;
+ memcpy( p_split->p_buffer, p_frame->p_buffer, i_offset );
+ p_frame->p_buffer += i_offset;
+ p_frame->i_buffer -= i_offset;
}
- *pp_remain = p_block;
- *pp_block = p_split;
+ *pp_remain = p_frame;
+ *pp_frame = p_split;
}
else /* other gets the tail of our split */
{
if( i_tocopy > 0 )
{
- p_split = block_Alloc( i_tocopy );
+ p_split = vlc_frame_Alloc( i_tocopy );
if( p_split == NULL )
return false;
- memcpy( p_split->p_buffer, &p_block->p_buffer[i_offset], i_tocopy );
- p_block->i_buffer -= i_tocopy;
+ memcpy( p_split->p_buffer, &p_frame->p_buffer[i_offset], i_tocopy );
+ p_frame->i_buffer -= i_tocopy;
}
*pp_remain = p_split;
}
@@ -2643,7 +2643,7 @@ static bool MayHaveStartCodeOnEnd( const uint8_t *p_buf, size_t i_buf )
return !( *(--p_buf) > 1 || *(--p_buf) > 0 || *(--p_buf) > 0 );
}
-static bool GatherPESData( demux_t *p_demux, ts_pid_t *pid, block_t *p_pkt, size_t i_skip )
+static bool GatherPESData( demux_t *p_demux, ts_pid_t *pid, vlc_frame_t *p_pkt, size_t i_skip )
{
demux_sys_t *p_sys = p_demux->p_sys;
const bool b_unit_start = p_pkt->p_buffer[1]&0x40;
@@ -2667,23 +2667,23 @@ static bool GatherPESData( demux_t *p_demux, ts_pid_t *pid, block_t *p_pkt, size
}
/* We'll cannot parse any pes data */
- if( (p_pkt->i_flags & BLOCK_FLAG_SCRAMBLED) && p_sys->b_valid_scrambling )
+ if( (p_pkt->i_flags & FRAME_FLAG_SCRAMBLED) && p_sys->b_valid_scrambling )
{
- block_Release( p_pkt );
+ vlc_frame_Release( p_pkt );
return PushPESBlock( p_demux, pid, NULL, true );
}
/* Data discontinuity, we need to drop or output currently
* gathered data as it can't match the target size or can
* have dropped next sync code */
- if( p_pkt->i_flags & BLOCK_FLAG_DISCONTINUITY )
+ if( p_pkt->i_flags & FRAME_FLAG_DISCONTINUITY )
{
p_pes->gather.i_saved = 0;
/* Flush/output current */
b_ret |= PushPESBlock( p_demux, pid, NULL, true );
/* Propagate to output block to notify packetizers/decoders */
if( p_pes->p_es )
- p_pes->p_es->i_next_block_flags |= BLOCK_FLAG_DISCONTINUITY;
+ p_pes->p_es->i_next_block_flags |= FRAME_FLAG_DISCONTINUITY;
}
if ( unlikely(p_pes->gather.i_saved > 0) )
@@ -2692,7 +2692,7 @@ static bool GatherPESData( demux_t *p_demux, ts_pid_t *pid, block_t *p_pkt, size
assert(p_pes->gather.i_saved < 6);
if( !b_aligned_ts_payload )
{
- p_pkt = block_Realloc( p_pkt, p_pes->gather.i_saved, p_pkt->i_buffer );
+ p_pkt = vlc_frame_Realloc( p_pkt, p_pes->gather.i_saved, p_pkt->i_buffer );
if( p_pkt )
memcpy( p_pkt->p_buffer, p_pes->gather.saved, p_pes->gather.i_saved );
}
@@ -2709,7 +2709,7 @@ static bool GatherPESData( demux_t *p_demux, ts_pid_t *pid, block_t *p_pkt, size
{
if( memcmp( p_pkt->p_buffer, pes_sync, 3 ) )
{
- block_Release( p_pkt );
+ vlc_frame_Release( p_pkt );
return b_ret;
}
}
@@ -2727,7 +2727,7 @@ static bool GatherPESData( demux_t *p_demux, ts_pid_t *pid, block_t *p_pkt, size
p_pes->gather.i_saved = p_pkt->i_buffer = 3;
memcpy(p_pes->gather.saved, p_pkt->p_buffer, p_pkt->i_buffer);
}
- block_Release( p_pkt );
+ vlc_frame_Release( p_pkt );
return b_ret;
}
p_pkt->i_buffer -= p_buf - p_pkt->p_buffer;
@@ -2756,10 +2756,10 @@ static bool GatherPESData( demux_t *p_demux, ts_pid_t *pid, block_t *p_pkt, size
}
else /* p_pkt->i_buffer > i_remain */
{
- block_t *p_split;
- if( !block_Split( &p_pkt, &p_split, i_remain ) )
+ vlc_frame_t *p_split;
+ if( !vlc_frame_Split( &p_pkt, &p_split, i_remain ) )
{
- block_Release( p_pkt );
+ vlc_frame_Release( p_pkt );
return false;
}
b_ret |= PushPESBlock( p_demux, pid, p_pkt, p_pes->gather.p_data == NULL );
@@ -2782,7 +2782,7 @@ static bool GatherPESData( demux_t *p_demux, ts_pid_t *pid, block_t *p_pkt, size
assert(p_pes->gather.i_saved == 0);
p_pes->gather.i_saved = p_pkt->i_buffer;
memcpy(p_pes->gather.saved, p_pkt->p_buffer, p_pkt->i_buffer);
- block_Release( p_pkt );
+ vlc_frame_Release( p_pkt );
p_pkt = NULL;
}
}
@@ -2790,23 +2790,23 @@ static bool GatherPESData( demux_t *p_demux, ts_pid_t *pid, block_t *p_pkt, size
return b_ret;
}
-static bool GatherSectionsData( demux_t *p_demux, ts_pid_t *p_pid, block_t *p_pkt, size_t i_skip )
+static bool GatherSectionsData( demux_t *p_demux, ts_pid_t *p_pid, vlc_frame_t *p_pkt, size_t i_skip )
{
VLC_UNUSED(i_skip); VLC_UNUSED(p_demux);
bool b_ret = false;
- if( p_pkt->i_flags & BLOCK_FLAG_DISCONTINUITY )
+ if( p_pkt->i_flags & FRAME_FLAG_DISCONTINUITY )
{
ts_sections_processor_Reset( p_pid->u.p_stream->p_sections_proc );
}
- if( (p_pkt->i_flags & (BLOCK_FLAG_SCRAMBLED | BLOCK_FLAG_CORRUPTED)) == 0 )
+ if( (p_pkt->i_flags & (FRAME_FLAG_SCRAMBLED | FRAME_FLAG_CORRUPTED)) == 0 )
{
ts_sections_processor_Push( p_pid->u.p_stream->p_sections_proc, p_pkt->p_buffer );
b_ret = true;
}
- block_Release( p_pkt );
+ vlc_frame_Release( p_pkt );
return b_ret;
}
diff --git a/modules/demux/mpeg/ts_hotfixes.c b/modules/demux/mpeg/ts_hotfixes.c
index 4a79b40d75..635c03b093 100644
--- a/modules/demux/mpeg/ts_hotfixes.c
+++ b/modules/demux/mpeg/ts_hotfixes.c
@@ -206,24 +206,24 @@ void ProbePES( demux_t *p_demux, ts_pid_t *pid, const uint8_t *p_pesstart, size_
}
-static void BuildPATCallback( void *p_opaque, block_t *p_block )
+static void BuildPATCallback( void *p_opaque, vlc_frame_t *p_frame )
{
ts_pid_t *pat_pid = (ts_pid_t *) p_opaque;
- dvbpsi_packet_push( pat_pid->u.p_pat->handle, p_block->p_buffer );
- block_Release( p_block );
+ dvbpsi_packet_push( pat_pid->u.p_pat->handle, p_frame->p_buffer );
+ vlc_frame_Release( p_frame );
}
-static void BuildPMTCallback( void *p_opaque, block_t *p_block )
+static void BuildPMTCallback( void *p_opaque, vlc_frame_t *p_frame )
{
ts_pid_t *program_pid = (ts_pid_t *) p_opaque;
assert(program_pid->type == TYPE_PMT);
- while( p_block )
+ while( p_frame )
{
dvbpsi_packet_push( program_pid->u.p_pmt->handle,
- p_block->p_buffer );
- block_t *p_next = p_block->p_next;
- block_Release( p_block );
- p_block = p_next;
+ p_frame->p_buffer );
+ vlc_frame_t *p_next = p_frame->p_next;
+ vlc_frame_Release( p_frame );
+ p_frame = p_next;
}
}
diff --git a/modules/demux/mpeg/ts_metadata.c b/modules/demux/mpeg/ts_metadata.c
index 906a0a9fcb..dc19b4253e 100644
--- a/modules/demux/mpeg/ts_metadata.c
+++ b/modules/demux/mpeg/ts_metadata.c
@@ -23,7 +23,7 @@
#include <vlc_common.h>
#include <vlc_meta.h>
#include <vlc_es_out.h>
-#include <vlc_block.h>
+#include <vlc_frame.h>
#include "ts_pid.h"
#include "ts_streams.h"
@@ -57,14 +57,14 @@ static void Metadata_stream_processor_Delete( ts_stream_processor_t *h )
free( h );
}
-static block_t * Metadata_stream_processor_Push( ts_stream_processor_t *h, uint8_t i_stream_id, block_t *p_block )
+static vlc_frame_t * Metadata_stream_processor_Push( ts_stream_processor_t *h, uint8_t i_stream_id, vlc_frame_t *p_frame )
{
Metadata_stream_processor_context_t *ctx = (Metadata_stream_processor_context_t *) h->priv;
ts_es_t *p_es = ctx->p_stream->p_es;
if( i_stream_id != 0xbd )
{
- block_Release( p_block );
+ vlc_frame_Release( p_frame );
return NULL;
}
@@ -73,13 +73,13 @@ static block_t * Metadata_stream_processor_Push( ts_stream_processor_t *h, uint8
vlc_meta_t *p_meta = vlc_meta_New();
if( p_meta )
{
- (void) ID3TAG_Parse( p_block->p_buffer, p_block->i_buffer, ID3TAG_Parse_Handler, p_meta );
+ (void) ID3TAG_Parse( p_frame->p_buffer, p_frame->i_buffer, ID3TAG_Parse_Handler, p_meta );
es_out_Control( ctx->out, ES_OUT_SET_GROUP_META, p_es->p_program->i_number, p_meta );
vlc_meta_Delete( p_meta );
}
}
- return p_block;
+ return p_frame;
}
ts_stream_processor_t *Metadata_stream_processor_New( ts_stream_t *p_stream, es_out_t *out )
diff --git a/modules/demux/mpeg/ts_scte.c b/modules/demux/mpeg/ts_scte.c
index 1dc4b71f11..23932db803 100644
--- a/modules/demux/mpeg/ts_scte.c
+++ b/modules/demux/mpeg/ts_scte.c
@@ -62,12 +62,12 @@ void SCTE18_Section_Callback( dvbpsi_t *p_handle, const dvbpsi_psi_section_t* p_
const ts_pmt_t *p_pmt = p_es->p_program;
const stime_t i_date = TimeStampWrapAround( p_pmt->pcr.i_first, p_pmt->pcr.i_current );
- block_t *p_block = block_Alloc( p_section->p_payload_end - p_section->p_payload_start );
- memcpy( p_block->p_buffer, p_section->p_payload_start, i_payload );
- p_block->i_dts = p_block->i_pts = FROM_SCALE( i_date );
+ vlc_frame_t *p_frame = vlc_frame_Alloc( p_section->p_payload_end - p_section->p_payload_start );
+ memcpy( p_frame->p_buffer, p_section->p_payload_start, i_payload );
+ p_frame->i_dts = p_frame->i_pts = FROM_SCALE( i_date );
es_out_Control( p_demux->out, ES_OUT_SET_ES_STATE, p_es->id, true );
- es_out_Send( p_demux->out, p_es->id, p_block );
+ es_out_Send( p_demux->out, p_es->id, p_frame );
}
}
}
@@ -83,7 +83,7 @@ void SCTE27_Section_Callback( demux_t *p_demux,
ts_pmt_t *p_pmt = p_pes->p_es->p_program;
stime_t i_date = p_pmt->pcr.i_current;
- block_t *p_content = block_Alloc( i_sectiondata );
+ vlc_frame_t *p_content = vlc_frame_Alloc( i_sectiondata );
if( unlikely(!p_content) || unlikely(!p_pes->p_es->id) )
return;
memcpy( p_content->p_buffer, p_sectiondata, i_sectiondata );
@@ -117,5 +117,5 @@ void SCTE27_Section_Callback( demux_t *p_demux,
if( p_pes->p_es->id )
es_out_Send( p_demux->out, p_pes->p_es->id, p_content );
else
- block_Release( p_content );
+ vlc_frame_Release( p_content );
}
diff --git a/modules/demux/mpeg/ts_sl.c b/modules/demux/mpeg/ts_sl.c
index 60354c234f..93c78776fd 100644
--- a/modules/demux/mpeg/ts_sl.c
+++ b/modules/demux/mpeg/ts_sl.c
@@ -194,8 +194,8 @@ void SLPackets_Section_Handler( demux_t *p_demux,
typedef struct
{
- block_t *p_au;
- block_t **pp_au_last;
+ vlc_frame_t *p_au;
+ vlc_frame_t **pp_au_last;
ts_stream_t *p_stream;
} SL_stream_processor_context_t;
@@ -203,7 +203,7 @@ typedef struct
static void SL_stream_processor_Delete( ts_stream_processor_t *h )
{
SL_stream_processor_context_t *ctx = (SL_stream_processor_context_t *) h->priv;
- block_ChainRelease( ctx->p_au );
+ vlc_frame_ChainRelease( ctx->p_au );
free( ctx );
free( h );
}
@@ -211,12 +211,12 @@ static void SL_stream_processor_Delete( ts_stream_processor_t *h )
static void SL_stream_processor_Reset( ts_stream_processor_t *h )
{
SL_stream_processor_context_t *ctx = (SL_stream_processor_context_t *) h->priv;
- block_ChainRelease( ctx->p_au );
+ vlc_frame_ChainRelease( ctx->p_au );
ctx->p_au = NULL;
ctx->pp_au_last = &ctx->p_au;
}
-static block_t * SL_stream_processor_Push( ts_stream_processor_t *h, uint8_t i_stream_id, block_t *p_block )
+static vlc_frame_t * SL_stream_processor_Push( ts_stream_processor_t *h, uint8_t i_stream_id, vlc_frame_t *p_frame )
{
SL_stream_processor_context_t *ctx = (SL_stream_processor_context_t *) h->priv;
ts_es_t *p_es = ctx->p_stream->p_es;
@@ -224,43 +224,43 @@ static block_t * SL_stream_processor_Push( ts_stream_processor_t *h, uint8_t i_s
if( ((i_stream_id & 0xFE) != 0xFA) /* 0xFA || 0xFB */ )
{
- block_Release( p_block );
+ vlc_frame_Release( p_frame );
return NULL;
}
const es_mpeg4_descriptor_t *p_desc = GetMPEG4DescByEsId( p_pmt, p_es->i_sl_es_id );
if(!p_desc)
{
- block_Release( p_block );
- p_block = NULL;
+ vlc_frame_Release( p_frame );
+ p_frame = NULL;
}
else
{
- sl_header_data header = DecodeSLHeader( p_block->i_buffer, p_block->p_buffer,
+ sl_header_data header = DecodeSLHeader( p_frame->i_buffer, p_frame->p_buffer,
&p_desc->sl_descr );
- p_block->i_buffer -= header.i_size;
- p_block->p_buffer += header.i_size;
- p_block->i_dts = header.i_dts ? header.i_dts : p_block->i_dts;
- p_block->i_pts = header.i_pts ? header.i_pts : p_block->i_pts;
+ p_frame->i_buffer -= header.i_size;
+ p_frame->p_buffer += header.i_size;
+ p_frame->i_dts = header.i_dts ? header.i_dts : p_frame->i_dts;
+ p_frame->i_pts = header.i_pts ? header.i_pts : p_frame->i_pts;
/* Assemble access units */
if( header.b_au_start && ctx->p_au )
{
- block_ChainRelease( ctx->p_au );
+ vlc_frame_ChainRelease( ctx->p_au );
ctx->p_au = NULL;
ctx->pp_au_last = &ctx->p_au;
}
- block_ChainLastAppend( &ctx->pp_au_last, p_block );
- p_block = NULL;
+ vlc_frame_ChainLastAppend( &ctx->pp_au_last, p_frame );
+ p_frame = NULL;
if( header.b_au_end && ctx->p_au )
{
- p_block = block_ChainGather( ctx->p_au );
+ p_frame = vlc_frame_ChainGather( ctx->p_au );
ctx->p_au = NULL;
ctx->pp_au_last = &ctx->p_au;
}
}
- return p_block;
+ return p_frame;
}
ts_stream_processor_t *SL_stream_processor_New( ts_stream_t *p_stream )
diff --git a/modules/demux/mpeg/ts_streams.c b/modules/demux/mpeg/ts_streams.c
index e266b6e37e..61faeaeb42 100644
--- a/modules/demux/mpeg/ts_streams.c
+++ b/modules/demux/mpeg/ts_streams.c
@@ -303,7 +303,7 @@ void ts_stream_Del( demux_t *p_demux, ts_stream_t *pes )
ts_pes_ChainDelete_es( p_demux, pes->p_es );
if( pes->gather.p_data )
- block_ChainRelease( pes->gather.p_data );
+ vlc_frame_ChainRelease( pes->gather.p_data );
if( pes->p_sections_proc )
ts_sections_processor_ChainDelete( pes->p_sections_proc );
@@ -312,7 +312,7 @@ void ts_stream_Del( demux_t *p_demux, ts_stream_t *pes )
ts_stream_processor_Delete( pes->p_proc );
if( pes->prepcr.p_head )
- block_ChainRelease( pes->prepcr.p_head );
+ vlc_frame_ChainRelease( pes->prepcr.p_head );
free( pes );
}
diff --git a/modules/demux/mpeg/ts_streams.h b/modules/demux/mpeg/ts_streams.h
index 982c1a0576..35b1dae9a7 100644
--- a/modules/demux/mpeg/ts_streams.h
+++ b/modules/demux/mpeg/ts_streams.h
@@ -32,7 +32,7 @@ struct ts_stream_processor_t
void *priv;
void (*pf_delete)(ts_stream_processor_t *);
void (*pf_reset) (ts_stream_processor_t *);
- block_t * (*pf_push) (ts_stream_processor_t *, uint8_t, block_t * );
+ vlc_frame_t * (*pf_push) (ts_stream_processor_t *, uint8_t, vlc_frame_t * );
};
static inline void ts_stream_processor_Delete( ts_stream_processor_t *sp )
@@ -47,7 +47,7 @@ static inline void ts_stream_processor_Reset( ts_stream_processor_t *sp )
sp->pf_reset( sp );
}
-static inline block_t * ts_stream_processor_Push( ts_stream_processor_t *sp, uint8_t i_stream_id, block_t *b )
+static inline vlc_frame_t * ts_stream_processor_Push( ts_stream_processor_t *sp, uint8_t i_stream_id, vlc_frame_t *b )
{
return (sp) ? sp->pf_push( sp, i_stream_id, b ) : b;
}
diff --git a/modules/demux/mpeg/ts_streams_private.h b/modules/demux/mpeg/ts_streams_private.h
index 9836900806..11355eecd7 100644
--- a/modules/demux/mpeg/ts_streams_private.h
+++ b/modules/demux/mpeg/ts_streams_private.h
@@ -122,8 +122,8 @@ struct ts_stream_t
{
size_t i_data_size;
size_t i_gathered;
- block_t *p_data;
- block_t **pp_last;
+ vlc_frame_t *p_data;
+ vlc_frame_t **pp_last;
uint8_t saved[5];
size_t i_saved;
} gather;
@@ -135,8 +135,8 @@ struct ts_stream_t
struct
{
- block_t *p_head;
- block_t **pp_last;
+ vlc_frame_t *p_head;
+ vlc_frame_t **pp_last;
} prepcr;
};
diff --git a/modules/demux/nsv.c b/modules/demux/nsv.c
index eef57b26a7..f255fa5cd2 100644
--- a/modules/demux/nsv.c
+++ b/modules/demux/nsv.c
@@ -153,7 +153,7 @@ static int Demux( demux_t *p_demux )
const uint8_t *p_peek;
int i_size;
- block_t *p_frame;
+ vlc_frame_t *p_frame;
for( ;; )
{
@@ -241,7 +241,7 @@ static int Demux( demux_t *p_demux )
if( vlc_stream_Read( p_demux->s, NULL, 2 ) < 2 )
return VLC_DEMUXER_EOF;
- if( ( p_frame = vlc_stream_Block( p_demux->s, i_aux - 2 ) ) )
+ if( ( p_frame = vlc_stream_Frame( p_demux->s, i_aux - 2 ) ) )
{
uint8_t *p = p_frame->p_buffer;
@@ -262,7 +262,7 @@ static int Demux( demux_t *p_demux )
if( p_sys->p_sub )
es_out_Send( p_demux->out, p_sys->p_sub, p_frame );
else
- block_Release( p_frame );
+ vlc_frame_Release( p_frame );
}
}
else
@@ -278,7 +278,7 @@ static int Demux( demux_t *p_demux )
}
/* msg_Dbg( p_demux, "frame video size=%d", i_size ); */
- if( i_size > 0 && ( p_frame = vlc_stream_Block( p_demux->s, i_size ) ) )
+ if( i_size > 0 && ( p_frame = vlc_stream_Frame( p_demux->s, i_size ) ) )
{
p_frame->i_dts = VLC_TICK_0 + p_sys->i_pcr;
@@ -286,7 +286,7 @@ static int Demux( demux_t *p_demux )
es_out_Send( p_demux->out, p_sys->p_video, p_frame );
else
{
- block_Release( p_frame );
+ vlc_frame_Release( p_frame );
msg_Dbg( p_demux, "ignoring unsupported video frame (size=%d)",
i_size );
}
@@ -314,7 +314,7 @@ static int Demux( demux_t *p_demux )
p_sys->p_audio = es_out_Add( p_demux->out, &p_sys->fmt_audio );
}
- if( ( p_frame = vlc_stream_Block( p_demux->s, i_size ) ) )
+ if( ( p_frame = vlc_stream_Frame( p_demux->s, i_size ) ) )
{
p_frame->i_dts =
p_frame->i_pts = VLC_TICK_0 + p_sys->i_pcr;
@@ -323,7 +323,7 @@ static int Demux( demux_t *p_demux )
es_out_Send( p_demux->out, p_sys->p_audio, p_frame );
else
{
- block_Release( p_frame );
+ vlc_frame_Release( p_frame );
msg_Dbg( p_demux, "ignoring unsupported audio frame (size=%d)",
i_size );
}
diff --git a/modules/demux/nuv.c b/modules/demux/nuv.c
index 7ef9c21340..82e92f0514 100644
--- a/modules/demux/nuv.c
+++ b/modules/demux/nuv.c
@@ -102,9 +102,9 @@ typedef struct
double d_aspect; /* 1.0 squared pixel */
double d_fps;
- int i_video_blocks; /* 0 no video, -1 unknown */
- int i_audio_blocks;
- int i_text_blocks;
+ int i_video_frames; /* 0 no video, -1 unknown */
+ int i_audio_frames;
+ int i_text_frames;
int i_keyframe_distance;
@@ -296,7 +296,7 @@ static int Open( vlc_object_t * p_this )
}
/* Create audio/video (will work only with extended header and audio=mp3 */
- if( p_sys->hdr.i_video_blocks != 0 )
+ if( p_sys->hdr.i_video_frames != 0 )
{
es_format_t fmt;
@@ -312,7 +312,7 @@ static int Open( vlc_object_t * p_this )
p_sys->p_es_video = es_out_Add( p_demux->out, &fmt );
}
- if( p_sys->hdr.i_audio_blocks != 0 )
+ if( p_sys->hdr.i_audio_frames != 0 )
{
es_format_t fmt;
@@ -322,7 +322,7 @@ static int Open( vlc_object_t * p_this )
p_sys->p_es_audio = es_out_Add( p_demux->out, &fmt );
}
- if( p_sys->hdr.i_text_blocks != 0 )
+ if( p_sys->hdr.i_text_frames != 0 )
{
msg_Warn( p_demux, "text not yet supported (upload samples)" );
}
@@ -364,7 +364,7 @@ static int Demux( demux_t *p_demux )
{
demux_sys_t *p_sys = p_demux->p_sys;
frame_header_t fh;
- block_t *p_data;
+ vlc_frame_t *p_data;
for( ;; )
{
@@ -374,7 +374,7 @@ static int Demux( demux_t *p_demux )
if( fh.i_type == 'A' || fh.i_type == 'V' )
break;
- /* TODO add support for some block type */
+ /* TODO add support for some frame type */
if( fh.i_type != 'R' && fh.i_length > 0 )
{
@@ -385,7 +385,7 @@ static int Demux( demux_t *p_demux )
}
/* */
- if( ( p_data = vlc_stream_Block( p_demux->s, fh.i_length ) ) == NULL )
+ if( ( p_data = vlc_stream_Frame( p_demux->s, fh.i_length ) ) == NULL )
return VLC_DEMUXER_EOF;
p_data->i_dts = VLC_TICK_0 + (int64_t)fh.i_timecode * 1000;
@@ -411,7 +411,7 @@ static int Demux( demux_t *p_demux )
else
{
msg_Dbg( p_demux, "unsupported compression %c for audio (upload samples)", fh.i_compression );
- block_Release( p_data );
+ vlc_frame_Release( p_data );
}
}
else if( fh.i_type == 'V' && p_sys->p_es_video )
@@ -419,7 +419,7 @@ static int Demux( demux_t *p_demux )
if( fh.i_compression >='0' && fh.i_compression <='3' )
{
/* for rtjpeg data, the header is also needed */
- p_data = block_Realloc( p_data, NUV_FH_SIZE, fh.i_length );
+ p_data = vlc_frame_Realloc( p_data, NUV_FH_SIZE, fh.i_length );
if( unlikely(!p_data) )
return VLC_DEMUXER_EGENERIC;
memcpy( p_data->p_buffer, p_sys->fh_buffer, NUV_FH_SIZE );
@@ -430,12 +430,12 @@ static int Demux( demux_t *p_demux )
else
{
msg_Dbg( p_demux, "unsupported compression %c for video (upload samples)", fh.i_compression );
- block_Release( p_data );
+ vlc_frame_Release( p_data );
}
}
else
{
- block_Release( p_data );
+ vlc_frame_Release( p_data );
}
return VLC_DEMUXER_SUCCESS;
@@ -651,14 +651,14 @@ static int HeaderLoad( demux_t *p_demux, header_t *h )
h->i_mode = buffer[36];
GetDoubleLE( &h->d_aspect, &buffer[40] );
GetDoubleLE( &h->d_fps, &buffer[48] );
- h->i_video_blocks = GetDWLE( &buffer[56] );
- h->i_audio_blocks = GetDWLE( &buffer[60] );
- h->i_text_blocks = GetDWLE( &buffer[64] );
+ h->i_video_frames = GetDWLE( &buffer[56] );
+ h->i_audio_frames = GetDWLE( &buffer[60] );
+ h->i_text_frames = GetDWLE( &buffer[64] );
h->i_keyframe_distance = GetDWLE( &buffer[68] );
#if 0
msg_Dbg( p_demux, "nuv: h=%s v=%s %dx%d a=%f fps=%f v=%d a=%d t=%d kfd=%d",
h->id, h->version, h->i_width, h->i_height, h->d_aspect,
- h->d_fps, h->i_video_blocks, h->i_audio_blocks, h->i_text_blocks,
+ h->d_fps, h->i_video_frames, h->i_audio_frames, h->i_text_frames,
h->i_keyframe_distance );
#endif
diff --git a/modules/demux/ogg.c b/modules/demux/ogg.c
index b57bf968ca..2c6b2fd8a3 100644
--- a/modules/demux/ogg.c
+++ b/modules/demux/ogg.c
@@ -127,12 +127,12 @@ static int Control( demux_t *, int, va_list );
static int Ogg_ReadPage ( demux_t *, ogg_page * );
static void Ogg_DecodePacket ( demux_t *, logical_stream_t *, ogg_packet * );
static unsigned Ogg_OpusPacketDuration( ogg_packet * );
-static void Ogg_QueueBlocks( demux_t *, logical_stream_t *, block_t * );
+static void Ogg_QueueBlocks( demux_t *, logical_stream_t *, vlc_frame_t * );
static void Ogg_SendQueuedBlock( demux_t *, logical_stream_t * );
static inline bool Ogg_HasQueuedBlocks( const logical_stream_t *p_stream )
{
- return ( p_stream->queue.p_blocks != NULL );
+ return ( p_stream->queue.p_frames != NULL );
}
static void Ogg_CreateES( demux_t *p_demux );
@@ -618,9 +618,9 @@ static void Ogg_ResetStream( logical_stream_t *p_stream )
p_stream->b_interpolation_failed = false;
date_Set( &p_stream->dts, VLC_TICK_INVALID );
ogg_stream_reset( &p_stream->os );
- block_ChainRelease( p_stream->queue.p_blocks );
- p_stream->queue.p_blocks = NULL;
- p_stream->queue.pp_append = &p_stream->queue.p_blocks;
+ vlc_frame_ChainRelease( p_stream->queue.p_frames );
+ p_stream->queue.p_frames = NULL;
+ p_stream->queue.pp_append = &p_stream->queue.p_frames;
}
static void Ogg_PreparePostSeek( demux_sys_t *p_sys )
@@ -628,7 +628,7 @@ static void Ogg_PreparePostSeek( demux_sys_t *p_sys )
for( int i = 0; i < p_sys->i_streams; i++ )
{
Ogg_ResetStream( p_sys->pp_stream[i] );
- p_sys->pp_stream[i]->i_next_block_flags = BLOCK_FLAG_DISCONTINUITY;
+ p_sys->pp_stream[i]->i_next_block_flags = FRAME_FLAG_DISCONTINUITY;
}
ogg_sync_reset( &p_sys->oy );
@@ -1001,29 +1001,29 @@ static vlc_tick_t Ogg_FixupOutputQueue( demux_t *p_demux, logical_stream_t *p_st
#endif
// PASS 1, set number of samples
unsigned i_total_samples = 0;
- for( block_t *p_block = p_stream->queue.p_blocks; p_block; p_block = p_block->p_next )
+ for( vlc_frame_t *p_frame = p_stream->queue.p_frames; p_frame; p_frame = p_frame->p_next )
{
- if( p_block->i_dts != VLC_TICK_INVALID )
+ if( p_frame->i_dts != VLC_TICK_INVALID )
{
- i_enddts = p_block->i_dts;
+ i_enddts = p_frame->i_dts;
break;
}
- if( p_block->i_flags & BLOCK_FLAG_HEADER )
+ if( p_frame->i_flags & FRAME_FLAG_HEADER )
continue;
ogg_packet dumb_packet;
- dumb_packet.bytes = p_block->i_buffer;
- dumb_packet.packet = p_block->p_buffer;
+ dumb_packet.bytes = p_frame->i_buffer;
+ dumb_packet.packet = p_frame->p_buffer;
switch( p_stream->fmt.i_codec )
{
case VLC_CODEC_SPEEX:
- p_block->i_nb_samples = p_stream->special.speex.i_framesize *
+ p_frame->i_nb_samples = p_stream->special.speex.i_framesize *
p_stream->special.speex.i_framesperpacket;
break;
case VLC_CODEC_OPUS:
- p_block->i_nb_samples = Ogg_OpusPacketDuration( &dumb_packet );
+ p_frame->i_nb_samples = Ogg_OpusPacketDuration( &dumb_packet );
break;
#ifdef HAVE_LIBVORBIS
case VLC_CODEC_VORBIS:
@@ -1036,19 +1036,19 @@ static vlc_tick_t Ogg_FixupOutputQueue( demux_t *p_demux, logical_stream_t *p_st
long i_blocksize = vorbis_packet_blocksize( p_stream->special.vorbis.p_info,
&dumb_packet );
if ( i_prev_blocksize )
- p_block->i_nb_samples = ( i_blocksize + i_prev_blocksize ) / 4;
+ p_frame->i_nb_samples = ( i_blocksize + i_prev_blocksize ) / 4;
else
- p_block->i_nb_samples = i_blocksize / 2;
+ p_frame->i_nb_samples = i_blocksize / 2;
i_prev_blocksize = i_blocksize;
break;
}
#endif
default:
if( p_stream->fmt.i_cat == VIDEO_ES )
- p_block->i_nb_samples = 1;
+ p_frame->i_nb_samples = 1;
break;
}
- i_total_samples += p_block->i_nb_samples;
+ i_total_samples += p_frame->i_nb_samples;
}
// PASS 2
@@ -1057,41 +1057,41 @@ static vlc_tick_t Ogg_FixupOutputQueue( demux_t *p_demux, logical_stream_t *p_st
date_t d = p_stream->dts;
date_Set( &d, i_enddts );
i_enddts = date_Decrement( &d, i_total_samples );
- for( block_t *p_block = p_stream->queue.p_blocks; p_block; p_block = p_block->p_next )
+ for( vlc_frame_t *p_frame = p_stream->queue.p_frames; p_frame; p_frame = p_frame->p_next )
{
- if( p_block->i_dts != VLC_TICK_INVALID )
+ if( p_frame->i_dts != VLC_TICK_INVALID )
break;
- if( p_block->i_flags & BLOCK_FLAG_HEADER )
+ if( p_frame->i_flags & FRAME_FLAG_HEADER )
continue;
- p_block->i_dts = date_Get( &d );
- date_Increment( &d, p_block->i_nb_samples );
+ p_frame->i_dts = date_Get( &d );
+ date_Increment( &d, p_frame->i_nb_samples );
}
- } /* else can't do anything, no timestamped blocks in stream */
+ } /* else can't do anything, no timestamped frames in stream */
return i_enddts;
}
-static void Ogg_QueueBlocks( demux_t *p_demux, logical_stream_t *p_stream, block_t *p_block )
+static void Ogg_QueueBlocks( demux_t *p_demux, logical_stream_t *p_stream, vlc_frame_t *p_frame )
{
demux_sys_t *p_sys = p_demux->p_sys;
VLC_UNUSED(p_sys);
- if( p_block == NULL )
+ if( p_frame == NULL )
{
- assert( p_block != NULL );
+ assert( p_frame != NULL );
return;
}
- block_ChainLastAppend( &p_stream->queue.pp_append, p_block );
+ vlc_frame_ChainLastAppend( &p_stream->queue.pp_append, p_frame );
- if( p_stream->i_pcr == VLC_TICK_INVALID && p_block->i_dts != VLC_TICK_INVALID )
+ if( p_stream->i_pcr == VLC_TICK_INVALID && p_frame->i_dts != VLC_TICK_INVALID )
{
/* fixup queue */
p_stream->i_pcr = Ogg_FixupOutputQueue( p_demux, p_stream );
}
- DemuxDebug( msg_Dbg( p_demux, "%4.4s block queued > dts %"PRId64" spcr %"PRId64" pcr %"PRId64,
- (char*)&p_stream->fmt.i_codec, p_block->i_dts, p_stream->i_pcr, p_sys->i_pcr ); )
+ DemuxDebug( msg_Dbg( p_demux, "%4.4s frame queued > dts %"PRId64" spcr %"PRId64" pcr %"PRId64,
+ (char*)&p_stream->fmt.i_codec, p_frame->i_dts, p_stream->i_pcr, p_sys->i_pcr ); )
}
static void Ogg_SendQueuedBlock( demux_t *p_demux, logical_stream_t *p_stream )
@@ -1100,22 +1100,22 @@ static void Ogg_SendQueuedBlock( demux_t *p_demux, logical_stream_t *p_stream )
if( Ogg_HasQueuedBlocks( p_stream ) )
{
- block_t *p_queued = p_stream->queue.p_blocks;
- p_stream->queue.p_blocks = p_queued->p_next;
+ vlc_frame_t *p_queued = p_stream->queue.p_frames;
+ p_stream->queue.p_frames = p_queued->p_next;
p_queued->p_next = NULL;
if( p_queued->i_dts == VLC_TICK_INVALID )
p_queued->i_dts = p_queued->i_pts;
- if( p_queued->i_flags & BLOCK_FLAG_HEADER )
+ if( p_queued->i_flags & FRAME_FLAG_HEADER )
{
if( p_sys->i_nzpcr_offset > 0 || /* Don't send metadata from chained streams */
p_stream->fmt.i_extra > 0 ) /* Don't send metadata if configured by extradata */
{
- block_Release( p_queued );
+ vlc_frame_Release( p_queued );
goto end;
}
- p_queued->i_flags &= ~BLOCK_FLAG_HEADER;
+ p_queued->i_flags &= ~FRAME_FLAG_HEADER;
}
unsigned i_toskip = 0;
@@ -1132,7 +1132,7 @@ static void Ogg_SendQueuedBlock( demux_t *p_demux, logical_stream_t *p_stream )
p_stream->i_skip_frames -= i_toskip;
p_queued->i_nb_samples -= i_toskip;
if( p_queued->i_nb_samples == 0 )
- p_queued->i_flags |= BLOCK_FLAG_PREROLL;
+ p_queued->i_flags |= FRAME_FLAG_PREROLL;
}
}
@@ -1140,7 +1140,7 @@ static void Ogg_SendQueuedBlock( demux_t *p_demux, logical_stream_t *p_stream )
p_stream->i_next_block_flags = 0;
p_stream->i_pcr = p_queued->i_dts;
- DemuxDebug( msg_Dbg( p_demux, "%4.4s block sent > dts %"PRId64" pts %"PRId64" spcr %"PRId64" pcr %"PRId64
+ DemuxDebug( msg_Dbg( p_demux, "%4.4s frame sent > dts %"PRId64" pts %"PRId64" spcr %"PRId64" pcr %"PRId64
" samples (%d/%d)",
(char*)&p_stream->fmt.i_codec, p_queued->i_dts,
p_queued->i_pts, p_stream->i_pcr, p_sys->i_pcr,
@@ -1151,12 +1151,12 @@ static void Ogg_SendQueuedBlock( demux_t *p_demux, logical_stream_t *p_stream )
if( p_stream->p_es )
es_out_Send( p_demux->out, p_stream->p_es, p_queued );
else
- block_Release( p_queued );
+ vlc_frame_Release( p_queued );
}
end:
- if( p_stream->queue.p_blocks == NULL )
- p_stream->queue.pp_append = &p_stream->queue.p_blocks;
+ if( p_stream->queue.p_frames == NULL )
+ p_stream->queue.pp_append = &p_stream->queue.p_frames;
}
static bool Ogg_IsHeaderPacket( const logical_stream_t *p_stream,
@@ -1178,7 +1178,7 @@ static void Ogg_DecodePacket( demux_t *p_demux,
ogg_packet *p_oggpacket )
{
demux_sys_t *p_sys = p_demux->p_sys;
- block_t *p_block;
+ vlc_frame_t *p_frame;
bool b_selected;
long i_header_len = 0;
@@ -1371,12 +1371,12 @@ static void Ogg_DecodePacket( demux_t *p_demux,
return;
}
- if( !( p_block = block_Alloc( p_oggpacket->bytes ) ) )
+ if( !( p_frame = vlc_frame_Alloc( p_oggpacket->bytes ) ) )
return;
/* Set effective timestamp */
if( i_dts != VLC_TICK_INVALID )
- p_block->i_dts = p_sys->i_nzpcr_offset + i_dts;
+ p_frame->i_dts = p_sys->i_nzpcr_offset + i_dts;
/* Vorbis and Opus can trim the end of a stream using granule positions. */
if( p_oggpacket->e_o_s )
@@ -1384,17 +1384,17 @@ static void Ogg_DecodePacket( demux_t *p_demux,
vlc_tick_t i_endtime = Ogg_GranuleToTime( p_stream, p_oggpacket->granulepos, false, false );
if( i_endtime != VLC_TICK_INVALID && i_expected_dts != VLC_TICK_INVALID )
{
- p_block->i_length = i_endtime - i_expected_dts;
- p_block->i_flags |= BLOCK_FLAG_END_OF_SEQUENCE;
+ p_frame->i_length = i_endtime - i_expected_dts;
+ p_frame->i_flags |= FRAME_FLAG_END_OF_SEQUENCE;
}
}
if( p_stream->fmt.i_codec == VLC_CODEC_OPUS ) /* also required for trimming */
- p_block->i_nb_samples = Ogg_OpusPacketDuration( p_oggpacket );
+ p_frame->i_nb_samples = Ogg_OpusPacketDuration( p_oggpacket );
- DemuxDebug( msg_Dbg(p_demux, "%4.4s block set from granule %"PRId64" to pts/pcr %"PRId64" skip %d",
+ DemuxDebug( msg_Dbg(p_demux, "%4.4s frame set from granule %"PRId64" to pts/pcr %"PRId64" skip %d",
(char *) &p_stream->fmt.i_codec, p_oggpacket->granulepos,
- p_block->i_dts, p_stream->i_skip_frames); )
+ p_frame->i_dts, p_stream->i_skip_frames); )
/* may need to preroll after a seek or in case of preskip */
@@ -1402,29 +1402,29 @@ static void Ogg_DecodePacket( demux_t *p_demux,
if ( p_stream->fmt.i_cat == VIDEO_ES )
{
if( Ogg_IsKeyFrame( p_stream, p_oggpacket ) )
- p_block->i_flags |= BLOCK_FLAG_TYPE_I;
+ p_frame->i_flags |= FRAME_FLAG_TYPE_I;
if( p_stream->fmt.i_codec == VLC_CODEC_DIRAC )
{
if( p_oggpacket->granulepos > 0 )
- p_block->i_pts = Ogg_GranuleToTime( p_stream, p_oggpacket->granulepos, true, true );
+ p_frame->i_pts = Ogg_GranuleToTime( p_stream, p_oggpacket->granulepos, true, true );
}
else if( p_stream->fmt.i_codec == VLC_CODEC_THEORA )
{
- p_block->i_pts = p_block->i_dts;
+ p_frame->i_pts = p_frame->i_dts;
}
}
else if( p_stream->fmt.i_cat == AUDIO_ES )
{
if( p_stream->b_interpolation_failed && p_oggpacket->granulepos < 0 )
- p_block->i_pts = VLC_TICK_INVALID;
+ p_frame->i_pts = VLC_TICK_INVALID;
else
- p_block->i_pts = p_block->i_dts;
+ p_frame->i_pts = p_frame->i_dts;
}
else if( p_stream->fmt.i_cat == SPU_ES )
{
- p_block->i_length = 0;
- p_block->i_pts = p_block->i_dts;
+ p_frame->i_length = 0;
+ p_frame->i_pts = p_frame->i_dts;
}
p_stream->b_interpolation_failed = false;
@@ -1434,7 +1434,7 @@ static void Ogg_DecodePacket( demux_t *p_demux,
if( p_oggpacket->bytes <= 0 )
{
msg_Dbg( p_demux, "discarding 0 sized packet" );
- block_Release( p_block );
+ vlc_frame_Release( p_frame );
return;
}
/* We remove the header from the packet */
@@ -1444,7 +1444,7 @@ static void Ogg_DecodePacket( demux_t *p_demux,
if( i_header_len >= p_oggpacket->bytes )
{
msg_Dbg( p_demux, "discarding invalid packet" );
- block_Release( p_block );
+ vlc_frame_Release( p_frame );
return;
}
@@ -1467,24 +1467,24 @@ static void Ogg_DecodePacket( demux_t *p_demux,
p_oggpacket->packet[i_header_len + 1] != '\n' &&
p_oggpacket->packet[i_header_len + 1] != '\r' ) )
{
- p_block->i_length = (vlc_tick_t)lenbytes * 1000;
+ p_frame->i_length = (vlc_tick_t)lenbytes * 1000;
}
}
i_header_len++;
- if( p_block->i_buffer >= (unsigned int)i_header_len )
- p_block->i_buffer -= i_header_len;
+ if( p_frame->i_buffer >= (unsigned int)i_header_len )
+ p_frame->i_buffer -= i_header_len;
else
- p_block->i_buffer = 0;
+ p_frame->i_buffer = 0;
}
if( b_header )
- p_block->i_flags |= BLOCK_FLAG_HEADER;
+ p_frame->i_flags |= FRAME_FLAG_HEADER;
- memcpy( p_block->p_buffer, p_oggpacket->packet + i_header_len,
+ memcpy( p_frame->p_buffer, p_oggpacket->packet + i_header_len,
p_oggpacket->bytes - i_header_len );
- Ogg_QueueBlocks( p_demux, p_stream, p_block );
+ Ogg_QueueBlocks( p_demux, p_stream, p_frame );
}
static unsigned Ogg_OpusPacketDuration( ogg_packet *p_oggpacket )
@@ -2275,7 +2275,7 @@ static void Ogg_LogicalStreamInit( logical_stream_t *p_stream )
date_Set( &p_stream->dts, VLC_TICK_INVALID );
p_stream->b_initializing = true;
p_stream->b_contiguous = true; /* default */
- p_stream->queue.pp_append = &p_stream->queue.p_blocks;
+ p_stream->queue.pp_append = &p_stream->queue.p_frames;
}
/**
@@ -2307,7 +2307,7 @@ static void Ogg_LogicalStreamDelete( demux_t *p_demux, logical_stream_t *p_strea
p_sys->p_skelstream = NULL;
/* Shouldn't happen */
- block_ChainRelease( p_stream->queue.p_blocks );
+ vlc_frame_ChainRelease( p_stream->queue.p_frames );
free( p_stream );
}
diff --git a/modules/demux/ogg.h b/modules/demux/ogg.h
index 5c4523032d..f77b5219e6 100644
--- a/modules/demux/ogg.h
+++ b/modules/demux/ogg.h
@@ -47,7 +47,7 @@ typedef struct ogg_skeleton_t ogg_skeleton_t;
typedef struct backup_queue
{
- block_t *p_block;
+ vlc_frame_t *p_frame;
vlc_tick_t i_duration;
} backup_queue_t;
@@ -107,11 +107,11 @@ typedef struct logical_stream_s
/* for Annodex logical bitstreams */
int i_secondary_header_packets;
- /* All blocks which can't be sent because track PCR isn't known yet */
+ /* All frames which can't be sent because track PCR isn't known yet */
struct
{
- block_t *p_blocks;
- block_t **pp_append;
+ vlc_frame_t *p_frames;
+ vlc_frame_t **pp_append;
} queue;
union
diff --git a/modules/demux/pva.c b/modules/demux/pva.c
index 72a7a9482a..9a46cbfd5f 100644
--- a/modules/demux/pva.c
+++ b/modules/demux/pva.c
@@ -63,8 +63,8 @@ typedef struct
int i_ac;
/* audio/video block */
- block_t *p_pes; /* audio */
- block_t *p_es; /* video */
+ vlc_frame_t *p_pes; /* audio */
+ vlc_frame_t *p_es; /* video */
int64_t b_pcr_audio;
} demux_sys_t;
@@ -129,8 +129,8 @@ static void Close( vlc_object_t *p_this )
demux_t *p_demux = (demux_t*)p_this;
demux_sys_t *p_sys = p_demux->p_sys;
- block_ChainRelease( p_sys->p_es );
- block_ChainRelease( p_sys->p_pes );
+ vlc_frame_ChainRelease( p_sys->p_es );
+ vlc_frame_ChainRelease( p_sys->p_pes );
free( p_sys );
}
@@ -147,7 +147,7 @@ static int Demux( demux_t *p_demux )
const uint8_t *p_peek;
int i_size;
- block_t *p_frame;
+ vlc_frame_t *p_frame;
int64_t i_pts;
int i_skip;
@@ -183,7 +183,7 @@ static int Demux( demux_t *p_demux )
msg_Dbg( p_demux, "packet lost (video)" );
if( p_sys->p_es )
{
- block_ChainRelease( p_sys->p_es );
+ vlc_frame_ChainRelease( p_sys->p_es );
p_sys->p_es = NULL;
}
}
@@ -196,18 +196,18 @@ static int Demux( demux_t *p_demux )
{
int i_pre = p_peek[5]&0x3;
- if( ( p_frame = vlc_stream_Block( p_demux->s, 8 + 4 + i_pre ) ) )
+ if( ( p_frame = vlc_stream_Frame( p_demux->s, 8 + 4 + i_pre ) ) )
{
i_pts = GetDWBE( &p_frame->p_buffer[8] );
if( p_frame->i_buffer > 12 )
{
p_frame->p_buffer += 12;
p_frame->i_buffer -= 12;
- block_ChainAppend( &p_sys->p_es, p_frame );
+ vlc_frame_ChainAppend( &p_sys->p_es, p_frame );
}
else
{
- block_Release( p_frame );
+ vlc_frame_Release( p_frame );
}
}
i_size -= 4 + i_pre;
@@ -221,7 +221,7 @@ static int Demux( demux_t *p_demux )
es_out_SetPCR( p_demux->out, p_frame->i_pts);
}
- p_frame = block_ChainGather( p_frame );
+ p_frame = vlc_frame_ChainGather( p_frame );
if( likely(p_frame) )
es_out_Send( p_demux->out, p_sys->p_video, p_frame );
@@ -229,13 +229,13 @@ static int Demux( demux_t *p_demux )
}
}
- if( ( p_frame = vlc_stream_Block( p_demux->s, i_size + i_skip ) ) )
+ if( ( p_frame = vlc_stream_Frame( p_demux->s, i_size + i_skip ) ) )
{
p_frame->p_buffer += i_skip;
p_frame->i_buffer -= i_skip;
if( i_pts >= 0 )
p_frame->i_pts = FROM_SCALE(i_pts);
- block_ChainAppend( &p_sys->p_es, p_frame );
+ vlc_frame_ChainAppend( &p_sys->p_es, p_frame );
}
break;
@@ -249,7 +249,7 @@ static int Demux( demux_t *p_demux )
msg_Dbg( p_demux, "packet lost (audio)" );
if( p_sys->p_pes )
{
- block_ChainRelease( p_sys->p_pes );
+ vlc_frame_ChainRelease( p_sys->p_pes );
p_sys->p_pes = NULL;
}
}
@@ -259,7 +259,7 @@ static int Demux( demux_t *p_demux )
{
ParsePES( p_demux );
}
- if( ( p_frame = vlc_stream_Block( p_demux->s, i_size + 8 ) ) )
+ if( ( p_frame = vlc_stream_Frame( p_demux->s, i_size + 8 ) ) )
{
p_frame->p_buffer += 8;
p_frame->i_buffer -= 8;
@@ -272,7 +272,7 @@ static int Demux( demux_t *p_demux )
{
ParsePES( p_demux );
}
- block_ChainAppend( &p_sys->p_pes, p_frame );
+ vlc_frame_ChainAppend( &p_sys->p_pes, p_frame );
}
break;
@@ -395,7 +395,7 @@ static int ReSynch( demux_t *p_demux )
static void ParsePES( demux_t *p_demux )
{
demux_sys_t *p_sys = p_demux->p_sys;
- block_t *p_pes = p_sys->p_pes;
+ vlc_frame_t *p_pes = p_sys->p_pes;
uint8_t hdr[30];
unsigned i_skip;
@@ -405,14 +405,14 @@ static void ParsePES( demux_t *p_demux )
p_sys->p_pes = NULL;
/* FIXME find real max size */
- block_ChainExtract( p_pes, hdr, 30 );
+ vlc_frame_ChainExtract( p_pes, hdr, 30 );
/* See §2.4.3.6 of ISO 13818-1 */
if( hdr[0] != 0 || hdr[1] != 0 || hdr[2] != 1 )
{
msg_Warn( p_demux, "invalid hdr [0x%2.2x:%2.2x:%2.2x:%2.2x]",
hdr[0], hdr[1],hdr[2],hdr[3] );
- block_ChainRelease( p_pes );
+ vlc_frame_ChainRelease( p_pes );
return;
}
// hdr[4] i_pes_size, 2 bytes
@@ -430,12 +430,12 @@ static void ParsePES( demux_t *p_demux )
}
}
- p_pes = block_ChainGather( p_pes );
+ p_pes = vlc_frame_ChainGather( p_pes );
if( unlikely(p_pes == NULL) )
return;
if( p_pes->i_buffer <= i_skip )
{
- block_ChainRelease( p_pes );
+ vlc_frame_ChainRelease( p_pes );
return;
}
diff --git a/modules/demux/rawaud.c b/modules/demux/rawaud.c
index 87b2112102..f1f8c6e65f 100644
--- a/modules/demux/rawaud.c
+++ b/modules/demux/rawaud.c
@@ -241,16 +241,16 @@ static void Close( vlc_object_t *p_this )
static int Demux( demux_t *p_demux )
{
demux_sys_t *p_sys = p_demux->p_sys;
- block_t *p_block;
+ vlc_frame_t *p_frame;
- p_block = vlc_stream_Block( p_demux->s, p_sys->i_frame_size );
- if( p_block == NULL )
+ p_frame = vlc_stream_Frame( p_demux->s, p_sys->i_frame_size );
+ if( p_frame == NULL )
return VLC_DEMUXER_EOF;
- p_block->i_dts = p_block->i_pts = date_Get( &p_sys->pts );
+ p_frame->i_dts = p_frame->i_pts = date_Get( &p_sys->pts );
- es_out_SetPCR( p_demux->out, p_block->i_pts );
- es_out_Send( p_demux->out, p_sys->p_es, p_block );
+ es_out_SetPCR( p_demux->out, p_frame->i_pts );
+ es_out_Send( p_demux->out, p_sys->p_es, p_frame );
date_Increment( &p_sys->pts, p_sys->i_frame_samples );
diff --git a/modules/demux/rawdv.c b/modules/demux/rawdv.c
index 8e56b44b99..129e2b84e1 100644
--- a/modules/demux/rawdv.c
+++ b/modules/demux/rawdv.c
@@ -252,7 +252,7 @@ static void Close( vlc_object_t *p_this )
static int Demux( demux_t *p_demux )
{
demux_sys_t *p_sys = p_demux->p_sys;
- block_t *p_block;
+ vlc_frame_t *p_frame;
bool b_audio = false;
if( p_sys->b_hurry_up )
@@ -263,8 +263,8 @@ static int Demux( demux_t *p_demux )
/* Call the pace control */
es_out_SetPCR( p_demux->out, VLC_TICK_0 + p_sys->i_pcr );
- p_block = vlc_stream_Block( p_demux->s, p_sys->frame_size );
- if( p_block == NULL )
+ p_frame = vlc_stream_Frame( p_demux->s, p_sys->frame_size );
+ if( p_frame == NULL )
return VLC_DEMUXER_EOF;
if( p_sys->p_es_audio )
@@ -273,17 +273,17 @@ static int Demux( demux_t *p_demux )
p_sys->p_es_audio, &b_audio );
}
- p_block->i_dts =
- p_block->i_pts = VLC_TICK_0 + p_sys->i_pcr;
+ p_frame->i_dts =
+ p_frame->i_pts = VLC_TICK_0 + p_sys->i_pcr;
if( b_audio )
{
- block_t *p_audio_block = dv_extract_audio( p_block );
- if( p_audio_block )
- es_out_Send( p_demux->out, p_sys->p_es_audio, p_audio_block );
+ vlc_frame_t *p_audio_frame = dv_extract_audio( p_frame );
+ if( p_audio_frame )
+ es_out_Send( p_demux->out, p_sys->p_es_audio, p_audio_frame );
}
- es_out_Send( p_demux->out, p_sys->p_es_video, p_block );
+ es_out_Send( p_demux->out, p_sys->p_es_video, p_frame );
if( !p_sys->b_hurry_up )
{
diff --git a/modules/demux/rawdv.h b/modules/demux/rawdv.h
index 6daaadbdb7..b91ba5e02d 100644
--- a/modules/demux/rawdv.h
+++ b/modules/demux/rawdv.h
@@ -113,10 +113,10 @@ static inline int dv_get_audio_sample_count( const uint8_t *p_buffer, int i_dsf
}
}
-static inline block_t *dv_extract_audio( block_t *p_frame_block )
+static inline vlc_frame_t *dv_extract_audio( vlc_frame_t *p_frame_block )
{
- block_t *p_block;
- uint8_t *p_frame, *p_buf;
+ vlc_frame_t *p_frame;
+ uint8_t *p_frame_buff, *p_buf;
int i_audio_quant, i_samples, i_half_ch;
const uint16_t (*audio_shuffle)[9];
int i, j, d, of;
@@ -138,15 +138,15 @@ static inline block_t *dv_extract_audio( block_t *p_frame_block )
i_samples = dv_get_audio_sample_count( &p_buf[1], i_dsf );
- p_block = block_Alloc( 4 * i_samples );
+ p_frame = vlc_frame_Alloc( 4 * i_samples );
/* for each DIF segment */
- p_frame = p_frame_block->p_buffer;
+ p_frame_buff = p_frame_block->p_buffer;
audio_shuffle = i_dsf ? dv_audio_shuffle625 : dv_audio_shuffle525;
i_half_ch = (i_dsf ? 12 : 10)/2;
for( i = 0; i < (i_dsf ? 12 : 10); i++ )
{
- p_frame += 6 * 80; /* skip DIF segment header */
+ p_frame_buff += 6 * 80; /* skip DIF segment header */
if( i_audio_quant == 1 && i == i_half_ch ) break;
@@ -163,18 +163,18 @@ static inline block_t *dv_extract_audio( block_t *p_frame_block )
if( of * 2 >= 4 * i_samples ) continue;
/* big endian */
- p_block->p_buffer[of*2] = p_frame[d+1];
- p_block->p_buffer[of*2+1] = p_frame[d];
+ p_frame->p_buffer[of*2] = p_frame_buff[d+1];
+ p_frame->p_buffer[of*2+1] = p_frame_buff[d];
- if( p_block->p_buffer[of*2+1] == 0x80 &&
- p_block->p_buffer[of*2] == 0x00 )
- p_block->p_buffer[of*2+1] = 0;
+ if( p_frame->p_buffer[of*2+1] == 0x80 &&
+ p_frame->p_buffer[of*2] == 0x00 )
+ p_frame->p_buffer[of*2+1] = 0;
}
else
{
/* 12bit quantization */
- uint16_t lc = (p_frame[d+0] << 4) | (p_frame[d+2] >> 4);
- uint16_t rc = (p_frame[d+1] << 4) | (p_frame[d+2] & 0x0f);
+ uint16_t lc = (p_frame_buff[d+0] << 4) | (p_frame_buff[d+2] >> 4);
+ uint16_t rc = (p_frame_buff[d+1] << 4) | (p_frame_buff[d+2] & 0x0f);
lc = lc == 0x800 ? 0 : dv_audio_12to16(lc);
rc = rc == 0x800 ? 0 : dv_audio_12to16(rc);
@@ -182,26 +182,26 @@ static inline block_t *dv_extract_audio( block_t *p_frame_block )
of = audio_shuffle[i][j] + (d - 8) / 3 * (i_dsf ? 108 : 90);
if( of*2 >= 4 * i_samples )
continue;
- p_block->p_buffer[of*2+0] = lc & 0xff;
- p_block->p_buffer[of*2+1] = lc >> 8;
+ p_frame->p_buffer[of*2+0] = lc & 0xff;
+ p_frame->p_buffer[of*2+1] = lc >> 8;
of = audio_shuffle[i + i_half_ch][j] + (d - 8) / 3 * (i_dsf ? 108 : 90);
if( of*2 >= 4 * i_samples )
continue;
- p_block->p_buffer[of*2+0] = rc & 0xff;
- p_block->p_buffer[of*2+1] = rc >> 8;
+ p_frame->p_buffer[of*2+0] = rc & 0xff;
+ p_frame->p_buffer[of*2+1] = rc >> 8;
++d;
}
}
- p_frame += 16 * 80; /* 15 Video DIFs + 1 Audio DIF */
+ p_frame_buff += 16 * 80; /* 15 Video DIFs + 1 Audio DIF */
}
}
- p_block->i_pts = p_frame_block->i_pts != VLC_TICK_INVALID ? p_frame_block->i_pts
+ p_frame->i_pts = p_frame_block->i_pts != VLC_TICK_INVALID ? p_frame_block->i_pts
: p_frame_block->i_dts;
- p_block->i_dts = p_frame_block->i_dts;
- return p_block;
+ p_frame->i_dts = p_frame_block->i_dts;
+ return p_frame;
}
diff --git a/modules/demux/rawvid.c b/modules/demux/rawvid.c
index 94a3b00f6a..c33e8f8134 100644
--- a/modules/demux/rawvid.c
+++ b/modules/demux/rawvid.c
@@ -198,7 +198,7 @@ valid:
goto error;
/* NB, it is not possible to handle interlaced here, since the
- * interlaced picture flags are in picture_t not block_t */
+ * interlaced picture flags are in picture_t not vlc_frame_t */
#define READ_FRAC( key, num, den ) do { \
psz_buf = strstr( psz+9, key );\
@@ -390,7 +390,7 @@ static void Close( vlc_object_t *p_this )
static int Demux( demux_t *p_demux )
{
demux_sys_t *p_sys = p_demux->p_sys;
- block_t *p_block;
+ vlc_frame_t *p_frame;
vlc_tick_t i_pcr = date_Get( &p_sys->pcr );
/* Call the pace control */
@@ -413,12 +413,12 @@ static int Demux( demux_t *p_demux )
}
}
- p_block = vlc_stream_Block( p_demux->s, p_sys->frame_size );
- if( p_block == NULL )
+ p_frame = vlc_stream_Frame( p_demux->s, p_sys->frame_size );
+ if( p_frame == NULL )
return VLC_DEMUXER_EOF;
- p_block->i_dts = p_block->i_pts = i_pcr;
- es_out_Send( p_demux->out, p_sys->p_es_video, p_block );
+ p_frame->i_dts = p_frame->i_pts = i_pcr;
+ es_out_Send( p_demux->out, p_sys->p_es_video, p_frame );
date_Increment( &p_sys->pcr, 1 );
diff --git a/modules/demux/sid.cpp b/modules/demux/sid.cpp
index 3ddec12115..3d69db481e 100644
--- a/modules/demux/sid.cpp
+++ b/modules/demux/sid.cpp
@@ -209,26 +209,26 @@ static int Demux (demux_t *demux)
{
demux_sys_t *sys = reinterpret_cast<demux_sys_t *>(demux->p_sys);
- block_t *block = block_Alloc( sys->block_size);
- if (unlikely(block==NULL))
+ vlc_frame_t *frame = vlc_frame_Alloc( sys->block_size);
+ if (unlikely(frame==NULL))
return VLC_DEMUXER_EOF;
if (!sys->tune->getStatus()) {
- block_Release (block);
+ vlc_frame_Release (frame);
return VLC_DEMUXER_EOF;
}
- int i_read = sys->player->play ((void*)block->p_buffer, block->i_buffer);
+ int i_read = sys->player->play ((void*)frame->p_buffer, frame->i_buffer);
if (i_read <= 0) {
- block_Release (block);
+ vlc_frame_Release (frame);
return VLC_DEMUXER_EOF;
}
- block->i_buffer = i_read;
- block->i_pts = block->i_dts = date_Get (&sys->pts);
+ frame->i_buffer = i_read;
+ frame->i_pts = frame->i_dts = date_Get (&sys->pts);
- es_out_SetPCR (demux->out, block->i_pts);
+ es_out_SetPCR (demux->out, frame->i_pts);
- es_out_Send (demux->out, sys->es, block);
+ es_out_Send (demux->out, sys->es, frame);
date_Increment (&sys->pts, i_read / sys->bytes_per_frame);
diff --git a/modules/demux/smf.c b/modules/demux/smf.c
index 4c4ea44e31..c290874760 100644
--- a/modules/demux/smf.c
+++ b/modules/demux/smf.c
@@ -256,7 +256,7 @@ int HandleMessage (demux_t *p_demux, mtrk_t *tr, es_out_t *out)
{
stream_t *s = p_demux->s;
demux_sys_t *sys = p_demux->p_sys;
- block_t *block;
+ vlc_frame_t *frame;
uint8_t first, event;
unsigned datalen;
@@ -279,13 +279,13 @@ int HandleMessage (demux_t *p_demux, mtrk_t *tr, es_out_t *out)
if (len == -1)
return -1;
- block = vlc_stream_Block (s, len);
- if (block == NULL)
+ frame = vlc_stream_Frame (s, len);
+ if (frame == NULL)
return -1;
- block = block_Realloc (block, 1, len);
- if (block == NULL)
+ frame = vlc_frame_Realloc (frame, 1, len);
+ if (frame == NULL)
return -1;
- block->p_buffer[0] = event;
+ frame->p_buffer[0] = event;
goto send;
}
case 0xFF: /* SMF Meta Event */
@@ -320,15 +320,15 @@ int HandleMessage (demux_t *p_demux, mtrk_t *tr, es_out_t *out)
break;
}
- /* FIXME: one message per block is very inefficient */
- block = block_Alloc (1 + datalen);
- if (block == NULL)
+ /* FIXME: one message per frame is very inefficient */
+ frame = vlc_frame_Alloc (1 + datalen);
+ if (frame == NULL)
goto skip;
- block->p_buffer[0] = event;
+ frame->p_buffer[0] = event;
if (first & 0x80)
{
- if (vlc_stream_Read(s, block->p_buffer + 1, datalen) < datalen)
+ if (vlc_stream_Read(s, frame->p_buffer + 1, datalen) < datalen)
goto error;
}
else
@@ -339,18 +339,18 @@ int HandleMessage (demux_t *p_demux, mtrk_t *tr, es_out_t *out)
goto error;
}
- block->p_buffer[1] = first;
+ frame->p_buffer[1] = first;
if (datalen > 1
- && vlc_stream_Read(s, block->p_buffer + 2, datalen - 1) < datalen - 1)
+ && vlc_stream_Read(s, frame->p_buffer + 2, datalen - 1) < datalen - 1)
goto error;
}
send:
- block->i_dts = block->i_pts = date_Get(&sys->pts);
+ frame->i_dts = frame->i_pts = date_Get(&sys->pts);
if (out != NULL)
- es_out_Send(out, sys->es, block);
+ es_out_Send(out, sys->es, frame);
else
- block_Release (block);
+ vlc_frame_Release (frame);
skip:
if (event < 0xF8)
@@ -361,7 +361,7 @@ skip:
return 0;
error:
- block_Release(block);
+ vlc_frame_Release(frame);
return -1;
}
@@ -442,7 +442,7 @@ static int Demux (demux_t *demux)
/* MIDI Tick emulation (ping the decoder every 10ms) */
if (sys->tick <= date_Get (&sys->pts))
{
- block_t *tick = block_Alloc (1);
+ vlc_frame_t *tick = vlc_frame_Alloc (1);
if (unlikely(tick == NULL))
return VLC_ENOMEM;
diff --git a/modules/demux/smooth/SmoothManager.cpp b/modules/demux/smooth/SmoothManager.cpp
index abb13d493d..d20f78bc32 100644
--- a/modules/demux/smooth/SmoothManager.cpp
+++ b/modules/demux/smooth/SmoothManager.cpp
@@ -56,14 +56,14 @@ Manifest * SmoothManager::fetchManifest()
{
std::string playlisturl(p_demux->psz_url);
- block_t *p_block = Retrieve::HTTP(VLC_OBJECT(p_demux), authStorage, playlisturl);
+ vlc_data_t *p_block = Retrieve::HTTP(VLC_OBJECT(p_demux), authStorage, playlisturl);
if(!p_block)
return NULL;
stream_t *memorystream = vlc_stream_MemoryNew(p_demux, p_block->p_buffer, p_block->i_buffer, true);
if(!memorystream)
{
- block_Release(p_block);
+ vlc_data_Release(p_block);
return NULL;
}
@@ -71,7 +71,7 @@ Manifest * SmoothManager::fetchManifest()
if(!parser.parse(true))
{
vlc_stream_Delete(memorystream);
- block_Release(p_block);
+ vlc_data_Release(p_block);
return NULL;
}
@@ -86,7 +86,7 @@ Manifest * SmoothManager::fetchManifest()
}
vlc_stream_Delete(memorystream);
- block_Release(p_block);
+ vlc_data_Release(p_block);
return manifest;
}
diff --git a/modules/demux/smooth/SmoothStream.cpp b/modules/demux/smooth/SmoothStream.cpp
index 7ebe886c88..5fe133887b 100644
--- a/modules/demux/smooth/SmoothStream.cpp
+++ b/modules/demux/smooth/SmoothStream.cpp
@@ -39,7 +39,7 @@ AbstractDemuxer *SmoothStream::newDemux(demux_t *p_realdemux, const StreamFormat
return AbstractStream::newDemux(p_realdemux, format, out, source);
}
-block_t * SmoothStream::checkBlock(block_t *p_block, bool)
+vlc_data_t * SmoothStream::checkBlock(vlc_data_t *p_block, bool)
{
return p_block;
}
diff --git a/modules/demux/smooth/SmoothStream.hpp b/modules/demux/smooth/SmoothStream.hpp
index 69fdfba18d..d4edcb1786 100644
--- a/modules/demux/smooth/SmoothStream.hpp
+++ b/modules/demux/smooth/SmoothStream.hpp
@@ -32,7 +32,7 @@ namespace smooth
SmoothStream(demux_t *);
protected:
- virtual block_t *checkBlock(block_t *, bool) /* impl */;
+ virtual vlc_data_t *checkBlock(vlc_data_t *, bool) /* impl */;
virtual AbstractDemuxer * newDemux(demux_t *, const StreamFormat &,
es_out_t *, AbstractSourceStream *) const; /* reimpl */
};
diff --git a/modules/demux/smooth/mp4/IndexReader.cpp b/modules/demux/smooth/mp4/IndexReader.cpp
index f8c6d7b511..b2922559b1 100644
--- a/modules/demux/smooth/mp4/IndexReader.cpp
+++ b/modules/demux/smooth/mp4/IndexReader.cpp
@@ -36,7 +36,7 @@ IndexReader::IndexReader(vlc_object_t *obj)
{
}
-bool IndexReader::parseIndex(block_t *p_block, BaseRepresentation *rep)
+bool IndexReader::parseIndex(vlc_data_t *p_block, BaseRepresentation *rep)
{
if(!rep || !parseBlock(p_block))
return false;
diff --git a/modules/demux/smooth/mp4/IndexReader.hpp b/modules/demux/smooth/mp4/IndexReader.hpp
index c270ddc9a5..063218e931 100644
--- a/modules/demux/smooth/mp4/IndexReader.hpp
+++ b/modules/demux/smooth/mp4/IndexReader.hpp
@@ -41,7 +41,7 @@ namespace smooth
{
public:
IndexReader(vlc_object_t *);
- bool parseIndex(block_t *, BaseRepresentation *);
+ bool parseIndex(vlc_data_t *, BaseRepresentation *);
};
}
}
diff --git a/modules/demux/smooth/playlist/ForgedInitSegment.cpp b/modules/demux/smooth/playlist/ForgedInitSegment.cpp
index 001a6d86f6..8c51aa73f2 100644
--- a/modules/demux/smooth/playlist/ForgedInitSegment.cpp
+++ b/modules/demux/smooth/playlist/ForgedInitSegment.cpp
@@ -26,6 +26,7 @@
#include "../adaptive/playlist/SegmentChunk.hpp"
#include <vlc_common.h>
+#include <vlc_data.h>
#include <cstdlib>
@@ -207,7 +208,7 @@ void ForgedInitSegment::setLanguage(const std::string &lang)
language = lang;
}
-block_t * ForgedInitSegment::buildMoovBox()
+vlc_data_t * ForgedInitSegment::buildMoovBox()
{
const Timescale &trackTimescale = inheritTimescale();
@@ -294,7 +295,7 @@ block_t * ForgedInitSegment::buildMoovBox()
if(!box)
return NULL;
- block_t *moov = box->b;
+ vlc_frame_t *fmoov = box->b;
free(box);
mp4mux_SetBrand(muxh, BRAND_isml, 0x01);
@@ -304,19 +305,34 @@ block_t * ForgedInitSegment::buildMoovBox()
mp4mux_AddExtraBrand(muxh, BRAND_smoo);
box = mp4mux_GetFtyp(muxh);
- if(box)
+ if(!box)
+ {
+ vlc_frame_Release(fmoov);
+ return NULL;
+ }
+
+ const size_t sz = fmoov->i_buffer + box->b->i_buffer;
+ vlc_data_t * moov = vlc_data_Alloc(sz);
+ if (moov == NULL)
{
- block_ChainAppend(&box->b, moov);
- moov = block_ChainGather(box->b);
+ vlc_frame_Release(fmoov);
+ vlc_frame_Release(box->b);
free(box);
+ return NULL;
}
+ memcpy(moov->p_buffer, fmoov->p_buffer, fmoov->i_buffer);
+ memcpy(&moov->p_buffer[fmoov->i_buffer], box->b->p_buffer, box->b->i_buffer);
+ vlc_frame_Release(fmoov);
+ vlc_frame_Release(box->b);
+ free(box);
+
return moov;
}
SegmentChunk* ForgedInitSegment::toChunk(size_t, BaseRepresentation *rep, AbstractConnectionManager *)
{
- block_t *moov = buildMoovBox();
+ vlc_data_t *moov = buildMoovBox();
if(moov)
{
MemoryChunkSource *source = new (std::nothrow) MemoryChunkSource(moov);
diff --git a/modules/demux/smooth/playlist/ForgedInitSegment.hpp b/modules/demux/smooth/playlist/ForgedInitSegment.hpp
index e132e5cbb2..e8a6470010 100644
--- a/modules/demux/smooth/playlist/ForgedInitSegment.hpp
+++ b/modules/demux/smooth/playlist/ForgedInitSegment.hpp
@@ -56,7 +56,7 @@ namespace smooth
private:
void fromWaveFormatEx(const uint8_t *p_data, size_t i_data);
void fromVideoInfoHeader(const uint8_t *p_data, size_t i_data);
- block_t * buildMoovBox();
+ vlc_data_t * buildMoovBox();
std::string data;
std::string type;
std::string language;
diff --git a/modules/demux/smooth/playlist/MemoryChunk.cpp b/modules/demux/smooth/playlist/MemoryChunk.cpp
index 08890f53e5..648318f8f5 100644
--- a/modules/demux/smooth/playlist/MemoryChunk.cpp
+++ b/modules/demux/smooth/playlist/MemoryChunk.cpp
@@ -23,11 +23,11 @@
#include "MemoryChunk.hpp"
-#include <vlc_block.h>
+#include <vlc_data.h>
using namespace smooth::http;
-MemoryChunkSource::MemoryChunkSource(block_t *block)
+MemoryChunkSource::MemoryChunkSource(vlc_data_t *block)
{
data = block;
i_read = 0;
@@ -37,7 +37,7 @@ MemoryChunkSource::MemoryChunkSource(block_t *block)
MemoryChunkSource::~MemoryChunkSource()
{
if(data)
- block_Release(data);
+ vlc_data_Release(data);
}
bool MemoryChunkSource::hasMoreData() const
@@ -45,9 +45,9 @@ bool MemoryChunkSource::hasMoreData() const
return i_read > contentLength;
}
-block_t * MemoryChunkSource::readBlock()
+vlc_data_t * MemoryChunkSource::readBlock()
{
- block_t *p_block = NULL;
+ vlc_data_t *p_block = NULL;
if(data)
{
p_block = data;
@@ -56,17 +56,17 @@ block_t * MemoryChunkSource::readBlock()
return p_block;
}
-block_t * MemoryChunkSource::read(size_t toread)
+vlc_data_t * MemoryChunkSource::read(size_t toread)
{
if(!data)
return NULL;
- block_t * p_block = NULL;
+ vlc_data_t * p_block = NULL;
toread = __MIN(data->i_buffer - i_read, toread);
if(toread > 0)
{
- if((p_block = block_Alloc(toread)))
+ if((p_block = vlc_data_Alloc(toread)))
{
memcpy(p_block->p_buffer, &data->p_buffer[i_read], toread);
p_block->i_buffer = toread;
diff --git a/modules/demux/smooth/playlist/MemoryChunk.hpp b/modules/demux/smooth/playlist/MemoryChunk.hpp
index 0bfc9206ba..d344743e08 100644
--- a/modules/demux/smooth/playlist/MemoryChunk.hpp
+++ b/modules/demux/smooth/playlist/MemoryChunk.hpp
@@ -31,15 +31,15 @@ namespace smooth
class MemoryChunkSource : public AbstractChunkSource
{
public:
- MemoryChunkSource(block_t *);
+ MemoryChunkSource(vlc_data_t *);
virtual ~MemoryChunkSource();
- virtual block_t * readBlock(); /* impl */
- virtual block_t * read(size_t); /* impl */
+ virtual vlc_data_t * readBlock(); /* impl */
+ virtual vlc_data_t * read(size_t); /* impl */
virtual bool hasMoreData() const; /* impl */
private:
- block_t *data;
+ vlc_data_t *data;
size_t i_read;
};
diff --git a/modules/demux/smooth/playlist/SmoothSegment.cpp b/modules/demux/smooth/playlist/SmoothSegment.cpp
index 186258b3a9..e531a65c27 100644
--- a/modules/demux/smooth/playlist/SmoothSegment.cpp
+++ b/modules/demux/smooth/playlist/SmoothSegment.cpp
@@ -36,9 +36,9 @@ SmoothSegment::SmoothSegment(SegmentInformation *parent) :
}
-void SmoothSegment::onChunkDownload(block_t **pp_block, SegmentChunk *, BaseRepresentation *rep)
+void SmoothSegment::onChunkDownload(vlc_data_t **pp_block, SegmentChunk *, BaseRepresentation *rep, bool header)
{
- if(!rep || ((*pp_block)->i_flags & BLOCK_FLAG_HEADER) == 0)
+ if(!rep || !header)
return;
IndexReader br(rep->getPlaylist()->getVLCObject());
diff --git a/modules/demux/smooth/playlist/SmoothSegment.hpp b/modules/demux/smooth/playlist/SmoothSegment.hpp
index 307d8fdf31..5c828728a5 100644
--- a/modules/demux/smooth/playlist/SmoothSegment.hpp
+++ b/modules/demux/smooth/playlist/SmoothSegment.hpp
@@ -34,7 +34,7 @@ namespace smooth
SmoothSegment(SegmentInformation * = NULL);
protected:
- virtual void onChunkDownload(block_t **, SegmentChunk *, BaseRepresentation *); //reimpl
+ virtual void onChunkDownload(vlc_data_t **, SegmentChunk *, BaseRepresentation *, bool); //reimpl
};
}
}
diff --git a/modules/demux/stl.c b/modules/demux/stl.c
index 02c10cd556..14dc585f51 100644
--- a/modules/demux/stl.c
+++ b/modules/demux/stl.c
@@ -202,7 +202,7 @@ static int Demux(demux_t *demux)
vlc_stream_Seek( demux->s, i_pos ) != VLC_SUCCESS )
return VLC_DEMUXER_EOF;
- block_t *b = vlc_stream_Block(demux->s, 128);
+ vlc_frame_t *b = vlc_stream_Frame(demux->s, 128);
if (b && b->i_buffer == 128)
{
b->i_dts =
@@ -214,7 +214,7 @@ static int Demux(demux_t *demux)
else
{
if(b)
- block_Release(b);
+ vlc_frame_Release(b);
return VLC_DEMUXER_EOF;
}
sys->current++;
diff --git a/modules/demux/subtitle.c b/modules/demux/subtitle.c
index c715402da4..5d5a50405d 100644
--- a/modules/demux/subtitle.c
+++ b/modules/demux/subtitle.c
@@ -175,7 +175,7 @@ typedef struct
/* */
subs_properties_t props;
- block_t * (*pf_convert)( const subtitle_t * );
+ vlc_frame_t * (*pf_convert)( const subtitle_t * );
} demux_sys_t;
static int ParseMicroDvd ( vlc_object_t *, subs_properties_t *, text_t *, subtitle_t *, size_t );
@@ -241,46 +241,46 @@ static char * get_language_from_filename( const char * );
* Decoder format output function
*****************************************************************************/
-static block_t *ToTextBlock( const subtitle_t *p_subtitle )
+static vlc_frame_t *ToTextFrame( const subtitle_t *p_subtitle )
{
- block_t *p_block;
+ vlc_frame_t *p_frame;
size_t i_len = strlen( p_subtitle->psz_text ) + 1;
- if( i_len <= 1 || !(p_block = block_Alloc( i_len )) )
+ if( i_len <= 1 || !(p_frame = vlc_frame_Alloc( i_len )) )
return NULL;
- memcpy( p_block->p_buffer, p_subtitle->psz_text, i_len );
+ memcpy( p_frame->p_buffer, p_subtitle->psz_text, i_len );
- return p_block;
+ return p_frame;
}
-static block_t *ToEIA608Block( const subtitle_t *p_subtitle )
+static vlc_frame_t *ToEIA608Frame( const subtitle_t *p_subtitle )
{
- block_t *p_block;
+ vlc_frame_t *p_frame;
const size_t i_len = strlen( p_subtitle->psz_text );
- const size_t i_block = (1 + i_len / 5) * 3;
+ const size_t i_frame = (1 + i_len / 5) * 3;
- if( i_len < 4 || !(p_block = block_Alloc( i_block )) )
+ if( i_len < 4 || !(p_frame = vlc_frame_Alloc( i_frame )) )
return NULL;
- p_block->i_buffer = 0;
+ p_frame->i_buffer = 0;
char *saveptr = NULL;
char *psz_tok = strtok_r( p_subtitle->psz_text, " ", &saveptr );
unsigned a, b;
while( psz_tok &&
sscanf( psz_tok, "%2x%2x", &a, &b ) == 2 &&
- i_block - p_block->i_buffer >= 3 )
+ i_frame - p_frame->i_buffer >= 3 )
{
- uint8_t *p_data = &p_block->p_buffer[p_block->i_buffer];
+ uint8_t *p_data = &p_frame->p_buffer[p_frame->i_buffer];
p_data[0] = 0xFC;
p_data[1] = a;
p_data[2] = b;
- p_block->i_buffer += 3;
+ p_frame->i_buffer += 3;
psz_tok = strtok_r( NULL, " ", &saveptr );
}
- return p_block;
+ return p_frame;
}
/*****************************************************************************
@@ -312,7 +312,7 @@ static int Open ( vlc_object_t *p_this )
p_sys->i_next_demux_date = 0;
p_sys->f_rate = 1.0;
- p_sys->pf_convert = ToTextBlock;
+ p_sys->pf_convert = ToTextFrame;
p_sys->subtitles.i_current= 0;
p_sys->subtitles.i_count = 0;
@@ -589,7 +589,7 @@ static int Open ( vlc_object_t *p_this )
else if( !strncasecmp( s, "Scenarist_SCC V1.0", 18 ) )
{
p_sys->props.i_type = SUB_TYPE_SCC;
- p_sys->pf_convert = ToEIA608Block;
+ p_sys->pf_convert = ToEIA608Frame;
break;
}
@@ -858,15 +858,15 @@ static int Demux( demux_t *p_demux )
if( p_subtitle->i_start >= 0 )
{
- block_t *p_block = p_sys->pf_convert( p_subtitle );
- if( p_block )
+ vlc_frame_t *p_frame = p_sys->pf_convert( p_subtitle );
+ if( p_frame )
{
- p_block->i_dts =
- p_block->i_pts = VLC_TICK_0 + p_subtitle->i_start * p_sys->f_rate;
+ p_frame->i_dts =
+ p_frame->i_pts = VLC_TICK_0 + p_subtitle->i_start * p_sys->f_rate;
if( p_subtitle->i_stop >= 0 && p_subtitle->i_stop >= p_subtitle->i_start )
- p_block->i_length = (p_subtitle->i_stop - p_subtitle->i_start) * p_sys->f_rate;
+ p_frame->i_length = (p_subtitle->i_stop - p_subtitle->i_start) * p_sys->f_rate;
- es_out_Send( p_demux->out, p_sys->es, p_block );
+ es_out_Send( p_demux->out, p_sys->es, p_frame );
}
}
diff --git a/modules/demux/timestamps_filter.h b/modules/demux/timestamps_filter.h
index fded8b5f5a..e9f35cf9fa 100644
--- a/modules/demux/timestamps_filter.h
+++ b/modules/demux/timestamps_filter.h
@@ -188,13 +188,13 @@ static struct tf_es_out_id_s * timestamps_filter_es_out_getID(struct tf_es_out_s
return NULL;
}
-static int timestamps_filter_es_out_Send(es_out_t *out, es_out_id_t *id, block_t *p_block)
+static int timestamps_filter_es_out_Send(es_out_t *out, es_out_id_t *id, vlc_frame_t *p_frame)
{
struct tf_es_out_s *p_sys = container_of(out, struct tf_es_out_s, es_out);
struct tf_es_out_id_s *cur = timestamps_filter_es_out_getID(p_sys, id);
timestamps_filter_push((char*)&cur->fourcc, &cur->tf,
- p_block->i_dts, p_block->i_length,
+ p_frame->i_dts, p_frame->i_length,
p_sys->b_discontinuity, cur->contiguous);
/* Record diff with last PCR */
@@ -215,12 +215,12 @@ static int timestamps_filter_es_out_Send(es_out_t *out, es_out_id_t *id, block_t
}
/* Fix timestamps */
- if(p_block->i_dts)
- p_block->i_dts += cur->tf.sequence_offset;
- if(p_block->i_pts)
- p_block->i_pts += cur->tf.sequence_offset;
+ if(p_frame->i_dts)
+ p_frame->i_dts += cur->tf.sequence_offset;
+ if(p_frame->i_pts)
+ p_frame->i_pts += cur->tf.sequence_offset;
- return es_out_Send(p_sys->original_es_out, id, p_block);
+ return es_out_Send(p_sys->original_es_out, id, p_frame);
}
static void timestamps_filter_es_out_Delete(es_out_t *out)
diff --git a/modules/demux/tta.c b/modules/demux/tta.c
index 81c162cd25..3e5285df29 100644
--- a/modules/demux/tta.c
+++ b/modules/demux/tta.c
@@ -198,12 +198,12 @@ static void Close( vlc_object_t * p_this )
static int Demux( demux_t *p_demux )
{
demux_sys_t *p_sys = p_demux->p_sys;
- block_t *p_data;
+ vlc_frame_t *p_data;
if( p_sys->i_currentframe >= p_sys->i_totalframes )
return VLC_DEMUXER_EOF;
- p_data = vlc_stream_Block( p_demux->s,
+ p_data = vlc_stream_Frame( p_demux->s,
p_sys->pi_seektable[p_sys->i_currentframe] );
if( p_data == NULL )
return VLC_DEMUXER_EOF;
diff --git a/modules/demux/ttml.c b/modules/demux/ttml.c
index 0579dbe1a6..af4e53ed27 100644
--- a/modules/demux/ttml.c
+++ b/modules/demux/ttml.c
@@ -366,14 +366,14 @@ static int Demux( demux_t* p_demux )
if( vlc_memstream_close( &stream ) == VLC_SUCCESS )
{
- block_t* p_block = block_heap_Alloc( stream.ptr, stream.length );
- if( p_block )
+ vlc_frame_t* p_frame = vlc_frame_heap_Alloc( stream.ptr, stream.length );
+ if( p_frame )
{
- p_block->i_dts =
- p_block->i_pts = VLC_TICK_0 + i_playbacktime;
- p_block->i_length = i_playbackendtime - i_playbacktime;
+ p_frame->i_dts =
+ p_frame->i_pts = VLC_TICK_0 + i_playbacktime;
+ p_frame->i_length = i_playbackendtime - i_playbacktime;
- es_out_Send( p_demux->out, p_sys->p_es, p_block );
+ es_out_Send( p_demux->out, p_sys->p_es, p_frame );
}
}
diff --git a/modules/demux/ty.c b/modules/demux/ty.c
index 7dc0439336..11150bbcf0 100644
--- a/modules/demux/ty.c
+++ b/modules/demux/ty.c
@@ -269,9 +269,9 @@ static int probe_stream(demux_t *p_demux);
static void analyze_chunk(demux_t *p_demux, const uint8_t *p_chunk);
static int parse_master(demux_t *p_demux);
-static int DemuxRecVideo( demux_t *p_demux, ty_rec_hdr_t *rec_hdr, block_t *p_block_in );
-static int DemuxRecAudio( demux_t *p_demux, ty_rec_hdr_t *rec_hdr, block_t *p_block_in );
-static int DemuxRecCc( demux_t *p_demux, ty_rec_hdr_t *rec_hdr, block_t *p_block_in );
+static int DemuxRecVideo( demux_t *p_demux, ty_rec_hdr_t *rec_hdr, vlc_frame_t *p_frame_in );
+static int DemuxRecAudio( demux_t *p_demux, ty_rec_hdr_t *rec_hdr, vlc_frame_t *p_frame_in );
+static int DemuxRecCc( demux_t *p_demux, ty_rec_hdr_t *rec_hdr, vlc_frame_t *p_frame_in );
static void DemuxDecodeXds( demux_t *p_demux, uint8_t d1, uint8_t d2 );
@@ -391,7 +391,7 @@ static int Demux( demux_t *p_demux )
{
demux_sys_t *p_sys = p_demux->p_sys;
ty_rec_hdr_t *p_rec;
- block_t *p_block_in = NULL;
+ vlc_frame_t *p_frame_in = NULL;
/*msg_Dbg(p_demux, "ty demux processing" );*/
@@ -405,7 +405,7 @@ static int Demux( demux_t *p_demux )
* - discard entire chunk if it is a PART header chunk
* - parse all the headers into record header array
* - keep a pointer of which record we're on
- * - use vlc_stream_Block() to fetch each record
+ * - use vlc_stream_Frame() to fetch each record
* - parse out PTS from PES headers
* - set PTS for data packets
* - pass the data on to the proper codec via es_out_Send()
@@ -440,12 +440,12 @@ static int Demux( demux_t *p_demux )
}
/* read in this record's payload */
- if( !( p_block_in = vlc_stream_Block( p_demux->s, l_rec_size ) ) )
+ if( !( p_frame_in = vlc_stream_Frame( p_demux->s, l_rec_size ) ) )
return VLC_DEMUXER_EOF;
/* set these as 'unknown' for now */
- p_block_in->i_pts =
- p_block_in->i_dts = VLC_TICK_INVALID;
+ p_frame_in->i_pts =
+ p_frame_in->i_dts = VLC_TICK_INVALID;
}
/*else
{
@@ -458,17 +458,17 @@ static int Demux( demux_t *p_demux )
switch( p_rec->rec_type )
{
case 0xe0: /* video */
- DemuxRecVideo( p_demux, p_rec, p_block_in );
+ DemuxRecVideo( p_demux, p_rec, p_frame_in );
break;
case 0xc0: /* audio */
- DemuxRecAudio( p_demux, p_rec, p_block_in );
+ DemuxRecAudio( p_demux, p_rec, p_frame_in );
break;
case 0x01:
case 0x02:
/* closed captions/XDS */
- DemuxRecCc( p_demux, p_rec, p_block_in );
+ DemuxRecCc( p_demux, p_rec, p_frame_in );
break;
default:
@@ -477,8 +477,8 @@ static int Demux( demux_t *p_demux )
case 0x03: /* tivo data services */
case 0x05: /* unknown, but seen regularly */
- if( p_block_in )
- block_Release( p_block_in );
+ if( p_frame_in )
+ vlc_frame_Release( p_frame_in );
}
/* */
@@ -589,7 +589,7 @@ static int find_es_header( const uint8_t *header,
* -1 partial PES hdr found, no audio data found
* 0 otherwise (complete PES found, pts extracted, pts set, buffer adjusted) */
/* TODO: HD support -- nothing known about those streams */
-static int check_sync_pes( demux_t *p_demux, block_t *p_block,
+static int check_sync_pes( demux_t *p_demux, vlc_frame_t *p_frame,
int32_t offset, int32_t rec_len )
{
demux_sys_t *p_sys = p_demux->p_sys;
@@ -611,67 +611,67 @@ static int check_sync_pes( demux_t *p_demux, block_t *p_block,
return -1;
}
/* copy the partial pes header we found */
- memcpy( p_sys->pes_buffer, p_block->p_buffer + offset,
+ memcpy( p_sys->pes_buffer, p_frame->p_buffer + offset,
rec_len - offset );
p_sys->i_pes_buf_cnt = rec_len - offset;
if( offset > 0 )
{
/* PES Header was found, but not complete, so trim the end of this record */
- p_block->i_buffer -= rec_len - offset;
+ p_frame->i_buffer -= rec_len - offset;
return 1;
}
return -1; /* partial PES, no audio data */
}
/* full PES header present, extract PTS */
- p_sys->lastAudioPTS = VLC_TICK_0 + get_pts( &p_block->p_buffer[ offset +
+ p_sys->lastAudioPTS = VLC_TICK_0 + get_pts( &p_frame->p_buffer[ offset +
p_sys->i_Pts_Offset ] );
- p_block->i_pts = p_sys->lastAudioPTS;
+ p_frame->i_pts = p_sys->lastAudioPTS;
/*msg_Dbg(p_demux, "Audio PTS %"PRId64, p_sys->lastAudioPTS );*/
/* adjust audio record to remove PES header */
- memmove(p_block->p_buffer + offset, p_block->p_buffer + offset +
+ memmove(p_frame->p_buffer + offset, p_frame->p_buffer + offset +
p_sys->i_Pes_Length, rec_len - p_sys->i_Pes_Length);
- p_block->i_buffer -= p_sys->i_Pes_Length;
+ p_frame->i_buffer -= p_sys->i_Pes_Length;
#if 0
msg_Dbg(p_demux, "pes hdr removed; buffer len=%d and has "
"%02x %02x %02x %02x %02x %02x %02x %02x "
- "%02x %02x %02x %02x %02x %02x %02x %02x", p_block->i_buffer,
- p_block->p_buffer[0], p_block->p_buffer[1],
- p_block->p_buffer[2], p_block->p_buffer[3],
- p_block->p_buffer[4], p_block->p_buffer[5],
- p_block->p_buffer[6], p_block->p_buffer[7],
- p_block->p_buffer[8], p_block->p_buffer[9],
- p_block->p_buffer[10], p_block->p_buffer[11],
- p_block->p_buffer[12], p_block->p_buffer[13],
- p_block->p_buffer[14], p_block->p_buffer[15]);
+ "%02x %02x %02x %02x %02x %02x %02x %02x", p_frame->i_buffer,
+ p_frame->p_buffer[0], p_frame->p_buffer[1],
+ p_frame->p_buffer[2], p_frame->p_buffer[3],
+ p_frame->p_buffer[4], p_frame->p_buffer[5],
+ p_frame->p_buffer[6], p_frame->p_buffer[7],
+ p_frame->p_buffer[8], p_frame->p_buffer[9],
+ p_frame->p_buffer[10], p_frame->p_buffer[11],
+ p_frame->p_buffer[12], p_frame->p_buffer[13],
+ p_frame->p_buffer[14], p_frame->p_buffer[15]);
#endif
return 0;
}
-static int DemuxRecVideo( demux_t *p_demux, ty_rec_hdr_t *rec_hdr, block_t *p_block_in )
+static int DemuxRecVideo( demux_t *p_demux, ty_rec_hdr_t *rec_hdr, vlc_frame_t *p_frame_in )
{
demux_sys_t *p_sys = p_demux->p_sys;
const int subrec_type = rec_hdr->subrec_type;
- const long l_rec_size = rec_hdr->l_rec_size; // p_block_in->i_buffer might be better
+ const long l_rec_size = rec_hdr->l_rec_size; // p_frame_in->i_buffer might be better
int esOffset1;
int i;
assert( rec_hdr->rec_type == 0xe0 );
- if( !p_block_in )
+ if( !p_frame_in )
return -1;
#if 0
msg_Dbg(p_demux, "packet buffer has "
"%02x %02x %02x %02x %02x %02x %02x %02x "
"%02x %02x %02x %02x %02x %02x %02x %02x",
- p_block_in->p_buffer[0], p_block_in->p_buffer[1],
- p_block_in->p_buffer[2], p_block_in->p_buffer[3],
- p_block_in->p_buffer[4], p_block_in->p_buffer[5],
- p_block_in->p_buffer[6], p_block_in->p_buffer[7],
- p_block_in->p_buffer[8], p_block_in->p_buffer[9],
- p_block_in->p_buffer[10], p_block_in->p_buffer[11],
- p_block_in->p_buffer[12], p_block_in->p_buffer[13],
- p_block_in->p_buffer[14], p_block_in->p_buffer[15]);
+ p_frame_in->p_buffer[0], p_frame_in->p_buffer[1],
+ p_frame_in->p_buffer[2], p_frame_in->p_buffer[3],
+ p_frame_in->p_buffer[4], p_frame_in->p_buffer[5],
+ p_frame_in->p_buffer[6], p_frame_in->p_buffer[7],
+ p_frame_in->p_buffer[8], p_frame_in->p_buffer[9],
+ p_frame_in->p_buffer[10], p_frame_in->p_buffer[11],
+ p_frame_in->p_buffer[12], p_frame_in->p_buffer[13],
+ p_frame_in->p_buffer[14], p_frame_in->p_buffer[15]);
#endif
//if( subrec_type == 0x06 || subrec_type == 0x07 )
if( subrec_type != 0x02 && subrec_type != 0x0c &&
@@ -680,13 +680,13 @@ static int DemuxRecVideo( demux_t *p_demux, ty_rec_hdr_t *rec_hdr, block_t *p_bl
/* get the PTS from this packet if it has one.
* on S1, only 0x06 has PES. On S2, however, most all do.
* Do NOT Pass the PES Header to the MPEG2 codec */
- esOffset1 = find_es_header( ty_VideoPacket, p_block_in->p_buffer, 5 );
+ esOffset1 = find_es_header( ty_VideoPacket, p_frame_in->p_buffer, 5 );
if( esOffset1 != -1 )
{
//msg_Dbg(p_demux, "Video PES hdr in pkt type 0x%02x at offset %d",
//subrec_type, esOffset1);
p_sys->lastVideoPTS = VLC_TICK_0 + get_pts(
- &p_block_in->p_buffer[ esOffset1 + VIDEO_PTS_OFFSET ] );
+ &p_frame_in->p_buffer[ esOffset1 + VIDEO_PTS_OFFSET ] );
/*msg_Dbg(p_demux, "Video rec %d PTS %"PRId64, p_sys->i_cur_rec,
p_sys->lastVideoPTS );*/
if (subrec_type != 0x06) {
@@ -694,13 +694,13 @@ static int DemuxRecVideo( demux_t *p_demux, ty_rec_hdr_t *rec_hdr, block_t *p_bl
/* The packet will have video data (& other headers) so we
* chop out the PES header and send the rest */
if (l_rec_size >= VIDEO_PES_LENGTH) {
- p_block_in->p_buffer += VIDEO_PES_LENGTH + esOffset1;
- p_block_in->i_buffer -= VIDEO_PES_LENGTH + esOffset1;
+ p_frame_in->p_buffer += VIDEO_PES_LENGTH + esOffset1;
+ p_frame_in->i_buffer -= VIDEO_PES_LENGTH + esOffset1;
} else {
msg_Dbg(p_demux, "video rec type 0x%02x has short PES"
" (%ld bytes)", subrec_type, l_rec_size);
- /* nuke this block; it's too short, but has PES marker */
- p_block_in->i_buffer = 0;
+ /* nuke this frame; it's too short, but has PES marker */
+ p_frame_in->i_buffer = 0;
}
}
}/* else
@@ -711,7 +711,7 @@ static int DemuxRecVideo( demux_t *p_demux, ty_rec_hdr_t *rec_hdr, block_t *p_bl
if(subrec_type == 0x06 )
{
/* type 6 (S1 DTivo) has no data, so we're done */
- block_Release(p_block_in);
+ vlc_frame_Release(p_frame_in);
return 0;
}
@@ -725,7 +725,7 @@ static int DemuxRecVideo( demux_t *p_demux, ty_rec_hdr_t *rec_hdr, block_t *p_bl
/* Some ty files don't have this bit set
* and it causes problems */
if (subrec_type == 0x0c && l_rec_size >= 6)
- p_block_in->p_buffer[5] |= 0x08;
+ p_frame_in->p_buffer[5] |= 0x08;
/* store the TY PTS if there is one */
if (subrec_type == 0x07) {
p_sys->l_last_ty_pts = rec_hdr->l_ty_pts;
@@ -741,10 +741,10 @@ static int DemuxRecVideo( demux_t *p_demux, ty_rec_hdr_t *rec_hdr, block_t *p_bl
p_sys->l_last_ty_pts += 35000000;
//p_sys->l_last_ty_pts += 33366667;
}
- /* set PTS for this block before we send */
+ /* set PTS for this frame before we send */
if (p_sys->lastVideoPTS != VLC_TICK_INVALID)
{
- p_block_in->i_pts = p_sys->lastVideoPTS;
+ p_frame_in->i_pts = p_sys->lastVideoPTS;
/* PTS gets used ONCE.
* Any subsequent frames we get BEFORE next PES
* header will have their PTS computed in the codec */
@@ -778,15 +778,15 @@ static int DemuxRecVideo( demux_t *p_demux, ty_rec_hdr_t *rec_hdr, block_t *p_bl
}
/* Send the CC data */
- if( p_block_in->i_pts != VLC_TICK_INVALID && p_sys->cc.i_data > 0 )
+ if( p_frame_in->i_pts != VLC_TICK_INVALID && p_sys->cc.i_data > 0 )
{
for( i = 0; i < 4; i++ )
{
if( p_sys->p_cc[i] )
{
- block_t *p_cc = block_Alloc( p_sys->cc.i_data );
- p_cc->i_flags |= BLOCK_FLAG_TYPE_I;
- p_cc->i_pts = p_block_in->i_pts;
+ vlc_frame_t *p_cc = vlc_frame_Alloc( p_sys->cc.i_data );
+ p_cc->i_flags |= FRAME_FLAG_TYPE_I;
+ p_cc->i_pts = p_frame_in->i_pts;
memcpy( p_cc->p_buffer, p_sys->cc.p_data, p_sys->cc.i_data );
es_out_Send( p_demux->out, p_sys->p_cc[i], p_cc );
@@ -797,10 +797,10 @@ static int DemuxRecVideo( demux_t *p_demux, ty_rec_hdr_t *rec_hdr, block_t *p_bl
//msg_Dbg(p_demux, "sending rec %d as video type 0x%02x",
//p_sys->i_cur_rec, subrec_type);
- es_out_Send(p_demux->out, p_sys->p_video, p_block_in);
+ es_out_Send(p_demux->out, p_sys->p_video, p_frame_in);
return 0;
}
-static int DemuxRecAudio( demux_t *p_demux, ty_rec_hdr_t *rec_hdr, block_t *p_block_in )
+static int DemuxRecAudio( demux_t *p_demux, ty_rec_hdr_t *rec_hdr, vlc_frame_t *p_frame_in )
{
demux_sys_t *p_sys = p_demux->p_sys;
const int subrec_type = rec_hdr->subrec_type;
@@ -808,19 +808,19 @@ static int DemuxRecAudio( demux_t *p_demux, ty_rec_hdr_t *rec_hdr, block_t *p_bl
int esOffset1;
assert( rec_hdr->rec_type == 0xc0 );
- if( !p_block_in )
+ if( !p_frame_in )
return -1;
#if 0
int i;
fprintf( stderr, "Audio Packet Header " );
for( i = 0 ; i < 24 ; i++ )
- fprintf( stderr, "%2.2x ", p_block_in->p_buffer[i] );
+ fprintf( stderr, "%2.2x ", p_frame_in->p_buffer[i] );
fprintf( stderr, "\n" );
#endif
if( subrec_type == 2 )
{
- /* SA or DTiVo Audio Data, no PES (continued block)
+ /* SA or DTiVo Audio Data, no PES (continued frame)
* ================================================
*/
@@ -835,19 +835,19 @@ static int DemuxRecAudio( demux_t *p_demux, ty_rec_hdr_t *rec_hdr, block_t *p_bl
{
/* don't have complete PES hdr; save what we have and return */
memcpy(&p_sys->pes_buffer[p_sys->i_pes_buf_cnt],
- p_block_in->p_buffer, l_rec_size);
+ p_frame_in->p_buffer, l_rec_size);
p_sys->i_pes_buf_cnt += l_rec_size;
/* */
- block_Release(p_block_in);
+ vlc_frame_Release(p_frame_in);
return 0;
}
/* we have enough; reconstruct this p_frame with the new hdr */
memcpy(&p_sys->pes_buffer[p_sys->i_pes_buf_cnt],
- p_block_in->p_buffer, i_need);
- /* advance the block past the PES header (don't want to send it) */
- p_block_in->p_buffer += i_need;
- p_block_in->i_buffer -= i_need;
+ p_frame_in->p_buffer, i_need);
+ /* advance the frame past the PES header (don't want to send it) */
+ p_frame_in->p_buffer += i_need;
+ p_frame_in->i_buffer -= i_need;
/* get the PTS out of this PES header (MPEG or AC3) */
if (p_sys->audio_type == TIVO_AUDIO_MPEG)
esOffset1 = find_es_header(ty_MPEGAudioPacket,
@@ -864,7 +864,7 @@ static int DemuxRecAudio( demux_t *p_demux, ty_rec_hdr_t *rec_hdr, block_t *p_bl
{
p_sys->lastAudioPTS = VLC_TICK_0 + get_pts(
&p_sys->pes_buffer[ esOffset1 + p_sys->i_Pts_Offset ] );
- p_block_in->i_pts = p_sys->lastAudioPTS;
+ p_frame_in->i_pts = p_sys->lastAudioPTS;
}
p_sys->i_pes_buf_cnt = 0;
}
@@ -876,12 +876,12 @@ static int DemuxRecAudio( demux_t *p_demux, ty_rec_hdr_t *rec_hdr, block_t *p_bl
* the first one's missing data, plus all of its own. Strange. */
if (p_sys->audio_type == TIVO_AUDIO_AC3 &&
p_sys->tivo_series == TIVO_SERIES2) {
- if (p_sys->l_ac3_pkt_size + p_block_in->i_buffer >
+ if (p_sys->l_ac3_pkt_size + p_frame_in->i_buffer >
AC3_PKT_LENGTH) {
- p_block_in->i_buffer -= 2;
+ p_frame_in->i_buffer -= 2;
p_sys->l_ac3_pkt_size = 0;
} else {
- p_sys->l_ac3_pkt_size += p_block_in->i_buffer;
+ p_sys->l_ac3_pkt_size += p_frame_in->i_buffer;
}
}
}
@@ -890,21 +890,21 @@ static int DemuxRecAudio( demux_t *p_demux, ty_rec_hdr_t *rec_hdr, block_t *p_bl
/* MPEG Audio with PES Header, either SA or DTiVo */
/* ================================================ */
esOffset1 = find_es_header( ty_MPEGAudioPacket,
- p_block_in->p_buffer, 5 );
+ p_frame_in->p_buffer, 5 );
/*msg_Dbg(p_demux, "buffer has %#02x %#02x %#02x %#02x",
- p_block_in->p_buffer[0], p_block_in->p_buffer[1],
- p_block_in->p_buffer[2], p_block_in->p_buffer[3]);
+ p_frame_in->p_buffer[0], p_frame_in->p_buffer[1],
+ p_frame_in->p_buffer[2], p_frame_in->p_buffer[3]);
msg_Dbg(p_demux, "audio ES hdr at offset %d", esOffset1);*/
/* SA PES Header, No Audio Data */
/* ================================================ */
if ( ( esOffset1 == 0 ) && ( l_rec_size == 16 ) )
{
- p_sys->lastAudioPTS = VLC_TICK_0 + get_pts( &p_block_in->p_buffer[
+ p_sys->lastAudioPTS = VLC_TICK_0 + get_pts( &p_frame_in->p_buffer[
SA_PTS_OFFSET ] );
- block_Release(p_block_in);
+ vlc_frame_Release(p_frame_in);
return 0;
/*msg_Dbg(p_demux, "SA Audio PTS %"PRId64, p_sys->lastAudioPTS );*/
}
@@ -912,26 +912,26 @@ static int DemuxRecAudio( demux_t *p_demux, ty_rec_hdr_t *rec_hdr, block_t *p_bl
/* ================================================ */
/* Check for complete PES */
- if (check_sync_pes(p_demux, p_block_in, esOffset1,
+ if (check_sync_pes(p_demux, p_frame_in, esOffset1,
l_rec_size) == -1)
{
/* partial PES header found, nothing else.
* we're done. */
- block_Release(p_block_in);
+ vlc_frame_Release(p_frame_in);
return 0;
}
#if 0
msg_Dbg(p_demux, "packet buffer has "
"%02x %02x %02x %02x %02x %02x %02x %02x "
"%02x %02x %02x %02x %02x %02x %02x %02x",
- p_block_in->p_buffer[0], p_block_in->p_buffer[1],
- p_block_in->p_buffer[2], p_block_in->p_buffer[3],
- p_block_in->p_buffer[4], p_block_in->p_buffer[5],
- p_block_in->p_buffer[6], p_block_in->p_buffer[7],
- p_block_in->p_buffer[8], p_block_in->p_buffer[9],
- p_block_in->p_buffer[10], p_block_in->p_buffer[11],
- p_block_in->p_buffer[12], p_block_in->p_buffer[13],
- p_block_in->p_buffer[14], p_block_in->p_buffer[15]);
+ p_frame_in->p_buffer[0], p_frame_in->p_buffer[1],
+ p_frame_in->p_buffer[2], p_frame_in->p_buffer[3],
+ p_frame_in->p_buffer[4], p_frame_in->p_buffer[5],
+ p_frame_in->p_buffer[6], p_frame_in->p_buffer[7],
+ p_frame_in->p_buffer[8], p_frame_in->p_buffer[9],
+ p_frame_in->p_buffer[10], p_frame_in->p_buffer[11],
+ p_frame_in->p_buffer[12], p_frame_in->p_buffer[13],
+ p_frame_in->p_buffer[14], p_frame_in->p_buffer[15]);
#endif
}
else if( subrec_type == 0x04 )
@@ -942,71 +942,71 @@ static int DemuxRecAudio( demux_t *p_demux, ty_rec_hdr_t *rec_hdr, block_t *p_bl
"Adding SA Audio Packet Size %ld", l_rec_size ); */
if (p_sys->lastAudioPTS != VLC_TICK_INVALID )
- p_block_in->i_pts = p_sys->lastAudioPTS;
+ p_frame_in->i_pts = p_sys->lastAudioPTS;
}
else if( subrec_type == 0x09 )
{
/* DTiVo AC3 Audio Data with PES Header */
/* ================================================ */
esOffset1 = find_es_header( ty_AC3AudioPacket,
- p_block_in->p_buffer, 5 );
+ p_frame_in->p_buffer, 5 );
#if 0
msg_Dbg(p_demux, "buffer has "
"%02x %02x %02x %02x %02x %02x %02x %02x "
"%02x %02x %02x %02x %02x %02x %02x %02x",
- p_block_in->p_buffer[0], p_block_in->p_buffer[1],
- p_block_in->p_buffer[2], p_block_in->p_buffer[3],
- p_block_in->p_buffer[4], p_block_in->p_buffer[5],
- p_block_in->p_buffer[6], p_block_in->p_buffer[7],
- p_block_in->p_buffer[8], p_block_in->p_buffer[9],
- p_block_in->p_buffer[10], p_block_in->p_buffer[11],
- p_block_in->p_buffer[12], p_block_in->p_buffer[13],
- p_block_in->p_buffer[14], p_block_in->p_buffer[15]);
+ p_frame_in->p_buffer[0], p_frame_in->p_buffer[1],
+ p_frame_in->p_buffer[2], p_frame_in->p_buffer[3],
+ p_frame_in->p_buffer[4], p_frame_in->p_buffer[5],
+ p_frame_in->p_buffer[6], p_frame_in->p_buffer[7],
+ p_frame_in->p_buffer[8], p_frame_in->p_buffer[9],
+ p_frame_in->p_buffer[10], p_frame_in->p_buffer[11],
+ p_frame_in->p_buffer[12], p_frame_in->p_buffer[13],
+ p_frame_in->p_buffer[14], p_frame_in->p_buffer[15]);
msg_Dbg(p_demux, "audio ES AC3 hdr at offset %d", esOffset1);
#endif
/* Check for complete PES */
- if (check_sync_pes(p_demux, p_block_in, esOffset1,
+ if (check_sync_pes(p_demux, p_frame_in, esOffset1,
l_rec_size) == -1)
{
/* partial PES header found, nothing else. we're done. */
- block_Release(p_block_in);
+ vlc_frame_Release(p_frame_in);
return 0;
}
/* S2 DTivo has invalid long AC3 packets */
if (p_sys->tivo_series == TIVO_SERIES2) {
- if (p_block_in->i_buffer > AC3_PKT_LENGTH) {
- p_block_in->i_buffer -= 2;
+ if (p_frame_in->i_buffer > AC3_PKT_LENGTH) {
+ p_frame_in->i_buffer -= 2;
p_sys->l_ac3_pkt_size = 0;
} else {
- p_sys->l_ac3_pkt_size = p_block_in->i_buffer;
+ p_sys->l_ac3_pkt_size = p_frame_in->i_buffer;
}
}
}
else
{
/* Unsupported/Unknown */
- block_Release(p_block_in);
+ vlc_frame_Release(p_frame_in);
return 0;
}
/* set PCR before we send (if PTS found) */
- if( p_block_in->i_pts != VLC_TICK_INVALID )
+ if( p_frame_in->i_pts != VLC_TICK_INVALID )
es_out_Control( p_demux->out, ES_OUT_SET_PCR,
- p_block_in->i_pts );
+ p_frame_in->i_pts );
/* Send data */
- es_out_Send( p_demux->out, p_sys->p_audio, p_block_in );
+ es_out_Send( p_demux->out, p_sys->p_audio, p_frame_in );
return 0;
}
-static int DemuxRecCc( demux_t *p_demux, ty_rec_hdr_t *rec_hdr, block_t *p_block_in )
+static int DemuxRecCc( demux_t *p_demux, ty_rec_hdr_t *rec_hdr, vlc_frame_t *p_frame_in )
{
demux_sys_t *p_sys = p_demux->p_sys;
int i_field;
- if( p_block_in )
- block_Release(p_block_in);
+ if( p_frame_in )
+ vlc_frame_Release(p_frame_in);
if( rec_hdr->rec_type == 0x01 )
i_field = 0;
diff --git a/modules/demux/vc1.c b/modules/demux/vc1.c
index efc60a7a6b..3c22d0e5b2 100644
--- a/modules/demux/vc1.c
+++ b/modules/demux/vc1.c
@@ -139,29 +139,29 @@ static void Close( vlc_object_t * p_this )
static int Demux( demux_t *p_demux)
{
demux_sys_t *p_sys = p_demux->p_sys;
- block_t *p_block_in, *p_block_out;
+ vlc_frame_t *p_frame_in, *p_frame_out;
bool b_eof = false;
- p_block_in = vlc_stream_Block( p_demux->s, VC1_PACKET_SIZE );
- if( p_block_in == NULL )
+ p_frame_in = vlc_stream_Frame( p_demux->s, VC1_PACKET_SIZE );
+ if( p_frame_in == NULL )
{
b_eof = true;
}
else
{
/* */
- p_block_in->i_dts = VLC_TICK_0;
- p_block_in->i_pts = VLC_TICK_0;
+ p_frame_in->i_dts = VLC_TICK_0;
+ p_frame_in->i_pts = VLC_TICK_0;
}
- while( (p_block_out = p_sys->p_packetizer->pf_packetize( p_sys->p_packetizer,
- p_block_in ? &p_block_in : NULL )) )
+ while( (p_frame_out = p_sys->p_packetizer->pf_packetize( p_sys->p_packetizer,
+ p_frame_in ? &p_frame_in : NULL )) )
{
- while( p_block_out )
+ while( p_frame_out )
{
- block_t *p_next = p_block_out->p_next;
+ vlc_frame_t *p_next = p_frame_out->p_next;
- p_block_out->p_next = NULL;
+ p_frame_out->p_next = NULL;
if( p_sys->p_es == NULL )
{
@@ -170,12 +170,12 @@ static int Demux( demux_t *p_demux)
}
es_out_SetPCR( p_demux->out, VLC_TICK_0 + p_sys->i_dts );
- p_block_out->i_dts = VLC_TICK_0 + p_sys->i_dts;
- p_block_out->i_pts = VLC_TICK_0 + p_sys->i_dts;
+ p_frame_out->i_dts = VLC_TICK_0 + p_sys->i_dts;
+ p_frame_out->i_pts = VLC_TICK_0 + p_sys->i_dts;
- es_out_Send( p_demux->out, p_sys->p_es, p_block_out );
+ es_out_Send( p_demux->out, p_sys->p_es, p_frame_out );
- p_block_out = p_next;
+ p_frame_out = p_next;
if( p_sys->p_packetizer->fmt_out.video.i_frame_rate > 0 &&
p_sys->p_packetizer->fmt_out.video.i_frame_rate_base > 0 )
diff --git a/modules/demux/vobsub.c b/modules/demux/vobsub.c
index 4b5444e71b..fd6e4a5d17 100644
--- a/modules/demux/vobsub.c
+++ b/modules/demux/vobsub.c
@@ -111,7 +111,7 @@ static int Control( demux_t *, int, va_list );
static int TextLoad( text_t *, stream_t *s );
static void TextUnload( text_t * );
static int ParseVobSubIDX( demux_t * );
-static int DemuxVobSub( demux_t *, block_t *);
+static int DemuxVobSub( demux_t *, vlc_frame_t *);
/*****************************************************************************
* Module initializer
@@ -363,7 +363,7 @@ static int Demux( demux_t *p_demux )
tk.p_subtitles[tk.i_current_subtitle].i_start < i_maxdate )
{
int i_pos = tk.p_subtitles[tk.i_current_subtitle].i_vobsub_location;
- block_t *p_block;
+ vlc_frame_t *p_frame;
int i_size = 0;
/* first compute SPU size */
@@ -383,29 +383,29 @@ static int Demux( demux_t *p_demux )
}
/* allocate a packet */
- if( ( p_block = block_Alloc( i_size ) ) == NULL )
+ if( ( p_frame = vlc_frame_Alloc( i_size ) ) == NULL )
{
tk.i_current_subtitle++;
continue;
}
/* read data */
- i_read = vlc_stream_Read( p_sys->p_vobsub_stream, p_block->p_buffer, i_size );
+ i_read = vlc_stream_Read( p_sys->p_vobsub_stream, p_frame->p_buffer, i_size );
if( i_read <= 6 )
{
- block_Release( p_block );
+ vlc_frame_Release( p_frame );
tk.i_current_subtitle++;
continue;
}
- p_block->i_buffer = i_read;
+ p_frame->i_buffer = i_read;
/* pts */
- p_block->i_pts = VLC_TICK_0 + tk.p_subtitles[tk.i_current_subtitle].i_start;
+ p_frame->i_pts = VLC_TICK_0 + tk.p_subtitles[tk.i_current_subtitle].i_start;
- /* demux this block */
- DemuxVobSub( p_demux, p_block );
+ /* demux this frame */
+ DemuxVobSub( p_demux, p_frame );
- block_Release( p_block );
+ vlc_frame_Release( p_frame );
tk.i_current_subtitle++;
}
@@ -632,7 +632,7 @@ static int ParseVobSubIDX( demux_t *p_demux )
return( 0 );
}
-static int DemuxVobSub( demux_t *p_demux, block_t *p_bk )
+static int DemuxVobSub( demux_t *p_demux, vlc_frame_t *p_bk )
{
demux_sys_t *p_sys = p_demux->p_sys;
uint8_t *p = p_bk->p_buffer;
@@ -642,7 +642,7 @@ static int DemuxVobSub( demux_t *p_demux, block_t *p_bk )
while( p + 6 < p_end )
{
int i_size = ps_pkt_size( p, p_end - p );
- block_t *p_pkt;
+ vlc_frame_t *p_pkt;
int i_id;
int i_spu;
@@ -668,8 +668,8 @@ static int DemuxVobSub( demux_t *p_demux, block_t *p_bk )
continue;
}
- /* Create a block */
- p_pkt = block_Alloc( i_size );
+ /* Create a frame */
+ p_pkt = vlc_frame_Alloc( i_size );
if( unlikely(p_pkt == NULL) )
break;
memcpy( p_pkt->p_buffer, p, i_size);
@@ -679,7 +679,7 @@ static int DemuxVobSub( demux_t *p_demux, block_t *p_bk )
if( (i_id&0xffe0) != 0xbd20 ||
ps_pkt_parse_pes( VLC_OBJECT(p_demux), p_pkt, 1 ) )
{
- block_Release( p_pkt );
+ vlc_frame_Release( p_pkt );
continue;
}
i_spu = i_id&0x1f;
@@ -701,7 +701,7 @@ static int DemuxVobSub( demux_t *p_demux, block_t *p_bk )
}
if( i >= p_sys->i_tracks )
{
- block_Release( p_pkt );
+ vlc_frame_Release( p_pkt );
}
}
diff --git a/modules/demux/voc.c b/modules/demux/voc.c
index 242308cb94..22d0d8abda 100644
--- a/modules/demux/voc.c
+++ b/modules/demux/voc.c
@@ -472,7 +472,7 @@ corrupt:
static int Demux( demux_t *p_demux )
{
demux_sys_t *p_sys = p_demux->p_sys;
- block_t *p_block;
+ vlc_frame_t *p_frame;
int64_t i_read_frames;
if( p_sys->i_silence_countdown == 0 )
@@ -491,10 +491,10 @@ static int Demux( demux_t *p_demux )
if( i_read_frames > MAX_READ_FRAME )
i_read_frames = MAX_READ_FRAME;
- p_block = vlc_stream_Block( p_demux->s,
+ p_frame = vlc_stream_Frame( p_demux->s,
p_sys->fmt.audio.i_bytes_per_frame
* i_read_frames );
- if( p_block == NULL )
+ if( p_frame == NULL )
{
msg_Warn( p_demux, "cannot read data" );
return VLC_DEMUXER_EOF;
@@ -506,20 +506,20 @@ static int Demux( demux_t *p_demux )
if( i_read_frames > MAX_READ_FRAME )
i_read_frames = MAX_READ_FRAME;
- p_block = block_Alloc( i_read_frames );
- if( p_block == NULL )
+ p_frame = vlc_frame_Alloc( i_read_frames );
+ if( p_frame == NULL )
return VLC_ENOMEM;
- memset( p_block->p_buffer, 0, i_read_frames );
+ memset( p_frame->p_buffer, 0, i_read_frames );
p_sys->i_silence_countdown -= i_read_frames;
}
- p_block->i_dts = p_block->i_pts = VLC_TICK_0 + date_Get( &p_sys->pts );
- p_block->i_nb_samples = i_read_frames * p_sys->fmt.audio.i_frame_length;
- date_Increment( &p_sys->pts, p_block->i_nb_samples );
- es_out_SetPCR( p_demux->out, p_block->i_pts );
+ p_frame->i_dts = p_frame->i_pts = VLC_TICK_0 + date_Get( &p_sys->pts );
+ p_frame->i_nb_samples = i_read_frames * p_sys->fmt.audio.i_frame_length;
+ date_Increment( &p_sys->pts, p_frame->i_nb_samples );
+ es_out_SetPCR( p_demux->out, p_frame->i_pts );
assert(p_sys->p_es != NULL);
- es_out_Send( p_demux->out, p_sys->p_es, p_block );
+ es_out_Send( p_demux->out, p_sys->p_es, p_frame );
return VLC_DEMUXER_SUCCESS;
}
diff --git a/modules/demux/wav.c b/modules/demux/wav.c
index 3d6fbd8b68..4f05df402a 100644
--- a/modules/demux/wav.c
+++ b/modules/demux/wav.c
@@ -453,7 +453,7 @@ error:
static int Demux( demux_t *p_demux )
{
demux_sys_t *p_sys = p_demux->p_sys;
- block_t *p_block;
+ vlc_frame_t *p_frame;
const int64_t i_pos = vlc_stream_Tell( p_demux->s );
unsigned int i_read_size = p_sys->i_frame_size;
@@ -468,25 +468,25 @@ static int Demux( demux_t *p_demux )
i_read_size = i_end - i_pos;
}
- if( ( p_block = vlc_stream_Block( p_demux->s, i_read_size ) ) == NULL )
+ if( ( p_frame = vlc_stream_Frame( p_demux->s, i_read_size ) ) == NULL )
{
msg_Warn( p_demux, "cannot read data" );
return VLC_DEMUXER_EOF;
}
- p_block->i_dts =
- p_block->i_pts = date_Get( &p_sys->pts );
+ p_frame->i_dts =
+ p_frame->i_pts = date_Get( &p_sys->pts );
/* set PCR */
- es_out_SetPCR( p_demux->out, p_block->i_pts );
+ es_out_SetPCR( p_demux->out, p_frame->i_pts );
/* Do the channel reordering */
if( p_sys->i_chans_to_reorder )
- aout_ChannelReorder( p_block->p_buffer, p_block->i_buffer,
+ aout_ChannelReorder( p_frame->p_buffer, p_frame->i_buffer,
p_sys->fmt.audio.i_channels,
p_sys->pi_chan_table, p_sys->fmt.i_codec );
- es_out_Send( p_demux->out, p_sys->p_es, p_block );
+ es_out_Send( p_demux->out, p_sys->p_es, p_frame );
date_Increment( &p_sys->pts, p_sys->i_frame_samples );
diff --git a/modules/demux/webvtt.c b/modules/demux/webvtt.c
index 23c5e36d66..93b8e4822f 100644
--- a/modules/demux/webvtt.c
+++ b/modules/demux/webvtt.c
@@ -47,7 +47,7 @@ typedef struct
es_out_id_t *es;
bool b_slave;
bool b_first_time;
- int i_next_block_flags;
+ int i_next_frame_flags;
vlc_tick_t i_next_demux_time;
vlc_tick_t i_length;
struct
@@ -93,7 +93,7 @@ static int cue_Compare( const void *a_, const void *b_ )
else return a->i_start < b->i_start ? -1 : 1;
}
-static block_t *ConvertWEBVTT( const webvtt_cue_t *p_cue, bool b_continued )
+static vlc_frame_t *ConvertWEBVTT( const webvtt_cue_t *p_cue, bool b_continued )
{
struct vlc_memstream stream;
@@ -133,7 +133,7 @@ static block_t *ConvertWEBVTT( const webvtt_cue_t *p_cue, bool b_continued )
vlc_memstream_write( &stream, p_cue->psz_text, paylsize - 8 );
if( vlc_memstream_close( &stream ) == VLC_SUCCESS )
- return block_heap_Alloc( stream.ptr, stream.length );
+ return vlc_frame_heap_Alloc( stream.ptr, stream.length );
else
return NULL;
}
@@ -266,8 +266,8 @@ static void StreamParserCueDoneHandler( void *priv, webvtt_cue_t *p_cue )
if( p_cue->psz_text )
{
- block_t *p_block = ConvertWEBVTT( p_cue, true );
- if( p_block )
+ vlc_frame_t *p_frame = ConvertWEBVTT( p_cue, true );
+ if( p_frame )
{
if ( p_sys->b_first_time )
{
@@ -275,11 +275,11 @@ static void StreamParserCueDoneHandler( void *priv, webvtt_cue_t *p_cue )
p_sys->b_first_time = false;
}
p_sys->i_next_demux_time = p_cue->i_start;
- p_block->i_dts =
- p_block->i_pts = VLC_TICK_0 + p_cue->i_start;
+ p_frame->i_dts =
+ p_frame->i_pts = VLC_TICK_0 + p_cue->i_start;
if( p_cue->i_stop >= 0 && p_cue->i_stop >= p_cue->i_start )
- p_block->i_length = p_cue->i_stop - p_cue->i_start;
- es_out_Send( p_demux->out, p_sys->es, p_block );
+ p_frame->i_length = p_cue->i_stop - p_cue->i_start;
+ es_out_Send( p_demux->out, p_sys->es, p_frame );
es_out_SetPCR( p_demux->out, p_cue->i_start + VLC_TICK_0 );
}
}
@@ -340,12 +340,12 @@ static void BuildIndex( demux_t *p_demux )
}
}
-static block_t *demux_From( demux_t *p_demux, vlc_tick_t i_start )
+static vlc_frame_t *demux_From( demux_t *p_demux, vlc_tick_t i_start )
{
demux_sys_t *p_sys = p_demux->p_sys;
- block_t *p_list = NULL;
- block_t **pp_append = &p_list;
+ vlc_frame_t *p_list = NULL;
+ vlc_frame_t **pp_append = &p_list;
for( size_t i=0; i<p_sys->cues.i_count; i++ )
{
const webvtt_cue_t *p_cue = &p_sys->cues.p_array[i];
@@ -361,7 +361,7 @@ static block_t *demux_From( demux_t *p_demux, vlc_tick_t i_start )
}
}
- return ( p_list ) ? block_ChainGather( p_list ) : NULL;
+ return ( p_list ) ? vlc_frame_ChainGather( p_list ) : NULL;
}
static int ReadWEBVTT( demux_t *p_demux )
@@ -442,7 +442,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
p_sys->b_first_time = true;
p_sys->i_next_demux_time =
p_sys->index.p_array[p_sys->index.i_current].time;
- p_sys->i_next_block_flags |= BLOCK_FLAG_DISCONTINUITY;
+ p_sys->i_next_frame_flags |= FRAME_FLAG_DISCONTINUITY;
return VLC_SUCCESS;
case DEMUX_GET_POSITION:
@@ -470,7 +470,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
p_sys->b_first_time = true;
p_sys->i_next_demux_time =
p_sys->index.p_array[p_sys->index.i_current].time;
- p_sys->i_next_block_flags |= BLOCK_FLAG_DISCONTINUITY;
+ p_sys->i_next_frame_flags |= FRAME_FLAG_DISCONTINUITY;
return VLC_SUCCESS;
}
break;
@@ -543,32 +543,32 @@ static int Demux( demux_t *p_demux )
}
}
- block_t *p_block = demux_From( p_demux, i_start_time );
- if( p_block )
+ vlc_frame_t *p_frame = demux_From( p_demux, i_start_time );
+ if( p_frame )
{
- p_block->i_length = i_end_time - i_start_time;
- p_block->i_dts = p_block->i_pts = VLC_TICK_0 + i_start_time;
+ p_frame->i_length = i_end_time - i_start_time;
+ p_frame->i_dts = p_frame->i_pts = VLC_TICK_0 + i_start_time;
- if( p_sys->i_next_block_flags )
+ if( p_sys->i_next_frame_flags )
{
- p_block->i_flags = p_sys->i_next_block_flags;
- p_sys->i_next_block_flags = 0;
+ p_frame->i_flags = p_sys->i_next_frame_flags;
+ p_sys->i_next_frame_flags = 0;
}
if ( !p_sys->b_slave && p_sys->b_first_time )
{
- es_out_SetPCR( p_demux->out, p_block->i_dts );
+ es_out_SetPCR( p_demux->out, p_frame->i_dts );
p_sys->b_first_time = false;
}
- es_out_Send( p_demux->out, p_sys->es, p_block );
+ es_out_Send( p_demux->out, p_sys->es, p_frame );
}
if( p_sys->index.i_current < p_sys->index.i_count &&
p_sys->index.p_array[p_sys->index.i_current].active > 1 )
{
/* we'll need to clear up overlaps */
- p_sys->i_next_block_flags |= BLOCK_FLAG_DISCONTINUITY;
+ p_sys->i_next_frame_flags |= FRAME_FLAG_DISCONTINUITY;
}
}
diff --git a/modules/demux/xa.c b/modules/demux/xa.c
index d90d057890..c38fda8874 100644
--- a/modules/demux/xa.c
+++ b/modules/demux/xa.c
@@ -161,7 +161,7 @@ static int Open( vlc_object_t * p_this )
static int Demux( demux_t *p_demux )
{
demux_sys_t *p_sys = p_demux->p_sys;
- block_t *p_block;
+ vlc_frame_t *p_frame;
int64_t i_offset = vlc_stream_Tell( p_demux->s );
unsigned i_frames = p_sys->i_block_frames;
@@ -171,17 +171,17 @@ static int Demux( demux_t *p_demux )
return VLC_DEMUXER_EOF;
}
- p_block = vlc_stream_Block( p_demux->s, p_sys->i_frame_size * i_frames );
- if( p_block == NULL )
+ p_frame = vlc_stream_Frame( p_demux->s, p_sys->i_frame_size * i_frames );
+ if( p_frame == NULL )
{
msg_Warn( p_demux, "cannot read data" );
return VLC_DEMUXER_EOF;
}
- i_frames = p_block->i_buffer / p_sys->i_frame_size;
- p_block->i_dts = p_block->i_pts = date_Get( &p_sys->pts );
- es_out_SetPCR( p_demux->out, p_block->i_pts );
- es_out_Send( p_demux->out, p_sys->p_es, p_block );
+ i_frames = p_frame->i_buffer / p_sys->i_frame_size;
+ p_frame->i_dts = p_frame->i_pts = date_Get( &p_sys->pts );
+ es_out_SetPCR( p_demux->out, p_frame->i_pts );
+ es_out_Send( p_demux->out, p_sys->p_es, p_frame );
date_Increment( &p_sys->pts, i_frames * FRAME_LENGTH );
--
2.20.1
More information about the vlc-devel
mailing list