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

Side by Side Diff: content/renderer/media/rtc_video_decoder.cc

Issue 1541353002: Add offset support to BitstreamBuffer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address review comments and rebase Created 4 years, 9 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 | « content/content_common.gypi ('k') | media/base/bitstream_buffer.h » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/renderer/media/rtc_video_decoder.h" 5 #include "content/renderer/media/rtc_video_decoder.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
501 if (!IsBufferAfterReset(buffer_data.bitstream_buffer_id, 501 if (!IsBufferAfterReset(buffer_data.bitstream_buffer_id,
502 reset_bitstream_buffer_id_)) { 502 reset_bitstream_buffer_id_)) {
503 PutSHM_Locked(std::move(shm_buffer)); 503 PutSHM_Locked(std::move(shm_buffer));
504 continue; 504 continue;
505 } 505 }
506 } 506 }
507 507
508 // Create a BitstreamBuffer and send to VDA to decode. 508 // Create a BitstreamBuffer and send to VDA to decode.
509 media::BitstreamBuffer bitstream_buffer( 509 media::BitstreamBuffer bitstream_buffer(
510 buffer_data.bitstream_buffer_id, shm_buffer->handle(), buffer_data.size, 510 buffer_data.bitstream_buffer_id, shm_buffer->handle(), buffer_data.size,
511 base::TimeDelta::FromInternalValue(buffer_data.timestamp)); 511 0, base::TimeDelta::FromInternalValue(buffer_data.timestamp));
512 const bool inserted = 512 const bool inserted =
513 bitstream_buffers_in_decoder_.insert( 513 bitstream_buffers_in_decoder_.insert(
514 std::make_pair(bitstream_buffer.id(), shm_buffer.release())).second; 514 std::make_pair(bitstream_buffer.id(), shm_buffer.release())).second;
515 DCHECK(inserted) << "bitstream_buffer_id " << bitstream_buffer.id() 515 DCHECK(inserted) << "bitstream_buffer_id " << bitstream_buffer.id()
516 << " existed already in bitstream_buffers_in_decoder_"; 516 << " existed already in bitstream_buffers_in_decoder_";
517 RecordBufferData(buffer_data); 517 RecordBufferData(buffer_data);
518 vda_->Decode(bitstream_buffer); 518 vda_->Decode(bitstream_buffer);
519 } 519 }
520 } 520 }
521 521
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
807 } 807 }
808 808
809 void RTCVideoDecoder::ClearPendingBuffers() { 809 void RTCVideoDecoder::ClearPendingBuffers() {
810 // Delete WebRTC input buffers. 810 // Delete WebRTC input buffers.
811 for (const auto& pending_buffer : pending_buffers_) 811 for (const auto& pending_buffer : pending_buffers_)
812 delete[] pending_buffer.first._buffer; 812 delete[] pending_buffer.first._buffer;
813 pending_buffers_.clear(); 813 pending_buffers_.clear();
814 } 814 }
815 815
816 } // namespace content 816 } // namespace content
OLDNEW
« no previous file with comments | « content/content_common.gypi ('k') | media/base/bitstream_buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698