Roll src/third_party/WebKit dbf9be3:8d6c3d5 (svn 202308:202312)
[chromium-blink-merge.git] / chromecast / public / cast_media_shlib.h
blobd523db881621fc3e0fde3c1336f4346158b646e0
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
3 // found in the LICENSE file.
5 #ifndef CHROMECAST_PUBLIC_CAST_MEDIA_SHLIB_H_
6 #define CHROMECAST_PUBLIC_CAST_MEDIA_SHLIB_H_
8 #include <string>
9 #include <vector>
11 #include "chromecast_export.h"
13 namespace chromecast {
14 namespace media {
16 class MediaPipelineBackend;
17 struct MediaPipelineDeviceParams;
18 class VideoPlane;
20 // Provides access to platform-specific media systems and hardware resources.
21 // In cast_shell, all usage is from the browser process. An implementation is
22 // assumed to be in an uninitialized state initially. When uninitialized, no
23 // API calls will be made except for Initialize, which brings the implementation
24 // into an initialized state. A call to Finalize returns the implementation to
25 // its uninitialized state. The implementation must support multiple
26 // transitions between these states, to support resource grant/revoke events and
27 // also to allow multiple unit tests to bring up the media systems in isolation
28 // from other tests.
29 class CHROMECAST_EXPORT CastMediaShlib {
30 public:
31 // Initializes platform-specific media systems. Only called when in an
32 // uninitialized state.
33 static void Initialize(const std::vector<std::string>& argv);
35 // Tears down platform-specific media systems and returns to the uninitialized
36 // state. The implementation must release all media-related hardware
37 // resources.
38 static void Finalize();
40 // Gets the VideoPlane instance for managing the hardware video plane.
41 // While an implementation is in an initialized state, this function may be
42 // called at any time. The VideoPlane object must be destroyed in Finalize.
43 static VideoPlane* GetVideoPlane();
45 // Creates a factory object for a media pipeline backend. Called in the
46 // browser process, any number of times (once per media pipeline). Each call
47 // must instantiate a new factory object
48 static MediaPipelineBackend* CreateMediaPipelineBackend(
49 const MediaPipelineDeviceParams& params);
52 } // namespace media
53 } // namespace chromecast
55 #endif // CHROMECAST_PUBLIC_CAST_MEDIA_SHLIB_H_