Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(48)

Side by Side Diff: media/filters/vpx_video_decoder.cc

Issue 1227383003: Remove memset from VideoFrame and mark buffer as unpoisoned (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: dalecurtis@ comments. Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #include "media/filters/vpx_video_decoder.h" 5 #include "media/filters/vpx_video_decoder.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 video_frame->get()->metadata()->SetInteger(VideoFrameMetadata::COLOR_SPACE, 496 video_frame->get()->metadata()->SetInteger(VideoFrameMetadata::COLOR_SPACE,
497 color_space); 497 color_space);
498 return; 498 return;
499 } 499 }
500 500
501 *video_frame = frame_pool_.CreateFrame( 501 *video_frame = frame_pool_.CreateFrame(
502 codec_format, 502 codec_format,
503 visible_size, 503 visible_size,
504 gfx::Rect(visible_size), 504 gfx::Rect(visible_size),
505 config_.natural_size(), 505 config_.natural_size(),
506 kNoTimestamp()); 506 kNoTimestamp(),
507 false);
507 video_frame->get()->metadata()->SetInteger(VideoFrameMetadata::COLOR_SPACE, 508 video_frame->get()->metadata()->SetInteger(VideoFrameMetadata::COLOR_SPACE,
508 color_space); 509 color_space);
509 510
510 CopyYPlane(vpx_image->planes[VPX_PLANE_Y], 511 CopyYPlane(vpx_image->planes[VPX_PLANE_Y],
511 vpx_image->stride[VPX_PLANE_Y], 512 vpx_image->stride[VPX_PLANE_Y],
512 vpx_image->d_h, 513 vpx_image->d_h,
513 video_frame->get()); 514 video_frame->get());
514 CopyUPlane(vpx_image->planes[VPX_PLANE_U], 515 CopyUPlane(vpx_image->planes[VPX_PLANE_U],
515 vpx_image->stride[VPX_PLANE_U], 516 vpx_image->stride[VPX_PLANE_U],
516 uv_rows, 517 uv_rows,
517 video_frame->get()); 518 video_frame->get());
518 CopyVPlane(vpx_image->planes[VPX_PLANE_V], 519 CopyVPlane(vpx_image->planes[VPX_PLANE_V],
519 vpx_image->stride[VPX_PLANE_V], 520 vpx_image->stride[VPX_PLANE_V],
520 uv_rows, 521 uv_rows,
521 video_frame->get()); 522 video_frame->get());
522 if (!vpx_codec_alpha_) 523 if (!vpx_codec_alpha_)
523 return; 524 return;
524 if (!vpx_image_alpha) { 525 if (!vpx_image_alpha) {
525 MakeOpaqueAPlane( 526 MakeOpaqueAPlane(
526 vpx_image->stride[VPX_PLANE_Y], vpx_image->d_h, video_frame->get()); 527 vpx_image->stride[VPX_PLANE_Y], vpx_image->d_h, video_frame->get());
527 return; 528 return;
528 } 529 }
529 CopyAPlane(vpx_image_alpha->planes[VPX_PLANE_Y], 530 CopyAPlane(vpx_image_alpha->planes[VPX_PLANE_Y],
530 vpx_image_alpha->stride[VPX_PLANE_Y], 531 vpx_image_alpha->stride[VPX_PLANE_Y],
531 vpx_image_alpha->d_h, 532 vpx_image_alpha->d_h,
532 video_frame->get()); 533 video_frame->get());
533 } 534 }
534 535
535 } // namespace media 536 } // namespace media
OLDNEW
« media/base/video_frame_unittest.cc ('K') | « media/filters/video_renderer_algorithm_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698