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 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: Added some comments and dchecks Created 4 years, 8 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 | « media/cdm/cdm_adapter.cc ('k') | media/formats/webm/webm_video_client.cc » ('j') | 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/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 actual VP9 profile from FFmpeg.
465 // crbug.com/592074
466 profile = VP9PROFILE_PROFILE0;
465 else 467 else
466 profile = ProfileIDToVideoCodecProfile(stream->codec->profile); 468 profile = ProfileIDToVideoCodecProfile(stream->codec->profile);
467 469
468 // Without the FFmpeg h264 decoder, AVFormat is unable to get the profile, so 470 // 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 471 // 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 472 // real profile. This is alright because if the FFmpeg h264 decoder isn't
471 // enabled, there is no fallback if the VDA fails. 473 // enabled, there is no fallback if the VDA fails.
472 #if defined(DISABLE_FFMPEG_VIDEO_DECODERS) 474 #if defined(DISABLE_FFMPEG_VIDEO_DECODERS)
473 if (codec == kCodecH264) 475 if (codec == kCodecH264)
474 profile = H264PROFILE_BASELINE; 476 profile = H264PROFILE_BASELINE;
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
759 } 761 }
760 762
761 int32_t HashCodecName(const char* codec_name) { 763 int32_t HashCodecName(const char* codec_name) {
762 // Use the first 32-bits from the SHA1 hash as the identifier. 764 // Use the first 32-bits from the SHA1 hash as the identifier.
763 int32_t hash; 765 int32_t hash;
764 memcpy(&hash, base::SHA1HashString(codec_name).substr(0, 4).c_str(), 4); 766 memcpy(&hash, base::SHA1HashString(codec_name).substr(0, 4).c_str(), 4);
765 return hash; 767 return hash;
766 } 768 }
767 769
768 } // namespace media 770 } // namespace media
OLDNEW
« no previous file with comments | « media/cdm/cdm_adapter.cc ('k') | media/formats/webm/webm_video_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698