OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "webkit/glue/plugins/pepper_video_decoder.h" | 5 #include "webkit/glue/plugins/pepper_video_decoder.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "ppapi/c/dev/pp_video_dev.h" | 8 #include "ppapi/c/dev/pp_video_dev.h" |
9 #include "ppapi/c/dev/ppb_video_decoder_dev.h" | 9 #include "ppapi/c/dev/ppb_video_decoder_dev.h" |
10 #include "ppapi/c/pp_completion_callback.h" | 10 #include "ppapi/c/pp_completion_callback.h" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 } | 99 } |
100 | 100 |
101 VideoDecoder::~VideoDecoder() { | 101 VideoDecoder::~VideoDecoder() { |
102 } | 102 } |
103 | 103 |
104 // static | 104 // static |
105 const PPB_VideoDecoder_Dev* VideoDecoder::GetInterface() { | 105 const PPB_VideoDecoder_Dev* VideoDecoder::GetInterface() { |
106 return &ppb_videodecoder; | 106 return &ppb_videodecoder; |
107 } | 107 } |
108 | 108 |
| 109 VideoDecoder* VideoDecoder::AsVideoDecoder() { |
| 110 return this; |
| 111 } |
| 112 |
109 bool VideoDecoder::Init(const PP_VideoDecoderConfig_Dev& decoder_config) { | 113 bool VideoDecoder::Init(const PP_VideoDecoderConfig_Dev& decoder_config) { |
110 if (!instance()) | 114 if (!instance()) |
111 return false; | 115 return false; |
112 | 116 |
113 platform_video_decoder_.reset( | 117 platform_video_decoder_.reset( |
114 instance()->delegate()->CreateVideoDecoder(decoder_config)); | 118 instance()->delegate()->CreateVideoDecoder(decoder_config)); |
115 | 119 |
116 return platform_video_decoder_.get()? true : false; | 120 return platform_video_decoder_.get()? true : false; |
117 } | 121 } |
118 | 122 |
(...skipping 13 matching lines...) Expand all Loading... |
132 | 136 |
133 bool VideoDecoder::ReturnUncompressedDataBuffer( | 137 bool VideoDecoder::ReturnUncompressedDataBuffer( |
134 PP_VideoUncompressedDataBuffer_Dev& buffer) { | 138 PP_VideoUncompressedDataBuffer_Dev& buffer) { |
135 if (!platform_video_decoder_.get()) | 139 if (!platform_video_decoder_.get()) |
136 return false; | 140 return false; |
137 | 141 |
138 return platform_video_decoder_->ReturnUncompressedDataBuffer(buffer); | 142 return platform_video_decoder_->ReturnUncompressedDataBuffer(buffer); |
139 } | 143 } |
140 | 144 |
141 } // namespace pepper | 145 } // namespace pepper |
OLD | NEW |