| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/dxva_picture_buffer_win.h" | 5 #include "media/gpu/dxva_picture_buffer_win.h" |
| 6 | 6 |
| 7 #include "media/gpu/dxva_video_decode_accelerator_win.h" | 7 #include "media/gpu/dxva_video_decode_accelerator_win.h" |
| 8 #include "third_party/angle/include/EGL/egl.h" | 8 #include "third_party/angle/include/EGL/egl.h" |
| 9 #include "third_party/angle/include/EGL/eglext.h" | 9 #include "third_party/angle/include/EGL/eglext.h" |
| 10 #include "ui/gl/gl_bindings.h" | 10 #include "ui/gl/gl_bindings.h" |
| 11 #include "ui/gl/gl_context.h" | 11 #include "ui/gl/gl_context.h" |
| 12 #include "ui/gl/gl_fence.h" | 12 #include "ui/gl/gl_fence.h" |
| 13 #include "ui/gl/gl_surface_egl.h" | 13 #include "ui/gl/gl_surface_egl.h" |
| 14 #include "ui/gl/scoped_binders.h" | 14 #include "ui/gl/scoped_binders.h" |
| 15 | 15 |
| 16 namespace media { | 16 namespace media { |
| 17 | 17 |
| 18 namespace { |
| 19 |
| 20 void LogDXVAError(int line) { |
| 21 LOG(ERROR) << "Error in dxva_picture_buffer_win.cc on line " << line; |
| 22 } |
| 23 |
| 24 } // namespace |
| 25 |
| 18 #define RETURN_ON_FAILURE(result, log, ret) \ | 26 #define RETURN_ON_FAILURE(result, log, ret) \ |
| 19 do { \ | 27 do { \ |
| 20 if (!(result)) { \ | 28 if (!(result)) { \ |
| 21 DLOG(ERROR) << log; \ | 29 DLOG(ERROR) << log; \ |
| 30 LogDXVAError(__LINE__); \ |
| 22 return ret; \ | 31 return ret; \ |
| 23 } \ | 32 } \ |
| 24 } while (0) | 33 } while (0) |
| 25 | 34 |
| 26 #define RETURN_ON_HR_FAILURE(result, log, ret) \ | 35 #define RETURN_ON_HR_FAILURE(result, log, ret) \ |
| 27 RETURN_ON_FAILURE(SUCCEEDED(result), \ | 36 RETURN_ON_FAILURE(SUCCEEDED(result), \ |
| 28 log << ", HRESULT: 0x" << std::hex << result, ret); | 37 log << ", HRESULT: 0x" << std::hex << result, ret); |
| 29 | 38 |
| 30 enum { | 39 enum { |
| 31 // The keyed mutex should always be released before the other thread | 40 // The keyed mutex should always be released before the other thread |
| (...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 581 | 590 |
| 582 if (stream_) { | 591 if (stream_) { |
| 583 EGLBoolean result = eglStreamConsumerReleaseKHR(egl_display, stream_); | 592 EGLBoolean result = eglStreamConsumerReleaseKHR(egl_display, stream_); |
| 584 RETURN_ON_FAILURE(result, "Could not release stream", false); | 593 RETURN_ON_FAILURE(result, "Could not release stream", false); |
| 585 } | 594 } |
| 586 set_available(true); | 595 set_available(true); |
| 587 return true; | 596 return true; |
| 588 } | 597 } |
| 589 | 598 |
| 590 } // namespace media | 599 } // namespace media |
| OLD | NEW |