7 #ifndef MEDIA_FORMATS_WEBM_SEGMENTER_TEST_UTILS_H_
8 #define MEDIA_FORMATS_WEBM_SEGMENTER_TEST_UTILS_H_
10 #include <gtest/gtest.h>
12 #include "packager/media/base/media_sample.h"
13 #include "packager/media/base/muxer_options.h"
14 #include "packager/media/base/status.h"
15 #include "packager/media/base/stream_info.h"
16 #include "packager/media/base/test/status_test_util.h"
17 #include "packager/media/base/video_stream_info.h"
18 #include "packager/media/file/file_closer.h"
19 #include "packager/media/file/file_test_util.h"
20 #include "packager/media/file/memory_file.h"
21 #include "packager/media/formats/webm/mkv_writer.h"
22 #include "packager/media/formats/webm/segmenter.h"
23 #include "packager/media/formats/webm/webm_parser.h"
42 void SetUp()
override;
43 void TearDown()
override;
51 std::unique_ptr<webm::Segmenter>* result)
const {
52 std::unique_ptr<S> segmenter(
new S(options));
54 std::unique_ptr<MkvWriter> writer(
new MkvWriter());
56 ASSERT_OK(segmenter->Initialize(
57 std::move(writer), info, NULL ,
58 NULL , key_source, 0 ,
61 *result = std::move(segmenter);
65 scoped_refptr<MediaSample>
CreateSample(KeyFrameFlag key_frame_flag,
67 SideDataFlag side_data_flag);
87 void PopulateFromCluster(
const std::string& file_name);
88 void PopulateFromSegment(
const std::string& file_name);
90 int GetFrameCountForCluster(
size_t i)
const;
92 int cluster_count()
const;
97 bool OnListEnd(
int id)
override;
98 bool OnUInt(
int id, int64_t val)
override;
99 bool OnFloat(
int id,
double val)
override;
100 bool OnBinary(
int id,
const uint8_t* data,
int size)
override;
101 bool OnString(
int id,
const std::string& str)
override;
104 std::vector<int> cluster_sizes_;
109 std::string output_file_name_;
110 std::string segment_template_;
111 uint64_t cur_time_timescale_;
112 bool single_segment_;
118 #endif // MEDIA_FORMATS_WEBM_SEGMENTER_TEST_UTILS_H_