Add is_key_frame in IsMediaSample Matcher

Added the key frame field to the IsMediaSample mather. All
tests that do not care about a sample being a keyframe (or not)
have been updated to use "_".

Change-Id: I44180687c58c260b6856e683d647f532227b14d5
This commit is contained in:
Aaron Vaage 2018-06-14 16:39:59 -07:00
parent 1fed9f9367
commit e0ce59aa91
5 changed files with 109 additions and 96 deletions

View File

@ -134,7 +134,13 @@ MATCHER_P6(MatchEncryptionConfig,
TryMatch(arg.key_id, key_id, result_listener, "key_id");
}
MATCHER_P4(IsMediaSample, stream_index, timestamp, duration, encrypted, "") {
MATCHER_P5(IsMediaSample,
stream_index,
timestamp,
duration,
encrypted,
keyframe,
"") {
if (!TryMatchStreamDataType(arg->stream_data_type,
StreamDataType::kMediaSample, result_listener)) {
return false;
@ -142,11 +148,13 @@ MATCHER_P4(IsMediaSample, stream_index, timestamp, duration, encrypted, "") {
const std::string is_encrypted_string =
BoolToString(arg->media_sample->is_encrypted());
const std::string is_key_frame_string =
BoolToString(arg->media_sample->is_key_frame());
*result_listener << "which is (" << arg->stream_index << ", "
<< arg->media_sample->dts() << ", "
<< arg->media_sample->duration() << ", "
<< is_encrypted_string << ")";
<< is_encrypted_string << ", " << is_key_frame_string << ")";
return TryMatch(arg->stream_index, stream_index, result_listener,
"stream_index") &&
@ -155,7 +163,9 @@ MATCHER_P4(IsMediaSample, stream_index, timestamp, duration, encrypted, "") {
TryMatch(arg->media_sample->duration(), duration, result_listener,
"duration") &&
TryMatch(arg->media_sample->is_encrypted(), encrypted, result_listener,
"is_encrypted");
"is_encrypted") &&
TryMatch(arg->media_sample->is_key_frame(), keyframe, result_listener,
"is_key_frame");
}
MATCHER_P6(IsTextSample,

View File

@ -71,11 +71,11 @@ TEST_F(ChunkingHandlerTest, AudioNoSubsegmentsThenFlush) {
ElementsAre(IsSegmentInfo(kStreamIndex, 0, kDuration * 3,
!kIsSubsegment, !kEncrypted),
IsMediaSample(kStreamIndex, i * kDuration,
kDuration, !kEncrypted)));
kDuration, !kEncrypted, _)));
} else {
EXPECT_THAT(GetOutputStreamDataVector(),
ElementsAre(IsMediaSample(kStreamIndex, i * kDuration,
kDuration, !kEncrypted)));
kDuration, !kEncrypted, _)));
}
}
@ -103,15 +103,16 @@ TEST_F(ChunkingHandlerTest, AudioWithSubsegments) {
GetOutputStreamDataVector(),
ElementsAre(
IsStreamInfo(kStreamIndex, kTimeScale0, !kEncrypted, _),
IsMediaSample(kStreamIndex, 0, kDuration, !kEncrypted),
IsMediaSample(kStreamIndex, kDuration, kDuration, !kEncrypted),
IsMediaSample(kStreamIndex, 0, kDuration, !kEncrypted, _),
IsMediaSample(kStreamIndex, kDuration, kDuration, !kEncrypted, _),
IsSegmentInfo(kStreamIndex, 0, kDuration * 2, kIsSubsegment,
!kEncrypted),
IsMediaSample(kStreamIndex, 2 * kDuration, kDuration, !kEncrypted),
IsMediaSample(kStreamIndex, 2 * kDuration, kDuration, !kEncrypted, _),
IsSegmentInfo(kStreamIndex, 0, kDuration * 3, !kIsSubsegment,
!kEncrypted),
IsMediaSample(kStreamIndex, 3 * kDuration, kDuration, !kEncrypted),
IsMediaSample(kStreamIndex, 4 * kDuration, kDuration, !kEncrypted)));
IsMediaSample(kStreamIndex, 3 * kDuration, kDuration, !kEncrypted, _),
IsMediaSample(kStreamIndex, 4 * kDuration, kDuration, !kEncrypted,
_)));
}
TEST_F(ChunkingHandlerTest, VideoAndSubsegmentAndNonzeroStart) {
@ -136,22 +137,22 @@ TEST_F(ChunkingHandlerTest, VideoAndSubsegmentAndNonzeroStart) {
IsStreamInfo(kStreamIndex, kTimeScale1, !kEncrypted, _),
// The first samples @ kStartTimestamp is discarded - not key frame.
IsMediaSample(kStreamIndex, kVideoStartTimestamp + kDuration,
kDuration, !kEncrypted),
kDuration, !kEncrypted, _),
IsMediaSample(kStreamIndex, kVideoStartTimestamp + kDuration * 2,
kDuration, !kEncrypted),
kDuration, !kEncrypted, _),
// The next segment boundary 13245 / 1000 != 12645 / 1000.
IsSegmentInfo(kStreamIndex, kVideoStartTimestamp + kDuration,
kDuration * 2, !kIsSubsegment, !kEncrypted),
IsMediaSample(kStreamIndex, kVideoStartTimestamp + kDuration * 3,
kDuration, !kEncrypted),
kDuration, !kEncrypted, _),
IsMediaSample(kStreamIndex, kVideoStartTimestamp + kDuration * 4,
kDuration, !kEncrypted),
kDuration, !kEncrypted, _),
// The subsegment has duration kDuration * 2 since it can only
// terminate before key frame.
IsSegmentInfo(kStreamIndex, kVideoStartTimestamp + kDuration * 3,
kDuration * 2, kIsSubsegment, !kEncrypted),
IsMediaSample(kStreamIndex, kVideoStartTimestamp + kDuration * 5,
kDuration, !kEncrypted)));
kDuration, !kEncrypted, _)));
}
TEST_F(ChunkingHandlerTest, CueEvent) {
@ -185,25 +186,25 @@ TEST_F(ChunkingHandlerTest, CueEvent) {
GetOutputStreamDataVector(),
ElementsAre(
IsMediaSample(kStreamIndex, kVideoStartTimestamp, kDuration,
!kEncrypted),
!kEncrypted, _),
// A new segment is created due to the existance of Cue.
IsSegmentInfo(kStreamIndex, kVideoStartTimestamp, kDuration,
!kIsSubsegment, !kEncrypted),
IsCueEvent(kStreamIndex, kCueTimeInSeconds),
IsMediaSample(kStreamIndex, kVideoStartTimestamp + kDuration * 1,
kDuration, !kEncrypted),
kDuration, !kEncrypted, _),
IsMediaSample(kStreamIndex, kVideoStartTimestamp + kDuration * 2,
kDuration, !kEncrypted),
kDuration, !kEncrypted, _),
IsSegmentInfo(kStreamIndex, kVideoStartTimestamp + kDuration,
kDuration * 2, kIsSubsegment, !kEncrypted),
IsMediaSample(kStreamIndex, kVideoStartTimestamp + kDuration * 3,
kDuration, !kEncrypted),
kDuration, !kEncrypted, _),
IsMediaSample(kStreamIndex, kVideoStartTimestamp + kDuration * 4,
kDuration, !kEncrypted),
kDuration, !kEncrypted, _),
IsSegmentInfo(kStreamIndex, kVideoStartTimestamp + kDuration,
kDuration * 4, !kIsSubsegment, !kEncrypted),
IsMediaSample(kStreamIndex, kVideoStartTimestamp + kDuration * 5,
kDuration, !kEncrypted)));
kDuration, !kEncrypted, _)));
}
} // namespace media

