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

Side by Side Diff: media/ffmpeg/ffmpeg_common.cc

Issue 1230793009: Initial support for the desktop media pipeline on Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed 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/ffmpeg/ffmpeg_common.h" 5 #include "media/ffmpeg/ffmpeg_common.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.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/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 // Note the PRESUBMIT_IGNORE_UMA_MAX below, this silences the PRESUBMIT.py 401 // Note the PRESUBMIT_IGNORE_UMA_MAX below, this silences the PRESUBMIT.py
402 // check for uma enum max usage, since we're abusing 402 // check for uma enum max usage, since we're abusing
403 // UMA_HISTOGRAM_ENUMERATION to report a discrete value. 403 // UMA_HISTOGRAM_ENUMERATION to report a discrete value.
404 UMA_HISTOGRAM_ENUMERATION("Media.VideoColorRange", 404 UMA_HISTOGRAM_ENUMERATION("Media.VideoColorRange",
405 stream->codec->color_range, 405 stream->codec->color_range,
406 AVCOL_RANGE_NB); // PRESUBMIT_IGNORE_UMA_MAX 406 AVCOL_RANGE_NB); // PRESUBMIT_IGNORE_UMA_MAX
407 } 407 }
408 408
409 VideoPixelFormat format = 409 VideoPixelFormat format =
410 PixelFormatToVideoPixelFormat(stream->codec->pix_fmt); 410 PixelFormatToVideoPixelFormat(stream->codec->pix_fmt);
411 // The format and coded size may be unknown if FFmpeg is compiled without
412 // video decoders.
413 #if defined(DISABLE_FFMPEG_VIDEO_DECODERS)
414 if (format == PIXEL_FORMAT_UNKNOWN)
415 format = PIXEL_FORMAT_YV12;
416 if (coded_size == gfx::Size(0, 0))
417 coded_size = visible_rect.size();
418 #endif
419
411 if (codec == kCodecVP9) { 420 if (codec == kCodecVP9) {
412 // TODO(tomfinegan): libavcodec doesn't know about VP9. 421 // TODO(tomfinegan): libavcodec doesn't know about VP9.
413 format = PIXEL_FORMAT_YV12; 422 format = PIXEL_FORMAT_YV12;
414 coded_size = visible_rect.size(); 423 coded_size = visible_rect.size();
415 } 424 }
416 425
417 // Pad out |coded_size| for subsampled YUV formats. 426 // Pad out |coded_size| for subsampled YUV formats.
418 if (format != PIXEL_FORMAT_YV24) { 427 if (format != PIXEL_FORMAT_YV24) {
419 coded_size.set_width((coded_size.width() + 1) / 2 * 2); 428 coded_size.set_width((coded_size.width() + 1) / 2 * 2);
420 if (format != PIXEL_FORMAT_YV16) 429 if (format != PIXEL_FORMAT_YV16)
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
617 return false; 626 return false;
618 627
619 *out = parsed_time; 628 *out = parsed_time;
620 return true; 629 return true;
621 } 630 }
622 631
623 return false; 632 return false;
624 } 633 }
625 634
626 } // namespace media 635 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698