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

Unified Diff: chromecast/base/cast_resource.h

Issue 1306843003: CmaMediaPipelineClient to watch media pipeline status (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CastResource Created 5 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 side-by-side diff with in-line comments
Download patch
Index: chromecast/base/cast_resource.h
diff --git a/chromecast/base/cast_resource.h b/chromecast/base/cast_resource.h
new file mode 100644
index 0000000000000000000000000000000000000000..0d8624d4a178fb94d96daad2f8f7b7849dfe98a6
--- /dev/null
+++ b/chromecast/base/cast_resource.h
@@ -0,0 +1,47 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+#ifndef CHROMECAST_BASE_CAST_RESOURCE_H_
+#define CHROMECAST_BASE_CAST_RESOURCE_H_
+
+namespace chromecast {
+
+// Interface for resources needed to run application.
+class CastResource {
+ public:
+ // Resources necessary to run cast apps.
+ enum Resource {
+ kResourceNone = 0,
+ // All resources necessary to render sounds, for example, audio pipeline,
+ // speaker, etc.
+ kResourceAudio = 1 << 0,
+ // All resources necessary to render videos or images, for example, video
+ // pipeline, primary graphics plane, display, etc.
+ kResourceScreenPrimary = 1 << 1,
+ // All resources necessary to render overlaid images, for example, secondary
+ // graphics plane, LCD, etc.
+ kResourceScreenSecondary = 1 << 2,
+ // Collection of resources used for display only combined with bitwise or.
+ kResourceDisplayOnly = (kResourceScreenPrimary | kResourceScreenSecondary),
+ // Collection of all resources combined with bitwise or.
+ kResourceAll = (kResourceAudio | kResourceScreenPrimary
+ | kResourceScreenSecondary),
+ };
+
+ class Client {
+ public:
+ virtual void OnResourceAcquired(CastResource* cast_resource) = 0;
+ virtual void OnResourceReleased(CastResource* cast_resource) = 0;
halliwell 2015/09/01 15:24:05 add virtual dtor, hide dtor as well?
yucliu1 2015/09/01 18:41:33 Done.
+ };
+
+ virtual ~CastResource() {}
+
+ // Called to release resources. Implementation should call
+ // Client::OnResourceReleased when resource is released on its side.
+ virtual void ReleaseResource(Resource resource) = 0;
+ virtual void SetCastResourceClient(Client* client) = 0;
+};
+
+} // namespace chromecast
+
+#endif
« no previous file with comments | « no previous file | chromecast/browser/cast_content_browser_client.h » ('j') | chromecast/browser/media/cma_media_pipeline_client.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698