View File

@ -91,13 +91,13 @@ TEST_F(CueAlignmentHandlerTest, VideoInputWithNoCues) {
OnProcess(IsStreamInfo(kParent, kMsTimeScale, !kEncrypted, _)));
EXPECT_CALL(*Output(kVideoStream),
OnProcess(IsMediaSample(kParent, kSample0Start, kSampleDuration,
!kEncrypted)));
!kEncrypted, _)));
EXPECT_CALL(*Output(kVideoStream),
OnProcess(IsMediaSample(kParent, kSample1Start, kSampleDuration,
!kEncrypted)));
!kEncrypted, _)));
EXPECT_CALL(*Output(kVideoStream),
OnProcess(IsMediaSample(kParent, kSample2Start, kSampleDuration,
!kEncrypted)));
!kEncrypted, _)));
EXPECT_CALL(*Output(kVideoStream), OnFlush(kParent));
}
@ -135,13 +135,13 @@ TEST_F(CueAlignmentHandlerTest, AudioInputWithNoCues) {
OnProcess(IsStreamInfo(kParent, kMsTimeScale, !kEncrypted, _)));
EXPECT_CALL(*Output(kAudioStream),
OnProcess(IsMediaSample(kParent, kSample0Start, kSampleDuration,
!kEncrypted)));
!kEncrypted, _)));
EXPECT_CALL(*Output(kAudioStream),
OnProcess(IsMediaSample(kParent, kSample1Start, kSampleDuration,
!kEncrypted)));
!kEncrypted, _)));
EXPECT_CALL(*Output(kAudioStream),
OnProcess(IsMediaSample(kParent, kSample2Start, kSampleDuration,
!kEncrypted)));
!kEncrypted, _)));
EXPECT_CALL(*Output(kAudioStream), OnFlush(kParent));
}
@ -250,13 +250,13 @@ TEST_F(CueAlignmentHandlerTest, TextAudioVideoInputWithNoCues) {
OnProcess(IsStreamInfo(kParent, kMsTimeScale, !kEncrypted, _)));
EXPECT_CALL(*Output(kAudioStream),
OnProcess(IsMediaSample(kParent, kSample0Start, kSampleDuration,
!kEncrypted)));
!kEncrypted, _)));
EXPECT_CALL(*Output(kAudioStream),
OnProcess(IsMediaSample(kParent, kSample1Start, kSampleDuration,
!kEncrypted)));
!kEncrypted, _)));
EXPECT_CALL(*Output(kAudioStream),
OnProcess(IsMediaSample(kParent, kSample2Start, kSampleDuration,
!kEncrypted)));
!kEncrypted, _)));
EXPECT_CALL(*Output(kAudioStream), OnFlush(kParent));
}
@ -267,13 +267,13 @@ TEST_F(CueAlignmentHandlerTest, TextAudioVideoInputWithNoCues) {
OnProcess(IsStreamInfo(kParent, kMsTimeScale, !kEncrypted, _)));
EXPECT_CALL(*Output(kVideoStream),
OnProcess(IsMediaSample(kParent, kSample0Start, kSampleDuration,
!kEncrypted)));
!kEncrypted, _)));
EXPECT_CALL(*Output(kVideoStream),
OnProcess(IsMediaSample(kParent, kSample1Start, kSampleDuration,
!kEncrypted)));
!kEncrypted, _)));
EXPECT_CALL(*Output(kVideoStream),
OnProcess(IsMediaSample(kParent, kSample2Start, kSampleDuration,
!kEncrypted)));
!kEncrypted, _)));
EXPECT_CALL(*Output(kVideoStream), OnFlush(kParent));
}
@ -357,15 +357,15 @@ TEST_F(CueAlignmentHandlerTest, VideoInputWithCues) {
OnProcess(IsStreamInfo(kParent, kMsTimeScale, !kEncrypted, _)));
EXPECT_CALL(*Output(kVideoStream),
OnProcess(IsMediaSample(kParent, kSample0Start, kSampleDuration,
!kEncrypted)));
!kEncrypted, _)));
EXPECT_CALL(*Output(kVideoStream),
OnProcess(IsMediaSample(kParent, kSample1Start, kSampleDuration,
!kEncrypted)));
!kEncrypted, _)));
EXPECT_CALL(*Output(kVideoStream),
OnProcess(IsCueEvent(kParent, kSample2StartInSeconds)));
EXPECT_CALL(*Output(kVideoStream),
OnProcess(IsMediaSample(kParent, kSample2Start, kSampleDuration,
!kEncrypted)));
!kEncrypted, _)));
EXPECT_CALL(*Output(kVideoStream), OnFlush(kParent));
}
@ -411,15 +411,15 @@ TEST_F(CueAlignmentHandlerTest, AudioInputWithCues) {
OnProcess(IsStreamInfo(kParent, kMsTimeScale, !kEncrypted, _)));
EXPECT_CALL(*Output(kAudioStream),
OnProcess(IsMediaSample(kParent, kSample0Start, kSampleDuration,
!kEncrypted)));
!kEncrypted, _)));
EXPECT_CALL(*Output(kAudioStream),
OnProcess(IsCueEvent(kParent, kSample1StartInSeconds)));
EXPECT_CALL(*Output(kAudioStream),
OnProcess(IsMediaSample(kParent, kSample1Start, kSampleDuration,
!kEncrypted)));
!kEncrypted, _)));
EXPECT_CALL(*Output(kAudioStream),
OnProcess(IsMediaSample(kParent, kSample2Start, kSampleDuration,
!kEncrypted)));
!kEncrypted, _)));
EXPECT_CALL(*Output(kAudioStream), OnFlush(kParent));
}
@ -608,15 +608,15 @@ TEST_F(CueAlignmentHandlerTest, TextAudioVideoInputWithCues) {
OnProcess(IsStreamInfo(kParent, kMsTimeScale, !kEncrypted, _)));
EXPECT_CALL(*Output(kAudioStream),
OnProcess(IsMediaSample(kParent, kSample0Start, kSampleDuration,
!kEncrypted)));
!kEncrypted, _)));
EXPECT_CALL(*Output(kAudioStream),
OnProcess(IsMediaSample(kParent, kSample1Start, kSampleDuration,
!kEncrypted)));
!kEncrypted, _)));
EXPECT_CALL(*Output(kAudioStream),
OnProcess(IsCueEvent(kParent, kSample2StartInSeconds)));
EXPECT_CALL(*Output(kAudioStream),
OnProcess(IsMediaSample(kParent, kSample2Start, kSampleDuration,
!kEncrypted)));
!kEncrypted, _)));
EXPECT_CALL(*Output(kAudioStream), OnFlush(kParent));
}
@ -627,15 +627,15 @@ TEST_F(CueAlignmentHandlerTest, TextAudioVideoInputWithCues) {
OnProcess(IsStreamInfo(kParent, kMsTimeScale, !kEncrypted, _)));
EXPECT_CALL(*Output(kVideoStream),
OnProcess(IsMediaSample(kParent, kSample0Start, kSampleDuration,
!kEncrypted)));
!kEncrypted, _)));
EXPECT_CALL(*Output(kVideoStream),
OnProcess(IsMediaSample(kParent, kSample1Start, kSampleDuration,
!kEncrypted)));
!kEncrypted, _)));
EXPECT_CALL(*Output(kVideoStream),
OnProcess(IsCueEvent(kParent, kSample2StartInSeconds)));
EXPECT_CALL(*Output(kVideoStream),
OnProcess(IsMediaSample(kParent, kSample2Start, kSampleDuration,
!kEncrypted)));
!kEncrypted, _)));
EXPECT_CALL(*Output(kVideoStream), OnFlush(kParent));
}

