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

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

Issue 1485043002: Passed is_encrypted parameter to the VDA initialization. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 5 years 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 <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
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(const Config& config,
437 media::VideoCodecProfile profile, 437 Client* client) {
438 VideoDecodeAccelerator::Client* client) { 438 DVLOGF(3) << "profile: " << config.profile;
439 DVLOGF(3) << "profile: " << profile; 439 if (config.is_encrypted) {
440 NOTREACHED() << "Encrypted streams are not supported for this VDA";
441 return false;
442 }
443
440 DCHECK(child_task_runner_->BelongsToCurrentThread()); 444 DCHECK(child_task_runner_->BelongsToCurrentThread());
441 DCHECK_EQ(state_, kUninitialized); 445 DCHECK_EQ(state_, kUninitialized);
442 446
443 client_ptr_factory_.reset( 447 client_ptr_factory_.reset(
444 new base::WeakPtrFactory<VideoDecodeAccelerator::Client>(client)); 448 new base::WeakPtrFactory<VideoDecodeAccelerator::Client>(client));
445 client_ = client_ptr_factory_->GetWeakPtr(); 449 client_ = client_ptr_factory_->GetWeakPtr();
446 450
447 video_profile_ = profile; 451 video_profile_ = config.profile;
448 452
449 if (video_profile_ >= media::H264PROFILE_MIN && 453 if (video_profile_ >= media::H264PROFILE_MIN &&
450 video_profile_ <= media::H264PROFILE_MAX) { 454 video_profile_ <= media::H264PROFILE_MAX) {
451 h264_accelerator_.reset(new V4L2H264Accelerator(this)); 455 h264_accelerator_.reset(new V4L2H264Accelerator(this));
452 decoder_.reset(new H264Decoder(h264_accelerator_.get())); 456 decoder_.reset(new H264Decoder(h264_accelerator_.get()));
453 } else if (video_profile_ >= media::VP8PROFILE_MIN && 457 } else if (video_profile_ >= media::VP8PROFILE_MIN &&
454 video_profile_ <= media::VP8PROFILE_MAX) { 458 video_profile_ <= media::VP8PROFILE_MAX) {
455 vp8_accelerator_.reset(new V4L2VP8Accelerator(this)); 459 vp8_accelerator_.reset(new V4L2VP8Accelerator(this));
456 decoder_.reset(new VP8Decoder(vp8_accelerator_.get())); 460 decoder_.reset(new VP8Decoder(vp8_accelerator_.get()));
457 } else { 461 } else {
(...skipping 2081 matching lines...) Expand 10 before | Expand all | Expand 10 after
2539 if (!device) 2543 if (!device)
2540 return SupportedProfiles(); 2544 return SupportedProfiles();
2541 2545
2542 const uint32_t supported_formats[] = { 2546 const uint32_t supported_formats[] = {
2543 V4L2_PIX_FMT_H264_SLICE, V4L2_PIX_FMT_VP8_FRAME}; 2547 V4L2_PIX_FMT_H264_SLICE, V4L2_PIX_FMT_VP8_FRAME};
2544 return device->GetSupportedDecodeProfiles(arraysize(supported_formats), 2548 return device->GetSupportedDecodeProfiles(arraysize(supported_formats),
2545 supported_formats); 2549 supported_formats);
2546 } 2550 }
2547 2551
2548 } // namespace content 2552 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698