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

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

Issue 2768713002: Pass a |media_log| to FFmpegVideoDecoder and roll ffmpeg (Closed)
Patch Set: Rebase DEPS. Created 3 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/sha1.h" 8 #include "base/sha1.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/string_split.h" 10 #include "base/strings/string_split.h"
(...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 return COLOR_SPACE_HD_REC709; 737 return COLOR_SPACE_HD_REC709;
738 case AVCOL_SPC_SMPTE170M: 738 case AVCOL_SPC_SMPTE170M:
739 case AVCOL_SPC_BT470BG: 739 case AVCOL_SPC_BT470BG:
740 return COLOR_SPACE_SD_REC601; 740 return COLOR_SPACE_SD_REC601;
741 default: 741 default:
742 DVLOG(1) << "Unknown AVColorSpace: " << color_space; 742 DVLOG(1) << "Unknown AVColorSpace: " << color_space;
743 } 743 }
744 return COLOR_SPACE_UNSPECIFIED; 744 return COLOR_SPACE_UNSPECIFIED;
745 } 745 }
746 746
747 std::string AVErrorToString(int errnum) {
748 char errbuf[AV_ERROR_MAX_STRING_SIZE] = {0};
749 av_strerror(errnum, errbuf, AV_ERROR_MAX_STRING_SIZE);
750 return std::string(errbuf);
751 }
752
747 int32_t HashCodecName(const char* codec_name) { 753 int32_t HashCodecName(const char* codec_name) {
748 // Use the first 32-bits from the SHA1 hash as the identifier. 754 // Use the first 32-bits from the SHA1 hash as the identifier.
749 int32_t hash; 755 int32_t hash;
750 memcpy(&hash, base::SHA1HashString(codec_name).substr(0, 4).c_str(), 4); 756 memcpy(&hash, base::SHA1HashString(codec_name).substr(0, 4).c_str(), 4);
751 return hash; 757 return hash;
752 } 758 }
753 759
754 } // namespace media 760 } // namespace media
OLDNEW
« DEPS ('K') | « media/ffmpeg/ffmpeg_common.h ('k') | media/filters/ffmpeg_video_decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698