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

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

Issue 2153643002: Make video codec support logic overridable via MediaClient (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move is_ambiguous flag handling back to StringToCodec Created 4 years, 5 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 | « content/renderer/media/render_media_client.h ('k') | media/base/key_systems_unittest.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/render_media_client.h" 5 #include "content/renderer/media/render_media_client.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/time/default_tick_clock.h" 9 #include "base/time/default_tick_clock.h"
10 #include "content/public/common/content_client.h" 10 #include "content/public/common/content_client.h"
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 #else 86 #else
87 is_update_needed_ = false; 87 is_update_needed_ = false;
88 #endif 88 #endif
89 } 89 }
90 90
91 void RenderMediaClient::RecordRapporURL(const std::string& metric, 91 void RenderMediaClient::RecordRapporURL(const std::string& metric,
92 const GURL& url) { 92 const GURL& url) {
93 GetContentClient()->renderer()->RecordRapporURL(metric, url); 93 GetContentClient()->renderer()->RecordRapporURL(metric, url);
94 } 94 }
95 95
96 bool RenderMediaClient::IsSupportedVideoConfig(media::VideoCodec codec,
97 media::VideoCodecProfile profile,
98 int level) {
99 switch (codec) {
100 case media::kCodecH264:
101 case media::kCodecVP8:
102 case media::kCodecVP9:
103 case media::kCodecTheora:
104 return true;
105
106 case media::kUnknownVideoCodec:
107 case media::kCodecVC1:
108 case media::kCodecMPEG2:
109 case media::kCodecMPEG4:
110 case media::kCodecHEVC:
111 return false;
112 }
113
114 NOTREACHED();
115 return false;
116 }
117
96 void RenderMediaClient::SetTickClockForTesting( 118 void RenderMediaClient::SetTickClockForTesting(
97 std::unique_ptr<base::TickClock> tick_clock) { 119 std::unique_ptr<base::TickClock> tick_clock) {
98 tick_clock_.swap(tick_clock); 120 tick_clock_.swap(tick_clock);
99 } 121 }
100 122
101 // This functions is for testing purpose only. The declaration in the 123 // This functions is for testing purpose only. The declaration in the
102 // header file is guarded by "#if defined(UNIT_TEST)" so that it can be used 124 // header file is guarded by "#if defined(UNIT_TEST)" so that it can be used
103 // by tests but not non-test code. However, this .cc file is compiled as part of 125 // by tests but not non-test code. However, this .cc file is compiled as part of
104 // "content" where "UNIT_TEST" is not defined. So we need to specify 126 // "content" where "UNIT_TEST" is not defined. So we need to specify
105 // "CONTENT_EXPORT" here again so that it is visible to tests. 127 // "CONTENT_EXPORT" here again so that it is visible to tests.
106 CONTENT_EXPORT RenderMediaClient* GetRenderMediaClientInstanceForTesting() { 128 CONTENT_EXPORT RenderMediaClient* GetRenderMediaClientInstanceForTesting() {
107 return g_render_media_client.Pointer(); 129 return g_render_media_client.Pointer();
108 } 130 }
109 131
110 } // namespace content 132 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/render_media_client.h ('k') | media/base/key_systems_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698