OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "ppapi/shared_impl/video_decoder_impl.h" | 5 #include "ppapi/shared_impl/video_decoder_impl.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "gpu/command_buffer/client/gles2_implementation.h" | 8 #include "gpu/command_buffer/client/gles2_implementation.h" |
9 #include "ppapi/c/pp_errors.h" | 9 #include "ppapi/c/pp_errors.h" |
10 #include "ppapi/proxy/plugin_resource_tracker.h" | 10 #include "ppapi/proxy/plugin_resource_tracker.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 | 25 |
26 VideoDecoderImpl::~VideoDecoderImpl() { | 26 VideoDecoderImpl::~VideoDecoderImpl() { |
27 } | 27 } |
28 | 28 |
29 void VideoDecoderImpl::InitCommon( | 29 void VideoDecoderImpl::InitCommon( |
30 PP_Resource graphics_context, | 30 PP_Resource graphics_context, |
31 gpu::gles2::GLES2Implementation* gles2_impl) { | 31 gpu::gles2::GLES2Implementation* gles2_impl) { |
32 DCHECK(graphics_context); | 32 DCHECK(graphics_context); |
33 DCHECK(!gles2_impl_ && !graphics_context_); | 33 DCHECK(!gles2_impl_ && !graphics_context_); |
34 gles2_impl_ = gles2_impl; | 34 gles2_impl_ = gles2_impl; |
35 PpapiGlobals::Get()->GetResourceTracker()->AddRefResource(graphics_context); | 35 TrackerBase::Get()->GetResourceTracker()->AddRefResource(graphics_context); |
36 graphics_context_ = graphics_context; | 36 graphics_context_ = graphics_context; |
37 } | 37 } |
38 | 38 |
39 void VideoDecoderImpl::Destroy() { | 39 void VideoDecoderImpl::Destroy() { |
40 graphics_context_ = 0; | 40 graphics_context_ = 0; |
41 gles2_impl_ = NULL; | 41 gles2_impl_ = NULL; |
42 PpapiGlobals::Get()->GetResourceTracker()->ReleaseResource(graphics_context_); | 42 TrackerBase::Get()->GetResourceTracker()->ReleaseResource(graphics_context_); |
43 } | 43 } |
44 | 44 |
45 bool VideoDecoderImpl::SetFlushCallback(PP_CompletionCallback callback) { | 45 bool VideoDecoderImpl::SetFlushCallback(PP_CompletionCallback callback) { |
46 CHECK(callback.func); | 46 CHECK(callback.func); |
47 if (flush_callback_.func) | 47 if (flush_callback_.func) |
48 return false; | 48 return false; |
49 flush_callback_ = callback; | 49 flush_callback_ = callback; |
50 return true; | 50 return true; |
51 } | 51 } |
52 | 52 |
(...skipping 30 matching lines...) Expand all Loading... |
83 bitstream_buffer_callbacks_.erase(it); | 83 bitstream_buffer_callbacks_.erase(it); |
84 PP_RunCompletionCallback(&cc, PP_OK); | 84 PP_RunCompletionCallback(&cc, PP_OK); |
85 } | 85 } |
86 | 86 |
87 void VideoDecoderImpl::FlushCommandBuffer() { | 87 void VideoDecoderImpl::FlushCommandBuffer() { |
88 if (gles2_impl_) | 88 if (gles2_impl_) |
89 gles2_impl_->Flush(); | 89 gles2_impl_->Flush(); |
90 } | 90 } |
91 | 91 |
92 } // namespace ppapi | 92 } // namespace ppapi |
OLD | NEW |