#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "media/base/stream_parser.h"
#include <stddef.h>
#include <stdint.h>
#include <map>
#include <sstream>
#include "base/ranges/algorithm.h"
#include "media/base/stream_parser_buffer.h"
#include "media/base/test_data_util.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace media {
TrackId;
BufferQueue;
const int kEnd = …;
const uint8_t kFakeData[] = …;
const TrackId kAudioTrackId = …;
const TrackId kVideoTrackId = …;
static bool IsAudio(scoped_refptr<StreamParserBuffer> buffer) { … }
static bool IsVideo(scoped_refptr<StreamParserBuffer> buffer) { … }
static void GenerateBuffers(const int* decode_timestamps,
StreamParserBuffer::Type type,
TrackId track_id,
BufferQueue* queue) { … }
class StreamParserTest : public testing::Test { … };
TEST_F(StreamParserTest, MergeBufferQueues_AllEmpty) { … }
TEST_F(StreamParserTest, MergeBufferQueues_SingleAudioBuffer) { … }
TEST_F(StreamParserTest, MergeBufferQueues_SingleVideoBuffer) { … }
TEST_F(StreamParserTest, MergeBufferQueues_OverlappingAudioVideo) { … }
TEST_F(StreamParserTest, MergeBufferQueues_NonDecreasingNoCrossMediaDuplicate) { … }
TEST_F(StreamParserTest, MergeBufferQueues_CrossStreamDuplicates) { … }
TEST_F(StreamParserTest, MergeBufferQueues_InvalidDecreasingSingleStream) { … }
TEST_F(StreamParserTest, MergeBufferQueues_InvalidDecreasingMultipleStreams) { … }
TEST_F(StreamParserTest, MergeBufferQueues_ValidAppendToExistingMerge) { … }
TEST_F(StreamParserTest, MergeBufferQueues_InvalidAppendToExistingMerge) { … }
}