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

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

Issue 10269022: Add StreamParserBuffer to ChunkDemuxer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 7 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) 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/base/decrypt_config.h" 9 #include "media/base/decrypt_config.h"
10 #include "media/webm/webm_constants.h" 10 #include "media/webm/webm_constants.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 if (last_block_timecode_ != -1 && timecode < last_block_timecode_) { 108 if (last_block_timecode_ != -1 && timecode < last_block_timecode_) {
109 DVLOG(1) << "Got SimpleBlock with a timecode before the previous block."; 109 DVLOG(1) << "Got SimpleBlock with a timecode before the previous block.";
110 return false; 110 return false;
111 } 111 }
112 112
113 last_block_timecode_ = timecode; 113 last_block_timecode_ = timecode;
114 114
115 base::TimeDelta timestamp = base::TimeDelta::FromMicroseconds( 115 base::TimeDelta timestamp = base::TimeDelta::FromMicroseconds(
116 (cluster_timecode_ + timecode) * timecode_multiplier_); 116 (cluster_timecode_ + timecode) * timecode_multiplier_);
117 117
118 scoped_refptr<DataBuffer> buffer = DataBuffer::CopyFrom(data, size); 118 bool is_keyframe = ((flags & 0x80) != 0);
Ami GONE FROM CHROMIUM 2012/05/01 22:34:16 IWBN if 0x80 came from some NUMERIC_CONSTANT.
Ami GONE FROM CHROMIUM 2012/05/01 22:34:16 ((flags & 0x80) != 0) == flags & 0x80 FWIW
vrk (LEFT CHROMIUM) 2012/05/02 17:24:51 Done.
vrk (LEFT CHROMIUM) 2012/05/02 17:24:51 I'm not sure where to put it, so I'm going to hold
119 scoped_refptr<StreamParserBuffer> buffer =
120 StreamParserBuffer::CopyFrom(data, size, is_keyframe);
119 121
120 if (track_num == video_track_num_ && video_encryption_key_id_.get()) { 122 if (track_num == video_track_num_ && video_encryption_key_id_.get()) {
121 buffer->SetDecryptConfig(scoped_ptr<DecryptConfig>(new DecryptConfig( 123 buffer->SetDecryptConfig(scoped_ptr<DecryptConfig>(new DecryptConfig(
122 video_encryption_key_id_.get(), video_encryption_key_id_size_))); 124 video_encryption_key_id_.get(), video_encryption_key_id_size_)));
123 } 125 }
124 126
125 buffer->SetTimestamp(timestamp); 127 buffer->SetTimestamp(timestamp);
126 BufferQueue* queue = NULL; 128 BufferQueue* queue = NULL;
127 129
128 if (track_num == audio_track_num_) { 130 if (track_num == audio_track_num_) {
(...skipping 12 matching lines...) Expand all
141 DVLOG(1) << "Got SimpleBlock timecode is not strictly monotonically " 143 DVLOG(1) << "Got SimpleBlock timecode is not strictly monotonically "
142 << "increasing for track " << track_num; 144 << "increasing for track " << track_num;
143 return false; 145 return false;
144 } 146 }
145 147
146 queue->push_back(buffer); 148 queue->push_back(buffer);
147 return true; 149 return true;
148 } 150 }
149 151
150 } // namespace media 152 } // namespace media
OLDNEW
« media/base/stream_parser_buffer.cc ('K') | « media/webm/webm_cluster_parser.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698