mkvmuxer_tests: Actually test cue points in the cue point test.

Instead of blindly doing a file compare and hoping that we're not
in a garbage in garbage out situation.

Change-Id: Ie2f278e09ad67b3e8f40e602fcdd5c9ffb5e1b7d
This commit is contained in:
Tom Finegan
2016-08-31 14:57:54 -07:00
parent 93e9fb35f9
commit cf1620444f
3 changed files with 44 additions and 20 deletions

View File

@@ -15,6 +15,7 @@
namespace mkvparser {
class IMkvReader;
class MkvReader;
class Segment;
}
@@ -57,6 +58,10 @@ std::string GetTestFilePath(const std::string& name);
// files match exactly, false otherwise.
bool CompareFiles(const std::string& file1, const std::string& file2);
// Returns true and sets |cues_offset| to the cues location within the MKV file
// parsed by |segment| when the MKV file has cue points.
bool HasCuePoints(const mkvparser::Segment* segment, std::int64_t* cues_offset);
// Validates cue points. Assumes caller has already called Load() on |segment|.
// Returns true when:
// All cue points point at clusters, OR
@@ -66,10 +71,17 @@ bool ValidateCues(mkvparser::Segment* segment, mkvparser::IMkvReader* reader);
// Parses |webm_file| using mkvparser and returns true when file parses
// successfully (all clusters and blocks can be successfully walked). Second
// variant allows further interaction with the parsed file via transferring
// ownership of the mkvparser Segment to the caller.
// ownership of the mkvparser Segment and MkvReader to the caller via
// |parser_out|.
struct MkvParser {
MkvParser() = default;
~MkvParser();
mkvparser::Segment* segment = nullptr;
mkvparser::MkvReader* reader = nullptr;
};
bool ParseMkvFile(const std::string& webm_file);
bool ParseMkvFileReleaseSegment(const std::string& webm_file,
mkvparser::Segment** segment_out);
bool ParseMkvFileReleaseParser(const std::string& webm_file,
MkvParser* parser_out);
} // namespace test