View File

@ -510,7 +510,7 @@ TEST_P(EncryptionHandlerEncryptionTest, ClearLeadWithNoKeyRotation) {
const auto& output_stream_data = GetOutputStreamDataVector();
EXPECT_THAT(output_stream_data,
ElementsAre(IsMediaSample(kStreamIndex, i * kSegmentDuration,
kSegmentDuration, is_encrypted),
kSegmentDuration, is_encrypted, _),
IsSegmentInfo(kStreamIndex, i * kSegmentDuration,
kSegmentDuration, !kIsSubsegment,
is_encrypted)));
@ -578,7 +578,7 @@ TEST_P(EncryptionHandlerEncryptionTest, ClearLeadWithKeyRotation) {
const auto& output_stream_data = GetOutputStreamDataVector();
EXPECT_THAT(output_stream_data,
ElementsAre(IsMediaSample(kStreamIndex, i * kSegmentDuration,
kSegmentDuration, is_encrypted),
kSegmentDuration, is_encrypted, _),
IsSegmentInfo(kStreamIndex, i * kSegmentDuration,
kSegmentDuration, !kIsSubsegment,
is_encrypted)));

View File

@ -129,7 +129,7 @@ TEST_F(WebVttToMp4HandlerTest, IngoresEmptyPayloadSamples) {
// the while segment.
EXPECT_CALL(*Out(),
OnProcess(IsMediaSample(kStreamIndex, kSegmentStart,
kSegmentDuration, !kEncrypted)));
kSegmentDuration, !kEncrypted, _)));
// Segment
EXPECT_CALL(*Out(), OnProcess(IsSegmentInfo(kStreamIndex, kSegmentStart,
kSegmentDuration, !kSubSegment,
@ -176,13 +176,13 @@ TEST_F(WebVttToMp4HandlerTest, NonZeroStartTime) {
// Gap
EXPECT_CALL(*Out(),
OnProcess(AllOf(IsMediaSample(kStreamIndex, kGapStart,
kGapDuration, !kEncrypted),
kGapDuration, !kEncrypted, _),
Not(MediaSampleContainsId(kId1)))));
// Sample
EXPECT_CALL(*Out(),
OnProcess(AllOf(IsMediaSample(kStreamIndex, kSampleStart,
kSampleDuration, !kEncrypted),
kSampleDuration, !kEncrypted, _),
MediaSampleContainsId(kId1))));
// Segment
@ -233,21 +233,21 @@ TEST_F(WebVttToMp4HandlerTest, NoOverlap) {
// Sample 1
EXPECT_CALL(*Out(),
OnProcess(AllOf(IsMediaSample(kStreamIndex, kSample1Start,
kSample1Duration, !kEncrypted),
kSample1Duration, !kEncrypted, _),
MediaSampleContainsId(kId1),
Not(MediaSampleContainsId(kId2)))));
// Gap
EXPECT_CALL(*Out(),
OnProcess(AllOf(IsMediaSample(kStreamIndex, kGapStart,
kGapDuration, !kEncrypted),
kGapDuration, !kEncrypted, _),
Not(MediaSampleContainsId(kId1)),
Not(MediaSampleContainsId(kId2)))));
// Sample 2
EXPECT_CALL(*Out(),
OnProcess(AllOf(IsMediaSample(kStreamIndex, kSample2Start,
kSample2Duration, !kEncrypted),
kSample2Duration, !kEncrypted, _),
Not(MediaSampleContainsId(kId1)),
MediaSampleContainsId(kId2))));
@ -306,7 +306,7 @@ TEST_F(WebVttToMp4HandlerTest, Overlap) {
// Sample 1
EXPECT_CALL(*Out(), OnProcess(AllOf(
IsMediaSample(kStreamIndex, kOnlySample1Start,
kOnlySample1Duration, !kEncrypted),
kOnlySample1Duration, !kEncrypted, _),
MediaSampleContainsId(kId1),
Not(MediaSampleContainsId(kId2)))));
@ -314,13 +314,13 @@ TEST_F(WebVttToMp4HandlerTest, Overlap) {
EXPECT_CALL(*Out(),
OnProcess(AllOf(
IsMediaSample(kStreamIndex, kSample1AndSample2Start,
kSample1AndSample2Duration, !kEncrypted),
kSample1AndSample2Duration, !kEncrypted, _),
MediaSampleContainsId(kId1), MediaSampleContainsId(kId2))));
// Sample 2
EXPECT_CALL(*Out(), OnProcess(AllOf(
IsMediaSample(kStreamIndex, kOnlySample2Start,
kOnlySample2Duration, !kEncrypted),
kOnlySample2Duration, !kEncrypted, _),
Not(MediaSampleContainsId(kId1)),
MediaSampleContainsId(kId2))));
@ -379,25 +379,27 @@ TEST_F(WebVttToMp4HandlerTest, Contains) {
EXPECT_CALL(*Out(), OnProcess(IsStreamInfo(kStreamIndex, _, _, _)));
// Sample 1
EXPECT_CALL(*Out(), OnProcess(AllOf(
IsMediaSample(kStreamIndex, kBeforeSample2Start,
kBeforeSample2Duration, !kEncrypted),
MediaSampleContainsId(kId1),
Not(MediaSampleContainsId(kId2)))));
EXPECT_CALL(
*Out(),
OnProcess(AllOf(IsMediaSample(kStreamIndex, kBeforeSample2Start,
kBeforeSample2Duration, !kEncrypted, _),
MediaSampleContainsId(kId1),
Not(MediaSampleContainsId(kId2)))));
// Sample 1 and Sample 2
EXPECT_CALL(*Out(),
OnProcess(AllOf(
IsMediaSample(kStreamIndex, kDuringSample2Start,
kDuringSample2Duration, !kEncrypted),
kDuringSample2Duration, !kEncrypted, _),
MediaSampleContainsId(kId1), MediaSampleContainsId(kId2))));
// Sample 1 Again
EXPECT_CALL(*Out(), OnProcess(AllOf(
IsMediaSample(kStreamIndex, kAfterSample2Start,
kAfterSample2Duration, !kEncrypted),
MediaSampleContainsId(kId1),
Not(MediaSampleContainsId(kId2)))));
EXPECT_CALL(
*Out(),
OnProcess(AllOf(IsMediaSample(kStreamIndex, kAfterSample2Start,
kAfterSample2Duration, !kEncrypted, _),
MediaSampleContainsId(kId1),
Not(MediaSampleContainsId(kId2)))));
// Segment
EXPECT_CALL(*Out(), OnProcess(IsSegmentInfo(kStreamIndex, kSegmentStart,
@ -440,7 +442,7 @@ TEST_F(WebVttToMp4HandlerTest, ExactOverlap) {
// Both Samples
EXPECT_CALL(*Out(),
OnProcess(AllOf(IsMediaSample(kStreamIndex, kSampleStart,
kSampleDuration, !kEncrypted),
kSampleDuration, !kEncrypted, _),
MediaSampleContainsId(kId1),
MediaSampleContainsId(kId2))));
@ -503,25 +505,25 @@ TEST_F(WebVttToMp4HandlerTest, OverlapStartWithStaggerEnd) {
EXPECT_CALL(*Out(),
OnProcess(AllOf(
IsMediaSample(kStreamIndex, kThreeSamplesStart,
kThreeSamplesDuration, !kEncrypted),
kThreeSamplesDuration, !kEncrypted, _),
MediaSampleContainsId(kId1), MediaSampleContainsId(kId2),
MediaSampleContainsId(kId3))));
// Two Samples
EXPECT_CALL(*Out(),
OnProcess(AllOf(IsMediaSample(kStreamIndex, kTwoSamplesStart,
kTwoSamplesDuration, !kEncrypted),
MediaSampleContainsId(kId1),
MediaSampleContainsId(kId2),
Not(MediaSampleContainsId(kId3)))));
OnProcess(AllOf(
IsMediaSample(kStreamIndex, kTwoSamplesStart,
kTwoSamplesDuration, !kEncrypted, _),
MediaSampleContainsId(kId1), MediaSampleContainsId(kId2),
Not(MediaSampleContainsId(kId3)))));
// One Sample
EXPECT_CALL(*Out(),
OnProcess(AllOf(IsMediaSample(kStreamIndex, kOneSampleStart,
kOneSampleDuration, !kEncrypted),
MediaSampleContainsId(kId1),
Not(MediaSampleContainsId(kId2)),
Not(MediaSampleContainsId(kId3)))));
EXPECT_CALL(*Out(), OnProcess(AllOf(
IsMediaSample(kStreamIndex, kOneSampleStart,
kOneSampleDuration, !kEncrypted, _),
MediaSampleContainsId(kId1),
Not(MediaSampleContainsId(kId2)),
Not(MediaSampleContainsId(kId3)))));
// Segment
EXPECT_CALL(*Out(), OnProcess(IsSegmentInfo(kStreamIndex, kSegmentStart,
@ -580,26 +582,26 @@ TEST_F(WebVttToMp4HandlerTest, StaggerStartWithOverlapEnd) {
EXPECT_CALL(*Out(), OnProcess(IsStreamInfo(kStreamIndex, _, _, _)));
// One Sample
EXPECT_CALL(*Out(),
OnProcess(AllOf(IsMediaSample(kStreamIndex, kOneSampleStart,
kOneSampleDuration, !kEncrypted),
MediaSampleContainsId(kId1),
Not(MediaSampleContainsId(kId2)),
Not(MediaSampleContainsId(kId3)))));
EXPECT_CALL(*Out(), OnProcess(AllOf(
IsMediaSample(kStreamIndex, kOneSampleStart,
kOneSampleDuration, !kEncrypted, _),
MediaSampleContainsId(kId1),
Not(MediaSampleContainsId(kId2)),
Not(MediaSampleContainsId(kId3)))));
// Two Samples
EXPECT_CALL(*Out(),
OnProcess(AllOf(IsMediaSample(kStreamIndex, kTwoSamplesStart,
kTwoSamplesDuration, !kEncrypted),
MediaSampleContainsId(kId1),
MediaSampleContainsId(kId2),
Not(MediaSampleContainsId(kId3)))));
OnProcess(AllOf(
IsMediaSample(kStreamIndex, kTwoSamplesStart,
kTwoSamplesDuration, !kEncrypted, _),
MediaSampleContainsId(kId1), MediaSampleContainsId(kId2),
Not(MediaSampleContainsId(kId3)))));
// Three Samples
EXPECT_CALL(*Out(),
OnProcess(AllOf(
IsMediaSample(kStreamIndex, kThreeSamplesStart,
kThreeSamplesDuration, !kEncrypted),
kThreeSamplesDuration, !kEncrypted, _),
MediaSampleContainsId(kId1), MediaSampleContainsId(kId2),
MediaSampleContainsId(kId3))));
@ -658,12 +660,12 @@ TEST_F(WebVttToMp4HandlerTest, CrossSegmentSamples) {
// Gap, Sample, Segment
EXPECT_CALL(*Out(),
OnProcess(AllOf(IsMediaSample(kStreamIndex, kGap1Start,
kGapDuration, !kEncrypted),
kGapDuration, !kEncrypted, _),
Not(MediaSampleContainsId(kId1)))));
EXPECT_CALL(*Out(), OnProcess(AllOf(
IsMediaSample(kStreamIndex, kSamplePart1Start,
kSamplePart1Duration, !kEncrypted),
kSamplePart1Duration, !kEncrypted, _),
MediaSampleContainsId(kId1))));
EXPECT_CALL(*Out(), OnProcess(IsSegmentInfo(kStreamIndex, kSegment1Start,
@ -673,12 +675,12 @@ TEST_F(WebVttToMp4HandlerTest, CrossSegmentSamples) {
// Sample, Gap, Segment
EXPECT_CALL(*Out(), OnProcess(AllOf(
IsMediaSample(kStreamIndex, kSamplePart2Start,
kSamplePart2Duration, !kEncrypted),
kSamplePart2Duration, !kEncrypted, _),
MediaSampleContainsId(kId1))));
EXPECT_CALL(*Out(),
OnProcess(AllOf(IsMediaSample(kStreamIndex, kGap2Start,
kGapDuration, !kEncrypted),
kGapDuration, !kEncrypted, _),
Not(MediaSampleContainsId(kId1)))));
EXPECT_CALL(*Out(), OnProcess(IsSegmentInfo(kStreamIndex, kSegment2Start,