| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/logging.h" | 5 #include "base/logging.h" |
| 6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
| 7 #include "media/base/mock_filters.h" | 7 #include "media/base/mock_filters.h" |
| 8 #include "media/base/test_data_util.h" | 8 #include "media/base/test_data_util.h" |
| 9 #include "media/ffmpeg/ffmpeg_common.h" | 9 #include "media/ffmpeg/ffmpeg_common.h" |
| 10 #include "media/filters/ffmpeg_glue.h" | 10 #include "media/filters/ffmpeg_glue.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 DISALLOW_COPY_AND_ASSIGN(FFmpegGlueTest); | 71 DISALLOW_COPY_AND_ASSIGN(FFmpegGlueTest); |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 class FFmpegGlueDestructionTest : public ::testing::Test { | 74 class FFmpegGlueDestructionTest : public ::testing::Test { |
| 75 public: | 75 public: |
| 76 FFmpegGlueDestructionTest() {} | 76 FFmpegGlueDestructionTest() {} |
| 77 | 77 |
| 78 void Initialize(const char* filename) { | 78 void Initialize(const char* filename) { |
| 79 data_ = ReadTestDataFile(filename); | 79 data_ = ReadTestDataFile(filename); |
| 80 protocol_.reset(new InMemoryUrlProtocol( | 80 protocol_.reset(new InMemoryUrlProtocol( |
| 81 data_->GetData(), data_->GetDataSize(), false)); | 81 data_->get_data(), data_->get_data_size(), false)); |
| 82 glue_.reset(new FFmpegGlue(protocol_.get())); | 82 glue_.reset(new FFmpegGlue(protocol_.get())); |
| 83 CHECK(glue_->format_context()); | 83 CHECK(glue_->format_context()); |
| 84 CHECK(glue_->format_context()->pb); | 84 CHECK(glue_->format_context()->pb); |
| 85 } | 85 } |
| 86 | 86 |
| 87 virtual ~FFmpegGlueDestructionTest() { | 87 virtual ~FFmpegGlueDestructionTest() { |
| 88 // Ensure Initialize() was called. | 88 // Ensure Initialize() was called. |
| 89 CHECK(glue_.get()); | 89 CHECK(glue_.get()); |
| 90 CHECK(protocol_.get()); | 90 CHECK(protocol_.get()); |
| 91 | 91 |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 Initialize("bear-320x240.webm"); | 234 Initialize("bear-320x240.webm"); |
| 235 ASSERT_TRUE(glue_->OpenContext()); | 235 ASSERT_TRUE(glue_->OpenContext()); |
| 236 ASSERT_GT(glue_->format_context()->nb_streams, 0u); | 236 ASSERT_GT(glue_->format_context()->nb_streams, 0u); |
| 237 | 237 |
| 238 AVCodecContext* context = glue_->format_context()->streams[0]->codec; | 238 AVCodecContext* context = glue_->format_context()->streams[0]->codec; |
| 239 ASSERT_EQ(avcodec_open2( | 239 ASSERT_EQ(avcodec_open2( |
| 240 context, avcodec_find_decoder(context->codec_id), NULL), 0); | 240 context, avcodec_find_decoder(context->codec_id), NULL), 0); |
| 241 } | 241 } |
| 242 | 242 |
| 243 } // namespace media | 243 } // namespace media |
| OLD | NEW |