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

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: fix compiling errors on android Created 4 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
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 495 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 if (!IsBufferAfterReset(buffer_data.bitstream_buffer_id, 506 if (!IsBufferAfterReset(buffer_data.bitstream_buffer_id,
507 reset_bitstream_buffer_id_)) { 507 reset_bitstream_buffer_id_)) {
508 PutSHM_Locked(std::move(shm_buffer)); 508 PutSHM_Locked(std::move(shm_buffer));
509 continue; 509 continue;
510 } 510 }
511 } 511 }
512 512
513 // Create a BitstreamBuffer and send to VDA to decode. 513 // Create a BitstreamBuffer and send to VDA to decode.
514 media::BitstreamBuffer bitstream_buffer( 514 media::BitstreamBuffer bitstream_buffer(
515 buffer_data.bitstream_buffer_id, shm_buffer->handle(), buffer_data.size, 515 buffer_data.bitstream_buffer_id, shm_buffer->handle(), buffer_data.size,
516 base::TimeDelta::FromInternalValue(buffer_data.timestamp)); 516 0, base::TimeDelta::FromInternalValue(buffer_data.timestamp));
517 const bool inserted = 517 const bool inserted =
518 bitstream_buffers_in_decoder_.insert( 518 bitstream_buffers_in_decoder_.insert(
519 std::make_pair(bitstream_buffer.id(), shm_buffer.release())).second; 519 std::make_pair(bitstream_buffer.id(), shm_buffer.release())).second;
520 DCHECK(inserted) << "bitstream_buffer_id " << bitstream_buffer.id() 520 DCHECK(inserted) << "bitstream_buffer_id " << bitstream_buffer.id()
521 << " existed already in bitstream_buffers_in_decoder_"; 521 << " existed already in bitstream_buffers_in_decoder_";
522 RecordBufferData(buffer_data); 522 RecordBufferData(buffer_data);
523 vda_->Decode(bitstream_buffer); 523 vda_->Decode(bitstream_buffer);
524 } 524 }
525 } 525 }
526 526
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
812 } 812 }
813 813
814 void RTCVideoDecoder::ClearPendingBuffers() { 814 void RTCVideoDecoder::ClearPendingBuffers() {
815 // Delete WebRTC input buffers. 815 // Delete WebRTC input buffers.
816 for (const auto& pending_buffer : pending_buffers_) 816 for (const auto& pending_buffer : pending_buffers_)
817 delete[] pending_buffer.first._buffer; 817 delete[] pending_buffer.first._buffer;
818 pending_buffers_.clear(); 818 pending_buffers_.clear();
819 } 819 }
820 820
821 } // namespace content 821 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698