Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(412)

Unified Diff: media/filters/frame_processor_unittest.cc

Issue 2254093002: Return buffers from StreamParsers in a single unified map (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Restored calling GetBuffers after each Parse in WebM test Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/filters/frame_processor.cc ('k') | media/filters/media_source_state.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/frame_processor_unittest.cc
diff --git a/media/filters/frame_processor_unittest.cc b/media/filters/frame_processor_unittest.cc
index d051e8e58aeba450e30f493f90bb333c092c529d..353635b723d5303dfd21085074505268d22b0b75 100644
--- a/media/filters/frame_processor_unittest.cc
+++ b/media/filters/frame_processor_unittest.cc
@@ -33,7 +33,6 @@ using ::testing::Values;
namespace media {
typedef StreamParser::BufferQueue BufferQueue;
-typedef StreamParser::TextBufferQueueMap TextBufferQueueMap;
typedef StreamParser::TrackId TrackId;
// Used for setting expectations on callbacks. Using a StrictMock also lets us
@@ -152,10 +151,17 @@ class FrameProcessorTest : public testing::TestWithParam<bool> {
void ProcessFrames(const std::string& audio_timestamps,
const std::string& video_timestamps) {
+ StreamParser::BufferQueueMap buffer_queue_map;
+ const auto& audio_buffers =
+ StringToBufferQueue(audio_timestamps, audio_id_, DemuxerStream::AUDIO);
+ if (!audio_buffers.empty())
+ buffer_queue_map.insert(std::make_pair(audio_id_, audio_buffers));
+ const auto& video_buffers =
+ StringToBufferQueue(video_timestamps, video_id_, DemuxerStream::VIDEO);
+ if (!video_buffers.empty())
+ buffer_queue_map.insert(std::make_pair(video_id_, video_buffers));
ASSERT_TRUE(frame_processor_->ProcessFrames(
- StringToBufferQueue(audio_timestamps, audio_id_, DemuxerStream::AUDIO),
- StringToBufferQueue(video_timestamps, video_id_, DemuxerStream::VIDEO),
- empty_text_buffers_, append_window_start_, append_window_end_,
+ buffer_queue_map, append_window_start_, append_window_end_,
&timestamp_offset_));
}
@@ -270,7 +276,6 @@ class FrameProcessorTest : public testing::TestWithParam<bool> {
const TrackId audio_id_;
const TrackId video_id_;
const BufferQueue empty_queue_;
- const TextBufferQueueMap empty_text_buffers_;
// StoreStatusAndBuffer's most recent result.
DemuxerStream::Status last_read_status_;
@@ -328,10 +333,13 @@ TEST_F(FrameProcessorTest, WrongTypeInAppendedBuffer) {
AddTestTracks(HAS_AUDIO);
EXPECT_FALSE(in_coded_frame_group());
- ASSERT_FALSE(frame_processor_->ProcessFrames(
- StringToBufferQueue("0K", audio_id_, DemuxerStream::VIDEO), empty_queue_,
- empty_text_buffers_, append_window_start_, append_window_end_,
- &timestamp_offset_));
+ StreamParser::BufferQueueMap buffer_queue_map;
+ const auto& audio_buffers =
+ StringToBufferQueue("0K", audio_id_, DemuxerStream::VIDEO);
+ buffer_queue_map.insert(std::make_pair(audio_id_, audio_buffers));
+ ASSERT_FALSE(
+ frame_processor_->ProcessFrames(buffer_queue_map, append_window_start_,
+ append_window_end_, &timestamp_offset_));
EXPECT_FALSE(in_coded_frame_group());
EXPECT_EQ(base::TimeDelta(), timestamp_offset_);
CheckExpectedRangesByTimestamp(audio_.get(), "{ }");
@@ -341,10 +349,13 @@ TEST_F(FrameProcessorTest, WrongTypeInAppendedBuffer) {
TEST_F(FrameProcessorTest, NonMonotonicallyIncreasingTimestampInOneCall) {
AddTestTracks(HAS_AUDIO);
- ASSERT_FALSE(frame_processor_->ProcessFrames(
- StringToBufferQueue("10K 0K", audio_id_, DemuxerStream::AUDIO),
- empty_queue_, empty_text_buffers_, append_window_start_,
- append_window_end_, &timestamp_offset_));
+ StreamParser::BufferQueueMap buffer_queue_map;
+ const auto& audio_buffers =
+ StringToBufferQueue("10K 0K", audio_id_, DemuxerStream::AUDIO);
+ buffer_queue_map.insert(std::make_pair(audio_id_, audio_buffers));
+ ASSERT_FALSE(
+ frame_processor_->ProcessFrames(buffer_queue_map, append_window_start_,
+ append_window_end_, &timestamp_offset_));
EXPECT_FALSE(in_coded_frame_group());
EXPECT_EQ(base::TimeDelta(), timestamp_offset_);
CheckExpectedRangesByTimestamp(audio_.get(), "{ }");
« no previous file with comments | « media/filters/frame_processor.cc ('k') | media/filters/media_source_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698