Shaka Player Embedded
Public Member Functions | List of all members
shaka::media::DemuxerThread Class Reference

#include <demuxer_thread.h>

Public Member Functions

 DemuxerThread (const std::string &mime, Demuxer::Client *client, ElementaryStream *stream)
 
 ~DemuxerThread ()
 
 SHAKA_NON_COPYABLE_OR_MOVABLE_TYPE (DemuxerThread)
 
void Stop ()
 
void AppendData (double timestamp_offset, double window_start, double window_end, const uint8_t *data, size_t data_size, std::function< void(bool)> on_complete)
 

Detailed Description

Handles the thread that demuxes input content. This handles synchronizing the threads and connecting the Demuxer to the Stream.

All callbacks given to this object will be called on the event thread.

Definition at line 41 of file demuxer_thread.h.

Constructor & Destructor Documentation

§ DemuxerThread()

shaka::media::DemuxerThread::DemuxerThread ( const std::string &  mime,
Demuxer::Client client,
ElementaryStream stream 
)

Creates a new Demuxer instance that pushes to the given stream.

Parameters
mimeThe full MIME type this will read from.
clientA client interface object for events.
streamThe stream to push frames to.

Definition at line 43 of file demuxer_thread.cc.

§ ~DemuxerThread()

shaka::media::DemuxerThread::~DemuxerThread ( )

Definition at line 60 of file demuxer_thread.cc.

Member Function Documentation

§ AppendData()

void shaka::media::DemuxerThread::AppendData ( double  timestamp_offset,
double  window_start,
double  window_end,
const uint8_t *  data,
size_t  data_size,
std::function< void(bool)>  on_complete 
)

Appends the given data to be demuxed.

Parameters
timestamp_offsetThe number of seconds to move the media timestamps forward.
window_startThe time (in seconds) to start the append window. Any frames outside the append window are ignored.
window_endThe time (in seconds) to end the append window.
dataThe data pointer; it must remain alive until a call to either on_complete or on_error.
data_sizeThe number of bytes in |data|.
on_completeThe callback to invoke once the append completes.

Definition at line 71 of file demuxer_thread.cc.

§ SHAKA_NON_COPYABLE_OR_MOVABLE_TYPE()

shaka::media::DemuxerThread::SHAKA_NON_COPYABLE_OR_MOVABLE_TYPE ( DemuxerThread  )

§ Stop()

void shaka::media::DemuxerThread::Stop ( )

Stops the background thread and joins it.

Definition at line 65 of file demuxer_thread.cc.


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