| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this |
| 2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the |
| 3 // LICENSE file. | 3 // LICENSE file. |
| 4 | 4 |
| 5 #ifndef MEDIA_BASE_MOCK_MEDIA_FILTERS_H_ | 5 #ifndef MEDIA_BASE_MOCK_MEDIA_FILTERS_H_ |
| 6 #define MEDIA_BASE_MOCK_MEDIA_FILTERS_H_ | 6 #define MEDIA_BASE_MOCK_MEDIA_FILTERS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/waitable_event.h" | 10 #include "base/waitable_event.h" |
| (...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 config_->video_height, | 451 config_->video_height, |
| 452 mock_frame_time_, | 452 mock_frame_time_, |
| 453 config_->frame_duration, | 453 config_->frame_duration, |
| 454 &frame); | 454 &frame); |
| 455 if (!frame) { | 455 if (!frame) { |
| 456 host_->Error(PIPELINE_ERROR_OUT_OF_MEMORY); | 456 host_->Error(PIPELINE_ERROR_OUT_OF_MEMORY); |
| 457 ADD_FAILURE(); | 457 ADD_FAILURE(); |
| 458 } else { | 458 } else { |
| 459 mock_frame_time_ += config_->frame_duration; | 459 mock_frame_time_ += config_->frame_duration; |
| 460 if (mock_frame_time_ >= config_->media_duration) { | 460 if (mock_frame_time_ >= config_->media_duration) { |
| 461 frame->SetEndOfStream(true); | 461 VideoFrameImpl::CreateEmptyFrame(&frame); |
| 462 } else { |
| 463 InitializeYV12Frame(frame, (mock_frame_time_.InSecondsF() / |
| 464 config_->media_duration.InSecondsF())); |
| 462 } | 465 } |
| 463 InitializeYV12Frame(frame, (mock_frame_time_.InSecondsF() / | |
| 464 config_->media_duration.InSecondsF())); | |
| 465 callback->Run(frame); | 466 callback->Run(frame); |
| 466 } | 467 } |
| 467 } | 468 } |
| 468 } | 469 } |
| 469 | 470 |
| 470 MediaFormat media_format_; | 471 MediaFormat media_format_; |
| 471 base::TimeDelta mock_frame_time_; | 472 base::TimeDelta mock_frame_time_; |
| 472 base::TimeDelta seek_time_; | 473 base::TimeDelta seek_time_; |
| 473 const MockFilterConfig* config_; | 474 const MockFilterConfig* config_; |
| 474 | 475 |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 661 base::WaitableEvent event_; | 662 base::WaitableEvent event_; |
| 662 bool callback_success_status_; | 663 bool callback_success_status_; |
| 663 bool waiting_for_callback_; | 664 bool waiting_for_callback_; |
| 664 | 665 |
| 665 DISALLOW_COPY_AND_ASSIGN(InitializationHelper); | 666 DISALLOW_COPY_AND_ASSIGN(InitializationHelper); |
| 666 }; | 667 }; |
| 667 | 668 |
| 668 } // namespace media | 669 } // namespace media |
| 669 | 670 |
| 670 #endif // MEDIA_BASE_MOCK_MEDIA_FILTERS_H_ | 671 #endif // MEDIA_BASE_MOCK_MEDIA_FILTERS_H_ |
| OLD | NEW |