| 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 "media/webm/webm_cluster_parser.h" | 5 #include "media/webm/webm_cluster_parser.h" | 
| 6 | 6 | 
| 7 #include "base/logging.h" | 7 #include "base/logging.h" | 
| 8 #include "media/base/data_buffer.h" | 8 #include "media/base/data_buffer.h" | 
| 9 #include "media/webm/webm_constants.h" | 9 #include "media/webm/webm_constants.h" | 
| 10 | 10 | 
| 11 namespace media { | 11 namespace media { | 
| 12 | 12 | 
| 13 static Buffer* CreateBuffer(const uint8* data, size_t size) { | 13 static Buffer* CreateBuffer(const uint8* data, size_t size) { | 
| 14   scoped_array<uint8> buf(new uint8[size]); | 14   scoped_array<uint8> buf(new uint8[size]); | 
| 15   memcpy(buf.get(), data, size); | 15   memcpy(buf.get(), data, size); | 
| 16   return new DataBuffer(buf.release(), size); | 16   return new DataBuffer(buf.Pass(), size); | 
| 17 } | 17 } | 
| 18 | 18 | 
| 19 WebMClusterParser::WebMClusterParser(int64 timecode_scale, | 19 WebMClusterParser::WebMClusterParser(int64 timecode_scale, | 
| 20                                      int audio_track_num, | 20                                      int audio_track_num, | 
| 21                                      base::TimeDelta audio_default_duration, | 21                                      base::TimeDelta audio_default_duration, | 
| 22                                      int video_track_num, | 22                                      int video_track_num, | 
| 23                                      base::TimeDelta video_default_duration) | 23                                      base::TimeDelta video_default_duration) | 
| 24     : timecode_multiplier_(timecode_scale / 1000.0), | 24     : timecode_multiplier_(timecode_scale / 1000.0), | 
| 25       audio_track_num_(audio_track_num), | 25       audio_track_num_(audio_track_num), | 
| 26       audio_default_duration_(audio_default_duration), | 26       audio_default_duration_(audio_default_duration), | 
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 146     DVLOG(1) << "Got SimpleBlock timecode is not strictly monotonically " | 146     DVLOG(1) << "Got SimpleBlock timecode is not strictly monotonically " | 
| 147             << "increasing for track " << track_num; | 147             << "increasing for track " << track_num; | 
| 148     return false; | 148     return false; | 
| 149   } | 149   } | 
| 150 | 150 | 
| 151   queue->push_back(buffer); | 151   queue->push_back(buffer); | 
| 152   return true; | 152   return true; | 
| 153 } | 153 } | 
| 154 | 154 | 
| 155 }  // namespace media | 155 }  // namespace media | 
| OLD | NEW | 
|---|