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

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

Issue 1769593002: Add 4 VP9 profiles to the media::VideoCodecProfile enum. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@hevc-codec-7
Patch Set: Rebase to ToT Created 4 years, 9 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/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/sha1.h" 9 #include "base/sha1.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 aspect_ratio = stream->sample_aspect_ratio; 454 aspect_ratio = stream->sample_aspect_ratio;
455 else if (stream->codec->sample_aspect_ratio.num) 455 else if (stream->codec->sample_aspect_ratio.num)
456 aspect_ratio = stream->codec->sample_aspect_ratio; 456 aspect_ratio = stream->codec->sample_aspect_ratio;
457 457
458 VideoCodec codec = CodecIDToVideoCodec(stream->codec->codec_id); 458 VideoCodec codec = CodecIDToVideoCodec(stream->codec->codec_id);
459 459
460 VideoCodecProfile profile = VIDEO_CODEC_PROFILE_UNKNOWN; 460 VideoCodecProfile profile = VIDEO_CODEC_PROFILE_UNKNOWN;
461 if (codec == kCodecVP8) 461 if (codec == kCodecVP8)
462 profile = VP8PROFILE_ANY; 462 profile = VP8PROFILE_ANY;
463 else if (codec == kCodecVP9) 463 else if (codec == kCodecVP9)
464 profile = VP9PROFILE_ANY; 464 // TODO(servolk): Find a way to obtain VP9 profile from FFmpeg.
465 profile = VP9PROFILE_PROFILE3;
fgalligan1 2016/03/23 18:14:09 I read the comments on why this should be profile
servolk 2016/03/24 18:05:43 I'm not sure I understand the distinction, this is
465 else 466 else
466 profile = ProfileIDToVideoCodecProfile(stream->codec->profile); 467 profile = ProfileIDToVideoCodecProfile(stream->codec->profile);
467 468
468 // Without the FFmpeg h264 decoder, AVFormat is unable to get the profile, so 469 // Without the FFmpeg h264 decoder, AVFormat is unable to get the profile, so
469 // default to baseline and let the VDA fail later if it doesn't support the 470 // default to baseline and let the VDA fail later if it doesn't support the
470 // real profile. This is alright because if the FFmpeg h264 decoder isn't 471 // real profile. This is alright because if the FFmpeg h264 decoder isn't
471 // enabled, there is no fallback if the VDA fails. 472 // enabled, there is no fallback if the VDA fails.
472 #if defined(DISABLE_FFMPEG_VIDEO_DECODERS) 473 #if defined(DISABLE_FFMPEG_VIDEO_DECODERS)
473 if (codec == kCodecH264) 474 if (codec == kCodecH264)
474 profile = H264PROFILE_BASELINE; 475 profile = H264PROFILE_BASELINE;
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
759 } 760 }
760 761
761 int32_t HashCodecName(const char* codec_name) { 762 int32_t HashCodecName(const char* codec_name) {
762 // Use the first 32-bits from the SHA1 hash as the identifier. 763 // Use the first 32-bits from the SHA1 hash as the identifier.
763 int32_t hash; 764 int32_t hash;
764 memcpy(&hash, base::SHA1HashString(codec_name).substr(0, 4).c_str(), 4); 765 memcpy(&hash, base::SHA1HashString(codec_name).substr(0, 4).c_str(), 4);
765 return hash; 766 return hash;
766 } 767 }
767 768
768 } // namespace media 769 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698