| 50 | } |
| 51 | |
| 52 | AbstractYuyvBufferDecoder::AbstractYuyvBufferDecoder(CameraFeed *p_camera_feed) : |
| 53 | BufferDecoder(p_camera_feed) { |
| 54 | switch (camera_feed->get_format().pixel_format) { |
| 55 | case V4L2_PIX_FMT_YYUV: |
| 56 | component_indexes = new int[4]{ 0, 1, 2, 3 }; |
| 57 | break; |
| 58 | case V4L2_PIX_FMT_YVYU: |
| 59 | component_indexes = new int[4]{ 0, 2, 3, 1 }; |
| 60 | break; |
| 61 | case V4L2_PIX_FMT_UYVY: |
| 62 | component_indexes = new int[4]{ 1, 3, 0, 2 }; |
| 63 | break; |
| 64 | case V4L2_PIX_FMT_VYUY: |
| 65 | component_indexes = new int[4]{ 1, 3, 2, 0 }; |
| 66 | break; |
| 67 | default: |
| 68 | component_indexes = new int[4]{ 0, 2, 1, 3 }; |
| 69 | } |
| 70 | } |
| 71 | |
| 72 | AbstractYuyvBufferDecoder::~AbstractYuyvBufferDecoder() { |
| 73 | delete[] component_indexes; |
nothing calls this directly
no test coverage detected