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

Side by Side Diff: media/gpu/avda_codec_image.cc

Issue 2000833003: Don't reset the codec state for a flush; this kills the frames. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix comment. Add dcheck. Created 4 years, 6 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 | « media/gpu/android_video_decode_accelerator.cc ('k') | no next file » | 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 "media/gpu/avda_codec_image.h" 5 #include "media/gpu/avda_codec_image.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 17 matching lines...) Expand all
28 : shared_state_(shared_state), 28 : shared_state_(shared_state),
29 codec_buffer_index_(kInvalidCodecBufferIndex), 29 codec_buffer_index_(kInvalidCodecBufferIndex),
30 media_codec_(codec), 30 media_codec_(codec),
31 decoder_(decoder), 31 decoder_(decoder),
32 surface_texture_(surface_texture), 32 surface_texture_(surface_texture),
33 texture_(0), 33 texture_(0),
34 picture_buffer_id_(picture_buffer_id) { 34 picture_buffer_id_(picture_buffer_id) {
35 // Default to a sane guess of "flip Y", just in case we can't get 35 // Default to a sane guess of "flip Y", just in case we can't get
36 // the matrix on the first call. 36 // the matrix on the first call.
37 memset(gl_matrix_, 0, sizeof(gl_matrix_)); 37 memset(gl_matrix_, 0, sizeof(gl_matrix_));
38 gl_matrix_[0] = gl_matrix_[10] = gl_matrix_[15] = 1.0f; 38 gl_matrix_[0] = gl_matrix_[10] = gl_matrix_[13] = gl_matrix_[15] = 1.0f;
39 gl_matrix_[5] = -1.0f; 39 gl_matrix_[5] = -1.0f;
40 shared_state_->SetImageForPicture(picture_buffer_id_, this); 40 shared_state_->SetImageForPicture(picture_buffer_id_, this);
41 } 41 }
42 42
43 AVDACodecImage::~AVDACodecImage() { 43 AVDACodecImage::~AVDACodecImage() {
44 shared_state_->SetImageForPicture(picture_buffer_id_, nullptr); 44 shared_state_->SetImageForPicture(picture_buffer_id_, nullptr);
45 } 45 }
46 46
47 void AVDACodecImage::Destroy(bool have_context) {} 47 void AVDACodecImage::Destroy(bool have_context) {}
48 48
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 } 277 }
278 278
279 bool AVDACodecImage::IsCodecBufferOutstanding() const { 279 bool AVDACodecImage::IsCodecBufferOutstanding() const {
280 static_assert(kUpdateOnly < 0 && kUpdateOnly > kRendered && 280 static_assert(kUpdateOnly < 0 && kUpdateOnly > kRendered &&
281 kRendered > kInvalidCodecBufferIndex, 281 kRendered > kInvalidCodecBufferIndex,
282 "Codec buffer index enum values are not ordered correctly."); 282 "Codec buffer index enum values are not ordered correctly.");
283 return codec_buffer_index_ > kRendered && media_codec_; 283 return codec_buffer_index_ > kRendered && media_codec_;
284 } 284 }
285 285
286 } // namespace media 286 } // namespace media
OLDNEW
« no previous file with comments | « media/gpu/android_video_decode_accelerator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698