@@ -175,7 +175,7 @@ bool AllwinnerV4L2Display::setup_drm() {
175175 m_display_width,
176176 m_display_height,
177177 m_display_vrefresh,
178- DRM_FORMAT_NV12 ,
178+ DRM_FORMAT_NV21 ,
179179 MODESET_PLANE_TYPE_PRIMARY) < 0 ) {
180180 std::cerr << " modeset_prepare failed" << std::endl;
181181 return false ;
@@ -240,7 +240,7 @@ bool AllwinnerV4L2Display::ensure_display_buffers(uint32_t width, uint32_t heigh
240240 recycle_display_buffers ();
241241
242242 debug_log (" cedar" , " Allocating " , kDisplayBufferCount ,
243- " DRM NV12 buffers for " , width, " x" , height);
243+ " DRM NV21 buffers for " , width, " x" , height);
244244
245245 m_drm_buffers.resize (kDisplayBufferCount );
246246 uint32_t stride = width;
@@ -272,7 +272,7 @@ bool AllwinnerV4L2Display::ensure_display_buffers(uint32_t width, uint32_t heigh
272272 if (drmModeAddFB2 (m_drm_fd,
273273 width,
274274 height,
275- DRM_FORMAT_NV12 ,
275+ DRM_FORMAT_NV21 ,
276276 handles,
277277 pitches,
278278 offsets,
@@ -575,7 +575,7 @@ void AllwinnerV4L2Display::teardown_omx() {
575575 m_decoder_state = OMX_StateLoaded;
576576}
577577
578- static void copy_planar_to_nv12 (uint8_t * dst,
578+ static void copy_planar_to_nv21 (uint8_t * dst,
579579 uint32_t dst_stride,
580580 uint32_t dst_uv_stride,
581581 const uint8_t * src,
@@ -595,8 +595,8 @@ static void copy_planar_to_nv12(uint8_t* dst,
595595 const uint8_t * u_row = src_u + row * (width / 2 );
596596 const uint8_t * v_row = src_v + row * (width / 2 );
597597 for (uint32_t col = 0 ; col < width / 2 ; ++col) {
598- dst_row[2 * col] = u_row [col];
599- dst_row[2 * col + 1 ] = v_row [col];
598+ dst_row[2 * col] = v_row [col];
599+ dst_row[2 * col + 1 ] = u_row [col];
600600 }
601601 }
602602}
@@ -725,7 +725,7 @@ void AllwinnerV4L2Display::decode_loop() {
725725 } else if (output_buffer->nFilledLen > 0 ) {
726726 auto & drm_buf = m_drm_buffers[m_drm_buffer_index];
727727 uint8_t * dst = static_cast <uint8_t *>(drm_buf.map );
728- copy_planar_to_nv12 (dst,
728+ copy_planar_to_nv21 (dst,
729729 m_display_stride,
730730 m_display_stride,
731731 output_buffer->pBuffer + output_buffer->nOffset ,
0 commit comments