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 {
32 void SetUp()
override;
33 void TearDown()
override;
39 scoped_ptr<webm::Segmenter>* result)
const {
40 scoped_ptr<S> segmenter(
new S(options));
42 scoped_ptr<MkvWriter> writer(
new MkvWriter());
43 ASSERT_OK(writer->Open(this->output_file_name_));
44 ASSERT_OK(segmenter->Initialize(writer.Pass(), info, NULL, NULL, NULL));
45 *result = segmenter.Pass();
49 scoped_refptr<MediaSample>
CreateSample(
bool is_key_frame, uint64_t duration);
69 void PopulateFromCluster(
const std::string& file_name);
70 void PopulateFromSegment(
const std::string& file_name);
72 int GetFrameCountForCluster(
size_t i)
const;
74 int cluster_count()
const;
79 bool OnListEnd(
int id)
override;
80 bool OnUInt(
int id, int64_t val)
override;
81 bool OnFloat(
int id,
double val)
override;
82 bool OnBinary(
int id,
const uint8_t* data,
int size)
override;
83 bool OnString(
int id,
const std::string& str)
override;
86 std::vector<int> cluster_sizes_;
91 std::string output_file_name_;
92 std::string segment_template_;
93 uint64_t cur_time_timescale_;
100 #endif // MEDIA_FORMATS_WEBM_SEGMENTER_TEST_UTILS_H_