Gnash  0.8.10
Classes | Public Member Functions | Static Public Attributes
gnash::media::FLVParser Class Reference

The FLVParser class parses FLV streams. More...

#include <FLVParser.h>

Inheritance diagram for gnash::media::FLVParser:
gnash::media::MediaParser

List of all members.

Classes

struct  FLVAudioTag
struct  FLVTag
struct  FLVVideoTag

Public Member Functions

 FLVParser (std::auto_ptr< IOChannel > lt)
 Create an FLV parser reading input from the given IOChannel.
 ~FLVParser ()
 Kills the parser...
virtual bool seek (boost::uint32_t &)
 Seeks to the closest possible position the given position, and returns the new position.
virtual bool parseNextChunk ()
 Parse next chunk of input.
boost::uint64_t getBytesLoaded () const
 Return number of bytes parsed so far.
bool indexingCompleted () const
 Return true of indexing is completed.
virtual void fetchMetaTags (OrderedMetaTags &tags, boost::uint64_t ts)
 Retrieve any parsed metadata tags up to a specified timestamp.

Static Public Attributes

static const size_t paddingBytes = 8
 The size of padding for all buffers that might be read by FFMPEG.

Detailed Description

The FLVParser class parses FLV streams.


Constructor & Destructor Documentation

gnash::media::FLVParser::FLVParser ( std::auto_ptr< IOChannel lt)

Create an FLV parser reading input from the given IOChannel.

Parameters:
ltIOChannel to use for input. Ownership transferred.

References gnash::media::MediaParser::startParserThread().

gnash::media::FLVParser::~FLVParser ( )

Kills the parser...

References gnash::media::MediaParser::stopParserThread().


Member Function Documentation

void gnash::media::FLVParser::fetchMetaTags ( OrderedMetaTags tags,
boost::uint64_t  ts 
) [virtual]

Retrieve any parsed metadata tags up to a specified timestamp.

This copies pointers to a SimpleBuffer of AMF data from _metaTags, then removes those pointers from the MetaTags map. Any metadata later than the timestamp is kept until fetchMetaTags is called again (or the dtor is called).

Parameters:
tsThe latest timestamp to retrieve metadata for.
tagsThis is filled with shared pointers to metatags in timestamp order. Ownership of the data is shared. It is destroyed automatically along with the last owner.

Reimplemented from gnash::media::MediaParser.

References second, and gnash::key::_1.

boost::uint64_t gnash::media::FLVParser::getBytesLoaded ( ) const [virtual]

Return number of bytes parsed so far.

Reimplemented from gnash::media::MediaParser.

References gnash::media::MediaParser::_bytesLoadedMutex, and gnash::media::MediaParser::_bytesLoaded.

bool gnash::media::FLVParser::indexingCompleted ( ) const [inline, virtual]

Return true of indexing is completed.

If this function returns false, parseNextChunk will be called even when buffers are full. Parsers supporting indexing separated from parsing should override this method and have parseNextChunk figure if they only need to index or to parse based on bufferFull.

Reimplemented from gnash::media::MediaParser.

bool gnash::media::FLVParser::parseNextChunk ( ) [virtual]

Parse next chunk of input.

The implementations are required to parse a small chunk of input, so to avoid blocking too much if parsing conditions change (ie: seek or destruction requested)

When LOAD_MEDIA_IN_A_SEPARATE_THREAD is defined, this should never be called by users (consider protected).

Implements gnash::media::MediaParser.

References gnash::media::MediaParser::bufferFull().

bool gnash::media::FLVParser::seek ( boost::uint32_t &  time) [virtual]

Seeks to the closest possible position the given position, and returns the new position.

Parameters:
timeinput/output parameter, input requests a time, output return the actual time seeked to.
Returns:
true if the seek was valid, false otherwise.

Implements gnash::media::MediaParser.

References gnash::media::MediaParser::_streamMutex, gnash::media::MediaParser::_seekRequest, gnash::media::MediaParser::_parsingComplete, and gnash::media::MediaParser::clearBuffers().


Member Data Documentation

const size_t gnash::media::FLVParser::paddingBytes = 8 [static]

The size of padding for all buffers that might be read by FFMPEG.

This possibly also applies to other media handlers (gst). Ideally this would be taken from the current Handler, but we don't know about it here.


The documentation for this class was generated from the following files: