| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/plugins/ppapi/content_decryptor_delegate.h" | 5 #include "webkit/plugins/ppapi/content_decryptor_delegate.h" |
| 6 | 6 |
| 7 #include "base/callback_helpers.h" | 7 #include "base/callback_helpers.h" |
| 8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
| 9 #include "base/message_loop/message_loop_proxy.h" | 9 #include "base/message_loop/message_loop_proxy.h" |
| 10 #include "media/base/audio_decoder_config.h" | 10 #include "media/base/audio_decoder_config.h" |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 memcpy(&frame_size, cur, sizeof(frame_size)); | 160 memcpy(&frame_size, cur, sizeof(frame_size)); |
| 161 cur += sizeof(frame_size); | 161 cur += sizeof(frame_size); |
| 162 bytes_left -= sizeof(frame_size); | 162 bytes_left -= sizeof(frame_size); |
| 163 | 163 |
| 164 // We should *not* have empty frame in the list. | 164 // We should *not* have empty frame in the list. |
| 165 if (frame_size <= 0 || bytes_left < frame_size) | 165 if (frame_size <= 0 || bytes_left < frame_size) |
| 166 return false; | 166 return false; |
| 167 | 167 |
| 168 scoped_refptr<media::DataBuffer> frame = | 168 scoped_refptr<media::DataBuffer> frame = |
| 169 media::DataBuffer::CopyFrom(cur, frame_size); | 169 media::DataBuffer::CopyFrom(cur, frame_size); |
| 170 frame->SetTimestamp(base::TimeDelta::FromMicroseconds(timestamp)); | 170 frame->set_timestamp(base::TimeDelta::FromMicroseconds(timestamp)); |
| 171 frames->push_back(frame); | 171 frames->push_back(frame); |
| 172 | 172 |
| 173 cur += frame_size; | 173 cur += frame_size; |
| 174 bytes_left -= frame_size; | 174 bytes_left -= frame_size; |
| 175 } while (bytes_left > 0); | 175 } while (bytes_left > 0); |
| 176 | 176 |
| 177 return true; | 177 return true; |
| 178 } | 178 } |
| 179 | 179 |
| 180 PP_AudioCodec MediaAudioCodecToPpAudioCodec(media::AudioCodec codec) { | 180 PP_AudioCodec MediaAudioCodecToPpAudioCodec(media::AudioCodec codec) { |
| (...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1018 | 1018 |
| 1019 if (free_buffers_.empty()) | 1019 if (free_buffers_.empty()) |
| 1020 return; | 1020 return; |
| 1021 | 1021 |
| 1022 tracking_info->buffer_id = free_buffers_.front(); | 1022 tracking_info->buffer_id = free_buffers_.front(); |
| 1023 free_buffers_.pop(); | 1023 free_buffers_.pop(); |
| 1024 } | 1024 } |
| 1025 | 1025 |
| 1026 } // namespace ppapi | 1026 } // namespace ppapi |
| 1027 } // namespace webkit | 1027 } // namespace webkit |
| OLD | NEW |