| 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 "content/common/gpu/media/fake_video_decode_accelerator.h" | 5 #include "content/common/gpu/media/fake_video_decode_accelerator.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/thread_task_runner_handle.h" | 9 #include "base/thread_task_runner_handle.h" |
| 10 #include "media/base/bitstream_buffer.h" | 10 #include "media/base/bitstream_buffer.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 make_context_current_(make_context_current), | 34 make_context_current_(make_context_current), |
| 35 gl_(gl), | 35 gl_(gl), |
| 36 frame_buffer_size_(size), | 36 frame_buffer_size_(size), |
| 37 flushing_(false), | 37 flushing_(false), |
| 38 weak_this_factory_(this) { | 38 weak_this_factory_(this) { |
| 39 } | 39 } |
| 40 | 40 |
| 41 FakeVideoDecodeAccelerator::~FakeVideoDecodeAccelerator() { | 41 FakeVideoDecodeAccelerator::~FakeVideoDecodeAccelerator() { |
| 42 } | 42 } |
| 43 | 43 |
| 44 bool FakeVideoDecodeAccelerator::Initialize(media::VideoCodecProfile profile, | 44 bool FakeVideoDecodeAccelerator::Initialize(const Config& config, |
| 45 Client* client) { | 45 Client* client) { |
| 46 DCHECK(child_task_runner_->BelongsToCurrentThread()); | 46 DCHECK(child_task_runner_->BelongsToCurrentThread()); |
| 47 if (profile == media::VIDEO_CODEC_PROFILE_UNKNOWN) { | 47 if (config.profile == media::VIDEO_CODEC_PROFILE_UNKNOWN) { |
| 48 LOG(ERROR) << "unknown codec profile"; | 48 LOG(ERROR) << "unknown codec profile"; |
| 49 return false; | 49 return false; |
| 50 } | 50 } |
| 51 if (config.is_encrypted) { |
| 52 NOTREACHED() << "encrypted streams are not supported"; |
| 53 return false; |
| 54 } |
| 55 |
| 51 // V4L2VideoDecodeAccelerator waits until first decode call to ask for buffers | 56 // V4L2VideoDecodeAccelerator waits until first decode call to ask for buffers |
| 52 // This class asks for it on initialization instead. | 57 // This class asks for it on initialization instead. |
| 53 client_ = client; | 58 client_ = client; |
| 54 client_->ProvidePictureBuffers(kNumBuffers, | 59 client_->ProvidePictureBuffers(kNumBuffers, |
| 55 frame_buffer_size_, | 60 frame_buffer_size_, |
| 56 kDefaultTextureTarget); | 61 kDefaultTextureTarget); |
| 57 return true; | 62 return true; |
| 58 } | 63 } |
| 59 | 64 |
| 60 void FakeVideoDecodeAccelerator::Decode( | 65 void FakeVideoDecodeAccelerator::Decode( |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 // Bitstream no longer needed. | 171 // Bitstream no longer needed. |
| 167 client_->NotifyEndOfBitstreamBuffer(bitstream_id); | 172 client_->NotifyEndOfBitstreamBuffer(bitstream_id); |
| 168 if (flushing_ && queued_bitstream_ids_.empty()) { | 173 if (flushing_ && queued_bitstream_ids_.empty()) { |
| 169 flushing_ = false; | 174 flushing_ = false; |
| 170 client_->NotifyFlushDone(); | 175 client_->NotifyFlushDone(); |
| 171 } | 176 } |
| 172 } | 177 } |
| 173 } | 178 } |
| 174 | 179 |
| 175 } // namespace content | 180 } // namespace content |
| OLD | NEW |