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

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

Issue 1281433002: Enable software decoding video with libvpx on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 delete context; 285 delete context;
286 return NULL; 286 return NULL;
287 } 287 }
288 return context; 288 return context;
289 } 289 }
290 290
291 bool VpxVideoDecoder::ConfigureDecoder(const VideoDecoderConfig& config) { 291 bool VpxVideoDecoder::ConfigureDecoder(const VideoDecoderConfig& config) {
292 if (config.codec() != kCodecVP8 && config.codec() != kCodecVP9) 292 if (config.codec() != kCodecVP8 && config.codec() != kCodecVP9)
293 return false; 293 return false;
294 294
295 // In VP8 videos, only those with alpha are handled by VpxVideoDecoder. All 295 #if !defined(DISABLE_FFMPEG_VIDEO_DECODERS)
296 // other VP8 videos go to FFmpegVideoDecoder. 296 // When FFmpegVideoDecoder is available it handles VP8 that doesn't have
297 // alpha, and VpxVideoDecoder will handle VP8 with alpha.
297 if (config.codec() == kCodecVP8 && config.format() != PIXEL_FORMAT_YV12A) 298 if (config.codec() == kCodecVP8 && config.format() != PIXEL_FORMAT_YV12A)
298 return false; 299 return false;
300 #endif
299 301
300 CloseDecoder(); 302 CloseDecoder();
301 303
302 vpx_codec_ = InitializeVpxContext(vpx_codec_, config); 304 vpx_codec_ = InitializeVpxContext(vpx_codec_, config);
303 if (!vpx_codec_) 305 if (!vpx_codec_)
304 return false; 306 return false;
305 307
306 // We use our own buffers for VP9 so that there is no need to copy data after 308 // We use our own buffers for VP9 so that there is no need to copy data after
307 // decoding. 309 // decoding.
308 if (config.codec() == kCodecVP9) { 310 if (config.codec() == kCodecVP9) {
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 vpx_image->stride[VPX_PLANE_Y], vpx_image->d_h, video_frame->get()); 573 vpx_image->stride[VPX_PLANE_Y], vpx_image->d_h, video_frame->get());
572 return; 574 return;
573 } 575 }
574 CopyAPlane(vpx_image_alpha->planes[VPX_PLANE_Y], 576 CopyAPlane(vpx_image_alpha->planes[VPX_PLANE_Y],
575 vpx_image_alpha->stride[VPX_PLANE_Y], 577 vpx_image_alpha->stride[VPX_PLANE_Y],
576 vpx_image_alpha->d_h, 578 vpx_image_alpha->d_h,
577 video_frame->get()); 579 video_frame->get());
578 } 580 }
579 581
580 } // namespace media 582 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698