| 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 // This file contains an implementation of VideoDecodeAccelerator | 5 // This file contains an implementation of VideoDecodeAccelerator |
| 6 // that utilizes hardware video decoders, which expose Video4Linux 2 API | 6 // that utilizes hardware video decoders, which expose Video4Linux 2 API |
| 7 // (http://linuxtv.org/downloads/v4l-dvb-apis/). | 7 // (http://linuxtv.org/downloads/v4l-dvb-apis/). |
| 8 | 8 |
| 9 #ifndef CONTENT_COMMON_GPU_MEDIA_V4L2_VIDEO_DECODE_ACCELERATOR_H_ | 9 #ifndef CONTENT_COMMON_GPU_MEDIA_V4L2_VIDEO_DECODE_ACCELERATOR_H_ |
| 10 #define CONTENT_COMMON_GPU_MEDIA_V4L2_VIDEO_DECODE_ACCELERATOR_H_ | 10 #define CONTENT_COMMON_GPU_MEDIA_V4L2_VIDEO_DECODE_ACCELERATOR_H_ |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 | 98 |
| 99 // VideoDecodeAcceleratorImpl implementation. | 99 // VideoDecodeAcceleratorImpl implementation. |
| 100 virtual bool CanDecodeOnIOThread() OVERRIDE; | 100 virtual bool CanDecodeOnIOThread() OVERRIDE; |
| 101 | 101 |
| 102 private: | 102 private: |
| 103 // These are rather subjectively tuned. | 103 // These are rather subjectively tuned. |
| 104 enum { | 104 enum { |
| 105 kInputBufferCount = 8, | 105 kInputBufferCount = 8, |
| 106 // TODO(posciak): determine input buffer size based on level limits. | 106 // TODO(posciak): determine input buffer size based on level limits. |
| 107 // See http://crbug.com/255116. | 107 // See http://crbug.com/255116. |
| 108 kInputBufferMaxSize = 1024 * 1024, | 108 // Input bitstream buffer size for up to 1080p streams. |
| 109 kInputBufferMaxSizeFor1080p = 1024 * 1024, |
| 110 // Input bitstream buffer size for up to 4k streams. |
| 111 kInputBufferMaxSizeFor4k = 4 * kInputBufferMaxSizeFor1080p, |
| 109 // Number of output buffers to use for each VDA stage above what's required | 112 // Number of output buffers to use for each VDA stage above what's required |
| 110 // by the decoder (e.g. DPB size, in H264). We need | 113 // by the decoder (e.g. DPB size, in H264). We need |
| 111 // media::limits::kMaxVideoFrames to fill up the GpuVideoDecode pipeline, | 114 // media::limits::kMaxVideoFrames to fill up the GpuVideoDecode pipeline, |
| 112 // and +1 for a frame in transit. | 115 // and +1 for a frame in transit. |
| 113 kDpbOutputBufferExtraCount = media::limits::kMaxVideoFrames + 1, | 116 kDpbOutputBufferExtraCount = media::limits::kMaxVideoFrames + 1, |
| 114 }; | 117 }; |
| 115 | 118 |
| 116 // Internal state of the decoder. | 119 // Internal state of the decoder. |
| 117 enum State { | 120 enum State { |
| 118 kUninitialized, // Initialize() not yet called. | 121 kUninitialized, // Initialize() not yet called. |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 436 | 439 |
| 437 // The WeakPtrFactory for |weak_this_|. | 440 // The WeakPtrFactory for |weak_this_|. |
| 438 base::WeakPtrFactory<V4L2VideoDecodeAccelerator> weak_this_factory_; | 441 base::WeakPtrFactory<V4L2VideoDecodeAccelerator> weak_this_factory_; |
| 439 | 442 |
| 440 DISALLOW_COPY_AND_ASSIGN(V4L2VideoDecodeAccelerator); | 443 DISALLOW_COPY_AND_ASSIGN(V4L2VideoDecodeAccelerator); |
| 441 }; | 444 }; |
| 442 | 445 |
| 443 } // namespace content | 446 } // namespace content |
| 444 | 447 |
| 445 #endif // CONTENT_COMMON_GPU_MEDIA_V4L2_VIDEO_DECODE_ACCELERATOR_H_ | 448 #endif // CONTENT_COMMON_GPU_MEDIA_V4L2_VIDEO_DECODE_ACCELERATOR_H_ |
| OLD | NEW |