| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <deque> | 5 #include <deque> |
| 6 | 6 |
| 7 #include "media/base/filters.h" | 7 #include "media/base/filters.h" |
| 8 #include "media/base/mock_ffmpeg.h" | 8 #include "media/base/mock_ffmpeg.h" |
| 9 #include "media/base/mock_filter_host.h" | 9 #include "media/base/mock_filter_host.h" |
| 10 #include "media/base/mock_filters.h" | 10 #include "media/base/mock_filters.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 FFmpegDemuxerTest() { | 60 FFmpegDemuxerTest() { |
| 61 // Create an FFmpegDemuxer. | 61 // Create an FFmpegDemuxer. |
| 62 factory_ = FFmpegDemuxer::CreateFilterFactory(); | 62 factory_ = FFmpegDemuxer::CreateFilterFactory(); |
| 63 MediaFormat media_format; | 63 MediaFormat media_format; |
| 64 media_format.SetAsString(MediaFormat::kMimeType, | 64 media_format.SetAsString(MediaFormat::kMimeType, |
| 65 mime_type::kApplicationOctetStream); | 65 mime_type::kApplicationOctetStream); |
| 66 demuxer_ = factory_->Create<FFmpegDemuxer>(media_format); | 66 demuxer_ = factory_->Create<FFmpegDemuxer>(media_format); |
| 67 DCHECK(demuxer_); | 67 DCHECK(demuxer_); |
| 68 | 68 |
| 69 // Inject a filter host and message loop and prepare a data source. | 69 // Inject a filter host and message loop and prepare a data source. |
| 70 demuxer_->SetFilterHost(&host_); | 70 demuxer_->set_host(&host_); |
| 71 demuxer_->SetMessageLoop(&message_loop_); | 71 demuxer_->set_message_loop(&message_loop_); |
| 72 data_source_ = new StrictMock<MockDataSource>(); | 72 data_source_ = new StrictMock<MockDataSource>(); |
| 73 | 73 |
| 74 // Initialize FFmpeg fixtures. | 74 // Initialize FFmpeg fixtures. |
| 75 memset(&format_context_, 0, sizeof(format_context_)); | 75 memset(&format_context_, 0, sizeof(format_context_)); |
| 76 memset(&streams_, 0, sizeof(streams_)); | 76 memset(&streams_, 0, sizeof(streams_)); |
| 77 memset(&codecs_, 0, sizeof(codecs_)); | 77 memset(&codecs_, 0, sizeof(codecs_)); |
| 78 | 78 |
| 79 // Initialize AVCodexContext structures. | 79 // Initialize AVCodexContext structures. |
| 80 codecs_[AV_STREAM_DATA].codec_type = CODEC_TYPE_DATA; | 80 codecs_[AV_STREAM_DATA].codec_type = CODEC_TYPE_DATA; |
| 81 codecs_[AV_STREAM_DATA].codec_id = CODEC_ID_NONE; | 81 codecs_[AV_STREAM_DATA].codec_id = CODEC_ID_NONE; |
| (...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 640 | 640 |
| 641 // Attempt the read... | 641 // Attempt the read... |
| 642 audio->Read(callback.release()); | 642 audio->Read(callback.release()); |
| 643 message_loop_.RunAllPending(); | 643 message_loop_.RunAllPending(); |
| 644 | 644 |
| 645 // ...and verify that |callback| was deleted. | 645 // ...and verify that |callback| was deleted. |
| 646 MockFFmpeg::get()->CheckPoint(1); | 646 MockFFmpeg::get()->CheckPoint(1); |
| 647 } | 647 } |
| 648 | 648 |
| 649 } // namespace media | 649 } // namespace media |
| OLD | NEW |