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/video_stream_info.h"
15 #include "packager/media/base/status.h"
16 #include "packager/media/base/stream_info.h"
17 #include "packager/media/base/test/status_test_util.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"
25 namespace edash_packager {
42 void SetUp()
override;
43 void TearDown()
override;
49 scoped_ptr<webm::Segmenter>* result)
const {
50 scoped_ptr<S> segmenter(
new S(options));
52 scoped_ptr<MkvWriter> writer(
new MkvWriter());
54 ASSERT_OK(segmenter->Initialize(writer.Pass(), info, NULL, NULL, NULL));
55 *result = segmenter.Pass();
59 scoped_refptr<MediaSample>
CreateSample(KeyFrameFlag key_frame_flag,
61 SideDataFlag side_data_flag);
81 void PopulateFromCluster(
const std::string& file_name);
82 void PopulateFromSegment(
const std::string& file_name);
84 int GetFrameCountForCluster(
size_t i)
const;
86 int cluster_count()
const;
91 bool OnListEnd(
int id)
override;
92 bool OnUInt(
int id, int64_t val)
override;
93 bool OnFloat(
int id,
double val)
override;
94 bool OnBinary(
int id,
const uint8_t* data,
int size)
override;
95 bool OnString(
int id,
const std::string& str)
override;
98 std::vector<int> cluster_sizes_;
103 std::string output_file_name_;
104 std::string segment_template_;
105 uint64_t cur_time_timescale_;
106 bool single_segment_;
112 #endif // MEDIA_FORMATS_WEBM_SEGMENTER_TEST_UTILS_H_