AVBlocks for C++  1.9
Audio and Video Software Development Kit
MediaSample Class Reference

MediaSample represents one or more samples of audio or video data. More...

Inherits Reference.

List of all members.

Public Member Functions

virtual MediaBufferbuffer ()=0
 Returns the buffer associated with this sample.
virtual void setBuffer (MediaBuffer *buffer)=0
 Sets a new MediaBuffer object.
virtual void reset ()=0
 Resets the sample to its default values and clears the data in the buffer.
virtual double startTime () const =0
 Returns the presentation timestamp (PTS) of the media sample.
virtual double endTime () const =0
 Returns the end time of the media sample.
virtual void setStartTime (double time)=0
 Sets presentation timestamp (PTS) of the media sample.
virtual void setEndTime (double time)=0
 Sets the end time of the media sample.
virtual int32_t flags () const =0
 Returns the media sample flags.
virtual void setFlags (int32_t flags)=0
 Sets the media sample flags.
virtual void setStreamNumber (int32_t streamNumber)=0
 Sets the elementary stream to which the sample belongs.
virtual int32_t streamNumber () const =0
 Returns the elementary stream to which the sample belongs.

Protected Member Functions

 ~MediaSample ()
 This object can be destroyed only by its implementation.

Detailed Description

MediaSample represents one or more samples of audio or video data.

It is used for storing uncompressed or compressed data.


Constructor & Destructor Documentation

~MediaSample ( ) [protected]

This object can be destroyed only by its implementation.

The caller must use Reference::release.

See also:
Object Management

Member Function Documentation

virtual MediaBuffer* buffer ( ) [pure virtual]

Returns the buffer associated with this sample.

Returns:
A pointer to a MediaBuffer object. Can be NULL.
virtual double endTime ( ) const [pure virtual]

Returns the end time of the media sample.

Returns:
The time when the sample should end. Time in seconds.
Remarks:
The end time is optional and is valid only if it is greater than the start time.
virtual int32_t flags ( ) const [pure virtual]

Returns the media sample flags.

Returns:
A combination of flags defined in MediaSampleFlags::Enum.
virtual void setBuffer ( MediaBuffer buffer) [pure virtual]

Sets a new MediaBuffer object.

The old MediaBuffer object is released. The new one is retained.

Parameters:
bufferA pointer to the new MediaBuffer object. Can be NULL.
virtual void setEndTime ( double  time) [pure virtual]

Sets the end time of the media sample.

Parameters:
time[in] The time when the sample should end. Time is in seconds.
Remarks:
The end time is optional and is valid only if it is greater than the start time.
virtual void setFlags ( int32_t  flags) [pure virtual]

Sets the media sample flags.

Parameters:
flags[in] A combination of flags defined in MediaSampleFlags::Enum.
virtual void setStartTime ( double  time) [pure virtual]

Sets presentation timestamp (PTS) of the media sample.

Parameters:
timein seconds
virtual void setStreamNumber ( int32_t  streamNumber) [pure virtual]

Sets the elementary stream to which the sample belongs.

Parameters:
streamNumber[in] A zero-based index of the elementary stream in the container.
virtual double startTime ( ) const [pure virtual]

Returns the presentation timestamp (PTS) of the media sample.

Returns:
time in seconds
virtual int32_t streamNumber ( ) const [pure virtual]

Returns the elementary stream to which the sample belongs.

Returns:
A zero-based index of the elementary stream in the container.
 All Classes Namespaces Files Functions Variables Enumerations Enumerator