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

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, 3 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 1214 matching lines...) Expand 10 before | Expand all | Expand 10 after
1225 VaapiVideoDecodeAccelerator::VaapiH264Accelerator:: 1225 VaapiVideoDecodeAccelerator::VaapiH264Accelerator::
1226 H264PictureToVaapiDecodeSurface(const scoped_refptr<H264Picture>& pic) { 1226 H264PictureToVaapiDecodeSurface(const scoped_refptr<H264Picture>& pic) {
1227 VaapiH264Picture* vaapi_pic = pic->AsVaapiH264Picture(); 1227 VaapiH264Picture* vaapi_pic = pic->AsVaapiH264Picture();
1228 CHECK(vaapi_pic); 1228 CHECK(vaapi_pic);
1229 return vaapi_pic->dec_surface(); 1229 return vaapi_pic->dec_surface();
1230 } 1230 }
1231 1231
1232 void VaapiVideoDecodeAccelerator::VaapiH264Accelerator::FillVAPicture( 1232 void VaapiVideoDecodeAccelerator::VaapiH264Accelerator::FillVAPicture(
1233 VAPictureH264* va_pic, 1233 VAPictureH264* va_pic,
1234 scoped_refptr<H264Picture> pic) { 1234 scoped_refptr<H264Picture> pic) {
1235 scoped_refptr<VaapiDecodeSurface> dec_surface = 1235 VASurfaceID va_surface_id = VA_INVALID_SURFACE;
1236 H264PictureToVaapiDecodeSurface(pic);
1237 1236
1238 va_pic->picture_id = dec_surface->va_surface()->id(); 1237 if (!pic->nonexisting) {
1238 scoped_refptr<VaapiDecodeSurface> dec_surface =
1239 H264PictureToVaapiDecodeSurface(pic);
1240 va_surface_id = dec_surface->va_surface()->id();
1241 }
1242
1243 va_pic->picture_id = va_surface_id;
1239 va_pic->frame_idx = pic->frame_num; 1244 va_pic->frame_idx = pic->frame_num;
1240 va_pic->flags = 0; 1245 va_pic->flags = 0;
1241 1246
1242 switch (pic->field) { 1247 switch (pic->field) {
1243 case H264Picture::FIELD_NONE: 1248 case H264Picture::FIELD_NONE:
1244 break; 1249 break;
1245 case H264Picture::FIELD_TOP: 1250 case H264Picture::FIELD_TOP:
1246 va_pic->flags |= VA_PICTURE_H264_TOP_FIELD; 1251 va_pic->flags |= VA_PICTURE_H264_TOP_FIELD;
1247 break; 1252 break;
1248 case H264Picture::FIELD_BOTTOM: 1253 case H264Picture::FIELD_BOTTOM:
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
1511 return vaapi_pic->dec_surface(); 1516 return vaapi_pic->dec_surface();
1512 } 1517 }
1513 1518
1514 // static 1519 // static
1515 media::VideoDecodeAccelerator::SupportedProfiles 1520 media::VideoDecodeAccelerator::SupportedProfiles
1516 VaapiVideoDecodeAccelerator::GetSupportedProfiles() { 1521 VaapiVideoDecodeAccelerator::GetSupportedProfiles() {
1517 return VaapiWrapper::GetSupportedDecodeProfiles(); 1522 return VaapiWrapper::GetSupportedDecodeProfiles();
1518 } 1523 }
1519 1524
1520 } // namespace content 1525 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698