| OLD | NEW |
| 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 <dlfcn.h> | 5 #include <dlfcn.h> |
| 6 #include <errno.h> | 6 #include <errno.h> |
| 7 #include <fcntl.h> | 7 #include <fcntl.h> |
| 8 #include <linux/videodev2.h> | 8 #include <linux/videodev2.h> |
| 9 #include <poll.h> | 9 #include <poll.h> |
| 10 #include <sys/eventfd.h> | 10 #include <sys/eventfd.h> |
| (...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 } | 438 } |
| 439 | 439 |
| 440 // Set to kError state just in case. | 440 // Set to kError state just in case. |
| 441 SetDecoderState(kError); | 441 SetDecoderState(kError); |
| 442 | 442 |
| 443 delete this; | 443 delete this; |
| 444 } | 444 } |
| 445 | 445 |
| 446 bool V4L2VideoDecodeAccelerator::CanDecodeOnIOThread() { return true; } | 446 bool V4L2VideoDecodeAccelerator::CanDecodeOnIOThread() { return true; } |
| 447 | 447 |
| 448 // static |
| 449 media::VideoDecodeAccelerator::SupportedResolution |
| 450 V4L2VideoDecodeAccelerator::GetSupportedResolution() { |
| 451 // NOTE: additional autodetection logic may require updating input buffer size |
| 452 // selection. |
| 453 media::VideoDecodeAccelerator::SupportedResolution resolution; |
| 454 resolution.min.SetSize(16, 16); |
| 455 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 456 switches::kIgnoreResolutionLimitsForAcceleratedVideoDecode)) |
| 457 resolution.max.SetSize(4096, 2160); |
| 458 else |
| 459 resolution.max.SetSize(1920, 1088); |
| 460 return resolution; |
| 461 } |
| 462 |
| 448 void V4L2VideoDecodeAccelerator::DecodeTask( | 463 void V4L2VideoDecodeAccelerator::DecodeTask( |
| 449 const media::BitstreamBuffer& bitstream_buffer) { | 464 const media::BitstreamBuffer& bitstream_buffer) { |
| 450 DVLOG(3) << "DecodeTask(): input_id=" << bitstream_buffer.id(); | 465 DVLOG(3) << "DecodeTask(): input_id=" << bitstream_buffer.id(); |
| 451 DCHECK_EQ(decoder_thread_.message_loop(), base::MessageLoop::current()); | 466 DCHECK_EQ(decoder_thread_.message_loop(), base::MessageLoop::current()); |
| 452 DCHECK_NE(decoder_state_, kUninitialized); | 467 DCHECK_NE(decoder_state_, kUninitialized); |
| 453 TRACE_EVENT1("Video Decoder", "V4L2VDA::DecodeTask", "input_id", | 468 TRACE_EVENT1("Video Decoder", "V4L2VDA::DecodeTask", "input_id", |
| 454 bitstream_buffer.id()); | 469 bitstream_buffer.id()); |
| 455 | 470 |
| 456 scoped_ptr<BitstreamBufferRef> bitstream_record(new BitstreamBufferRef( | 471 scoped_ptr<BitstreamBufferRef> bitstream_record(new BitstreamBufferRef( |
| 457 io_client_, io_message_loop_proxy_, | 472 io_client_, io_message_loop_proxy_, |
| (...skipping 1515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1973 gfx::Size new_size(base::checked_cast<int>(format.fmt.pix_mp.width), | 1988 gfx::Size new_size(base::checked_cast<int>(format.fmt.pix_mp.width), |
| 1974 base::checked_cast<int>(format.fmt.pix_mp.height)); | 1989 base::checked_cast<int>(format.fmt.pix_mp.height)); |
| 1975 if (frame_buffer_size_ != new_size) { | 1990 if (frame_buffer_size_ != new_size) { |
| 1976 DVLOG(3) << "IsResolutionChangeNecessary(): Resolution change detected"; | 1991 DVLOG(3) << "IsResolutionChangeNecessary(): Resolution change detected"; |
| 1977 return true; | 1992 return true; |
| 1978 } | 1993 } |
| 1979 return false; | 1994 return false; |
| 1980 } | 1995 } |
| 1981 | 1996 |
| 1982 } // namespace content | 1997 } // namespace content |
| OLD | NEW |