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_
11 #include "chromecast_export.h"
13 namespace chromecast
{
16 class MediaPipelineBackend
;
17 struct MediaPipelineDeviceParams
;
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
29 class CHROMECAST_EXPORT CastMediaShlib
{
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
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
);
53 } // namespace chromecast
55 #endif // CHROMECAST_PUBLIC_CAST_MEDIA_SHLIB_H_