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

Side by Side Diff: content/renderer/media/media_recorder_handler.cc

Issue 1875913002: Cleanup: Convert const char* kFoo to const char kFoo[]. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "content/renderer/media/media_recorder_handler.h" 5 #include "content/renderer/media/media_recorder_handler.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 const std::string type(web_type.utf8()); 58 const std::string type(web_type.utf8());
59 const bool video = base::EqualsCaseInsensitiveASCII(type, "video/webm"); 59 const bool video = base::EqualsCaseInsensitiveASCII(type, "video/webm");
60 const bool audio = 60 const bool audio =
61 video ? false : base::EqualsCaseInsensitiveASCII(type, "audio/webm"); 61 video ? false : base::EqualsCaseInsensitiveASCII(type, "audio/webm");
62 if (!video && !audio) 62 if (!video && !audio)
63 return false; 63 return false;
64 64
65 // Both |video| and |audio| support empty |codecs|; |type| == "video" supports 65 // Both |video| and |audio| support empty |codecs|; |type| == "video" supports
66 // vp8, vp9 or opus; |type| = "audio", supports only opus. 66 // vp8, vp9 or opus; |type| = "audio", supports only opus.
67 // http://www.webmproject.org/docs/container Sec:"HTML5 Video Type Parameters" 67 // http://www.webmproject.org/docs/container Sec:"HTML5 Video Type Parameters"
68 static const char* kVideoCodecs[] = { "vp8", "vp9", "opus" }; 68 static const char* const kVideoCodecs[] = { "vp8", "vp9", "opus" };
69 static const char* kAudioCodecs[] = { "opus" }; 69 static const char* const kAudioCodecs[] = { "opus" };
70 const char** codecs = video ? &kVideoCodecs[0] : &kAudioCodecs[0]; 70 const char* const* codecs = video ? &kVideoCodecs[0] : &kAudioCodecs[0];
71 int codecs_count = video ? arraysize(kVideoCodecs) : arraysize(kAudioCodecs); 71 int codecs_count = video ? arraysize(kVideoCodecs) : arraysize(kAudioCodecs);
72 72
73 std::vector<std::string> codecs_list; 73 std::vector<std::string> codecs_list;
74 media::ParseCodecString(web_codecs.utf8(), &codecs_list, true /* strip */); 74 media::ParseCodecString(web_codecs.utf8(), &codecs_list, true /* strip */);
75 for (const auto& codec : codecs_list) { 75 for (const auto& codec : codecs_list) {
76 const auto found = std::find_if( 76 const auto found = std::find_if(
77 &codecs[0], &codecs[codecs_count], [&codec](const char* name) { 77 &codecs[0], &codecs[codecs_count], [&codec](const char* name) {
78 return base::EqualsCaseInsensitiveASCII(codec, name); 78 return base::EqualsCaseInsensitiveASCII(codec, name);
79 }); 79 });
80 if (found == &codecs[codecs_count]) 80 if (found == &codecs[codecs_count])
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 recorder->OnData(audio_bus, timestamp); 274 recorder->OnData(audio_bus, timestamp);
275 } 275 }
276 276
277 void MediaRecorderHandler::SetAudioFormatForTesting( 277 void MediaRecorderHandler::SetAudioFormatForTesting(
278 const media::AudioParameters& params) { 278 const media::AudioParameters& params) {
279 for (auto* recorder : audio_recorders_) 279 for (auto* recorder : audio_recorders_)
280 recorder->OnSetFormat(params); 280 recorder->OnSetFormat(params);
281 } 281 }
282 282
283 } // namespace content 283 } // namespace content
OLDNEW
« no previous file with comments | « content/common/origin_trials/trial_token.cc ('k') | content/renderer/media/media_stream_video_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698