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"
42 void SetUp()
override;
43 void TearDown()
override;
50 scoped_ptr<webm::Segmenter>* result)
const {
51 scoped_ptr<S> segmenter(
new S(options));
53 scoped_ptr<MkvWriter> writer(
new MkvWriter());
55 ASSERT_OK(segmenter->Initialize(
56 writer.Pass(), info, NULL ,
57 NULL , key_source, 0 ,
59 *result = segmenter.Pass();
63 scoped_refptr<MediaSample>
CreateSample(KeyFrameFlag key_frame_flag,
65 SideDataFlag side_data_flag);
85 void PopulateFromCluster(
const std::string& file_name);
86 void PopulateFromSegment(
const std::string& file_name);
88 int GetFrameCountForCluster(
size_t i)
const;
90 int cluster_count()
const;
95 bool OnListEnd(
int id)
override;
96 bool OnUInt(
int id, int64_t val)
override;
97 bool OnFloat(
int id,
double val)
override;
98 bool OnBinary(
int id,
const uint8_t* data,
int size)
override;
99 bool OnString(
int id,
const std::string& str)
override;
102 std::vector<int> cluster_sizes_;
107 std::string output_file_name_;
108 std::string segment_template_;
109 uint64_t cur_time_timescale_;
110 bool single_segment_;
116 #endif // MEDIA_FORMATS_WEBM_SEGMENTER_TEST_UTILS_H_