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

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

Issue 17408005: Refactored DecoderBuffer to use unix_hacker_style naming. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@localrefactor
Patch Set: Created 7 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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/video_frame_stream.h" 5 #include "media/filters/video_frame_stream.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback_helpers.h" 8 #include "base/callback_helpers.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 SatisfyRead(VideoDecoder::kOk, NULL); 198 SatisfyRead(VideoDecoder::kOk, NULL);
199 } 199 }
200 200
201 void VideoFrameStream::Decode(const scoped_refptr<DecoderBuffer>& buffer) { 201 void VideoFrameStream::Decode(const scoped_refptr<DecoderBuffer>& buffer) {
202 DCHECK(state_ == STATE_NORMAL || state_ == STATE_FLUSHING_DECODER) << state_; 202 DCHECK(state_ == STATE_NORMAL || state_ == STATE_FLUSHING_DECODER) << state_;
203 DCHECK(!read_cb_.is_null()); 203 DCHECK(!read_cb_.is_null());
204 DCHECK(reset_cb_.is_null()); 204 DCHECK(reset_cb_.is_null());
205 DCHECK(stop_cb_.is_null()); 205 DCHECK(stop_cb_.is_null());
206 DCHECK(buffer); 206 DCHECK(buffer);
207 207
208 int buffer_size = buffer->IsEndOfStream() ? 0 : buffer->GetDataSize(); 208 int buffer_size = buffer->end_of_stream() ? 0 : buffer->data_size();
209 decoder_->Decode(buffer, base::Bind(&VideoFrameStream::OnFrameReady, 209 decoder_->Decode(buffer, base::Bind(&VideoFrameStream::OnFrameReady,
210 weak_this_, buffer_size)); 210 weak_this_, buffer_size));
211 } 211 }
212 212
213 void VideoFrameStream::FlushDecoder() { 213 void VideoFrameStream::FlushDecoder() {
214 Decode(DecoderBuffer::CreateEOSBuffer()); 214 Decode(DecoderBuffer::CreateEOSBuffer());
215 } 215 }
216 216
217 void VideoFrameStream::OnFrameReady(int buffer_size, 217 void VideoFrameStream::OnFrameReady(int buffer_size,
218 const VideoDecoder::Status status, 218 const VideoDecoder::Status status,
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 DCHECK(!stop_cb_.is_null()); 411 DCHECK(!stop_cb_.is_null());
412 412
413 state_ = STATE_STOPPED; 413 state_ = STATE_STOPPED;
414 stream_ = NULL; 414 stream_ = NULL;
415 decoder_.reset(); 415 decoder_.reset();
416 decrypting_demuxer_stream_.reset(); 416 decrypting_demuxer_stream_.reset();
417 base::ResetAndReturn(&stop_cb_).Run(); 417 base::ResetAndReturn(&stop_cb_).Run();
418 } 418 }
419 419
420 } // namespace media 420 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/source_buffer_stream_unittest.cc ('k') | media/filters/video_frame_stream_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698