| 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 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 } | 444 } |
| 445 | 445 |
| 446 // Set to kError state just in case. | 446 // Set to kError state just in case. |
| 447 SetDecoderState(kError); | 447 SetDecoderState(kError); |
| 448 | 448 |
| 449 delete this; | 449 delete this; |
| 450 } | 450 } |
| 451 | 451 |
| 452 bool V4L2VideoDecodeAccelerator::CanDecodeOnIOThread() { return true; } | 452 bool V4L2VideoDecodeAccelerator::CanDecodeOnIOThread() { return true; } |
| 453 | 453 |
| 454 // static |
| 455 media::VideoDecodeAccelerator::SupportedResolution |
| 456 V4L2VideoDecodeAccelerator::GetSupportedResolution() { |
| 457 // NOTE: additional autodetection logic may require updating input buffer size |
| 458 // selection. |
| 459 media::VideoDecodeAccelerator::SupportedResolution resolution; |
| 460 resolution.min.SetSize(16, 16); |
| 461 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 462 switches::kIgnoreResolutionLimitsForAcceleratedVideoDecode)) |
| 463 resolution.max.SetSize(4096, 2160); |
| 464 else |
| 465 resolution.max.SetSize(1920, 1088); |
| 466 return resolution; |
| 467 } |
| 468 |
| 454 void V4L2VideoDecodeAccelerator::DecodeTask( | 469 void V4L2VideoDecodeAccelerator::DecodeTask( |
| 455 const media::BitstreamBuffer& bitstream_buffer) { | 470 const media::BitstreamBuffer& bitstream_buffer) { |
| 456 DVLOG(3) << "DecodeTask(): input_id=" << bitstream_buffer.id(); | 471 DVLOG(3) << "DecodeTask(): input_id=" << bitstream_buffer.id(); |
| 457 DCHECK_EQ(decoder_thread_.message_loop(), base::MessageLoop::current()); | 472 DCHECK_EQ(decoder_thread_.message_loop(), base::MessageLoop::current()); |
| 458 DCHECK_NE(decoder_state_, kUninitialized); | 473 DCHECK_NE(decoder_state_, kUninitialized); |
| 459 TRACE_EVENT1("Video Decoder", "V4L2VDA::DecodeTask", "input_id", | 474 TRACE_EVENT1("Video Decoder", "V4L2VDA::DecodeTask", "input_id", |
| 460 bitstream_buffer.id()); | 475 bitstream_buffer.id()); |
| 461 | 476 |
| 462 scoped_ptr<BitstreamBufferRef> bitstream_record(new BitstreamBufferRef( | 477 scoped_ptr<BitstreamBufferRef> bitstream_record(new BitstreamBufferRef( |
| 463 io_client_, io_message_loop_proxy_, | 478 io_client_, io_message_loop_proxy_, |
| (...skipping 1470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1934 gfx::Size new_size(base::checked_cast<int>(format.fmt.pix_mp.width), | 1949 gfx::Size new_size(base::checked_cast<int>(format.fmt.pix_mp.width), |
| 1935 base::checked_cast<int>(format.fmt.pix_mp.height)); | 1950 base::checked_cast<int>(format.fmt.pix_mp.height)); |
| 1936 if (frame_buffer_size_ != new_size) { | 1951 if (frame_buffer_size_ != new_size) { |
| 1937 DVLOG(3) << "IsResolutionChangeNecessary(): Resolution change detected"; | 1952 DVLOG(3) << "IsResolutionChangeNecessary(): Resolution change detected"; |
| 1938 return true; | 1953 return true; |
| 1939 } | 1954 } |
| 1940 return false; | 1955 return false; |
| 1941 } | 1956 } |
| 1942 | 1957 |
| 1943 } // namespace content | 1958 } // namespace content |
| OLD | NEW |