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

Side by Side Diff: media/filters/gpu_video_decoder.cc

Issue 11961051: Merge 176816 (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1364/src/
Patch Set: Created 7 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
« no previous file with comments | « media/filters/gpu_video_decoder.h ('k') | ppapi/api/dev/pp_video_dev.idl » ('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 (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/filters/gpu_video_decoder.h" 5 #include "media/filters/gpu_video_decoder.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback_helpers.h" 8 #include "base/callback_helpers.h"
9 #include "base/cpu.h" 9 #include "base/cpu.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 return; 278 return;
279 } 279 }
280 280
281 if (!pending_reset_cb_.is_null()) 281 if (!pending_reset_cb_.is_null())
282 return; 282 return;
283 283
284 size_t size = buffer->GetDataSize(); 284 size_t size = buffer->GetDataSize();
285 SHMBuffer* shm_buffer = GetSHM(size); 285 SHMBuffer* shm_buffer = GetSHM(size);
286 memcpy(shm_buffer->shm->memory(), buffer->GetData(), size); 286 memcpy(shm_buffer->shm->memory(), buffer->GetData(), size);
287 BitstreamBuffer bitstream_buffer( 287 BitstreamBuffer bitstream_buffer(
288 next_bitstream_buffer_id_++, shm_buffer->shm->handle(), size); 288 next_bitstream_buffer_id_, shm_buffer->shm->handle(), size);
289 // Mask against 30 bits, to avoid (undefined) wraparound on signed integer.
290 next_bitstream_buffer_id_ = (next_bitstream_buffer_id_ + 1) & 0x3FFFFFFF;
289 bool inserted = bitstream_buffers_in_decoder_.insert(std::make_pair( 291 bool inserted = bitstream_buffers_in_decoder_.insert(std::make_pair(
290 bitstream_buffer.id(), BufferPair(shm_buffer, buffer))).second; 292 bitstream_buffer.id(), BufferPair(shm_buffer, buffer))).second;
291 DCHECK(inserted); 293 DCHECK(inserted);
292 RecordBufferData(bitstream_buffer, *buffer); 294 RecordBufferData(bitstream_buffer, *buffer);
293 295
294 vda_loop_proxy_->PostTask(FROM_HERE, base::Bind( 296 vda_loop_proxy_->PostTask(FROM_HERE, base::Bind(
295 &VideoDecodeAccelerator::Decode, weak_vda_, bitstream_buffer)); 297 &VideoDecodeAccelerator::Decode, weak_vda_, bitstream_buffer));
296 298
297 if (CanMoreDecodeWorkBeDone()) 299 if (CanMoreDecodeWorkBeDone())
298 EnsureDemuxOrDecode(); 300 EnsureDemuxOrDecode();
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 584
583 error_occured_ = true; 585 error_occured_ = true;
584 586
585 if (!pending_read_cb_.is_null()) { 587 if (!pending_read_cb_.is_null()) {
586 base::ResetAndReturn(&pending_read_cb_).Run(kDecodeError, NULL); 588 base::ResetAndReturn(&pending_read_cb_).Run(kDecodeError, NULL);
587 return; 589 return;
588 } 590 }
589 } 591 }
590 592
591 } // namespace media 593 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/gpu_video_decoder.h ('k') | ppapi/api/dev/pp_video_dev.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698