#ifndef MEDIA_BASE_STREAM_PARSER_BUFFER_H_
#define MEDIA_BASE_STREAM_PARSER_BUFFER_H_
#include <deque>
#include "media/base/decoder_buffer.h"
#include "media/base/demuxer_stream.h"
#include "media/base/media_export.h"
#include "media/base/stream_parser.h"
namespace media {
class MEDIA_EXPORT StreamParserBuffer : public DecoderBuffer {
public:
enum { kInvalidConfigId = -1 };
typedef DemuxerStream::Type Type;
typedef StreamParser::TrackId TrackId;
static scoped_refptr<StreamParserBuffer> CreateEOSBuffer();
static scoped_refptr<StreamParserBuffer> CopyFrom(
const uint8* data, int data_size, bool is_keyframe, Type type,
TrackId track_id);
static scoped_refptr<StreamParserBuffer> CopyFrom(
const uint8* data, int data_size,
const uint8* side_data, int side_data_size, bool is_keyframe, Type type,
TrackId track_id);
bool IsKeyframe() const { return is_keyframe_; }
base::TimeDelta GetDecodeTimestamp() const;
void SetDecodeTimestamp(const base::TimeDelta& timestamp);
int GetConfigId() const;
void SetConfigId(int config_id);
Type type() const { return type_; }
TrackId track_id() const { return track_id_; }
typedef StreamParser::BufferQueue BufferQueue;
void ConvertToSpliceBuffer(const BufferQueue& pre_splice_buffers);
const BufferQueue& get_splice_buffers() const { return splice_buffers_; }
private:
StreamParserBuffer(const uint8* data, int data_size,
const uint8* side_data, int side_data_size,
bool is_keyframe, Type type,
TrackId track_id);
virtual ~StreamParserBuffer();
bool is_keyframe_;
base::TimeDelta decode_timestamp_;
int config_id_;
Type type_;
TrackId track_id_;
BufferQueue splice_buffers_;
DISALLOW_COPY_AND_ASSIGN(StreamParserBuffer);
};
}
#endif