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 "media/gpu/fake_video_decode_accelerator.h" | 5 #include "media/gpu/fake_video_decode_accelerator.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <string.h> | 8 #include <string.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 | 42 |
43 FakeVideoDecodeAccelerator::~FakeVideoDecodeAccelerator() {} | 43 FakeVideoDecodeAccelerator::~FakeVideoDecodeAccelerator() {} |
44 | 44 |
45 bool FakeVideoDecodeAccelerator::Initialize(const Config& config, | 45 bool FakeVideoDecodeAccelerator::Initialize(const Config& config, |
46 Client* client) { | 46 Client* client) { |
47 DCHECK(child_task_runner_->BelongsToCurrentThread()); | 47 DCHECK(child_task_runner_->BelongsToCurrentThread()); |
48 if (config.profile == media::VIDEO_CODEC_PROFILE_UNKNOWN) { | 48 if (config.profile == media::VIDEO_CODEC_PROFILE_UNKNOWN) { |
49 LOG(ERROR) << "unknown codec profile"; | 49 LOG(ERROR) << "unknown codec profile"; |
50 return false; | 50 return false; |
51 } | 51 } |
52 if (config.is_encrypted) { | 52 if (config.is_encrypted()) { |
53 NOTREACHED() << "encrypted streams are not supported"; | 53 NOTREACHED() << "encrypted streams are not supported"; |
54 return false; | 54 return false; |
55 } | 55 } |
56 | 56 |
57 // V4L2VideoDecodeAccelerator waits until first decode call to ask for buffers | 57 // V4L2VideoDecodeAccelerator waits until first decode call to ask for buffers |
58 // This class asks for it on initialization instead. | 58 // This class asks for it on initialization instead. |
59 client_ = client; | 59 client_ = client; |
60 client_->ProvidePictureBuffers(kNumBuffers, 1, frame_buffer_size_, | 60 client_->ProvidePictureBuffers(kNumBuffers, 1, frame_buffer_size_, |
61 kDefaultTextureTarget); | 61 kDefaultTextureTarget); |
62 return true; | 62 return true; |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 // Bitstream no longer needed. | 175 // Bitstream no longer needed. |
176 client_->NotifyEndOfBitstreamBuffer(bitstream_id); | 176 client_->NotifyEndOfBitstreamBuffer(bitstream_id); |
177 if (flushing_ && queued_bitstream_ids_.empty()) { | 177 if (flushing_ && queued_bitstream_ids_.empty()) { |
178 flushing_ = false; | 178 flushing_ = false; |
179 client_->NotifyFlushDone(); | 179 client_->NotifyFlushDone(); |
180 } | 180 } |
181 } | 181 } |
182 } | 182 } |
183 | 183 |
184 } // namespace media | 184 } // namespace media |
OLD | NEW |