OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 VideoDecoderAccelerator | 5 // This file contains an implementation of VideoDecoderAccelerator |
6 // that utilizes the hardware video decoder present on the Exynos SoC. | 6 // that utilizes the hardware video decoder present on the Exynos SoC. |
7 | 7 |
8 #ifndef CONTENT_COMMON_GPU_MEDIA_EXYNOS_VIDEO_DECODE_ACCELERATOR_H_ | 8 #ifndef CONTENT_COMMON_GPU_MEDIA_EXYNOS_VIDEO_DECODE_ACCELERATOR_H_ |
9 #define CONTENT_COMMON_GPU_MEDIA_EXYNOS_VIDEO_DECODE_ACCELERATOR_H_ | 9 #define CONTENT_COMMON_GPU_MEDIA_EXYNOS_VIDEO_DECODE_ACCELERATOR_H_ |
10 | 10 |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 size_t length[2]; // mmap() length for each plane. | 144 size_t length[2]; // mmap() length for each plane. |
145 int32 input_id; // triggering input_id as given to Decode(). | 145 int32 input_id; // triggering input_id as given to Decode(). |
146 }; | 146 }; |
147 | 147 |
148 // Record for GSC input buffers. | 148 // Record for GSC input buffers. |
149 struct GscInputRecord { | 149 struct GscInputRecord { |
150 GscInputRecord(); | 150 GscInputRecord(); |
151 ~GscInputRecord(); | 151 ~GscInputRecord(); |
152 bool at_device; // held by device. | 152 bool at_device; // held by device. |
153 int mfc_output; // MFC output buffer index to recycle when this input | 153 int mfc_output; // MFC output buffer index to recycle when this input |
154 // is complete | 154 // is complete. |
155 }; | 155 }; |
156 | 156 |
157 // Record for GSC output buffers. | 157 // Record for GSC output buffers. |
158 struct GscOutputRecord { | 158 struct GscOutputRecord { |
159 GscOutputRecord(); | 159 GscOutputRecord(); |
160 ~GscOutputRecord(); | 160 ~GscOutputRecord(); |
161 bool at_device; // held by device. | 161 bool at_device; // held by device. |
162 bool at_client; // held by client. | 162 bool at_client; // held by client. |
163 int fd; // file descriptor from backing EGLImage. | 163 int fd; // file descriptor from backing EGLImage. |
164 EGLImageKHR egl_image; // backing EGLImage. | 164 EGLImageKHR egl_image; // backing EGLImage. |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 // | 340 // |
341 | 341 |
342 // Completed decode buffers, waiting for MFC. | 342 // Completed decode buffers, waiting for MFC. |
343 std::list<int> mfc_input_ready_queue_; | 343 std::list<int> mfc_input_ready_queue_; |
344 | 344 |
345 // MFC decode device. | 345 // MFC decode device. |
346 int mfc_fd_; | 346 int mfc_fd_; |
347 | 347 |
348 // MFC input buffer state. | 348 // MFC input buffer state. |
349 bool mfc_input_streamon_; | 349 bool mfc_input_streamon_; |
350 // MFC input buffers, total. | |
351 int mfc_input_buffer_count_; | |
352 // MFC input buffers enqueued to device. | 350 // MFC input buffers enqueued to device. |
353 int mfc_input_buffer_queued_count_; | 351 int mfc_input_buffer_queued_count_; |
354 // Input buffers ready to use, as a LIFO since we don't care about ordering. | 352 // Input buffers ready to use, as a LIFO since we don't care about ordering. |
355 std::vector<int> mfc_free_input_buffers_; | 353 std::vector<int> mfc_free_input_buffers_; |
356 // Mapping of int index to MFC input buffer record. | 354 // Mapping of int index to MFC input buffer record. |
357 std::vector<MfcInputRecord> mfc_input_buffer_map_; | 355 std::vector<MfcInputRecord> mfc_input_buffer_map_; |
358 | 356 |
359 // MFC output buffer state. | 357 // MFC output buffer state. |
360 bool mfc_output_streamon_; | 358 bool mfc_output_streamon_; |
361 // MFC output buffers, total. | |
362 int mfc_output_buffer_count_; | |
363 // MFC output buffers enqueued to device. | 359 // MFC output buffers enqueued to device. |
364 int mfc_output_buffer_queued_count_; | 360 int mfc_output_buffer_queued_count_; |
365 // Output buffers ready to use, as a LIFO since we don't care about ordering. | 361 // Output buffers ready to use, as a LIFO since we don't care about ordering. |
366 std::vector<int> mfc_free_output_buffers_; | 362 std::vector<int> mfc_free_output_buffers_; |
367 // Mapping of int index to MFC output buffer record. | 363 // Mapping of int index to MFC output buffer record. |
368 std::vector<MfcOutputRecord> mfc_output_buffer_map_; | 364 std::vector<MfcOutputRecord> mfc_output_buffer_map_; |
369 // Required size of MFC output buffers. Two sizes for two planes. | 365 // Required size of MFC output buffers. Two sizes for two planes. |
370 size_t mfc_output_buffer_size_[2]; | 366 size_t mfc_output_buffer_size_[2]; |
371 uint32 mfc_output_buffer_pixelformat_; | 367 uint32 mfc_output_buffer_pixelformat_; |
372 | 368 |
373 // Completed MFC outputs, waiting for GSC. | 369 // Completed MFC outputs, waiting for GSC. |
374 std::list<int> mfc_output_gsc_input_queue_; | 370 std::list<int> mfc_output_gsc_input_queue_; |
375 | 371 |
376 // GSC decode device. | 372 // GSC decode device. |
377 int gsc_fd_; | 373 int gsc_fd_; |
378 | 374 |
379 // GSC input buffer state. | 375 // GSC input buffer state. |
380 bool gsc_input_streamon_; | 376 bool gsc_input_streamon_; |
381 // GSC input buffers, total. | |
382 int gsc_input_buffer_count_; | |
383 // GSC input buffers enqueued to device. | 377 // GSC input buffers enqueued to device. |
384 int gsc_input_buffer_queued_count_; | 378 int gsc_input_buffer_queued_count_; |
385 // Input buffers ready to use, as a LIFO since we don't care about ordering. | 379 // Input buffers ready to use, as a LIFO since we don't care about ordering. |
386 std::vector<int> gsc_free_input_buffers_; | 380 std::vector<int> gsc_free_input_buffers_; |
387 // Mapping of int index to GSC input buffer record. | 381 // Mapping of int index to GSC input buffer record. |
388 std::vector<GscInputRecord> gsc_input_buffer_map_; | 382 std::vector<GscInputRecord> gsc_input_buffer_map_; |
389 | 383 |
390 // GSC output buffer state. | 384 // GSC output buffer state. |
391 bool gsc_output_streamon_; | 385 bool gsc_output_streamon_; |
392 // GSC output buffers, total. | |
393 int gsc_output_buffer_count_; | |
394 // GSC output buffers enqueued to device. | 386 // GSC output buffers enqueued to device. |
395 int gsc_output_buffer_queued_count_; | 387 int gsc_output_buffer_queued_count_; |
396 // Output buffers ready to use. We need a FIFO here. | 388 // Output buffers ready to use. We need a FIFO here. |
397 std::list<int> gsc_free_output_buffers_; | 389 std::list<int> gsc_free_output_buffers_; |
398 // Mapping of int index to GSC output buffer record. | 390 // Mapping of int index to GSC output buffer record. |
399 std::vector<GscOutputRecord> gsc_output_buffer_map_; | 391 std::vector<GscOutputRecord> gsc_output_buffer_map_; |
400 | 392 |
401 // Output picture size. | 393 // Output picture size. |
402 gfx::Size frame_buffer_size_; | 394 gfx::Size frame_buffer_size_; |
403 | 395 |
(...skipping 20 matching lines...) Expand all Loading... |
424 | 416 |
425 // The codec we'll be decoding for. | 417 // The codec we'll be decoding for. |
426 media::VideoCodecProfile video_profile_; | 418 media::VideoCodecProfile video_profile_; |
427 | 419 |
428 DISALLOW_COPY_AND_ASSIGN(ExynosVideoDecodeAccelerator); | 420 DISALLOW_COPY_AND_ASSIGN(ExynosVideoDecodeAccelerator); |
429 }; | 421 }; |
430 | 422 |
431 } // namespace content | 423 } // namespace content |
432 | 424 |
433 #endif // CONTENT_COMMON_GPU_MEDIA_EXYNOS_VIDEO_DECODE_ACCELERATOR_H_ | 425 #endif // CONTENT_COMMON_GPU_MEDIA_EXYNOS_VIDEO_DECODE_ACCELERATOR_H_ |
OLD | NEW |