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

Side by Side Diff: chromecast/media/cma/decoder/cast_audio_decoder_linux.cc

Issue 2158923004: Convert media constants to constexpr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "chromecast/media/cma/decoder/cast_audio_decoder.h" 5 #include "chromecast/media/cma/decoder/cast_audio_decoder.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <limits> 8 #include <limits>
9 #include <queue> 9 #include <queue>
10 #include <utility> 10 #include <utility>
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 // Post the task to ensure that |decode_callback| is not called from 130 // Post the task to ensure that |decode_callback| is not called from
131 // within a call to Decode(). 131 // within a call to Decode().
132 task_runner_->PostTask(FROM_HERE, 132 task_runner_->PostTask(FROM_HERE,
133 base::Bind(decode_callback, kDecodeOk, data)); 133 base::Bind(decode_callback, kDecodeOk, data));
134 return; 134 return;
135 } 135 }
136 136
137 // FFmpegAudioDecoder requires a timestamp to be set. 137 // FFmpegAudioDecoder requires a timestamp to be set.
138 base::TimeDelta timestamp = 138 base::TimeDelta timestamp =
139 base::TimeDelta::FromMicroseconds(data->timestamp()); 139 base::TimeDelta::FromMicroseconds(data->timestamp());
140 if (timestamp == ::media::kNoTimestamp()) 140 if (timestamp == ::media::kNoTimestamp)
141 data->set_timestamp(base::TimeDelta()); 141 data->set_timestamp(base::TimeDelta());
142 142
143 decode_pending_ = true; 143 decode_pending_ = true;
144 decoder_->Decode( 144 decoder_->Decode(
145 data->ToMediaBuffer(), 145 data->ToMediaBuffer(),
146 base::Bind(&CastAudioDecoderImpl::OnDecodeStatus, 146 base::Bind(&CastAudioDecoderImpl::OnDecodeStatus,
147 weak_factory_.GetWeakPtr(), timestamp, decode_callback)); 147 weak_factory_.GetWeakPtr(), timestamp, decode_callback));
148 } 148 }
149 149
150 void OnInitialized(bool success) { 150 void OnInitialized(bool success) {
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 return 2; 297 return 2;
298 case CastAudioDecoder::OutputFormat::kOutputPlanarFloat: 298 case CastAudioDecoder::OutputFormat::kOutputPlanarFloat:
299 return 4; 299 return 4;
300 } 300 }
301 NOTREACHED(); 301 NOTREACHED();
302 return 1; 302 return 1;
303 } 303 }
304 304
305 } // namespace media 305 } // namespace media
306 } // namespace chromecast 306 } // namespace chromecast
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698