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

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

Issue 9293033: Fix Android build after r119851 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "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"
10
11 #if !defined(OS_ANDROID)
9 #include "media/ffmpeg/ffmpeg_common.h" 12 #include "media/ffmpeg/ffmpeg_common.h"
10 #include "media/webm/webm_constants.h" 13
14 // Why FF_INPUT_BUFFER_PADDING_SIZE? FFmpeg assumes all input buffers are
15 // padded with this value.
16 #define INPUT_BUFFER_PADDING_SIZE FF_INPUT_BUFFER_PADDING_SIZE
17 #else
18 // Since FFmpeg is not available on Android, align the value with the setting
19 // in libavcodec's avcodec.h.
20 #define INPUT_BUFFER_PADDING_SIZE 16
acolwell GONE FROM CHROMIUM 2012/01/31 16:30:43 Since you're not compiling webm_stream_parser.cc f
21 #endif
11 22
12 namespace media { 23 namespace media {
13 24
14 static Buffer* CreateBuffer(const uint8* data, size_t size) { 25 static Buffer* CreateBuffer(const uint8* data, size_t size) {
15 // Why FF_INPUT_BUFFER_PADDING_SIZE? FFmpeg assumes all input buffers are 26 scoped_array<uint8> buf(new uint8[size + INPUT_BUFFER_PADDING_SIZE]);
16 // padded with this value.
17 scoped_array<uint8> buf(new uint8[size + FF_INPUT_BUFFER_PADDING_SIZE]);
18 memcpy(buf.get(), data, size); 27 memcpy(buf.get(), data, size);
19 memset(buf.get() + size, 0, FF_INPUT_BUFFER_PADDING_SIZE); 28 memset(buf.get() + size, 0, INPUT_BUFFER_PADDING_SIZE);
20 return new DataBuffer(buf.Pass(), size); 29 return new DataBuffer(buf.Pass(), size);
21 } 30 }
22 31
23 WebMClusterParser::WebMClusterParser(int64 timecode_scale, 32 WebMClusterParser::WebMClusterParser(int64 timecode_scale,
24 int audio_track_num, 33 int audio_track_num,
25 base::TimeDelta audio_default_duration, 34 base::TimeDelta audio_default_duration,
26 int video_track_num, 35 int video_track_num,
27 base::TimeDelta video_default_duration) 36 base::TimeDelta video_default_duration)
28 : timecode_multiplier_(timecode_scale / 1000.0), 37 : timecode_multiplier_(timecode_scale / 1000.0),
29 audio_track_num_(audio_track_num), 38 audio_track_num_(audio_track_num),
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 DVLOG(1) << "Got SimpleBlock timecode is not strictly monotonically " 144 DVLOG(1) << "Got SimpleBlock timecode is not strictly monotonically "
136 << "increasing for track " << track_num; 145 << "increasing for track " << track_num;
137 return false; 146 return false;
138 } 147 }
139 148
140 queue->push_back(buffer); 149 queue->push_back(buffer);
141 return true; 150 return true;
142 } 151 }
143 152
144 } // namespace media 153 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698