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

Side by Side Diff: media/cast/test/fake_media_source.cc

Issue 518433002: Revert of Revert of Remove the last piece of deprecated synchronous IO code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/base/channel_mixer_unittest.cc ('k') | media/filters/audio_renderer_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "media/cast/test/fake_media_source.h" 5 #include "media/cast/test/fake_media_source.h"
6 6
7 #include "base/files/memory_mapped_file.h" 7 #include "base/files/memory_mapped_file.h"
8 #include "base/files/scoped_file.h" 8 #include "base/files/scoped_file.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 continue; 140 continue;
141 } 141 }
142 if (audio_stream_index_ != -1) { 142 if (audio_stream_index_ != -1) {
143 LOG(WARNING) << "Found multiple audio streams."; 143 LOG(WARNING) << "Found multiple audio streams.";
144 } 144 }
145 audio_stream_index_ = static_cast<int>(i); 145 audio_stream_index_ = static_cast<int>(i);
146 audio_params_.Reset( 146 audio_params_.Reset(
147 AudioParameters::AUDIO_PCM_LINEAR, 147 AudioParameters::AUDIO_PCM_LINEAR,
148 layout, 148 layout,
149 av_codec_context->channels, 149 av_codec_context->channels,
150 av_codec_context->channels,
151 av_codec_context->sample_rate, 150 av_codec_context->sample_rate,
152 8 * av_get_bytes_per_sample(av_codec_context->sample_fmt), 151 8 * av_get_bytes_per_sample(av_codec_context->sample_fmt),
153 av_codec_context->sample_rate / kAudioPacketsPerSecond); 152 av_codec_context->sample_rate / kAudioPacketsPerSecond);
154 LOG(INFO) << "Source file has audio."; 153 LOG(INFO) << "Source file has audio.";
155 } else if (av_codec->type == AVMEDIA_TYPE_VIDEO) { 154 } else if (av_codec->type == AVMEDIA_TYPE_VIDEO) {
156 VideoFrame::Format format = 155 VideoFrame::Format format =
157 PixelFormatToVideoFormat(av_codec_context->pix_fmt); 156 PixelFormatToVideoFormat(av_codec_context->pix_fmt);
158 if (format != VideoFrame::YV12) { 157 if (format != VideoFrame::YV12) {
159 LOG(ERROR) << "Cannot handle non YV12 video format: " << format; 158 LOG(ERROR) << "Cannot handle non YV12 video format: " << format;
160 continue; 159 continue;
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
586 AVCodecContext* FakeMediaSource::av_audio_context() { 585 AVCodecContext* FakeMediaSource::av_audio_context() {
587 return av_audio_stream()->codec; 586 return av_audio_stream()->codec;
588 } 587 }
589 588
590 AVCodecContext* FakeMediaSource::av_video_context() { 589 AVCodecContext* FakeMediaSource::av_video_context() {
591 return av_video_stream()->codec; 590 return av_video_stream()->codec;
592 } 591 }
593 592
594 } // namespace cast 593 } // namespace cast
595 } // namespace media 594 } // namespace media
OLDNEW
« no previous file with comments | « media/base/channel_mixer_unittest.cc ('k') | media/filters/audio_renderer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698