| OLD | NEW |
| 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_picture_buffer_manager.h" | 5 #include "media/gpu/avda_picture_buffer_manager.h" |
| 6 | 6 |
| 7 #include <EGL/egl.h> | 7 #include <EGL/egl.h> |
| 8 #include <EGL/eglext.h> | 8 #include <EGL/eglext.h> |
| 9 | 9 |
| 10 #include "base/android/build_info.h" | 10 #include "base/android/build_info.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "media/base/android/sdk_media_codec_bridge.h" | 21 #include "media/base/android/sdk_media_codec_bridge.h" |
| 22 #include "media/gpu/avda_codec_image.h" | 22 #include "media/gpu/avda_codec_image.h" |
| 23 #include "media/gpu/avda_shared_state.h" | 23 #include "media/gpu/avda_shared_state.h" |
| 24 #include "ui/gl/android/surface_texture.h" | 24 #include "ui/gl/android/surface_texture.h" |
| 25 #include "ui/gl/egl_util.h" | 25 #include "ui/gl/egl_util.h" |
| 26 #include "ui/gl/gl_bindings.h" | 26 #include "ui/gl/gl_bindings.h" |
| 27 #include "ui/gl/gl_surface_egl.h" | 27 #include "ui/gl/gl_surface_egl.h" |
| 28 #include "ui/gl/scoped_binders.h" | 28 #include "ui/gl/scoped_binders.h" |
| 29 #include "ui/gl/scoped_make_current.h" | 29 #include "ui/gl/scoped_make_current.h" |
| 30 | 30 |
| 31 // If !|ptr|, log a message, post an error to |state_provider_|, and | 31 // If !|ptr|, log a message, notify |state_provider_| of the error, and |
| 32 // return an optional value. | 32 // return an optional value. |
| 33 #define RETURN_IF_NULL(ptr, ...) \ | 33 #define RETURN_IF_NULL(ptr, ...) \ |
| 34 do { \ | 34 do { \ |
| 35 if (!(ptr)) { \ | 35 if (!(ptr)) { \ |
| 36 DLOG(ERROR) << "Got null for " << #ptr; \ | 36 DLOG(ERROR) << "Got null for " << #ptr; \ |
| 37 state_provider_->PostError(FROM_HERE, \ | 37 state_provider_->NotifyError(VideoDecodeAccelerator::ILLEGAL_STATE); \ |
| 38 VideoDecodeAccelerator::ILLEGAL_STATE); \ | 38 return __VA_ARGS__; \ |
| 39 return __VA_ARGS__; \ | 39 } \ |
| 40 } \ | |
| 41 } while (0) | 40 } while (0) |
| 42 | 41 |
| 43 namespace media { | 42 namespace media { |
| 44 namespace { | 43 namespace { |
| 45 | 44 |
| 46 // Creates a SurfaceTexture and attaches a new gl texture to it. |*service_id| | 45 // Creates a SurfaceTexture and attaches a new gl texture to it. |*service_id| |
| 47 // is set to the new texture id. | 46 // is set to the new texture id. |
| 48 scoped_refptr<gl::SurfaceTexture> CreateAttachedSurfaceTexture( | 47 scoped_refptr<gl::SurfaceTexture> CreateAttachedSurfaceTexture( |
| 49 base::WeakPtr<gpu::gles2::GLES2Decoder> gl_decoder, | 48 base::WeakPtr<gpu::gles2::GLES2Decoder> gl_decoder, |
| 50 GLuint* service_id) { | 49 GLuint* service_id) { |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 | 292 |
| 294 bool AVDAPictureBufferManager::HasUnrenderedPictures() const { | 293 bool AVDAPictureBufferManager::HasUnrenderedPictures() const { |
| 295 for (int id : pictures_out_for_display_) { | 294 for (int id : pictures_out_for_display_) { |
| 296 if (GetImageForPicture(id)->is_unrendered()) | 295 if (GetImageForPicture(id)->is_unrendered()) |
| 297 return true; | 296 return true; |
| 298 } | 297 } |
| 299 return false; | 298 return false; |
| 300 } | 299 } |
| 301 | 300 |
| 302 } // namespace media | 301 } // namespace media |
| OLD | NEW |