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

Side by Side Diff: media/webm/webm_cluster_parser.cc

Issue 9015015: Take advantage of the new Pass() machinery on scoped_ptr{,_malloc}. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased & removed unnecessary include of ffmpeg_common.h from ffmpeg_demuxer.h Created 8 years, 11 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 | Annotate | Revision Log
OLDNEW
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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 DVLOG(1) << "Got SimpleBlock timecode is not strictly monotonically " 131 DVLOG(1) << "Got SimpleBlock timecode is not strictly monotonically "
132 << "increasing for track " << track_num; 132 << "increasing for track " << track_num;
133 return false; 133 return false;
134 } 134 }
135 135
136 queue->push_back(buffer); 136 queue->push_back(buffer);
137 return true; 137 return true;
138 } 138 }
139 139
140 } // namespace media 140 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698