| 
    Gnash
    0.8.11dev
    
   | 
 
Gstreamer based MediaParser. More...
#include <MediaParserGst.h>
  
 Public Member Functions | |
| MediaParserGst (std::unique_ptr< IOChannel > stream) | |
| Construct a Gstreamer-based media parser for given stream.  More... | |
| ~MediaParserGst () | |
| bool | seek (std::uint32_t &) | 
| Seeks to the closest possible position the given position, and returns the new position.  More... | |
| bool | parseNextChunk () | 
| Parse next chunk of input.  More... | |
| virtual std::uint64_t | getBytesLoaded () const | 
| Return number of bytes parsed so far.  More... | |
| virtual boost::optional< Id3Info > | getId3Info () const | 
| Get ID3 data from the parsed stream if it exists.  More... | |
| void | rememberAudioFrame (EncodedAudioFrame *frame) | 
| void | rememberVideoFrame (EncodedVideoFrame *frame) | 
  Public Member Functions inherited from gnash::media::MediaParser | |
| MediaParser (std::unique_ptr< IOChannel > stream) | |
| virtual | ~MediaParser () | 
| DSOEXPORT std::uint64_t | getBufferLength () const | 
| Returns mininum length of available buffers in milliseconds.  More... | |
| DSOEXPORT bool | isBufferEmpty () const | 
| Return true if both audio and video buffers are empty.  More... | |
| DSOEXPORT std::uint_fast64_t | getBufferTime () const | 
| Return the time we want the parser thread to maintain in the buffer.  More... | |
| DSOEXPORT void | setBufferTime (std::uint_fast64_t t) | 
| Set the time we want the parser thread to maintain in the buffer.  More... | |
| DSOEXPORT bool | nextFrameTimestamp (std::uint64_t &ts) const | 
| Get timestamp of the next frame available, if any.  More... | |
| DSOEXPORT bool | nextVideoFrameTimestamp (std::uint64_t &ts) const | 
| Get timestamp of the video frame which would be returned on nextVideoFrame.  More... | |
| DSOEXPORT std::unique_ptr< EncodedVideoFrame > | nextVideoFrame () | 
| Returns the next video frame in the parsed buffer, advancing video cursor.  More... | |
| DSOEXPORT bool | nextAudioFrameTimestamp (std::uint64_t &ts) const | 
| Get timestamp of the audio frame which would be returned on nextAudioFrame.  More... | |
| DSOEXPORT std::unique_ptr< EncodedAudioFrame > | nextAudioFrame () | 
| Returns the next audio frame in the parsed buffer, advancing audio cursor.  More... | |
| VideoInfo * | getVideoInfo () | 
| Returns a VideoInfo class about the videostream.  More... | |
| AudioInfo * | getAudioInfo () | 
| Returns a AudioInfo class about the audiostream.  More... | |
| bool | parsingCompleted () const | 
| Return true of parsing is completed.  More... | |
| virtual bool | indexingCompleted () const | 
| Return true of indexing is completed.  More... | |
| std::uint64_t | getBytesTotal () const | 
| Return total number of bytes in input.  More... | |
| virtual void | fetchMetaTags (OrderedMetaTags &tags, std::uint64_t ts) | 
| Retrieve any parsed metadata tags up to a specified timestamp.  More... | |
Additional Inherited Members | |
  Public Types inherited from gnash::media::MediaParser | |
| typedef std::multimap< std::uint64_t, std::shared_ptr< SimpleBuffer > > | MetaTags | 
| A container for executable MetaTags contained in media streams.  More... | |
| typedef std::vector< MetaTags::mapped_type > | OrderedMetaTags | 
  Protected Member Functions inherited from gnash::media::MediaParser | |
