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

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

Issue 2161193003: Use __func__ instead of __FUNCTION__. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resync Created 4 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 | « media/cdm/cdm_adapter.cc ('k') | media/filters/audio_timestamp_validator.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/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 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 363
364 base::TimeDelta seek_preroll; 364 base::TimeDelta seek_preroll;
365 if (codec_context->seek_preroll > 0) { 365 if (codec_context->seek_preroll > 0) {
366 seek_preroll = base::TimeDelta::FromMicroseconds( 366 seek_preroll = base::TimeDelta::FromMicroseconds(
367 codec_context->seek_preroll * 1000000.0 / codec_context->sample_rate); 367 codec_context->seek_preroll * 1000000.0 / codec_context->sample_rate);
368 } 368 }
369 369
370 // AVStream occasionally has invalid extra data. See http://crbug.com/517163 370 // AVStream occasionally has invalid extra data. See http://crbug.com/517163
371 if ((codec_context->extradata_size == 0) != 371 if ((codec_context->extradata_size == 0) !=
372 (codec_context->extradata == nullptr)) { 372 (codec_context->extradata == nullptr)) {
373 LOG(ERROR) << __FUNCTION__ 373 LOG(ERROR) << __func__
374 << (codec_context->extradata == nullptr ? " NULL" : " Non-NULL") 374 << (codec_context->extradata == nullptr ? " NULL" : " Non-NULL")
375 << " extra data cannot have size of " 375 << " extra data cannot have size of "
376 << codec_context->extradata_size << "."; 376 << codec_context->extradata_size << ".";
377 return false; 377 return false;
378 } 378 }
379 379
380 std::vector<uint8_t> extra_data; 380 std::vector<uint8_t> extra_data;
381 if (codec_context->extradata_size > 0) { 381 if (codec_context->extradata_size > 0) {
382 extra_data.assign(codec_context->extradata, 382 extra_data.assign(codec_context->extradata,
383 codec_context->extradata + codec_context->extradata_size); 383 codec_context->extradata + codec_context->extradata_size);
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
513 if (color_space == COLOR_SPACE_UNSPECIFIED) { 513 if (color_space == COLOR_SPACE_UNSPECIFIED) {
514 // Otherwise, assume that SD video is usually Rec.601, and HD is usually 514 // Otherwise, assume that SD video is usually Rec.601, and HD is usually
515 // Rec.709. 515 // Rec.709.
516 color_space = (natural_size.height() < 720) ? COLOR_SPACE_SD_REC601 516 color_space = (natural_size.height() < 720) ? COLOR_SPACE_SD_REC601
517 : COLOR_SPACE_HD_REC709; 517 : COLOR_SPACE_HD_REC709;
518 } 518 }
519 519
520 // AVStream occasionally has invalid extra data. See http://crbug.com/517163 520 // AVStream occasionally has invalid extra data. See http://crbug.com/517163
521 if ((stream->codec->extradata_size == 0) != 521 if ((stream->codec->extradata_size == 0) !=
522 (stream->codec->extradata == nullptr)) { 522 (stream->codec->extradata == nullptr)) {
523 LOG(ERROR) << __FUNCTION__ 523 LOG(ERROR) << __func__
524 << (stream->codec->extradata == nullptr ? " NULL" : " Non-Null") 524 << (stream->codec->extradata == nullptr ? " NULL" : " Non-Null")
525 << " extra data cannot have size of " 525 << " extra data cannot have size of "
526 << stream->codec->extradata_size << "."; 526 << stream->codec->extradata_size << ".";
527 return false; 527 return false;
528 } 528 }
529 529
530 std::vector<uint8_t> extra_data; 530 std::vector<uint8_t> extra_data;
531 if (stream->codec->extradata_size > 0) { 531 if (stream->codec->extradata_size > 0) {
532 extra_data.assign(stream->codec->extradata, 532 extra_data.assign(stream->codec->extradata,
533 stream->codec->extradata + stream->codec->extradata_size); 533 stream->codec->extradata + stream->codec->extradata_size);
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
755 } 755 }
756 756
757 int32_t HashCodecName(const char* codec_name) { 757 int32_t HashCodecName(const char* codec_name) {
758 // Use the first 32-bits from the SHA1 hash as the identifier. 758 // Use the first 32-bits from the SHA1 hash as the identifier.
759 int32_t hash; 759 int32_t hash;
760 memcpy(&hash, base::SHA1HashString(codec_name).substr(0, 4).c_str(), 4); 760 memcpy(&hash, base::SHA1HashString(codec_name).substr(0, 4).c_str(), 4);
761 return hash; 761 return hash;
762 } 762 }
763 763
764 } // namespace media 764 } // namespace media
OLDNEW
« no previous file with comments | « media/cdm/cdm_adapter.cc ('k') | media/filters/audio_timestamp_validator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698