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

Side by Side Diff: media/cast/receiver/video_decoder.cc

Issue 308713005: Cast: Synthetic benchmark tool. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge + minor fix Created 6 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
« no previous file with comments | « media/cast/cast_testing.gypi ('k') | media/cast/test/cast_benchmarks.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/cast/receiver/video_decoder.h" 5 #include "media/cast/receiver/video_decoder.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/json/json_reader.h" 9 #include "base/json/json_reader.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 if (ImplBase::cast_initialization_status_ != STATUS_VIDEO_UNINITIALIZED) 178 if (ImplBase::cast_initialization_status_ != STATUS_VIDEO_UNINITIALIZED)
179 return; 179 return;
180 ImplBase::cast_initialization_status_ = STATUS_VIDEO_INITIALIZED; 180 ImplBase::cast_initialization_status_ = STATUS_VIDEO_INITIALIZED;
181 } 181 }
182 182
183 private: 183 private:
184 virtual ~FakeImpl() {} 184 virtual ~FakeImpl() {}
185 185
186 virtual scoped_refptr<VideoFrame> Decode(uint8* data, int len) OVERRIDE { 186 virtual scoped_refptr<VideoFrame> Decode(uint8* data, int len) OVERRIDE {
187 base::JSONReader reader; 187 base::JSONReader reader;
188 scoped_ptr<base::Value> values(reader.Read( 188 scoped_ptr<base::Value> values(
189 base::StringPiece(reinterpret_cast<char*>(data), len))); 189 reader.Read(base::StringPiece(reinterpret_cast<char*>(data))));
190 base::DictionaryValue* dict = NULL; 190 base::DictionaryValue* dict = NULL;
191 values->GetAsDictionary(&dict); 191 values->GetAsDictionary(&dict);
192 192
193 bool key = false; 193 bool key = false;
194 int id = 0; 194 int id = 0;
195 int ref = 0; 195 int ref = 0;
196 dict->GetBoolean("key", &key); 196 dict->GetBoolean("key", &key);
197 dict->GetInteger("id", &id); 197 dict->GetInteger("id", &id);
198 dict->GetInteger("ref", &ref); 198 dict->GetInteger("ref", &ref);
199 DCHECK(id == last_decoded_id_ + 1); 199 DCHECK(id == last_decoded_id_ + 1);
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 cast_environment_->PostTask(CastEnvironment::VIDEO, 250 cast_environment_->PostTask(CastEnvironment::VIDEO,
251 FROM_HERE, 251 FROM_HERE,
252 base::Bind(&VideoDecoder::ImplBase::DecodeFrame, 252 base::Bind(&VideoDecoder::ImplBase::DecodeFrame,
253 impl_, 253 impl_,
254 base::Passed(&encoded_frame), 254 base::Passed(&encoded_frame),
255 callback)); 255 callback));
256 } 256 }
257 257
258 } // namespace cast 258 } // namespace cast
259 } // namespace media 259 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/cast_testing.gypi ('k') | media/cast/test/cast_benchmarks.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698