| void | startParserThread () | 
| }@  More... | |
| void | stopParserThread () | 
| Stop the parser thread.  More... | |
| void | clearBuffers () | 
| Clear the a/v buffers.  More... | |
| void | pushEncodedAudioFrame (std::unique_ptr< EncodedAudioFrame > frame) | 
| Push an encoded audio frame to buffer.  More... | |
| void | pushEncodedVideoFrame (std::unique_ptr< EncodedVideoFrame > frame) | 
| Push an encoded video frame to buffer.  More... | |
| void | parserLoop () | 
| bool | parserThreadKillRequested () const | 
| void | waitIfNeeded (std::unique_lock< std::mutex > &qMutexLock) | 
| void | wakeupParserThread () | 
| bool | bufferFull () const | 
| Method to check if buffer is full w/out locking the _qMutex.  More... | |
  Protected Attributes inherited from gnash::media::MediaParser | |
| std::unique_ptr< VideoInfo > | _videoInfo | 
| Subclasses must set the following variables:  More... | |
| std::unique_ptr< AudioInfo > | _audioInfo | 
| Info about the audio stream (if any)  More... | |
| bool | _parsingComplete | 
| Whether the parsing is complete or not.  More... | |
| std::atomic< std::uint_fast64_t > | _bytesLoaded | 
| Number of bytes loaded.  More... | |
| std::unique_ptr< IOChannel > | _stream | 
| The stream used to access the file.  More... | |
| std::mutex | _streamMutex | 
| std::atomic< std::uint_fast64_t > | _bufferTime | 
| std::thread | _parserThread | 
| std::atomic< bool > | _parserThreadKillRequested | 
| std::condition_variable | _parserThreadWakeup | 
| std::mutex | _qMutex | 
| mutex protecting access to the a/v encoded frames queues  More... | |
| bool | _seekRequest | 
Gstreamer based MediaParser.
| gnash::media::gst::MediaParserGst::MediaParserGst | ( | std::unique_ptr< IOChannel > | stream | ) | 
Construct a Gstreamer-based media parser for given stream.
Can throw a MediaException if input format couldn't be detected
References _, gnash::media::MediaParser::startParserThread(), and swfdec_gst_connect_srcpad().
| gnash::media::gst::MediaParserGst::~MediaParserGst | ( | ) | 
References gnash::media::MediaParser::stopParserThread().
      
  | 
  virtual | 
Return number of bytes parsed so far.
Reimplemented from gnash::media::MediaParser.
References _, gnash::media::MediaParser::_bytesLoaded, gnash::media::MediaParser::_stream, gnash::log_debug(), gnash::log_error(), PUSHBUF_SIZE, gnash::media::MediaParser::pushEncodedAudioFrame(), and gnash::media::MediaParser::pushEncodedVideoFrame().
      
  | 
  virtual | 
Get ID3 data from the parsed stream if it exists.
It's best to do this only when parsingComplete is true.
Reimplemented from gnash::media::MediaParser.
      
  | 
  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::_bytesLoaded, gnash::media::MediaParser::_parsingComplete, gnash::media::MediaParser::_stream, and gnash::media::MediaParser::_streamMutex.
| void gnash::media::gst::MediaParserGst::rememberAudioFrame | ( | EncodedAudioFrame * | frame | ) | 
Referenced by rememberVideoFrame().
| void gnash::media::gst::MediaParserGst::rememberVideoFrame | ( | EncodedVideoFrame * | frame | ) | 
References _, gnash::media::MediaParser::_audioInfo, gnash::media::MediaParser::_videoInfo, gnash::media::CODEC_TYPE_CUSTOM, data, gnash::media::EncodedAudioFrame::dataSize, gnash::equal(), gnash::media::VideoInfo::extra, gnash::media::EncodedVideoFrame::extradata, gnash::media::EncodedAudioFrame::extradata, GST_TIME_AS_MSECONDS, gnash::log_debug(), gnash::log_error(), LOG_ONCE, gnash::log_unimpl(), rememberAudioFrame(), rememberVideoFrame(), swfdec_gst_connect_sinkpad_by_pad(), swfdec_gst_get_demuxer_factory(), swfdec_gst_get_parser_factory(), and gnash::media::EncodedAudioFrame::timestamp.
Referenced by rememberVideoFrame().
      
  | 
  virtual | 
Seeks to the closest possible position the given position, and returns the new position.
| time | input/output parameter, input requests a time, output return the actual time seeked to. | 
Implements gnash::media::MediaParser.
 1.8.12