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

Side by Side Diff: content/common/gpu/media/vaapi_video_decode_accelerator.cc

Issue 1369673002: H264Decoder: Handle gaps in frame_num. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 "content/common/gpu/media/vaapi_video_decode_accelerator.h" 5 #include "content/common/gpu/media/vaapi_video_decode_accelerator.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 1274 matching lines...) Expand 10 before | Expand all | Expand 10 after
1285 VaapiVideoDecodeAccelerator::VaapiH264Accelerator:: 1285 VaapiVideoDecodeAccelerator::VaapiH264Accelerator::
1286 H264PictureToVaapiDecodeSurface(const scoped_refptr<H264Picture>& pic) { 1286 H264PictureToVaapiDecodeSurface(const scoped_refptr<H264Picture>& pic) {
1287 VaapiH264Picture* vaapi_pic = pic->AsVaapiH264Picture(); 1287 VaapiH264Picture* vaapi_pic = pic->AsVaapiH264Picture();
1288 CHECK(vaapi_pic); 1288 CHECK(vaapi_pic);
1289 return vaapi_pic->dec_surface(); 1289 return vaapi_pic->dec_surface();
1290 } 1290 }
1291 1291
1292 void VaapiVideoDecodeAccelerator::VaapiH264Accelerator::FillVAPicture( 1292 void VaapiVideoDecodeAccelerator::VaapiH264Accelerator::FillVAPicture(
1293 VAPictureH264* va_pic, 1293 VAPictureH264* va_pic,
1294 scoped_refptr<H264Picture> pic) { 1294 scoped_refptr<H264Picture> pic) {
1295 scoped_refptr<VaapiDecodeSurface> dec_surface = 1295 VASurfaceID va_surface_id = VA_INVALID_SURFACE;
1296 H264PictureToVaapiDecodeSurface(pic);
1297 1296
1298 va_pic->picture_id = dec_surface->va_surface()->id(); 1297 if (!pic->nonexisting) {
1298 scoped_refptr<VaapiDecodeSurface> dec_surface =
1299 H264PictureToVaapiDecodeSurface(pic);
1300 va_surface_id = dec_surface->va_surface()->id();
1301 }
1302
1303 va_pic->picture_id = va_surface_id;
1299 va_pic->frame_idx = pic->frame_num; 1304 va_pic->frame_idx = pic->frame_num;
1300 va_pic->flags = 0; 1305 va_pic->flags = 0;
1301 1306
1302 switch (pic->field) { 1307 switch (pic->field) {
1303 case H264Picture::FIELD_NONE: 1308 case H264Picture::FIELD_NONE:
1304 break; 1309 break;
1305 case H264Picture::FIELD_TOP: 1310 case H264Picture::FIELD_TOP:
1306 va_pic->flags |= VA_PICTURE_H264_TOP_FIELD; 1311 va_pic->flags |= VA_PICTURE_H264_TOP_FIELD;
1307 break; 1312 break;
1308 case H264Picture::FIELD_BOTTOM: 1313 case H264Picture::FIELD_BOTTOM:
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
1726 return vaapi_pic->dec_surface(); 1731 return vaapi_pic->dec_surface();
1727 } 1732 }
1728 1733
1729 // static 1734 // static
1730 media::VideoDecodeAccelerator::SupportedProfiles 1735 media::VideoDecodeAccelerator::SupportedProfiles
1731 VaapiVideoDecodeAccelerator::GetSupportedProfiles() { 1736 VaapiVideoDecodeAccelerator::GetSupportedProfiles() {
1732 return VaapiWrapper::GetSupportedDecodeProfiles(); 1737 return VaapiWrapper::GetSupportedDecodeProfiles();
1733 } 1738 }
1734 1739
1735 } // namespace content 1740 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698