NaCl Player API
NaCl Player API Documentation
|
#include <es_data_source.h>
Public Member Functions | |
ESDataSource (const ESDataSource &other) | |
ESDataSource & | operator= (const ESDataSource &other) |
template<typename T > | |
int32_t | AddStream (const std::function< void(int32_t, const T &)> &callback, ElementaryStreamListener *listener) |
template<typename T > | |
int32_t | AddStream (const std::function< void(int32_t, const T &)> &callback, std::shared_ptr< ElementaryStreamListener > listener) |
template<typename T > | |
int32_t | AddStream (T &stream, ElementaryStreamListener *listener=nullptr) |
template<typename T > | |
int32_t | AddStream (T &stream, std::shared_ptr< ElementaryStreamListener > listener) |
int32_t | SetDuration (TimeDelta duration, const std::function< void(int32_t)> &callback) |
int32_t | SetDuration (TimeDelta duration) |
int32_t | SetEndOfStream (const std::function< void(int32_t)> &callback) |
int32_t | SetEndOfStream () |
Public Member Functions inherited from Samsung::NaClPlayer::MediaDataSource | |
MediaDataSource (const MediaDataSource &other) | |
MediaDataSource & | operator= (const MediaDataSource &other) |
Protected Member Functions | |
MediaDataSource::Impl * | impl () const |
Data source handling appends of Elementary Streams.
It is a container for Elementary Streams (audio/video/...) and there can be at most one stream of given type (see ElementaryStreamType
).
Basic usage (playback of clip containing audio and video):
AddStream<T> with argument being callback accepting AudioElementryStream</code.
Configure audio stream, by setting codec, sampling rate, channels and other necessary information.
Call ElementaryStream.InitializeDone
to confirm the configuration
Add video stream using AddStream<T> with argument being callback accepting VideoElementryStream</code.
Configure video stream, by setting codec, frame rate, resolution and other necessary information.
Call ElementaryStream.InitializeDone
to confirm the configuration.
Attach data source to the player by calling MediaPlayer.AttachMediaSource
.
Download and append Elementary Stream audio and video packets by calling ElementaryStream.AppendPacket
Signalize end of stream (clip) by calling
SetEndOfStream
MediaPlayer.AttachMediaSource
with NULL
object.Methods in this class are available in synchronous and asynchronous variant. Both versions perform the same action, the only difference is how results of those actions are reported to the caller. Asynchronous method propagates this result by a provided additional parameter
callback
function.
Common constraints:
Definition at line 500 of file es_data_source.h.
|
inline |
Factory method which adds stream of given type to the data source.
Type T must be one of concrete types inherited form ElementaryStream
This data source can handle at most one buffer of given type, so multiple calls of this method with the same buffer type will return the same resource as all previous calls.
[in] | callback | A callback to be called upon completion. |
ErrorCodes::Success
on success, otherwise an error code from ErrorCodes
. Definition at line 700 of file es_data_source.h.
|
inline |
Deprecated method for backwards compatibility
For detailed description
Definition at line 688 of file es_data_source.h.
|
inline |
Synchronous factory method which adds stream of given type to the data source.
For detailed description
Definition at line 721 of file es_data_source.h.
|
inline |
Deprecated method for backwards compatibility
Synchronous factory method which adds stream of given type to the data source.
For detailed description
Definition at line 712 of file es_data_source.h.
int32_t Samsung::NaClPlayer::ESDataSource::SetDuration | ( | TimeDelta | duration, |
const std::function< void(int32_t)> & | callback | ||
) |
Sets duration of the whole stream/container/clip.
[in] | duration | A duration of played media. |
[in] | callback | A callback to be called upon completion. |
ErrorCodes::Success
on success, otherwise an error code from ErrorCodes
. int32_t Samsung::NaClPlayer::ESDataSource::SetDuration | ( | TimeDelta | duration | ) |
Synchronously sets duration of the whole stream/container/clip.
For detailed description
int32_t Samsung::NaClPlayer::ESDataSource::SetEndOfStream | ( | const std::function< void(int32_t)> & | callback | ) |
Signalizes end of the whole stream/container/clip.
[in] | callback | A callback to be called upon completion. |
ErrorCodes::Success
on success, otherwise an error code from ErrorCodes
. int32_t Samsung::NaClPlayer::ESDataSource::SetEndOfStream | ( | ) |
Synchronously signalizes end of the whole stream/container/clip.
For detailed description