Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 <sys/eventfd.h> | 9 #include <sys/eventfd.h> |
| 10 #include <sys/ioctl.h> | 10 #include <sys/ioctl.h> |
| (...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 426 weak_this_, error)); | 426 weak_this_, error)); |
| 427 return; | 427 return; |
| 428 } | 428 } |
| 429 | 429 |
| 430 if (client_) { | 430 if (client_) { |
| 431 client_->NotifyError(error); | 431 client_->NotifyError(error); |
| 432 client_ptr_factory_.reset(); | 432 client_ptr_factory_.reset(); |
| 433 } | 433 } |
| 434 } | 434 } |
| 435 | 435 |
| 436 bool V4L2SliceVideoDecodeAccelerator::Initialize( | 436 bool V4L2SliceVideoDecodeAccelerator::Initialize( |
|
Pawel Osciak
2015/12/01 07:16:07
Initialize() should fail for VDAs that don't suppo
Tima Vaisburd
2015/12/02 02:25:07
Done.
| |
| 437 media::VideoCodecProfile profile, | 437 const media::VideoDecodeAccelerator::InitParams& params, |
|
Pawel Osciak
2015/12/01 07:16:07
Just "const InitParam& params" should work as well
Tima Vaisburd
2015/12/02 02:25:07
Done.
| |
| 438 VideoDecodeAccelerator::Client* client) { | 438 VideoDecodeAccelerator::Client* client) { |
| 439 DVLOGF(3) << "profile: " << profile; | 439 DVLOGF(3) << "profile: " << profile; |
|
Pawel Osciak
2015/12/01 07:16:07
s/profile/params.profile/
Tima Vaisburd
2015/12/02 02:25:06
Done.
| |
| 440 DCHECK(child_task_runner_->BelongsToCurrentThread()); | 440 DCHECK(child_task_runner_->BelongsToCurrentThread()); |
| 441 DCHECK_EQ(state_, kUninitialized); | 441 DCHECK_EQ(state_, kUninitialized); |
| 442 | 442 |
| 443 client_ptr_factory_.reset( | 443 client_ptr_factory_.reset( |
| 444 new base::WeakPtrFactory<VideoDecodeAccelerator::Client>(client)); | 444 new base::WeakPtrFactory<VideoDecodeAccelerator::Client>(client)); |
| 445 client_ = client_ptr_factory_->GetWeakPtr(); | 445 client_ = client_ptr_factory_->GetWeakPtr(); |
| 446 | 446 |
| 447 video_profile_ = profile; | 447 video_profile_ = params.profile; |
|
xhwang
2015/12/01 07:15:02
In all non-android concrete VDAs, DCHECK that |is_
Tima Vaisburd
2015/12/02 02:25:07
Returned |false| instead as recommended by Pawel O
| |
| 448 | 448 |
| 449 if (video_profile_ >= media::H264PROFILE_MIN && | 449 if (video_profile_ >= media::H264PROFILE_MIN && |
| 450 video_profile_ <= media::H264PROFILE_MAX) { | 450 video_profile_ <= media::H264PROFILE_MAX) { |
| 451 h264_accelerator_.reset(new V4L2H264Accelerator(this)); | 451 h264_accelerator_.reset(new V4L2H264Accelerator(this)); |
| 452 decoder_.reset(new H264Decoder(h264_accelerator_.get())); | 452 decoder_.reset(new H264Decoder(h264_accelerator_.get())); |
| 453 } else if (video_profile_ >= media::VP8PROFILE_MIN && | 453 } else if (video_profile_ >= media::VP8PROFILE_MIN && |
| 454 video_profile_ <= media::VP8PROFILE_MAX) { | 454 video_profile_ <= media::VP8PROFILE_MAX) { |
| 455 vp8_accelerator_.reset(new V4L2VP8Accelerator(this)); | 455 vp8_accelerator_.reset(new V4L2VP8Accelerator(this)); |
| 456 decoder_.reset(new VP8Decoder(vp8_accelerator_.get())); | 456 decoder_.reset(new VP8Decoder(vp8_accelerator_.get())); |
| 457 } else { | 457 } else { |
| (...skipping 2081 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2539 if (!device) | 2539 if (!device) |
| 2540 return SupportedProfiles(); | 2540 return SupportedProfiles(); |
| 2541 | 2541 |
| 2542 const uint32_t supported_formats[] = { | 2542 const uint32_t supported_formats[] = { |
| 2543 V4L2_PIX_FMT_H264_SLICE, V4L2_PIX_FMT_VP8_FRAME}; | 2543 V4L2_PIX_FMT_H264_SLICE, V4L2_PIX_FMT_VP8_FRAME}; |
| 2544 return device->GetSupportedDecodeProfiles(arraysize(supported_formats), | 2544 return device->GetSupportedDecodeProfiles(arraysize(supported_formats), |
| 2545 supported_formats); | 2545 supported_formats); |
| 2546 } | 2546 } |
| 2547 | 2547 |
| 2548 } // namespace content | 2548 } // namespace content |
| OLD | NEW |