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

Side by Side Diff: content/common/gpu/media/v4l2_slice_video_decode_accelerator.cc

Issue 1706023003: Moving the validation of bitstream_buffer into VDA implementations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix compiling errors on windows Created 4 years, 10 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 <errno.h> 5 #include <errno.h>
6 #include <fcntl.h> 6 #include <fcntl.h>
7 #include <linux/videodev2.h> 7 #include <linux/videodev2.h>
8 #include <poll.h> 8 #include <poll.h>
9 #include <string.h> 9 #include <string.h>
10 #include <sys/eventfd.h> 10 #include <sys/eventfd.h>
(...skipping 1166 matching lines...) Expand 10 before | Expand all | Expand 10 after
1177 DVLOGF(3) << "Device poll stopped"; 1177 DVLOGF(3) << "Device poll stopped";
1178 return true; 1178 return true;
1179 } 1179 }
1180 1180
1181 void V4L2SliceVideoDecodeAccelerator::Decode( 1181 void V4L2SliceVideoDecodeAccelerator::Decode(
1182 const media::BitstreamBuffer& bitstream_buffer) { 1182 const media::BitstreamBuffer& bitstream_buffer) {
1183 DVLOGF(3) << "input_id=" << bitstream_buffer.id() 1183 DVLOGF(3) << "input_id=" << bitstream_buffer.id()
1184 << ", size=" << bitstream_buffer.size(); 1184 << ", size=" << bitstream_buffer.size();
1185 DCHECK(io_task_runner_->BelongsToCurrentThread()); 1185 DCHECK(io_task_runner_->BelongsToCurrentThread());
1186 1186
1187 if (bitstream_buffer.id() < 0) {
1188 LOG(ERROR) << "Invalid bitstream_buffer, id: " << bitstream_buffer.id();
1189 if (base::SharedMemory::IsHandleValid(bitstream_buffer.handle()))
1190 base::SharedMemory::CloseHandle(bitstream_buffer.handle());
1191 NOTIFY_ERROR(INVALID_ARGUMENT);
1192 return;
1193 }
1194
1187 decoder_thread_task_runner_->PostTask( 1195 decoder_thread_task_runner_->PostTask(
1188 FROM_HERE, base::Bind(&V4L2SliceVideoDecodeAccelerator::DecodeTask, 1196 FROM_HERE, base::Bind(&V4L2SliceVideoDecodeAccelerator::DecodeTask,
1189 base::Unretained(this), bitstream_buffer)); 1197 base::Unretained(this), bitstream_buffer));
1190 } 1198 }
1191 1199
1192 void V4L2SliceVideoDecodeAccelerator::DecodeTask( 1200 void V4L2SliceVideoDecodeAccelerator::DecodeTask(
1193 const media::BitstreamBuffer& bitstream_buffer) { 1201 const media::BitstreamBuffer& bitstream_buffer) {
1194 DVLOGF(3) << "input_id=" << bitstream_buffer.id() 1202 DVLOGF(3) << "input_id=" << bitstream_buffer.id()
1195 << " size=" << bitstream_buffer.size(); 1203 << " size=" << bitstream_buffer.size();
1196 DCHECK(decoder_thread_task_runner_->BelongsToCurrentThread()); 1204 DCHECK(decoder_thread_task_runner_->BelongsToCurrentThread());
(...skipping 1356 matching lines...) Expand 10 before | Expand all | Expand 10 after
2553 V4L2SliceVideoDecodeAccelerator::GetSupportedProfiles() { 2561 V4L2SliceVideoDecodeAccelerator::GetSupportedProfiles() {
2554 scoped_refptr<V4L2Device> device = V4L2Device::Create(V4L2Device::kDecoder); 2562 scoped_refptr<V4L2Device> device = V4L2Device::Create(V4L2Device::kDecoder);
2555 if (!device) 2563 if (!device)
2556 return SupportedProfiles(); 2564 return SupportedProfiles();
2557 2565
2558 return device->GetSupportedDecodeProfiles(arraysize(supported_input_fourccs_), 2566 return device->GetSupportedDecodeProfiles(arraysize(supported_input_fourccs_),
2559 supported_input_fourccs_); 2567 supported_input_fourccs_);
2560 } 2568 }
2561 2569
2562 } // namespace content 2570 } // namespace content
OLDNEW
« no previous file with comments | « content/common/gpu/media/v4l2_jpeg_decode_accelerator.cc ('k') | content/common/gpu/media/v4l2_video_decode_accelerator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698