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

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

Issue 1834303005: Refactor audio and video decoder status into common file. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments. Created 4 years, 8 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
« no previous file with comments | « no previous file | content/common/gpu/media/video_encode_accelerator_unittest.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 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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 DecodeNow(d.first, d.second); 177 DecodeNow(d.first, d.second);
178 decode_queue_.pop(); 178 decode_queue_.pop();
179 } 179 }
180 180
181 if (!initialized_callback_.is_null()) 181 if (!initialized_callback_.is_null())
182 initialized_callback_.Run(initialized_); 182 initialized_callback_.Run(initialized_);
183 } 183 }
184 184
185 void OnDecodeStatus(base::TimeDelta buffer_timestamp, 185 void OnDecodeStatus(base::TimeDelta buffer_timestamp,
186 const DecodeCallback& decode_callback, 186 const DecodeCallback& decode_callback,
187 ::media::AudioDecoder::Status status) { 187 ::media::DecodeStatus status) {
188 Status result_status = kDecodeOk; 188 Status result_status = kDecodeOk;
189 scoped_refptr<media::DecoderBufferBase> decoded; 189 scoped_refptr<media::DecoderBufferBase> decoded;
190 if (status == ::media::AudioDecoder::kOk && !decoded_chunks_.empty()) { 190 if (status == ::media::DecodeStatus::OK && !decoded_chunks_.empty()) {
191 decoded = ConvertDecoded(); 191 decoded = ConvertDecoded();
192 } else { 192 } else {
193 if (status != ::media::AudioDecoder::kOk) 193 if (status != ::media::DecodeStatus::OK)
194 result_status = kDecodeError; 194 result_status = kDecodeError;
195 decoded = new media::DecoderBufferAdapter(config_.id, 195 decoded = new media::DecoderBufferAdapter(config_.id,
196 new ::media::DecoderBuffer(0)); 196 new ::media::DecoderBuffer(0));
197 } 197 }
198 decoded_chunks_.clear(); 198 decoded_chunks_.clear();
199 decoded->set_timestamp(buffer_timestamp); 199 decoded->set_timestamp(buffer_timestamp);
200 base::WeakPtr<CastAudioDecoderImpl> self = weak_factory_.GetWeakPtr(); 200 base::WeakPtr<CastAudioDecoderImpl> self = weak_factory_.GetWeakPtr();
201 decode_callback.Run(result_status, decoded); 201 decode_callback.Run(result_status, decoded);
202 if (!self.get()) 202 if (!self.get())
203 return; // Return immediately if the decode callback deleted this. 203 return; // Return immediately if the decode callback deleted this.
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 return 2; 327 return 2;
328 case CastAudioDecoder::OutputFormat::kOutputPlanarFloat: 328 case CastAudioDecoder::OutputFormat::kOutputPlanarFloat:
329 return 4; 329 return 4;
330 } 330 }
331 NOTREACHED(); 331 NOTREACHED();
332 return 1; 332 return 1;
333 } 333 }
334 334
335 } // namespace media 335 } // namespace media
336 } // namespace chromecast 336 } // namespace chromecast
OLDNEW
« no previous file with comments | « no previous file | content/common/gpu/media/video_encode_accelerator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698