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

Side by Side Diff: media/filters/ffmpeg_audio_decoder.cc

Issue 8418017: Miscellaneous header file cleanup for src/media. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add at_exit Created 9 years, 1 month 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/filters/chunk_demuxer.cc ('k') | media/filters/ffmpeg_video_decoder.h » ('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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/filters/ffmpeg_audio_decoder.h" 5 #include "media/filters/ffmpeg_audio_decoder.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "media/base/audio_decoder_config.h"
8 #include "media/base/data_buffer.h" 9 #include "media/base/data_buffer.h"
9 #include "media/base/demuxer.h" 10 #include "media/base/demuxer.h"
10 #include "media/base/filter_host.h" 11 #include "media/base/filter_host.h"
11 #include "media/ffmpeg/ffmpeg_common.h" 12 #include "media/ffmpeg/ffmpeg_common.h"
12 13
13 namespace media { 14 namespace media {
14 15
15 // Returns true if the decode result was an error. 16 // Returns true if the decode result was an error.
16 static bool IsErrorResult(int result, int decoded_size) { 17 static bool IsErrorResult(int result, int decoded_size) {
17 return result < 0 || 18 return result < 0 ||
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 283
283 base::TimeDelta FFmpegAudioDecoder::CalculateDuration(int size) { 284 base::TimeDelta FFmpegAudioDecoder::CalculateDuration(int size) {
284 int64 denominator = ChannelLayoutToChannelCount(channel_layout_) * 285 int64 denominator = ChannelLayoutToChannelCount(channel_layout_) *
285 bits_per_channel_ / 8 * samples_per_second_; 286 bits_per_channel_ / 8 * samples_per_second_;
286 double microseconds = size / 287 double microseconds = size /
287 (denominator / static_cast<double>(base::Time::kMicrosecondsPerSecond)); 288 (denominator / static_cast<double>(base::Time::kMicrosecondsPerSecond));
288 return base::TimeDelta::FromMicroseconds(static_cast<int64>(microseconds)); 289 return base::TimeDelta::FromMicroseconds(static_cast<int64>(microseconds));
289 } 290 }
290 291
291 } // namespace media 292 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/chunk_demuxer.cc ('k') | media/filters/ffmpeg_video_decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698