Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Side by Side Diff: webkit/plugins/ppapi/content_decryptor_delegate.cc

Issue 17315021: Refactored DataBuffer to use unix_hacker style methods. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Inlined getters and setters on DataBuffer Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « media/filters/opus_audio_decoder.cc ('k') | webkit/renderer/media/crypto/ppapi/ffmpeg_cdm_audio_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698